Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
318 commits
Select commit Hold shift + click to select a range
cb807d1
remove usage of choose_individual_max_utility
Jun 20, 2022
f0cc563
interaction_sample util based w/p probs
Jun 20, 2022
417e90f
wrong method in cdap
Jun 20, 2022
4f825ae
style fixes
Jun 20, 2022
7a6cc29
need probs in interaction_sample - try it the quick way
Jun 20, 2022
f0143e9
remove false comparison
Jun 20, 2022
f6d81d6
bug fix
Jun 20, 2022
b449593
bug fix
Jun 20, 2022
dbc809a
add utility based choice option for transit virtual pathbuilder
Jun 20, 2022
4c6a524
custom chooser
Jun 20, 2022
2ec41b1
mem tracing in interaction_sample
Jun 20, 2022
47601e3
bug fix
Jun 20, 2022
e0555d4
interaction_sample memory saving implementation
Jun 20, 2022
2568b72
memory work
Jun 20, 2022
78630be
spelling
Jun 20, 2022
c6d75d1
delete after last ref, not before
Jun 20, 2022
7a66a67
set index
Jun 20, 2022
7df4c8d
to numpy once
Jun 20, 2022
d6f4f97
remove comment
Jun 20, 2022
26a7090
interaction sample dev
Jun 21, 2022
313bcd0
remove scale and location params from ev1 quartile fct
Jun 21, 2022
6451abd
use numpy's gumbel to draw from ev1
Jun 24, 2022
3973bcd
clean up
Jun 24, 2022
c0d1ca1
gumbel by hand by inverse cdf
Jun 24, 2022
6b0b4e9
memory logging
Jun 27, 2022
9a17395
resolves merge conflicts with main v1.2
Jan 31, 2023
b86093f
Merge branch 'master' into janzill/utilit_based_choices_2025
Mar 29, 2025
792d183
merge bug
Mar 29, 2025
08d013a
more merge bugs
Mar 29, 2025
75bb84d
more merge fixes, example runs through
Mar 29, 2025
c6feaef
log eet setting on start up
Mar 29, 2025
114b747
some variation checks, dev notebooks, to delete
Apr 2, 2025
e1e9d08
seeding corr test
Apr 2, 2025
14441a6
corr
Apr 2, 2025
73b8c32
sign on logsum
Apr 2, 2025
f5f365f
removes notebook folder
Apr 2, 2025
0f54cec
compute_setting overrides for eet, currently only for interaction_sam…
Apr 6, 2025
11d86a1
Adds subcomponent-specific eet setting
Apr 6, 2025
30ddb3e
default compute settings set before, no need to check if none
Apr 6, 2025
5105b17
Merge remote-tracking branch 'origin/master' into janzill/utilit_base…
Apr 6, 2025
c6d60c6
comment clean up
Apr 11, 2025
6a0987d
identifies eet todos
Apr 11, 2025
5637fb0
test SOA MC for disagg access
Apr 11, 2025
6f8958b
lint
Apr 11, 2025
9d12b08
comments
May 24, 2025
9a0fb66
more comments
May 24, 2025
0fa183e
jtp custom chooser for EET
May 25, 2025
9900f48
lint
May 25, 2025
892c3fb
move interaction sample without sampling out of MC loop to enable for…
May 25, 2025
d6ecb0d
update comments
May 25, 2025
3793ec2
fix no sampling in interaction_sample
May 25, 2025
fc68697
fix _interaction_sample return doc
May 25, 2025
28142cd
fix bool conversion of None for eet compute settings in sub-components
May 25, 2025
5de1d23
compute settings in disaggreagte accessibility w/o hack
May 25, 2025
2a563ff
lint
May 25, 2025
ef0be21
fix nest_spec is None bug
May 26, 2025
1f815e8
remove comment
May 26, 2025
41d49ff
clean up comments
May 26, 2025
582c998
comment clean up
May 26, 2025
49fcaa5
Merge remote-tracking branch 'origin/master' into janzill/utilit_base…
May 29, 2025
c40b989
avoid choosing alternatives corresponding to padded utilities in inte…
May 29, 2025
5636cd9
lint
May 29, 2025
94e629a
patch other instance of padded_utility for eet
May 29, 2025
e102a9e
adds validate utility method to align with unavailable choices in MC …
May 29, 2025
66cdac9
consistently treat utilities that would lead to zero choices in MC si…
May 30, 2025
3b48a07
lint
May 30, 2025
6f31c76
fix allow_zero_probs for prob calculation in EET interaction_sample
May 30, 2025
7fe8746
Merge branch 'explicit_error_terms_2'
jpn-- Mar 5, 2026
57ba5bc
fix unbound variable in estimation mode
jpn-- Mar 9, 2026
45ab2ca
blacken
jpn-- Mar 9, 2026
0754bb0
Merge branch 'main' into eet
jpn-- Mar 10, 2026
82f1f7d
update larch pin to 6.0.46
jpn-- Mar 13, 2026
5604b3e
Merge pull request #1042 from driftlesslabs/eet
jpn-- Mar 13, 2026
5c506f1
np array instead of for loop
janzill Mar 19, 2026
710b3b0
memory reduction
janzill Mar 19, 2026
60a744a
no duplicate arrays
janzill Mar 19, 2026
f97185e
bug fix: order of chooser_idx in interaction_simulate
janzill Mar 19, 2026
9d69dab
add tests, docstrings for logit
tomstephen Mar 16, 2026
a9db131
Add basic with/without EET test for interaction simulate
tomstephen Mar 17, 2026
a7f2e8f
Fix, complete tests for interaction sample, simulate
tomstephen Mar 18, 2026
df574ee
Linting
tomstephen Mar 18, 2026
cf92aad
Normalise number of choosers, alternatives and minimum tolerance for …
tomstephen Mar 18, 2026
73f45fe
reshape, do not flatten for potential performance
janzill Mar 19, 2026
6440d3f
undo stray comment
janzill Mar 19, 2026
1df7d0d
unify mc and eet reporting during choice making
janzill Mar 19, 2026
5e9847d
series not array
janzill Mar 19, 2026
1213b56
reinstate test, up number of draws for comparison
janzill Mar 19, 2026
fa54204
numpy not loop
janzill Mar 19, 2026
1b2b6dc
interaction_sample test to catch index order bug
janzill Mar 19, 2026
4e0c7e8
make test clearer
janzill Mar 20, 2026
1aa85ba
reset rng offset on iterate_location_choice (shadow pricing)
janzill Mar 22, 2026
bd4211f
Add tests for logit NL, ordering, and all models using EET
tomstephen Mar 23, 2026
76cacb2
Add basic docs for EET
tomstephen Mar 23, 2026
f628505
Add tests checking that choices made using eet and from probabilities…
TylerP132 Mar 23, 2026
362eef0
Linting, minor changes to test_simulate.py
tomstephen Mar 23, 2026
d0a6429
roll back changes to core tests to minimize noise
janzill Mar 26, 2026
65fd171
Implement Jan's suggestion of how to calculate household ids for test…
TylerP132 Mar 30, 2026
f55b2cd
Add test for compute_nested_utilities. Computes nested utilities on a…
TylerP132 Mar 31, 2026
4debaad
Linting
tomstephen Mar 31, 2026
743c56f
Move nest_spec to a fixture in simulate.py tests
TylerP132 Mar 31, 2026
b62001e
Merge with Tom's linting changes
TylerP132 Mar 31, 2026
b021cee
Finish removing nest_spec definition in simulate.py tests
TylerP132 Mar 31, 2026
52f75fa
Merge pull request #5 from outerl/tom/nested-logit-tests-and-docs
janzill Mar 31, 2026
ae71433
lint
janzill Mar 31, 2026
6ef25e1
clean up
janzill Mar 31, 2026
d491e45
Merge branch 'jzill/runtime_improvement' into jzill/reset_rng_on_shad…
janzill Mar 31, 2026
cc8fda0
reset rng only for eet for now. discuss in engineering meeting
janzill Mar 31, 2026
c1806fc
Close out remaining TODO-EETs
tomstephen Mar 31, 2026
3270474
Shuffle check to logit.py
tomstephen Mar 31, 2026
dd54711
Linting
tomstephen Mar 31, 2026
a73f6ea
Fix test
tomstephen Mar 31, 2026
b455e2a
Roll back validate_utils
tomstephen Mar 31, 2026
a490999
eet doco start
janzill Mar 31, 2026
661c6b3
doco part two
janzill Mar 31, 2026
a0bc5ba
Merge branch 'jzill/runtime_improvement' of github.com:outerl/activit…
janzill Mar 31, 2026
40b0b06
add scale comment
janzill Mar 31, 2026
21daa5c
Revert linting changes
tomstephen Apr 1, 2026
0da80bf
.
tomstephen Apr 1, 2026
1d139e0
Fix failing tests
tomstephen Apr 2, 2026
605366f
doc fix
janzill Apr 2, 2026
8c74d2a
docs
janzill Apr 2, 2026
f542e58
doco clean up
janzill Apr 2, 2026
2d1dbcb
doco re memory
janzill Apr 2, 2026
837ae41
doco clean up
janzill Apr 2, 2026
d674268
memory usage doco
janzill Apr 2, 2026
7959c94
clean up doco
janzill Apr 2, 2026
a7e8529
undo changes in unrelated code to reduce noise
janzill Apr 2, 2026
c5bd23f
Merge pull request #3 from outerl/jzill/runtime_improvement
janzill Apr 2, 2026
be3a270
testing for semcog model, update to shadow pricing reset
janzill Apr 2, 2026
7209985
lint
janzill Apr 2, 2026
22a4f62
disable test unitl further investigation
janzill Apr 2, 2026
220c5cf
mp rng reset, disabling one new test for no
janzill Apr 3, 2026
d50ad3c
semcog test with different seed for eet mp to work around non-determi…
janzill Apr 3, 2026
d5a8fd4
no need to restrict to specific choosers for reset, each process has …
janzill Apr 3, 2026
033f08a
Add eet multiple zone test for zone=2
TylerP132 Apr 7, 2026
f5b6301
Change formatting from using ruff to black
TylerP132 Apr 7, 2026
5b24d44
add back accidentally removed import
janzill Apr 7, 2026
9661d01
re-add 3-zone tests
janzill Apr 7, 2026
7c96cbc
base seed same as non-eet, update regress eet data
janzill Apr 7, 2026
c786919
progressive 2 zone test
janzill Apr 7, 2026
08b2b03
Merge pull request #6 from outerl/explicit_error_terms-multiple_zone_…
janzill Apr 8, 2026
0d2356e
Copy changes from m-richards:matt/poisson_eet_2026_04
tomstephen Apr 9, 2026
89dbe5c
Tidy, complete implementation of alts_context, add tests, rebuild reg…
tomstephen Apr 9, 2026
47ed600
Commenting/fix alts context constructions, update semcog test
tomstephen Apr 9, 2026
2d181b2
Deterministic randoms when adding/removing tours for trip scheduling …
tomstephen Apr 10, 2026
cfe6166
PR noise
tomstephen Apr 10, 2026
7a22612
Roll back final_trips.csv for production_semcog
tomstephen Apr 10, 2026
bc56a87
PR noise, make sure alts_context built on un-modified alternatives in…
tomstephen Apr 10, 2026
531b562
linting
tomstephen Apr 10, 2026
19750a0
updates outdated comment
janzill Apr 10, 2026
834fc90
re-add arc test, remove parking choice column from regress trips
janzill Apr 10, 2026
6d29f18
re-instate arc tests
janzill Apr 11, 2026
12a3d8a
Revert "Deterministic randoms when adding/removing tours for trip sch…
janzill Apr 11, 2026
3bd3251
no alts_context for trip_scheduling
janzill Apr 11, 2026
8d7ae41
updates arc regress files
janzill Apr 11, 2026
f2d7bfa
removes outdated comment
janzill Apr 11, 2026
d7c1345
trip scheduling comment for EET
janzill Apr 11, 2026
e9fb130
disable arc sharrow test until regress trips are updated
janzill Apr 11, 2026
10db123
doco update
janzill Apr 11, 2026
fcef6b3
Merge pull request #7 from outerl/deterministic-alt-sample-randoms
janzill Apr 11, 2026
1e9f26c
Matt's Poisson sampling changes from PR 1065
janzill Apr 11, 2026
3bde470
bug fix
janzill Apr 12, 2026
346f0e8
add second return arg for zero probs as well
janzill Apr 12, 2026
32a2662
eet for nested logit
janzill May 6, 2026
e0dbad8
towards a unified choice interface
janzill May 6, 2026
e944d1e
test and doco updates
janzill May 6, 2026
968da57
jtp fix
janzill May 6, 2026
04b2a28
fused location sampling
janzill May 6, 2026
8f0ae70
c order to map the first n_alt rands to all alternatives for the firs…
janzill May 6, 2026
510c6ab
fused mnl ev1 argmax with alt_info
janzill May 6, 2026
3ae81fa
stable sampling
janzill May 6, 2026
cb0c5d4
some doco updates
janzill May 6, 2026
bd762c8
doc clean up
janzill May 6, 2026
acaa22a
Merge remote-tracking branch 'origin/jzill/eet_poisson_sampling_from_…
janzill May 6, 2026
248defd
poisson sample tests and runtime improvements
janzill May 10, 2026
cfdd7da
tests for random sampling as fallback, some doc strings and removal o…
janzill May 11, 2026
ee3c429
avoid unneccessary dataframe construction, better doco
janzill May 11, 2026
68faa94
update interaction sample tests for poisson
janzill May 11, 2026
73d83e6
integration of sampling methods with clear separation from eet as sim…
janzill May 11, 2026
e8fb1d7
poisson sampling optimization
janzill May 11, 2026
ccd5098
poisson sampling with stable rands across scenarios where attractions…
janzill May 11, 2026
fecb26d
do not throw on poisson fallback sampling with sample_size > alternat…
janzill May 11, 2026
0cb9289
debug logging
janzill May 11, 2026
3c4a3b1
clean up
janzill May 12, 2026
e4e415a
sampling doco
janzill May 12, 2026
b7b1d90
clean up
janzill May 12, 2026
bf24aa5
doco update
janzill May 12, 2026
067448c
linting
janzill May 12, 2026
1f731ca
razzmatazz. I mean maz for taz.
janzill May 12, 2026
7731971
test fixes and stable sorting for tour/trip loc choice
janzill May 12, 2026
480c8ad
no stable alts for MC
janzill May 12, 2026
c8470ec
lint
janzill May 12, 2026
a77cbec
stable two-zone maz_from_taz for Poisson
janzill May 13, 2026
e91e566
more doco
janzill May 13, 2026
a6ff459
no op if no alts_context
janzill May 13, 2026
7aaeb1b
do not throw on interaction_sample_simulate w/o alts_context
janzill May 13, 2026
e9a2813
eet special casing
janzill May 13, 2026
6d0a24e
tour_od with maz_taz stable, clean up
janzill May 13, 2026
5b0c79e
arc eet golden trips
janzill May 13, 2026
429f954
Merge branch 'jzill/eet_runtime_inc_nl_and_poisson' of github.com:out…
janzill May 13, 2026
5c961b7
switch base seed to avoid trip_scheduling (probabilistic) to come up …
janzill May 13, 2026
a325f45
forgot the corresponding golden trips
janzill May 13, 2026
4fcd239
test multiple_zone golden
janzill May 14, 2026
8933d6c
removes requirement of interaction_sample_simulate to have alts_context
janzill May 14, 2026
270d450
fix test by using eet as intended, remove stable_indexing in tour_des…
janzill May 14, 2026
01b38c7
clean up
janzill May 14, 2026
4b78e20
conditional stable sample indexes
janzill May 14, 2026
ae278cc
stable alts only for eet with poisson sampling for two-zone
janzill May 14, 2026
de74dfc
trip maz-for-taz stable alts for eet with poisson sampling
janzill May 14, 2026
77b80b3
clean up
janzill May 14, 2026
bdfe757
stable two-zone alts for tour_od
janzill May 14, 2026
67fd055
tour_od stable alt cond
janzill May 14, 2026
249acfa
resolve_smapling_method
janzill May 14, 2026
3ebe20c
decouple sample and simulation methods
janzill May 18, 2026
dc52907
separate RNG for shadow pricing to enable loc choiec rng reset for si…
janzill May 18, 2026
d58d0c5
lint
janzill May 18, 2026
7f68160
logging and comments
janzill May 18, 2026
e6b75ea
debug logging for sample method, add warning for disagg acc and poisson
janzill May 20, 2026
4803032
doco
janzill May 20, 2026
d11f2be
info, nto warning
janzill May 20, 2026
7b7170b
compute settings, not model settings
janzill May 20, 2026
b844372
compute settings, not model settings
janzill May 20, 2026
196704a
variable name
janzill May 20, 2026
1567d5f
Merge pull request #8 from outerl/jzill/eet_runtime_inc_nl_and_poisson
janzill May 21, 2026
99239c2
log log on subset of rands only
janzill May 29, 2026
7768547
optionally bias poisson disagg acc
janzill May 29, 2026
aa13d2d
bias also for non-mand
janzill May 29, 2026
95c1058
avoid copy in favour of log log for gumbel choice
janzill May 31, 2026
82cd511
switch to bias all location choice logsums for poisson sampling
janzill May 31, 2026
5bfd4b3
add setting
janzill May 31, 2026
7424aec
adds missing import in trip dest
janzill May 31, 2026
0f2ddbd
adds missing import in trip dest
janzill May 31, 2026
3d6f1db
ling
janzill May 31, 2026
57156aa
Merge pull request #9 from outerl/jzill/eet_cleanup
janzill May 31, 2026
979337b
addresses claude code review
janzill Jun 9, 2026
a57e78a
consistent spelling
janzill Jun 27, 2026
ac2adf3
mal-formed html comment
janzill Jun 27, 2026
d3b64ba
doc ref
janzill Jun 27, 2026
9a10edb
addresses copilot code review
janzill Jun 27, 2026
05452ec
remove try block
janzill Jun 27, 2026
c226928
clean up
janzill Jun 27, 2026
a93da9c
logit clean up
janzill Jun 27, 2026
28b4011
clean up
janzill Jun 27, 2026
82b208f
lint
janzill Jun 27, 2026
a859214
estimation safe guard only for poisson
janzill Jun 27, 2026
1cc0ce5
merge origin/main
janzill Jun 27, 2026
ecb3131
deletes arc test as discussed in engineering meeting in June
janzill Jun 27, 2026
d439c7f
adding skip_failed_choices into test, removing dead function parameter
janzill Jun 27, 2026
c93d307
fix eet trip_dest presample test
janzill Jun 27, 2026
fa5b1b7
Merge pull request #10 from outerl/jzill/eet_llm_review
janzill Jul 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion activitysim/abm/models/disaggregate_accessibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
from activitysim.abm.models.util import tour_destination
from activitysim.abm.tables import shadow_pricing
from activitysim.core import estimation, los, tracing, util, workflow
from activitysim.core.configuration.base import PreprocessorSettings, PydanticReadable
from activitysim.core.configuration.base import (
ComputeSettings,
PreprocessorSettings,
PydanticReadable,
)
from activitysim.core.configuration.logit import TourLocationComponentSettings
from activitysim.core.expressions import assign_columns

Expand Down Expand Up @@ -184,6 +188,8 @@ class DisaggregateAccessibilitySettings(PydanticReadable, extra="forbid"):
If not supplied or None, will default to the chunk size in the location choice model settings.
"""

compute_settings: ComputeSettings | None = None


def read_disaggregate_accessibility_yaml(
state: workflow.State, file_name
Expand Down Expand Up @@ -795,6 +801,11 @@ def get_disaggregate_logsums(
if disagg_model_settings.explicit_chunk is not None:
model_settings.explicit_chunk = disagg_model_settings.explicit_chunk

# Can set compute settings for disaggregate accessibility
# Otherwise this will be set to whatever is in the location model settings
if disagg_model_settings.compute_settings is not None:
model_settings.compute_settings = disagg_model_settings.compute_settings

# Include the suffix tags to pass onto downstream logsum models (e.g., tour mode choice)
if model_settings.LOGSUM_SETTINGS:
suffixes = util.concat_suffix_dict(disagg_model_settings.suffixes)
Expand Down
68 changes: 53 additions & 15 deletions activitysim/abm/models/joint_tour_participation.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
workflow,
)
from activitysim.core.configuration.base import ComputeSettings, PreprocessorSettings
from activitysim.core.configuration.logit import LogitComponentSettings
from activitysim.core.util import assign_in_place, reindex
from activitysim.core.configuration.logit import LogitComponentSettings, LogitNestSpec
from activitysim.core.exceptions import InvalidTravelError
from activitysim.core.util import assign_in_place, reindex

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -127,10 +127,11 @@ def get_tour_satisfaction(candidates, participate):

def participants_chooser(
state: workflow.State,
probs: pd.DataFrame,
probs_or_utils: pd.DataFrame,
choosers: pd.DataFrame,
spec: pd.DataFrame,
trace_label: str,
nest_spec: dict | LogitNestSpec | None = None,
) -> tuple[pd.Series, pd.Series]:
"""
custom alternative to logit.make_choices for simulate.simple_simulate
Expand All @@ -147,9 +148,10 @@ def participants_chooser(

Parameters
----------
probs : pandas.DataFrame
probs_or_utils : pandas.DataFrame
Rows for choosers and columns for the alternatives from which they
are choosing. Values are expected to be valid probabilities across
are choosing. If running with explicit_error_terms, these are utilities.
Otherwise, values are expected to be valid probabilities across
each row, e.g. they should sum to 1.
choosers : pandas.dataframe
simple_simulate choosers df
Expand All @@ -166,7 +168,7 @@ def participants_chooser(

"""

assert probs.index.equals(choosers.index)
assert probs_or_utils.index.equals(choosers.index)

# choice is boolean (participate or not)
model_settings = JointTourParticipationSettings.read_settings_file(
Expand Down Expand Up @@ -202,7 +204,7 @@ def participants_chooser(
"%s max iterations exceeded (%s).", trace_label, MAX_ITERATIONS
)
diagnostic_cols = ["tour_id", "household_id", "composition", "adult"]
unsatisfied_candidates = candidates[diagnostic_cols].join(probs)
unsatisfied_candidates = candidates[diagnostic_cols].join(probs_or_utils)
state.tracing.write_csv(
unsatisfied_candidates,
file_name="%s.UNSATISFIED" % trace_label,
Expand All @@ -215,9 +217,31 @@ def participants_chooser(
f"Forcing joint tour participation for {num_tours_remaining} tours."
)
# anybody with probability > 0 is forced to join the joint tour
probs[choice_col] = np.where(probs[choice_col] > 0, 1, 0)
non_choice_col = [col for col in probs.columns if col != choice_col][0]
probs[non_choice_col] = 1 - probs[choice_col]
if state.settings.use_explicit_error_terms:
# need "is valid choice" such that we certainly choose those with non-zero values,
# and do not choose others. Let's use 3.0 as large value here.
probs_or_utils[choice_col] = np.where(
probs_or_utils[choice_col] > logit.UTIL_MIN,
3.0,
logit.UTIL_UNAVAILABLE,
)
non_choice_col = [
col for col in probs_or_utils.columns if col != choice_col
][0]
probs_or_utils[non_choice_col] = np.where(
probs_or_utils[choice_col] <= logit.UTIL_MIN,
3.0,
logit.UTIL_UNAVAILABLE,
)
else:
probs_or_utils[choice_col] = np.where(
probs_or_utils[choice_col] > 0, 1, 0
)
non_choice_col = [
col for col in probs_or_utils.columns if col != choice_col
][0]
probs_or_utils[non_choice_col] = 1 - probs_or_utils[choice_col]

if iter > MAX_ITERATIONS + 1:
raise InvalidTravelError(
f"{num_tours_remaining} tours could not be satisfied even with forcing participation"
Expand All @@ -227,9 +251,21 @@ def participants_chooser(
f"{num_tours_remaining} tours could not be satisfied after {iter} iterations"
)

choices, rands = logit.make_choices(
state, probs, trace_label=trace_label, trace_choosers=choosers
)
if state.settings.use_explicit_error_terms:
choices, rands = logit.make_choices_utility_based(
state,
probs_or_utils,
trace_label=trace_label,
trace_choosers=choosers,
nest_spec=nest_spec,
)
else:
choices, rands = logit.make_choices(
state,
probs_or_utils,
trace_label=trace_label,
trace_choosers=choosers,
)
participate = choices == PARTICIPATE_CHOICE

# satisfaction indexed by tour_id
Expand All @@ -252,7 +288,7 @@ def participants_chooser(
rands_list.append(rands[satisfied])

# remove candidates of satisfied tours
probs = probs[~satisfied]
probs_or_utils = probs_or_utils[~satisfied]
candidates = candidates[~satisfied]

logger.debug(
Expand Down Expand Up @@ -401,6 +437,8 @@ def joint_tour_participation(
if i not in model_settings.compute_settings.protect_columns:
model_settings.compute_settings.protect_columns.append(i)

custom_chooser = participants_chooser

choices = simulate.simple_simulate_by_chunk_id(
state,
choosers=candidates,
Expand All @@ -409,7 +447,7 @@ def joint_tour_participation(
locals_d=constants,
trace_label=trace_label,
trace_choice_name="participation",
custom_chooser=participants_chooser,
custom_chooser=custom_chooser,
estimator=estimator,
compute_settings=model_settings.compute_settings,
)
Expand Down
Loading
Loading