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

DumpJSON

Print a binary map or scenario file as JSON

Fields of DumpJSON

path: String
RandomScenario

Generates a random scenario using the proletariat robot travel demand model

Fields of RandomScenario

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

ClipOSM

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

pbf_path: String

The path to the input .osm.pbf file

clip_path: String

The path to an Osmosis boundary polygon

out_path: String

The path to write the XML results

GeoJSONToOsmosis

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

ImportGrid2Demand

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

Fields of ImportGrid2Demand

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 of ImportScenario

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 of ImportJSONMap

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 of MinifyMap

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

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 of PickGeofabrik

input: String
OneStepImport

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.

OneshotImport

Imports a one-shot A/B Street map from an .osm file in a single command.

Fields of OneshotImport

osm_input: Stringclip_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
RegenerateEverything

Regenerate all maps and scenarios from scratch.

Fields of RegenerateEverything

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.

RegenerateAllMaps

Regenerate all maps from RawMaps in parallel.

Import

Import RawMaps, maps, scenarios, and city overviews for a single city.

Fields of Import

job: Job

Trait Implementations

Returns clap::App corresponding to the struct.

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

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

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

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

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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

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

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

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

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

Performs the conversion.

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

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

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.