Enum cli::Command[][src]

pub(crate) enum Command {
Show 17 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, create_uk_travel_demand_model: bool, }, OneshotImport { osm_input: String, clip_path: Option<String>, drive_on_left: bool, filter_crosswalks: bool, create_uk_travel_demand_model: bool, opts: RawToMapOptions, }, RegenerateEverything { shard_num: usize, num_shards: usize, }, RegenerateAllMaps, Import { job: Job, }, OSM2Lanes { map_path: String, },
}

Variants

DumpJSON

Fields

path: String

Print a binary map or scenario file as JSON

RandomScenario

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

Generates a random scenario using the proletariat robot travel demand model

AugmentScenario

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 trp home, insert a round-trip to a nearby cafe or restaurant

rng_seed: u64

A seed for generating random numbers

Modifies the schedule of every person in an existing scenario.

ClipOSM

Fields

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

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.

GeoJSONToOsmosis

Fields

input: String

The path to a GeoJSON file

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.

ImportGrid2Demand

Fields

input: String

The path to a grid2demand CSV file

map: String

The path to a map matching the grid2demand data

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

ImportScenario

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.

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

ImportJSONMap

Fields

input: String

The path to a JSON map file to import

output: String

The path to write

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

MinifyMap

Fields

map: String

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

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

GenerateHouses

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

Procedurally generates houses along empty residential roads of a map

PickGeofabrik

Fields

input: String

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

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.

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

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.

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

OneshotImport

Fields

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

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.

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

RegenerateEverything

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.

Regenerate all maps and scenarios from scratch.

RegenerateAllMaps

Regenerate all maps from RawMaps in parallel.

Import

Fields

job: Job

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

OSM2Lanes

Fields

map_path: String

The path to a map file

Generates JSON test cases for osm2lanes.

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.