cli

Enum Command

Source
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

Fields

§path: String
§

RandomScenario

Generates a random scenario using the proletariat robot travel demand model

Fields

§rng_seed: u64

A seed for generating random numbers

§map: String

The path to a map to generate a scenario for

§scenario_name: String

The name of the scenario to generate

§

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

§scenario_modifiers: Vec<ScenarioModifier>

A JSON list of modifiers to transform the scenario. These can be generated with the GUI.

§delete_cancelled_trips: bool

Delete cancelled trips, and delete people with no remaining trips.

§rng_seed: u64

A seed for generating random numbers

§

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

§pbf_path: String

The path to the input .osm.pbf file

§clip_path: String

The path to a GeoJSON file with one boundary polygon

§out_path: String

The path to write the XML results

§

ImportGrid2Demand

Import a scenario from https://github.com/asu-trans-ai-lab/grid2demand.

Fields

§input: String

The path to a grid2demand CSV file

§map: String

The path to a map matching the grid2demand data

§

ImportScenario

Import a JSON scenario in the https://a-b-street.github.io/docs/tech/dev/formats/scenarios.html format

Fields

§input: String

The path to a JSON scenario file

§map: String

The path to a map matching the scenario data

§skip_problems: bool

Problems occur when a position is within the map boundary, but not close enough to buildings. Skip people with problematic positions if true, abort otherwise.

§

ImportJSONMap

Transform a JSON map that’s been manually edited into the binary format suitable for simulation.

Fields

§input: String

The path to a JSON map file to import

§output: String

The path to write

§

MinifyMap

Removes nonessential parts of a Map, for the bike network tool.

Fields

§map: String

The path to a map to shrink. The map is modified in-place.

§

GenerateHouses

Procedurally generates houses along empty residential roads of a map

Fields

§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

§

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.

Fields

§input: String

The path to a GeoJSON file with one boundary polygon

§

OneStepImport

Imports a one-shot A/B Street map from a GeoJSON boundary in a single command.

Fields

§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.

§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

§osm_input: String
§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

§shard_num: usize

If this command is being run in the cloud, parallelize the jobs by specifying which shard this invocation should run.

§num_shards: usize

If this command is being run in the cloud, parallelize the jobs by specifying how many total shards there are.

§

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.

Fields

§job: Job
§

PrebakeScenario

Simulate a full day of a scenario, and write the “prebaked results,” so the UI can later be used for A/B testing.

Fields

§scenario_path: String

The path to a scenario file

Trait Implementations§

Source§

impl StructOpt for Command

Source§

fn clap<'a, 'b>() -> App<'a, 'b>

Returns clap::App corresponding to the struct.
Source§

fn from_clap(matches: &ArgMatches<'_>) -> Self

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.
§

fn from_args() -> Self
where Self: Sized,

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.
§

fn from_args_safe() -> Result<Self, Error>
where Self: Sized,

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.
§

fn from_iter<I>(iter: I) -> Self
where Self: Sized, I: IntoIterator, <I as IntoIterator>::Item: Into<OsString> + 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 Self: Sized, I: IntoIterator, <I as IntoIterator>::Item: Into<OsString> + Clone,

Gets the struct from any iterator such as a Vec of your making. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn 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.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert 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)

Convert &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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

§

fn is_within(&self, b: &G2) -> bool