pub(crate) enum Command {
Show 16 variants
DumpJSON {
path: String,
},
RandomScenario {
rng_seed: u64,
map: String,
scenario_name: String,
},
AugmentScenario {
input_scenario: String,
add_return_trips: bool,
add_lunch_trips: bool,
scenario_modifiers: Vec<ScenarioModifier>,
delete_cancelled_trips: bool,
rng_seed: u64,
},
ClipOSM {
pbf_path: String,
clip_path: String,
out_path: String,
},
ImportGrid2Demand {
input: String,
map: String,
},
ImportScenario {
input: String,
map: String,
skip_problems: bool,
},
ImportJSONMap {
input: String,
output: String,
},
MinifyMap {
map: String,
},
GenerateHouses {
map: String,
num_required: usize,
rng_seed: u64,
output: String,
},
PickGeofabrik {
input: String,
},
OneStepImport {
geojson_path: String,
map_name: String,
use_geofabrik: bool,
use_osmium: bool,
inferred_sidewalks: bool,
filter_crosswalks: bool,
create_uk_travel_demand_model: bool,
opts: RawToMapOptions,
},
OneshotImport {
osm_input: String,
clip_path: Option<String>,
inferred_sidewalks: bool,
filter_crosswalks: bool,
create_uk_travel_demand_model: bool,
opts: RawToMapOptions,
},
RegenerateEverything {
shard_num: usize,
num_shards: usize,
},
RegenerateEverythingExternally,
Import {
job: Job,
},
PrebakeScenario {
scenario_path: String,
},
}
Variants§
DumpJSON
Print a binary map or scenario file as JSON
RandomScenario
Generates a random scenario using the proletariat robot travel demand model
Fields
AugmentScenario
Modifies the schedule of every person in an existing scenario.
Fields
input_scenario: String
The path to a scenario to augment. This will be modified in-place.
This tool isn’t very smart about detecting if a scenario already has these extra trips added in; be careful about running this on the correct input.
add_return_trips: bool
For people with only a single trip, add a return trip back home sometime 4-12 hours later
add_lunch_trips: bool
Before a person’s final trip home, insert a round-trip to a nearby cafe or restaurant
ClipOSM
Clips an OSM file to a boundary. This is a simple Rust port of osmium extract large_map.osm -p clipping.poly -o smaller_map.osm
.
Fields
ImportGrid2Demand
Import a scenario from https://github.com/asu-trans-ai-lab/grid2demand.
Fields
ImportScenario
Import a JSON scenario in the https://a-b-street.github.io/docs/tech/dev/formats/scenarios.html format
Fields
ImportJSONMap
Transform a JSON map that’s been manually edited into the binary format suitable for simulation.
MinifyMap
Removes nonessential parts of a Map, for the bike network tool.
GenerateHouses
Procedurally generates houses along empty residential roads of a map
Fields
PickGeofabrik
Prints the osm.pbf file from download.geofabrik.de that covers a given boundary.
This is a useful tool when importing a new map, if you don’t already know which geofabrik file you should use as your OSM input.
OneStepImport
Imports a one-shot A/B Street map from a GeoJSON boundary in a single command.
Fields
map_name: String
What to name the new imported map. The country will always be “zz” (a fake country code), with the city as “oneshot.” This name shouldn’t contain spaces or be empty.
use_geofabrik: bool
Use Geofabrik to grab OSM input if true, or Overpass if false. Overpass is faster.
use_osmium: bool
Use osmium to clip osm.pbf files. Faster, but requires an external system dependency. Falls back to something built-in and slower.
inferred_sidewalks: bool
If true, roads without explicitly tagged sidewalks may be assigned sidewalks or shoulders. If false, no inference will occur and separate sidewalks and crossings will be included.
filter_crosswalks: bool
Downgrade crosswalks not matching a highway=crossing
OSM node into unmarked crossings.
create_uk_travel_demand_model: bool
Generate a simple travel demand model based on 2011 UK commuting data. This will only work if the boundary is in the UK.
opts: RawToMapOptions
OneshotImport
Imports a one-shot A/B Street map from an .osm file in a single command.
Fields
clip_path: Option<String>
The path to a GeoJSON file with one boundary polygon. If omitted, a boundary will be derived from the .osm file, but borders will likely be broken or missing.
inferred_sidewalks: bool
If true, roads without explicitly tagged sidewalks may be assigned sidewalks or shoulders. If false, no inference will occur and separate sidewalks and crossings will be included.
filter_crosswalks: bool
Downgrade crosswalks not matching a highway=crossing
OSM node into unmarked crossings.
Downgrade crosswalks not matching a highway=crossing
OSM node into unmarked crossings.
create_uk_travel_demand_model: bool
Generate a simple travel demand model based on 2011 UK commuting data. This will only work if the boundary is in the UK.
opts: RawToMapOptions
RegenerateEverything
Regenerate all maps and scenarios from scratch.
Fields
RegenerateEverythingExternally
Generate a shell script to regenerate all cities that uses an external task runner.
Import
Import RawMaps, maps, scenarios, and city overviews for a single city.
PrebakeScenario
Simulate a full day of a scenario, and write the “prebaked results,” so the UI can later be used for A/B testing.
Trait Implementations§
Source§impl StructOpt for Command
impl StructOpt for Command
Source§fn from_clap(matches: &ArgMatches<'_>) -> Self
fn from_clap(matches: &ArgMatches<'_>) -> Self
clap::ArgMatches
. It’s guaranteed to succeed
if matches
originates from an App
generated by [StructOpt::clap
] called on
the same type, otherwise it must panic.§fn from_args() -> Selfwhere
Self: Sized,
fn from_args() -> Selfwhere
Self: Sized,
std::env::args_os
).
Calls clap::Error::exit
on failure, printing the error message and aborting the program.§fn from_args_safe() -> Result<Self, Error>where
Self: Sized,
fn from_args_safe() -> Result<Self, Error>where
Self: Sized,
std::env::args_os
).
Unlike [StructOpt::from_args
], returns clap::Error
on failure instead of aborting the program,
so calling .exit
is up to you.§fn from_iter<I>(iter: I) -> Self
fn from_iter<I>(iter: I) -> Self
Vec
of your making.
Print the error message and quit the program in case of failure. Read more§fn from_iter_safe<I>(iter: I) -> Result<Self, Error>
fn from_iter_safe<I>(iter: I) -> Result<Self, Error>
Vec
of your making. Read moreAuto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnwindSafe for Command
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.