Rebuild actdev scenarios again, remembering to include return and lunch trips. cyipt/actdev#132

This commit is contained in:
Dustin Carlino 2021-03-08 13:17:52 -08:00
parent 5970883cff
commit 6594597c3f
3 changed files with 424 additions and 421 deletions

File diff suppressed because it is too large Load Diff

View File

@ -18,4 +18,7 @@ wget https://raw.githubusercontent.com/cyipt/actdev/main/data-small/$SITE/scenar
cargo run --release --bin import_traffic -- --map=data/system/gb/$CITY/maps/center.bin --input=scenario_base.json --skip_problems
cargo run --release --bin import_traffic -- --map=data/system/gb/$CITY/maps/center.bin --input=scenario_go_active.json --skip_problems
rm -fv *.json
cargo run --release --bin augment_scenario -- --input=data/system/gb/$CITY/scenarios/center/base.bin --add_return_trips --add_lunch_trips
cargo run --release --bin augment_scenario -- --input=data/system/gb/$CITY/scenarios/center/go_active.bin --add_return_trips --add_lunch_trips
# Generate the background traffic from OD data, and mix it in with the two actdev scenarios
./import.sh --scenario --city=gb/$CITY

View File

@ -92,7 +92,7 @@ fn add_lunch_trips(scenario: &mut Scenario, map: &Map, rng: &mut XorShiftRng, ti
timer.next();
let num_trips = person.trips.len();
// Only handle people with their final trip going back home.
if num_trips == 1 || person.trips[num_trips - 1].destination != person.origin {
if num_trips <= 1 || person.trips[num_trips - 1].destination != person.origin {
continue;
}