Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

School zone alternatives are far away from home for high school student #815

Open
i-am-sijia opened this issue Feb 22, 2024 · 3 comments
Open
Labels
Bug Something isn't working/bug f

Comments

@i-am-sijia
Copy link
Contributor

Describe the bug
When doing benchmarking runs with full size prototype mtc extended, the model crashed in the trip mode choice for some school-related trips. When looking at the trip mode choice trace files, I noticed that the child is going to their high school (taz 1402) that is 146 miles away from home (taz 690). This is not directly causing the mode choice to fail, but it is odd to go to school 146 miles away from home for a high school student.

Traced the school location choice model. Attaching the trace files.

choosers-5c2274.csv
alternatives-5c2274.csv
2156922-5c2274.csv
interaction_utilities-5c2274.csv
probs-5c2274.csv
rands-5c2274.csv
utilities-5c2274.csv

This high school child only has 8 school zone alternatives, and all 8 of them are far far away from home.

Hypothesis:

  1. The new Shadow Pricing mechanism could be causing this. It could be that all the schools close to home are full and they are turned off in the next shadow pricing simulation.
  2. Others?

To Reproduce
Steps to reproduce the behavior:

  1. Use main branch @ff3e96b.
  2. Run full size prototype mtc extended model with 100% household.
  3. Trace hh id 1098914

Additional context

If it is the new Shadow Pricing mechanism that's causing this, should we not run Shadow Pricing for high school students? For work, it might be ok to commute 146 miles, but for school, one probably prefer going over the size term than sending students far away from home...

It would be good to check in the model result how many students are attending schools far away from home.

@i-am-sijia i-am-sijia added the Bug Something isn't working/bug f label Feb 22, 2024
@jpn--
Copy link
Member

jpn-- commented Feb 26, 2024

I ran this and confirmed it is the new shadow pricing algorithm that is sending this high school kids musical-chairs style to a school 143 miles away from home, after being booted out from 7 other closer schools due to overcrowding.

I don't think this is a "bug" per se, I think it is an expected outcome of this algorithm, and I recall we did talk about this potentially happening back when we were discussing the implementation. We agreed back then that it was not a problem to have a smattering of people end up sent pell mell across the region, as it's expected to be only a small handful. @i-am-sijia has a good point on the school location though... I believe when RSG initially looked at these effects they looked at work locations, which are a bit more homogeneously distributed through the region than schools, esp high schools. As an example in this model with 1454 zones, nearly every zone has grade school and employment attractions, but there are only 218 zones with high school enrollment.

@dhensle
Copy link
Contributor

dhensle commented Feb 29, 2024

The 6 Oct 22 Presentation that RSG gave goes into good detail about how the simulation-based mandatory location choice constraint algorithm works and some plots on convergence.

Pasted below is an excerpt from that presentation. It shows that the school tour lengths are a little bit longer than the old "ctramp" shadow pricing method showed. If you dig more into the presentation you will see that the simulation-based constraint mechanism converges much better than the shadow pricing mechanism. The thought at the time was that the shadow pricing would eventually converge to a value close to the simulation-based mechanism. We did not see any red flags when looking in aggregate at school level trips and the trend for longer tour lengths was present for workplace location as well.

image

There is a setting for percent tolerance which gets applied here as

# shadow prices are set to -999 if overassigned or 0 if the zone still has room for this segment self.shadow_prices[segment] = np.where( (sprice <= 1 + percent_tolerance / 100), -999, 0 )

We could adjust the percent tolerance setting and see if this makes a difference? (The default value is 5% which I think is actually relatively large for a one zone system running a 100% sample.)

cc: @aletzdy

@joecastiglione
Copy link
Contributor

joecastiglione commented Feb 29, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working/bug f
Projects
None yet
Development

No branches or pull requests

4 participants