mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-24 23:15:24 +03:00
Filter out trips between the same place. Regenerate all Britain background scenarios. Fixes #664
This commit is contained in:
parent
455399b90e
commit
53430319b1
File diff suppressed because it is too large
Load Diff
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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(())
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user