Enum cli::Command [−][src]
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,
rng_seed: u64,
},
ClipOSM {
pbf_path: String,
clip_path: String,
out_path: String,
},
GeoJSONToOsmosis {
input: 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,
drive_on_left: bool,
use_geofabrik: bool,
filter_crosswalks: bool,
},
OneshotImport {
osm_input: String,
clip_path: Option<String>,
drive_on_left: bool,
filter_crosswalks: bool,
opts: RawToMapOptions,
},
RegenerateEverything {
shard_num: usize,
num_shards: usize,
},
RegenerateAllMaps,
Import {
job: Job,
},
}
Variants
Print a binary map or scenario file as JSON
Fields of DumpJSON
path: String
Generates a random scenario using the proletariat robot travel demand model
Fields of RandomScenario
Modifies the schedule of every person in an existing scenario.
Fields of AugmentScenario
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 trp home, insert a round-trip to a nearby cafe or restaurant
rng_seed: u64
A seed for generating random numbers
Clips an OSM file to a boundary. This is a simple Rust port of osmconvert large_map.osm -B=clipping.poly --complete-ways -o=smaller_map.osm
.
Fields of ClipOSM
Reads a GeoJSON file, extracts a polygon from every feature, and writes numbered files in the https://wiki.openstreetmap.org/wiki/Osmosis/Polygon_Filter_File_Format format as output.
Fields of GeoJSONToOsmosis
input: String
The path to a GeoJSON file
Import a scenario from https://github.com/asu-trans-ai-lab/grid2demand.
Fields of ImportGrid2Demand
Import a JSON scenario in the https://a-b-street.github.io/docs/tech/dev/formats/scenarios.html format
Fields of ImportScenario
Transform a JSON map that’s been manually edited into the binary format suitable for simulation.
Fields of ImportJSONMap
Removes nonessential parts of a Map, for the bike network tool.
Fields of MinifyMap
map: String
The path to a map to shrink. The map is modified in-place.
Procedurally generates houses along empty residential roads of a map
Fields of GenerateHouses
map: String
The path to a map to generate houses for
num_required: usize
If the tool doesn’t generate at least this many houses, then fail. This can be used to autodetect if a map probably already has most houses tagged in OSM.
rng_seed: u64
A seed for generating random numbers
output: String
The GeoJSON file to write
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.
Fields of PickGeofabrik
input: String
The path to an osmosis polygon boundary file
Imports a one-shot A/B Street map from a GeoJSON boundary in a single command.
Fields of OneStepImport
geojson_path: String
The path to a GeoJSON file with a boundary
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.
drive_on_left: bool
Do people drive on the left side of the road in this map?
use_geofabrik: bool
Use Geofabrik to grab OSM input if true, or Overpass if false. Overpass is faster.
filter_crosswalks: bool
Filter out auto-generated crosswalks based on OpenStreetMap crossing tags. Experimental, will likely disconnect the pedestrian network.
Imports a one-shot A/B Street map from an .osm file in a single command.
Fields of OneshotImport
osm_input: String
clip_path: Option<String>
The path to an Osmosis boundary polygon. If omitted, a boundary will be derived from the .osm file, but borders will likely be broken or missing.
drive_on_left: bool
Do people drive on the left side of the road in this map?
filter_crosswalks: bool
Filter out auto-generated crosswalks based on OpenStreetMap crossing tags. Experimental, will likely disconnect the pedestrian network.
opts: RawToMapOptions
Regenerate all maps and scenarios from scratch.
Fields of RegenerateEverything
Regenerate all maps from RawMaps in parallel.
Import RawMaps, maps, scenarios, and city overviews for a single city.
Fields of Import
job: Job
Trait Implementations
Builds the struct from 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. Read more
fn from_args() -> Self
fn from_args() -> Self
Builds the struct from the command line arguments (std::env::args_os
).
Calls clap::Error::exit
on failure, printing the error message and aborting the program. Read more
fn from_args_safe() -> Result<Self, Error>
fn from_args_safe() -> Result<Self, Error>
Builds the struct from the command line arguments (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. Read more
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
Gets the struct from any iterator such as a 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> where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
fn from_iter_safe<I>(iter: I) -> Result<Self, Error> where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
Gets the struct from any iterator such as a Vec
of your making. Read more
Auto Trait Implementations
impl RefUnwindSafe for Command
impl UnwindSafe for Command
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
Convert 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
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self