Filter out trips between the same place. Regenerate all Britain background scenarios. Fixes #664

This commit is contained in:
Dustin Carlino 2021-05-27 07:57:24 -07:00
parent 455399b90e
commit 53430319b1
3 changed files with 331 additions and 303 deletions

File diff suppressed because it is too large Load Diff

View File

@ -39,21 +39,19 @@ pub fn prebake_all() {
prebake(&map, scenario, None, &mut timer);
}
if false {
for &scenario_name in &["base", "go_active", "base_with_bg", "go_active_with_bg"] {
let map = map_model::Map::load_synchronously(
MapName::new("gb", "poundbury", "center").path(),
&mut timer,
);
let scenario: Scenario = abstio::read_binary(
abstio::path_scenario(map.get_name(), scenario_name),
&mut timer,
);
let mut opts = SimOptions::new("prebaked");
opts.alerts = AlertHandler::Silence;
opts.infinite_parking = true;
prebake(&map, scenario, Some(opts), &mut timer);
}
for &scenario_name in &["base", "go_active", "base_with_bg", "go_active_with_bg"] {
let map = map_model::Map::load_synchronously(
MapName::new("gb", "poundbury", "center").path(),
&mut timer,
);
let scenario: Scenario = abstio::read_binary(
abstio::path_scenario(map.get_name(), scenario_name),
&mut timer,
);
let mut opts = SimOptions::new("prebaked");
opts.alerts = AlertHandler::Silence;
opts.infinite_parking = true;
prebake(&map, scenario, Some(opts), &mut timer);
}
}

View File

@ -429,6 +429,16 @@ impl PersonSpec {
}
}
for trip in &self.trips {
if trip.origin == trip.destination {
bail!(
"Person ({:?}) has a trip from/to the same place: {:?}",
self.orig_id,
trip.origin
);
}
}
Ok(())
}