Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 8 additions & 1 deletion activitysim/defaults/models/school_location.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,14 @@ def school_location_simulate(set_random_seed,
choices_list.append(choices)

choices = pd.concat(choices_list)
choices = choices.reindex(persons_merged.index)

# this fillna is necessary to avoid a downstream crash and might be a bit
# wrong logically. The issue here is that there is a small but non-zero
# chance to choose a school trip even if not of the school type (because
# of -999 rather than outright removal of alternative availability). -
# this fills in the location for those uncommon circumstances,
# so at least it runs
choices = choices.reindex(persons_merged.index).fillna(-1)

print "Describe of choices:\n", choices.describe()
sim.add_column("persons", "school_taz", choices)
2 changes: 1 addition & 1 deletion example/configs/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ urban_threshold: 4
cbd_threshold: 2
rural_threshold: 6

households_sample_size: 1000
households_sample_size: 100

grade_school_max_age: 14

Expand Down
Loading