diff --git a/rustdoc/geom/polygon/fn.from_multi.html b/rustdoc/geom/polygon/fn.from_multi.html index d8218c02d8..18c404ee89 100644 --- a/rustdoc/geom/polygon/fn.from_multi.html +++ b/rustdoc/geom/polygon/fn.from_multi.html @@ -1 +1 @@ -
pub struct Polygon {
pub(crate) rings: Vec<Ring>,
pub(crate) tessellation: Option<Tessellation>,
-}
rings: Vec<Ring>
tessellation: Option<Tessellation>
impl<A> Write for Vec<u8, A>where
A: Allocator,
Does this polygon contain the point in its interior?
+}rings: Vec<Ring>
tessellation: Option<Tessellation>
impl<A> Write for Vec<u8, A>where
A: Allocator,
Does this polygon contain the point in its interior?
Transformations must preserve Rings.
When factor
is small, this may collapse Rings and thus fail.
When factor
is known to be over 1, then scaling can’t fail.
width
or height
is 0.
Top-left at the origin. Doesn’t take Distance, because this is usually pixels, actually. If it’s not possible to apply the specified radius, fallback to a regular rectangle.
Union all of the polygons into one geo::MultiPolygon
-Find the “pole of inaccessibility” – the most distant internal point from the polygon +
Find the “pole of inaccessibility” – the most distant internal point from the polygon outline
-Do two polygons intersect at all?
-Does this polygon intersect a polyline?
-Creates the outline around the polygon (both the exterior and holes), with the thickness +
Do two polygons intersect at all?
+Does this polygon intersect a polyline?
+Creates the outline around the polygon (both the exterior and holes), with the thickness half straddling the polygon and half of it just outside.
Returns a Tessellation
that may union together the outline from the exterior and multiple
holes. Callers that need a Polygon
must call to_outline
on the individual Rings
.
Doesn’t handle multiple crossings in and out.
-Optionally map the world-space points back to GPS.
-Extracts all polygons from raw bytes representing a GeoJSON file, along with the string +
Doesn’t handle multiple crossings in and out.
+Optionally map the world-space points back to GPS.
+Extracts all polygons from raw bytes representing a GeoJSON file, along with the string
key/value properties. Only the first polygon from multipolygons is returned. If
require_in_bounds
is set, then the polygon must completely fit within the gps_bounds
.
If simplification fails, just keep the original polygon
-Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From<T> for U
chooses to do.
pub struct Polygon {
pub(crate) rings: Vec<Ring>,
pub(crate) tessellation: Option<Tessellation>,
-}
rings: Vec<Ring>
tessellation: Option<Tessellation>
impl<A> Write for Vec<u8, A>where
A: Allocator,
Does this polygon contain the point in its interior?
+}rings: Vec<Ring>
tessellation: Option<Tessellation>
impl<A> Write for Vec<u8, A>where
A: Allocator,
Does this polygon contain the point in its interior?
Transformations must preserve Rings.
When factor
is small, this may collapse Rings and thus fail.
When factor
is known to be over 1, then scaling can’t fail.
width
or height
is 0.
Top-left at the origin. Doesn’t take Distance, because this is usually pixels, actually. If it’s not possible to apply the specified radius, fallback to a regular rectangle.
Union all of the polygons into one geo::MultiPolygon
-Find the “pole of inaccessibility” – the most distant internal point from the polygon +
Find the “pole of inaccessibility” – the most distant internal point from the polygon outline
-Do two polygons intersect at all?
-Does this polygon intersect a polyline?
-Creates the outline around the polygon (both the exterior and holes), with the thickness +
Do two polygons intersect at all?
+Does this polygon intersect a polyline?
+Creates the outline around the polygon (both the exterior and holes), with the thickness half straddling the polygon and half of it just outside.
Returns a Tessellation
that may union together the outline from the exterior and multiple
holes. Callers that need a Polygon
must call to_outline
on the individual Rings
.
Doesn’t handle multiple crossings in and out.
-Optionally map the world-space points back to GPS.
-Extracts all polygons from raw bytes representing a GeoJSON file, along with the string +
Doesn’t handle multiple crossings in and out.
+Optionally map the world-space points back to GPS.
+Extracts all polygons from raw bytes representing a GeoJSON file, along with the string
key/value properties. Only the first polygon from multipolygons is returned. If
require_in_bounds
is set, then the polygon must completely fit within the gps_bounds
.
If simplification fails, just keep the original polygon
-Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From<T> for U
chooses to do.
points: Vec<Pt2D>
These points aren’t in any meaningful order. It’s not generally possible to reconstruct a
Polygon
from this.
indices: Vec<u16>
Groups of three indices make up the triangles
-The points
are not necessarily a Ring
, which has strict requirements about no duplicate
+
The points
are not necessarily a Ring
, which has strict requirements about no duplicate
points. We can render various types of invalid polygon.
impl<A> Write for Vec<u8, A>where
A: Allocator,
Equivalent to self.scale(scale).translate(translate_x, translate_y).rotate_around(rotate, pivot)
, but modifies the polygon in-place and is faster.
Produces a GeoJSON multipolygon consisting of individual triangles. Optionally map the world-space points back to GPS.
-source
. Read moreself
and other
values to be equal, and is used
+source
. Read moreCalls U::from(self)
.
points: Vec<Pt2D>
These points aren’t in any meaningful order. It’s not generally possible to reconstruct a
Polygon
from this.
indices: Vec<u16>
Groups of three indices make up the triangles
-The points
are not necessarily a Ring
, which has strict requirements about no duplicate
+
The points
are not necessarily a Ring
, which has strict requirements about no duplicate
points. We can render various types of invalid polygon.
impl<A> Write for Vec<u8, A>where
A: Allocator,
Equivalent to self.scale(scale).translate(translate_x, translate_y).rotate_around(rotate, pivot)
, but modifies the polygon in-place and is faster.
Produces a GeoJSON multipolygon consisting of individual triangles. Optionally map the world-space points back to GPS.
-source
. Read moreself
and other
values to be equal, and is used
+source
. Read moreCalls U::from(self)
.
pub const BUILT_TIME_UTC: &'static str = r"Wed, 09 Nov 2022 12:11:28 +0000";
The build time in RFC2822, UTC.
+pub const BUILT_TIME_UTC: &'static str = r"Thu, 10 Nov 2022 15:26:44 +0000";
The build time in RFC2822, UTC.
road_thruput: TimeSeriesCount<RoadID>
intersection_thruput: TimeSeriesCount<IntersectionID>
traffic_signal_thruput: TimeSeriesCount<CompressedMovementID>
demand: BTreeMap<MovementID, usize>
Most fields in Analytics are cumulative over time, but this is just for the current moment in time.
bus_arrivals: Vec<(Time, CarID, TransitRouteID, TransitStopID)>
passengers_boarding: BTreeMap<TransitStopID, Vec<(Time, TransitRouteID, Duration)>>
For each passenger boarding, how long did they wait at the stop?
-passengers_alighting: BTreeMap<TransitStopID, Vec<(Time, TransitRouteID)>>
started_trips: BTreeMap<TripID, Time>
finished_trips: Vec<(Time, TripID, TripMode, Option<Duration>)>
Finish time, ID, mode, trip duration if successful (or None if cancelled)
+passengers_alighting: BTreeMap<TransitStopID, Vec<(Time, TransitRouteID)>>
started_trips: BTreeMap<TripID, Time>
finished_trips: Vec<(Time, TripID, TripMode, Option<Duration>)>
Finish time, ID, mode, trip duration if successful (or None if cancelled)
problems_per_trip: BTreeMap<TripID, Vec<(Time, Problem)>>
Record different problems that each trip encounters.
trip_log: Vec<(Time, TripID, Option<PathRequest>, TripPhaseType)>
intersection_delays: BTreeMap<IntersectionID, Vec<(u8, Time, Duration, AgentType)>>
Only for traffic signals. The u8 is the movement index from a CompressedMovementID.
parking_lane_changes: BTreeMap<LaneID, Vec<(Time, bool)>>
Per parking lane or lot, when does a spot become filled (true) or free (false)
parking_lot_changes: BTreeMap<ParkingLotID, Vec<(Time, bool)>>
alerts: Vec<(Time, AlertLocation, String)>
record_anything: bool
For benchmarking, we may want to disable collecting data.
Ignores the current time. Returns None for cancelled trips.
-impl<A> Write for Vec<u8, A>where
A: Allocator,
Returns pairs of trip times for finished trips in both worlds. (ID, before, after, mode)
+impl<A> Write for Vec<u8, A>where
A: Allocator,
Returns pairs of trip times for finished trips in both worlds. (ID, before, after, mode)
impl<A> Write for Vec<u8, A>where
A: Allocator,
If calling on prebaked Analytics, be careful to pass in an unedited map, to match how the simulation was originally run. Otherwise the paths may be nonsense.
impl<A> Write for Vec<u8, A>where
A: Allocator,
impl<A> Write for Vec<u8, A>where
A: Allocator,
Returns the free spots over time
diff --git a/rustdoc/sim/events/enum.Event.html b/rustdoc/sim/events/enum.Event.html index a3a9c13b1b..cd6484ae3b 100644 --- a/rustdoc/sim/events/enum.Event.html +++ b/rustdoc/sim/events/enum.Event.html @@ -16,11 +16,11 @@ IntersectionDelayMeasured(TripID, TurnID, AgentID, Duration), TripFinished { trip: TripID, - mode: TripMode, + mode: TripMode, total_time: Duration, blocked_time: Duration, }, - TripCancelled(TripID, TripMode), + TripCancelled(TripID, TripMode), TripPhaseStarting(TripID, PersonID, Option<PathRequest>, TripPhaseType), PathAmended(Path), Alert(AlertLocation, String), @@ -35,7 +35,7 @@ has no performance impact.PersonEntersMap(PersonID, AgentID, IntersectionID)
PedReachedParkingSpot(PedestrianID, ParkingSpot)
BikeStoppedAtSidewalk(CarID, LaneID)
ProblemEncountered(TripID, Problem)
AgentEntersTraversable(AgentID, Option<TripID>, Traversable, Option<usize>)
If the agent is a transit vehicle, then include a count of how many passengers are on board.
IntersectionDelayMeasured(TripID, TurnID, AgentID, Duration)
TripID, TurnID (Where the delay was encountered), Time spent waiting at that turn
-TripFinished
TripCancelled(TripID, TripMode)
TripPhaseStarting(TripID, PersonID, Option<PathRequest>, TripPhaseType)
PathAmended(Path)
Just use for parking replanning. Not happy about copying the full path in here, but the way +
TripFinished
TripCancelled(TripID, TripMode)
TripPhaseStarting(TripID, PersonID, Option<PathRequest>, TripPhaseType)
PathAmended(Path)
Just use for parking replanning. Not happy about copying the full path in here, but the way to plumb info into Analytics is Event.
Alert(AlertLocation, String)
!=
. The default implementation is almost always
diff --git a/rustdoc/sim/fn.count_parked_cars_per_bldg.html b/rustdoc/sim/fn.count_parked_cars_per_bldg.html
index 62cd7c2de0..bc672ac510 100644
--- a/rustdoc/sim/fn.count_parked_cars_per_bldg.html
+++ b/rustdoc/sim/fn.count_parked_cars_per_bldg.html
@@ -1 +1 @@
-pub fn count_parked_cars_per_bldg(scenario: &Scenario) -> Counter<BuildingID>
pub fn count_parked_cars_per_bldg(scenario: &Scenario) -> Counter<BuildingID>
pub fn fork_rng(base_rng: &mut XorShiftRng) -> XorShiftRng
Need to explain this trick – basically keeps consistency between two different simulations when +
pub fn fork_rng(base_rng: &mut XorShiftRng) -> XorShiftRng
Need to explain this trick – basically keeps consistency between two different simulations when each one might make slightly different sequences of calls to the RNG.
fn parse_modifiers(x: &str) -> Result<Vec<ScenarioModifier>>
pub struct SimFlags {
load_path: Option<String>,
pub load: String,
- pub scenario_modifiers: Vec<ScenarioModifier>,
+ pub scenario_modifiers: Vec<ScenarioModifier>,
pub rng_seed: u64,
pub opts: SimOptions,
}
SimFlags specifies a simulation to setup. After parsing from structopt, you must call @@ -14,7 +14,7 @@
load: String
The same as load_path
, but with a default value filled out. Call initialize
to set this
up.
scenario_modifiers: Vec<ScenarioModifier>
A JSON list of modifiers to transform the scenario. These can be generated with the GUI.
+scenario_modifiers: Vec<ScenarioModifier>
A JSON list of modifiers to transform the scenario. These can be generated with the GUI.
rng_seed: u64
An arbitrary number to seed the random number generator. This is input to the deterministic simulation, so different values affect results.
opts: SimOptions
Loads a map and simulation. Not appropriate for use in the UI or on web.
diff --git a/rustdoc/sim/make/load/type.ModifierList.html b/rustdoc/sim/make/load/type.ModifierList.html index b4150eb6bf..800244ef58 100644 --- a/rustdoc/sim/make/load/type.ModifierList.html +++ b/rustdoc/sim/make/load/type.ModifierList.html @@ -1 +1 @@ -type ModifierList = Vec<ScenarioModifier>;
retry_if_no_room: bool
Can be used to spawn from a border or anywhere for interactive debugging.
SpawningFailure
Something went wrong spawning the trip.
UsingParkedCar
JustWalking
UsingBike
UsingTransit
JustWalking
UsingBike
UsingTransit
Turn an origin/destination pair and mode into a specific plan for instantiating a trip. Decisions like how to use public transit happen here.
!=
. The default implementation is almost always
diff --git a/rustdoc/sim/make/spawner/fn.driving_goal.html b/rustdoc/sim/make/spawner/fn.driving_goal.html
index 43b0f08f94..8b9af64b8f 100644
--- a/rustdoc/sim/make/spawner/fn.driving_goal.html
+++ b/rustdoc/sim/make/spawner/fn.driving_goal.html
@@ -1 +1 @@
-fn driving_goal(
endpt: TripEndpoint,
constraints: PathConstraints,
map: &Map
) -> Result<DrivingGoal>
fn driving_goal(
endpt: TripEndpoint,
constraints: PathConstraints,
map: &Map
) -> Result<DrivingGoal>
fn end_sidewalk_spot(endpt: TripEndpoint, map: &Map) -> Result<SidewalkSpot>
fn end_sidewalk_spot(endpt: TripEndpoint, map: &Map) -> Result<SidewalkSpot>
fn start_sidewalk_spot(endpt: TripEndpoint, map: &Map) -> Result<SidewalkSpot>
fn start_sidewalk_spot(endpt: TripEndpoint, map: &Map) -> Result<SidewalkSpot>
pub fn prebake(
map: &Map,
scenario: Scenario,
timer: &mut Timer<'_>
) -> PrebakeSummary
Simulate a curated list of scenarios to completion, and save the analytics as “prebaked +
pub fn prebake(
map: &Map,
scenario: Scenario,
timer: &mut Timer<'_>
) -> PrebakeSummary
Simulate a curated list of scenarios to completion, and save the analytics as “prebaked results,” to later compare simulation metrics against the baseline without map edits.
map: String
scenario: String
finished_trips: usize
cancelled_trips: usize
total_trip_duration_seconds: f64
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
+}map: String
scenario: String
finished_trips: usize
cancelled_trips: usize
total_trip_duration_seconds: f64
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 moreRc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
diff --git a/rustdoc/sim/recorder/struct.TrafficRecorder.html b/rustdoc/sim/recorder/struct.TrafficRecorder.html
index bb78ba1f18..f5cc2efb4e 100644
--- a/rustdoc/sim/recorder/struct.TrafficRecorder.html
+++ b/rustdoc/sim/recorder/struct.TrafficRecorder.html
@@ -1,11 +1,11 @@
pub(crate) struct TrafficRecorder {
capture_points: BTreeSet<IntersectionID>,
- trips: Vec<IndividTrip>,
+ trips: Vec<IndividTrip>,
seen_trips: BTreeSet<TripID>,
}
Records trips beginning and ending at a specified set of intersections. This can be used to capture and reproduce behavior in a gridlock-prone chunk of the map, without simulating everything.
-capture_points: BTreeSet<IntersectionID>
trips: Vec<IndividTrip>
seen_trips: BTreeSet<TripID>
source
. Read moreBox<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
+capture_points: BTreeSet<IntersectionID>
trips: Vec<IndividTrip>
seen_trips: BTreeSet<TripID>
source
. Read moreBox<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 moreRc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
diff --git a/rustdoc/sim/sim/scenario/fn.count_parked_cars_per_bldg.html b/rustdoc/sim/sim/scenario/fn.count_parked_cars_per_bldg.html
index 1dcf43785a..64ae9dae9d 100644
--- a/rustdoc/sim/sim/scenario/fn.count_parked_cars_per_bldg.html
+++ b/rustdoc/sim/sim/scenario/fn.count_parked_cars_per_bldg.html
@@ -1 +1 @@
-fn get_vehicles(
person: &PersonSpec,
rng: &mut XorShiftRng
) -> (Vec<VehicleSpec>, Vec<(usize, BuildingID)>, Vec<Option<usize>>)
fn get_vehicles(
person: &PersonSpec,
rng: &mut XorShiftRng
) -> (Vec<VehicleSpec>, Vec<(usize, BuildingID)>, Vec<Option<usize>>)
Only call for active agents, will panic otherwise
impl<A> Write for Vec<u8, A>where
A: Allocator,
impl<A> Write for Vec<u8, A>where
A: Allocator,
If trip is finished, returns (total time, total waiting time, total distance)
impl<A> Write for Vec<u8, A>where
A: Allocator,
For every parked car, (position of parking spot, position of owner)
-impl<A> Write for Vec<u8, A>where
A: Allocator,
impl<A> Write for Vec<u8, A>where
A: Allocator,
impl<A> Write for Vec<u8, A>where
A: Allocator,
impl<A> Write for Vec<u8, A>where
A: Allocator,
For every agent that’s currently not moving, figure out how long they’ve been waiting and +
impl<A> Write for Vec<u8, A>where
A: Allocator,
impl<A> Write for Vec<u8, A>where
A: Allocator,
impl<A> Write for Vec<u8, A>where
A: Allocator,
impl<A> Write for Vec<u8, A>where
A: Allocator,
For every agent that’s currently not moving, figure out how long they’ve been waiting and why they’re blocked.
impl<A> Write for Vec<u8, A>where
A: Allocator,
(bus, stop index it’s coming from, percent to next stop, location)
impl<A> Write for Vec<u8, A>where
A: Allocator,
For intersections with an agent waiting beyond some threshold, return when they started waiting. Sorted by earliest waiting (likely the root cause of gridlock).
impl<A> Write for Vec<u8, A>where
A: Allocator,
impl<A> Write for Vec<u8, A>where
A: Allocator,
(number of vehicles in the lane, penalty if a bike or other slow vehicle is present)
-impl<A> Write for Vec<u8, A>where
A: Allocator,
impl<A> Write for Vec<u8, A>where
A: Allocator,
Returns the best-case time for a trip in a world with no traffic or intersection delays. +
impl<A> Write for Vec<u8, A>where
A: Allocator,
impl<A> Write for Vec<u8, A>where
A: Allocator,
Returns the best-case time for a trip in a world with no traffic or intersection delays. Might fail in some cases where the real trip succeeds, but the single-mode path can’t be found. Assumes the TripID exists.
impl<A> Write for Vec<u8, A>where
A: Allocator,
impl<A> Write for Vec<u8, A>where
A: Allocator,
impl<A> Write for Vec<u8, A>where
A: Allocator,
impl<A> Write for Vec<u8, A>where
A: Allocator,
This does not include transit riders. Some callers need those in addition, but the rendering ones don’t.
-impl<A> Write for Vec<u8, A>where
A: Allocator,
If retry_if_no_room is false, any vehicles that fail to spawn because of something else in +
impl<A> Write for Vec<u8, A>where
A: Allocator,
If retry_if_no_room is false, any vehicles that fail to spawn because of something else in the way will just wind up as cancelled trips.
impl<A> Write for Vec<u8, A>where
A: Allocator,
impl<A> Write for Vec<u8, A>where
A: Allocator,
impl<A> Write for Vec<u8, A>where
A: Allocator,
(Filled, available)
-impl<A> Write for Vec<u8, A>where
A: Allocator,
Respond to arbitrary map edits without resetting the simulation. Returns the number of +
impl<A> Write for Vec<u8, A>where
A: Allocator,
Respond to arbitrary map edits without resetting the simulation. Returns the number of (trips cancelled, parked cars displaced).
impl<A> Write for Vec<u8, A>where
A: Allocator,
Only one at a time supported.
diff --git a/rustdoc/sim/struct.Analytics.html b/rustdoc/sim/struct.Analytics.html index 567ef4ce8b..10d62b6911 100644 --- a/rustdoc/sim/struct.Analytics.html +++ b/rustdoc/sim/struct.Analytics.html @@ -7,7 +7,7 @@ pub passengers_boarding: BTreeMap<TransitStopID, Vec<(Time, TransitRouteID, Duration)>>, pub passengers_alighting: BTreeMap<TransitStopID, Vec<(Time, TransitRouteID)>>, pub started_trips: BTreeMap<TripID, Time>, - pub finished_trips: Vec<(Time, TripID, TripMode, Option<Duration>)>, + pub finished_trips: Vec<(Time, TripID, TripMode, Option<Duration>)>, pub problems_per_trip: BTreeMap<TripID, Vec<(Time, Problem)>>, pub trip_log: Vec<(Time, TripID, Option<PathRequest>, TripPhaseType)>, pub intersection_delays: BTreeMap<IntersectionID, Vec<(u8, Time, Duration, AgentType)>>, @@ -25,13 +25,13 @@ running the simulation, and compare the live Analytics to the prebaked baselineroad_thruput: TimeSeriesCount<RoadID>
intersection_thruput: TimeSeriesCount<IntersectionID>
traffic_signal_thruput: TimeSeriesCount<CompressedMovementID>
demand: BTreeMap<MovementID, usize>
Most fields in Analytics are cumulative over time, but this is just for the current moment in time.
bus_arrivals: Vec<(Time, CarID, TransitRouteID, TransitStopID)>
passengers_boarding: BTreeMap<TransitStopID, Vec<(Time, TransitRouteID, Duration)>>
For each passenger boarding, how long did they wait at the stop?
-passengers_alighting: BTreeMap<TransitStopID, Vec<(Time, TransitRouteID)>>
started_trips: BTreeMap<TripID, Time>
finished_trips: Vec<(Time, TripID, TripMode, Option<Duration>)>
Finish time, ID, mode, trip duration if successful (or None if cancelled)
+passengers_alighting: BTreeMap<TransitStopID, Vec<(Time, TransitRouteID)>>
started_trips: BTreeMap<TripID, Time>
finished_trips: Vec<(Time, TripID, TripMode, Option<Duration>)>
Finish time, ID, mode, trip duration if successful (or None if cancelled)
problems_per_trip: BTreeMap<TripID, Vec<(Time, Problem)>>
Record different problems that each trip encounters.
trip_log: Vec<(Time, TripID, Option<PathRequest>, TripPhaseType)>
intersection_delays: BTreeMap<IntersectionID, Vec<(u8, Time, Duration, AgentType)>>
Only for traffic signals. The u8 is the movement index from a CompressedMovementID.
parking_lane_changes: BTreeMap<LaneID, Vec<(Time, bool)>>
Per parking lane or lot, when does a spot become filled (true) or free (false)
parking_lot_changes: BTreeMap<ParkingLotID, Vec<(Time, bool)>>
alerts: Vec<(Time, AlertLocation, String)>
record_anything: bool
For benchmarking, we may want to disable collecting data.
Ignores the current time. Returns None for cancelled trips.
-impl<A> Write for Vec<u8, A>where
A: Allocator,
Returns pairs of trip times for finished trips in both worlds. (ID, before, after, mode)
+impl<A> Write for Vec<u8, A>where
A: Allocator,
Returns pairs of trip times for finished trips in both worlds. (ID, before, after, mode)
impl<A> Write for Vec<u8, A>where
A: Allocator,
If calling on prebaked Analytics, be careful to pass in an unedited map, to match how the simulation was originally run. Otherwise the paths may be nonsense.
impl<A> Write for Vec<u8, A>where
A: Allocator,
impl<A> Write for Vec<u8, A>where
A: Allocator,
Returns the free spots over time
diff --git a/rustdoc/sim/struct.BorderSpawnOverTime.html b/rustdoc/sim/struct.BorderSpawnOverTime.html index b9d8b53b58..f2954565c0 100644 --- a/rustdoc/sim/struct.BorderSpawnOverTime.html +++ b/rustdoc/sim/struct.BorderSpawnOverTime.html @@ -1,4 +1,4 @@ -pub struct BorderSpawnOverTime {
+BorderSpawnOverTime in sim - Rust Struct sim::BorderSpawnOverTime
source · [−]pub struct BorderSpawnOverTime {
pub num_peds: usize,
pub num_cars: usize,
pub num_bikes: usize,
@@ -6,8 +6,8 @@
pub start_time: Time,
pub stop_time: Time,
pub start_from_border: IntersectionID,
- pub goal: Option<TripEndpoint>,
-}
Fields
num_peds: usize
num_cars: usize
num_bikes: usize
percent_use_transit: f64
start_time: Time
stop_time: Time
start_from_border: IntersectionID
goal: Option<TripEndpoint>
Trait Implementations
impl Clone for BorderSpawnOverTime
fn clone(&self) -> BorderSpawnOverTime
Returns a copy of the value. Read more1.0.0 · sourcefn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreimpl Debug for BorderSpawnOverTime
impl<'de> Deserialize<'de> for BorderSpawnOverTime
fn deserialize<__D>(
__deserializer: __D
) -> Result<BorderSpawnOverTime, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreimpl Serialize for BorderSpawnOverTime
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read moreAuto Trait Implementations
impl RefUnwindSafe for BorderSpawnOverTime
impl Send for BorderSpawnOverTime
impl Sync for BorderSpawnOverTime
impl Unpin for BorderSpawnOverTime
impl UnwindSafe for BorderSpawnOverTime
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreimpl<T> Downcast for Twhere
T: Any,
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
+ pub goal: Option<TripEndpoint>,
+}Fields
num_peds: usize
num_cars: usize
num_bikes: usize
percent_use_transit: f64
start_time: Time
stop_time: Time
start_from_border: IntersectionID
goal: Option<TripEndpoint>
Trait Implementations
sourceimpl Clone for BorderSpawnOverTime
sourcefn clone(&self) -> BorderSpawnOverTime
Returns a copy of the value. Read more1.0.0 · sourcefn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresourceimpl Debug for BorderSpawnOverTime
sourceimpl<'de> Deserialize<'de> for BorderSpawnOverTime
sourcefn deserialize<__D>(
__deserializer: __D
) -> Result<BorderSpawnOverTime, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresourceimpl Serialize for BorderSpawnOverTime
sourcefn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read moreAuto Trait Implementations
impl RefUnwindSafe for BorderSpawnOverTime
impl Send for BorderSpawnOverTime
impl Sync for BorderSpawnOverTime
impl Unpin for BorderSpawnOverTime
impl UnwindSafe for BorderSpawnOverTime
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreimpl<T> Downcast for Twhere
T: Any,
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
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 morefn 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 morefn 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. Read morefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
diff --git a/rustdoc/sim/struct.Person.html b/rustdoc/sim/struct.Person.html
index a271e7f47b..639715412a 100644
--- a/rustdoc/sim/struct.Person.html
+++ b/rustdoc/sim/struct.Person.html
@@ -1,6 +1,6 @@
Person in sim - Rust pub struct Person {
pub id: PersonID,
- pub orig_id: Option<OrigPersonID>,
+ pub orig_id: Option<OrigPersonID>,
pub trips: Vec<TripID>,
pub state: PersonState,
pub ped: PedestrianID,
@@ -8,7 +8,7 @@
pub vehicles: Vec<Vehicle>,
delayed_trips: Vec<(TripID, StartTripArgs)>,
on_bus: Option<CarID>,
-}
Fields
id: PersonID
orig_id: Option<OrigPersonID>
trips: Vec<TripID>
state: PersonState
ped: PedestrianID
ped_speed: Speed
vehicles: Vec<Vehicle>
Both cars and bikes
+}Fields
id: PersonID
orig_id: Option<OrigPersonID>
trips: Vec<TripID>
state: PersonState
ped: PedestrianID
ped_speed: Speed
vehicles: Vec<Vehicle>
Both cars and bikes
delayed_trips: Vec<(TripID, StartTripArgs)>
on_bus: Option<CarID>
Implementations
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Person
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations
impl RefUnwindSafe for Person
impl Send for Person
impl Sync for Person
impl Unpin for Person
impl UnwindSafe for Person
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreimpl<T> Downcast for Twhere
T: Any,
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
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 morefn 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 morefn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
diff --git a/rustdoc/sim/struct.ScenarioGenerator.html b/rustdoc/sim/struct.ScenarioGenerator.html
index de7123b13f..4c3edefe61 100644
--- a/rustdoc/sim/struct.ScenarioGenerator.html
+++ b/rustdoc/sim/struct.ScenarioGenerator.html
@@ -1,10 +1,10 @@
-ScenarioGenerator in sim - Rust Struct sim::ScenarioGenerator
[−]pub struct ScenarioGenerator {
+ScenarioGenerator in sim - Rust Struct sim::ScenarioGenerator
source · [−]pub struct ScenarioGenerator {
pub scenario_name: String,
pub only_seed_buses: Option<BTreeSet<String, Global>>,
pub spawn_over_time: Vec<SpawnOverTime, Global>,
pub border_spawn_over_time: Vec<BorderSpawnOverTime, Global>,
-}
Fields
scenario_name: String
only_seed_buses: Option<BTreeSet<String, Global>>
spawn_over_time: Vec<SpawnOverTime, Global>
border_spawn_over_time: Vec<BorderSpawnOverTime, Global>
Implementations
impl ScenarioGenerator
pub fn proletariat_robot(
map: &Map,
rng: &mut XorShiftRng,
timer: &mut Timer<'_>
) -> Scenario
Designed in https://github.com/a-b-street/abstreet/issues/154
-impl ScenarioGenerator
pub fn generate(
&self,
map: &Map,
rng: &mut XorShiftRng,
timer: &mut Timer<'_>
) -> Scenario
pub fn small_run(map: &Map) -> ScenarioGenerator
pub fn empty(name: &str) -> ScenarioGenerator
Trait Implementations
impl Clone for ScenarioGenerator
fn clone(&self) -> ScenarioGenerator
Returns a copy of the value. Read more1.0.0 · sourcefn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreimpl Debug for ScenarioGenerator
impl<'de> Deserialize<'de> for ScenarioGenerator
fn deserialize<__D>(
__deserializer: __D
) -> Result<ScenarioGenerator, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreimpl Serialize for ScenarioGenerator
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read moreAuto Trait Implementations
impl RefUnwindSafe for ScenarioGenerator
impl Send for ScenarioGenerator
impl Sync for ScenarioGenerator
impl Unpin for ScenarioGenerator
impl UnwindSafe for ScenarioGenerator
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreimpl<T> Downcast for Twhere
T: Any,
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
+}Fields
scenario_name: String
only_seed_buses: Option<BTreeSet<String, Global>>
spawn_over_time: Vec<SpawnOverTime, Global>
border_spawn_over_time: Vec<BorderSpawnOverTime, Global>
Implementations
sourceimpl ScenarioGenerator
sourcepub fn proletariat_robot(
map: &Map,
rng: &mut XorShiftRng,
timer: &mut Timer<'_>
) -> Scenario
Designed in https://github.com/a-b-street/abstreet/issues/154
+sourceimpl ScenarioGenerator
sourcepub fn generate(
&self,
map: &Map,
rng: &mut XorShiftRng,
timer: &mut Timer<'_>
) -> Scenario
sourcepub fn small_run(map: &Map) -> ScenarioGenerator
sourcepub fn empty(name: &str) -> ScenarioGenerator
Trait Implementations
sourceimpl Clone for ScenarioGenerator
sourcefn clone(&self) -> ScenarioGenerator
Returns a copy of the value. Read more1.0.0 · sourcefn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresourceimpl Debug for ScenarioGenerator
sourceimpl<'de> Deserialize<'de> for ScenarioGenerator
sourcefn deserialize<__D>(
__deserializer: __D
) -> Result<ScenarioGenerator, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresourceimpl Serialize for ScenarioGenerator
sourcefn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read moreAuto Trait Implementations
impl RefUnwindSafe for ScenarioGenerator
impl Send for ScenarioGenerator
impl Sync for ScenarioGenerator
impl Unpin for ScenarioGenerator
impl UnwindSafe for ScenarioGenerator
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreimpl<T> Downcast for Twhere
T: Any,
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
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 morefn 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 morefn 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. Read morefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
diff --git a/rustdoc/sim/struct.Sim.html b/rustdoc/sim/struct.Sim.html
index 802d6f63af..48955ff20f 100644
--- a/rustdoc/sim/struct.Sim.html
+++ b/rustdoc/sim/struct.Sim.html
@@ -23,23 +23,23 @@
sourcepub fn debug_agent_json(&self, id: AgentID) -> String
sourcepub fn debug_intersection_json(&self, id: IntersectionID, map: &Map) -> String
sourcepub fn debug_lane(&self, id: LaneID)
sourcepub fn agent_properties(&self, map: &Map, id: AgentID) -> AgentProperties
Only call for active agents, will panic otherwise
sourcepub fn num_transit_passengers(&self, car: CarID) -> usize
sourcepub fn bus_route_id(&self, maybe_bus: CarID) -> Option<TransitRouteID>
sourcepub fn active_agents(&self) -> Vec<AgentID>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourcepub fn num_active_agents(&self) -> usize
sourcepub fn agent_to_trip(&self, id: AgentID) -> Option<TripID>
sourcepub fn trip_to_agent(&self, id: TripID) -> TripResult<AgentID>
sourcepub fn trip_info(&self, id: TripID) -> TripInfo
sourcepub fn all_trip_info(&self) -> Vec<(TripID, TripInfo)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourcepub fn finished_trip_details(
&self,
id: TripID
) -> Option<(Duration, Duration, Distance)>
If trip is finished, returns (total time, total waiting time, total distance)
sourcepub fn trip_blocked_time(&self, id: TripID) -> Duration
sourcepub fn trip_to_person(&self, id: TripID) -> Option<PersonID>
sourcepub fn agent_to_person(&self, id: AgentID) -> Option<PersonID>
sourcepub fn person_to_agent(&self, id: PersonID) -> Option<AgentID>
sourcepub fn get_owner_of_car(&self, id: CarID) -> Option<PersonID>
sourcepub fn lookup_parked_car(&self, id: CarID) -> Option<&ParkedCar>
sourcepub fn all_parked_car_positions(&self, map: &Map) -> Vec<(Position, Position)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
For every parked car, (position of parking spot, position of owner)
-sourcepub fn lookup_person(&self, id: PersonID) -> Option<&Person>
sourcepub fn get_person(&self, id: PersonID) -> &Person
sourcepub fn find_person_by_orig_id(&self, id: OrigPersonID) -> Option<PersonID>
sourcepub fn get_all_people(&self) -> &Vec<Person>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourcepub fn lookup_car_id(&self, idx: usize) -> Option<CarID>
sourcepub fn get_path(&self, id: AgentID) -> Option<&Path>
sourcepub fn get_all_driving_paths(&self) -> Vec<&Path>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourcepub fn trace_route(&self, id: AgentID, map: &Map) -> Option<PolyLine>
sourcepub fn get_canonical_pt_per_trip(
&self,
trip: TripID,
map: &Map
) -> TripResult<Pt2D>
sourcepub fn get_canonical_pt_per_person(&self, p: PersonID, map: &Map) -> Option<Pt2D>
sourcepub fn canonical_pt_for_agent(&self, id: AgentID, map: &Map) -> Option<Pt2D>
sourcepub fn get_accepted_agents(&self, id: IntersectionID) -> Vec<(AgentID, TurnID)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourcepub fn get_waiting_agents(
&self,
id: IntersectionID
) -> Vec<(AgentID, TurnID, Time)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourcepub fn get_blocked_by_graph(
&self,
map: &Map
) -> BTreeMap<AgentID, (Duration, DelayCause)>
For every agent that’s currently not moving, figure out how long they’ve been waiting and
+
sourcepub fn lookup_person(&self, id: PersonID) -> Option<&Person>
sourcepub fn get_person(&self, id: PersonID) -> &Person
sourcepub fn find_person_by_orig_id(&self, id: OrigPersonID) -> Option<PersonID>
sourcepub fn get_all_people(&self) -> &Vec<Person>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourcepub fn lookup_car_id(&self, idx: usize) -> Option<CarID>
sourcepub fn get_path(&self, id: AgentID) -> Option<&Path>
sourcepub fn get_all_driving_paths(&self) -> Vec<&Path>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourcepub fn trace_route(&self, id: AgentID, map: &Map) -> Option<PolyLine>
sourcepub fn get_canonical_pt_per_trip(
&self,
trip: TripID,
map: &Map
) -> TripResult<Pt2D>
sourcepub fn get_canonical_pt_per_person(&self, p: PersonID, map: &Map) -> Option<Pt2D>
sourcepub fn canonical_pt_for_agent(&self, id: AgentID, map: &Map) -> Option<Pt2D>
sourcepub fn get_accepted_agents(&self, id: IntersectionID) -> Vec<(AgentID, TurnID)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourcepub fn get_waiting_agents(
&self,
id: IntersectionID
) -> Vec<(AgentID, TurnID, Time)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourcepub fn get_blocked_by_graph(
&self,
map: &Map
) -> BTreeMap<AgentID, (Duration, DelayCause)>
For every agent that’s currently not moving, figure out how long they’ve been waiting and
why they’re blocked.
sourcepub fn status_of_buses(
&self,
route: TransitRouteID,
map: &Map
) -> Vec<(CarID, Option<usize>, f64, Pt2D)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
(bus, stop index it’s coming from, percent to next stop, location)
sourcepub fn get_analytics(&self) -> &Analytics
sourcepub fn delayed_intersections(
&self,
threshold: Duration
) -> Vec<(IntersectionID, Time)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
For intersections with an agent waiting beyond some threshold, return when they started
waiting. Sorted by earliest waiting (likely the root cause of gridlock).
sourcepub fn bldg_to_people(&self, b: BuildingID) -> Vec<PersonID>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourcepub fn get_pandemic_model(&self) -> Option<&PandemicModel>
sourcepub fn get_end_of_day(&self) -> Time
sourcepub fn current_stage_and_remaining_time(
&self,
i: IntersectionID
) -> (usize, Duration)
sourcepub fn all_arrivals_at_border(
&self,
i: IntersectionID
) -> Vec<(AgentType, Vec<(Time, usize)>)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourcepub fn target_lane_penalty(&self, lane: &Lane) -> (usize, usize)
(number of vehicles in the lane, penalty if a bike or other slow vehicle is present)
-sourcepub fn get_people_waiting_at_stop(
&self,
at: TransitStopID
) -> &Vec<(PedestrianID, TransitRouteID, Option<TransitStopID>, Time)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourcepub fn generate_scenario(&self, map: &Map, name: String) -> Scenario
sourcepub fn infinite_parking(&self) -> bool
sourcepub fn all_waiting_people(&self) -> BTreeMap<PersonID, Duration>
sourcepub fn describe_internal_stats(&self) -> Vec<String>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourcepub fn debug_queue_lengths(&self, l: LaneID) -> Option<(Distance, Distance)>
sourcepub fn get_trip_time_lower_bound(&self, map: &Map, id: TripID) -> Result<Duration>
Returns the best-case time for a trip in a world with no traffic or intersection delays.
+
sourcepub fn get_people_waiting_at_stop(
&self,
at: TransitStopID
) -> &Vec<(PedestrianID, TransitRouteID, Option<TransitStopID>, Time)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourcepub fn generate_scenario(&self, map: &Map, name: String) -> Scenario
sourcepub fn infinite_parking(&self) -> bool
sourcepub fn all_waiting_people(&self) -> BTreeMap<PersonID, Duration>
sourcepub fn describe_internal_stats(&self) -> Vec<String>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourcepub fn debug_queue_lengths(&self, l: LaneID) -> Option<(Distance, Distance)>
sourcepub fn get_trip_time_lower_bound(&self, map: &Map, id: TripID) -> Result<Duration>
Returns the best-case time for a trip in a world with no traffic or intersection delays.
Might fail in some cases where the real trip succeeds, but the single-mode path can’t be
found. Assumes the TripID exists.
sourcepub fn get_highlighted_people(&self) -> &Option<BTreeSet<PersonID>>
sourceimpl Sim
sourcepub fn step_count(&self) -> usize
sourcepub fn get_draw_car(&self, id: CarID, map: &Map) -> Option<DrawCarInput>
sourcepub fn get_draw_ped(
&self,
id: PedestrianID,
map: &Map
) -> Option<DrawPedestrianInput>
sourcepub fn get_draw_cars(&self, on: Traversable, map: &Map) -> Vec<DrawCarInput>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourcepub fn get_draw_peds(
&self,
on: Traversable,
map: &Map
) -> (Vec<DrawPedestrianInput>, Vec<DrawPedCrowdInput>)
sourcepub fn get_all_draw_cars(&self, map: &Map) -> Vec<DrawCarInput>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourcepub fn get_all_draw_peds(&self, map: &Map) -> Vec<DrawPedestrianInput>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourcepub fn get_unzoomed_agents(&self, map: &Map) -> Vec<UnzoomedAgent>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
This does not include transit riders. Some callers need those in addition, but the
rendering ones don’t.
-sourcepub fn get_unzoomed_transit_riders(&self, map: &Map) -> Vec<UnzoomedAgent>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourceimpl Sim
sourcepub fn instantiate(
&mut self,
scenario: &Scenario,
map: &Map,
rng: &mut XorShiftRng,
timer: &mut Timer<'_>
)
sourcepub fn instantiate_without_retries(
&mut self,
scenario: &Scenario,
map: &Map,
rng: &mut XorShiftRng,
retry_if_no_room: bool,
timer: &mut Timer<'_>
)
If retry_if_no_room is false, any vehicles that fail to spawn because of something else in
+
sourcepub fn get_unzoomed_transit_riders(&self, map: &Map) -> Vec<UnzoomedAgent>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourceimpl Sim
sourcepub fn instantiate(
&mut self,
scenario: &Scenario,
map: &Map,
rng: &mut XorShiftRng,
timer: &mut Timer<'_>
)
sourcepub fn instantiate_without_retries(
&mut self,
scenario: &Scenario,
map: &Map,
rng: &mut XorShiftRng,
retry_if_no_room: bool,
timer: &mut Timer<'_>
)
If retry_if_no_room is false, any vehicles that fail to spawn because of something else in
the way will just wind up as cancelled trips.
sourceimpl Sim
sourcepub fn new(map: &Map, opts: SimOptions) -> Sim
sourcepub(crate) fn spawn_trips(
&mut self,
input: Vec<(PersonID, TripInfo, StartTripArgs)>,
map: &Map,
timer: &mut Timer<'_>
)
sourcepub fn get_free_onstreet_spots(&self, l: LaneID) -> Vec<ParkingSpot>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourcepub fn get_free_offstreet_spots(&self, b: BuildingID) -> Vec<ParkingSpot>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourcepub fn get_free_lot_spots(&self, pl: ParkingLotID) -> Vec<ParkingSpot>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourcepub fn get_all_parking_spots(&self) -> (Vec<ParkingSpot>, Vec<ParkingSpot>)
(Filled, available)
-sourcepub fn bldg_to_parked_cars(&self, b: BuildingID) -> Vec<CarID>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourcepub fn walking_path_to_nearest_parking_spot(
&self,
map: &Map,
b: BuildingID
) -> Option<Path>
sourcepub(crate) fn new_person(
&mut self,
orig_id: Option<OrigPersonID>,
ped_speed: Speed,
vehicle_specs: Vec<VehicleSpec>
) -> &Person
sourcepub(crate) fn seed_parked_car(&mut self, vehicle: Vehicle, spot: ParkingSpot)
sourcepub(crate) fn seed_bus_route(&mut self, route: &TransitRoute)
sourcefn start_bus(&mut self, route: &TransitRoute, map: &Map)
sourcepub fn set_run_name(&mut self, name: String)
sourcepub fn get_run_name(&self) -> &String
sourceimpl Sim
sourcefn minimal_step(
&mut self,
map: &Map,
max_dt: Duration,
maybe_cb: &mut Option<Box<dyn SimCallback>>
) -> bool
sourcefn do_step(
&mut self,
map: &Map,
time: Time,
cmd: Command,
maybe_cb: &mut Option<Box<dyn SimCallback>>
) -> bool
sourcefn dispatch_events(&mut self, events: Vec<Event>, map: &Map)
sourcepub fn timed_step(
&mut self,
map: &Map,
dt: Duration,
maybe_cb: &mut Option<Box<dyn SimCallback>>,
timer: &mut Timer<'_>
)
sourcepub fn tiny_step(
&mut self,
map: &Map,
maybe_cb: &mut Option<Box<dyn SimCallback>>
)
sourcepub fn time_limited_step(
&mut self,
map: &Map,
dt: Duration,
real_time_limit: Duration,
maybe_cb: &mut Option<Box<dyn SimCallback>>
)
sourcepub fn dump_before_abort(&self)
sourceimpl Sim
sourcepub fn save_dir(&self) -> String
sourcefn save_path(&self, base_time: Time) -> String
sourcepub fn save(&mut self) -> String
sourcepub fn find_previous_savestate(&self, base_time: Time) -> Option<String>
sourcepub fn find_next_savestate(&self, base_time: Time) -> Option<String>
sourcepub fn load_savestate(path: String, timer: &mut Timer<'_>) -> Result<Sim>
sourceimpl Sim
sourcepub fn handle_live_edited_traffic_signals(&mut self, map: &Map)
sourcepub fn handle_live_edits(
&mut self,
map: &Map,
timer: &mut Timer<'_>
) -> (usize, usize)
Respond to arbitrary map edits without resetting the simulation. Returns the number of
+
sourcepub fn bldg_to_parked_cars(&self, b: BuildingID) -> Vec<CarID>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourcepub fn walking_path_to_nearest_parking_spot(
&self,
map: &Map,
b: BuildingID
) -> Option<Path>
sourcepub(crate) fn new_person(
&mut self,
orig_id: Option<OrigPersonID>,
ped_speed: Speed,
vehicle_specs: Vec<VehicleSpec>
) -> &Person
sourcepub(crate) fn seed_parked_car(&mut self, vehicle: Vehicle, spot: ParkingSpot)
sourcepub(crate) fn seed_bus_route(&mut self, route: &TransitRoute)
sourcefn start_bus(&mut self, route: &TransitRoute, map: &Map)
sourcepub fn set_run_name(&mut self, name: String)
sourcepub fn get_run_name(&self) -> &String
sourceimpl Sim
sourcefn minimal_step(
&mut self,
map: &Map,
max_dt: Duration,
maybe_cb: &mut Option<Box<dyn SimCallback>>
) -> bool
sourcefn do_step(
&mut self,
map: &Map,
time: Time,
cmd: Command,
maybe_cb: &mut Option<Box<dyn SimCallback>>
) -> bool
sourcefn dispatch_events(&mut self, events: Vec<Event>, map: &Map)
sourcepub fn timed_step(
&mut self,
map: &Map,
dt: Duration,
maybe_cb: &mut Option<Box<dyn SimCallback>>,
timer: &mut Timer<'_>
)
sourcepub fn tiny_step(
&mut self,
map: &Map,
maybe_cb: &mut Option<Box<dyn SimCallback>>
)
sourcepub fn time_limited_step(
&mut self,
map: &Map,
dt: Duration,
real_time_limit: Duration,
maybe_cb: &mut Option<Box<dyn SimCallback>>
)
sourcepub fn dump_before_abort(&self)
sourceimpl Sim
sourcepub fn save_dir(&self) -> String
sourcefn save_path(&self, base_time: Time) -> String
sourcepub fn save(&mut self) -> String
sourcepub fn find_previous_savestate(&self, base_time: Time) -> Option<String>
sourcepub fn find_next_savestate(&self, base_time: Time) -> Option<String>
sourcepub fn load_savestate(path: String, timer: &mut Timer<'_>) -> Result<Sim>
sourceimpl Sim
sourcepub fn handle_live_edited_traffic_signals(&mut self, map: &Map)
sourcepub fn handle_live_edits(
&mut self,
map: &Map,
timer: &mut Timer<'_>
) -> (usize, usize)
Respond to arbitrary map edits without resetting the simulation. Returns the number of
(trips cancelled, parked cars displaced).
sourceimpl Sim
sourcepub fn delete_car(&mut self, id: CarID, map: &Map)
sourcepub fn clear_alerts(&mut self) -> Vec<(Time, AlertLocation, String)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourceimpl Sim
sourcepub fn set_periodic_callback(&mut self, frequency: Duration)
Only one at a time supported.
diff --git a/rustdoc/sim/struct.SimFlags.html b/rustdoc/sim/struct.SimFlags.html
index 59ae9c6dc1..d15bf99ac3 100644
--- a/rustdoc/sim/struct.SimFlags.html
+++ b/rustdoc/sim/struct.SimFlags.html
@@ -1,7 +1,7 @@
SimFlags in sim - Rust pub struct SimFlags {
load_path: Option<String>,
pub load: String,
- pub scenario_modifiers: Vec<ScenarioModifier>,
+ pub scenario_modifiers: Vec<ScenarioModifier>,
pub rng_seed: u64,
pub opts: SimOptions,
}
Expand description
SimFlags specifies a simulation to setup. After parsing from structopt, you must call
@@ -14,7 +14,7 @@
load: String
The same as load_path
, but with a default value filled out. Call initialize
to set this
up.
-scenario_modifiers: Vec<ScenarioModifier>
A JSON list of modifiers to transform the scenario. These can be generated with the GUI.
+scenario_modifiers: Vec<ScenarioModifier>
A JSON list of modifiers to transform the scenario. These can be generated with the GUI.
rng_seed: u64
An arbitrary number to seed the random number generator. This is input to the deterministic
simulation, so different values affect results.
opts: SimOptions
Implementations
sourceimpl SimFlags
sourcepub const RNG_SEED: u64 = 42u64
sourcepub fn initialize(&mut self)
sourcepub fn for_test(run_name: &str) -> SimFlags
sourcepub fn make_rng(&self) -> XorShiftRng
sourcepub fn load_synchronously(
&self,
timer: &mut Timer<'_>
) -> (Map, Sim, XorShiftRng)
Loads a map and simulation. Not appropriate for use in the UI or on web.
diff --git a/rustdoc/sim/struct.SpawnOverTime.html b/rustdoc/sim/struct.SpawnOverTime.html
index 6143926cba..9fa48f796b 100644
--- a/rustdoc/sim/struct.SpawnOverTime.html
+++ b/rustdoc/sim/struct.SpawnOverTime.html
@@ -1,12 +1,12 @@
-SpawnOverTime in sim - Rust Struct sim::SpawnOverTime
[−]pub struct SpawnOverTime {
+SpawnOverTime in sim - Rust Struct sim::SpawnOverTime
source · [−]pub struct SpawnOverTime {
pub num_agents: usize,
pub start_time: Time,
pub stop_time: Time,
- pub goal: Option<TripEndpoint>,
+ pub goal: Option<TripEndpoint>,
pub percent_driving: f64,
pub percent_biking: f64,
pub percent_use_transit: f64,
-}
Fields
num_agents: usize
start_time: Time
stop_time: Time
goal: Option<TripEndpoint>
percent_driving: f64
percent_biking: f64
percent_use_transit: f64
Trait Implementations
impl Clone for SpawnOverTime
fn clone(&self) -> SpawnOverTime
Returns a copy of the value. Read more1.0.0 · sourcefn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreimpl Debug for SpawnOverTime
impl<'de> Deserialize<'de> for SpawnOverTime
fn deserialize<__D>(
__deserializer: __D
) -> Result<SpawnOverTime, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreimpl Serialize for SpawnOverTime
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read moreAuto Trait Implementations
impl RefUnwindSafe for SpawnOverTime
impl Send for SpawnOverTime
impl Sync for SpawnOverTime
impl Unpin for SpawnOverTime
impl UnwindSafe for SpawnOverTime
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreimpl<T> Downcast for Twhere
T: Any,
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
+}Fields
num_agents: usize
start_time: Time
stop_time: Time
goal: Option<TripEndpoint>
percent_driving: f64
percent_biking: f64
percent_use_transit: f64
Trait Implementations
sourceimpl Clone for SpawnOverTime
sourcefn clone(&self) -> SpawnOverTime
Returns a copy of the value. Read more1.0.0 · sourcefn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresourceimpl Debug for SpawnOverTime
sourceimpl<'de> Deserialize<'de> for SpawnOverTime
sourcefn deserialize<__D>(
__deserializer: __D
) -> Result<SpawnOverTime, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresourceimpl Serialize for SpawnOverTime
sourcefn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read moreAuto Trait Implementations
impl RefUnwindSafe for SpawnOverTime
impl Send for SpawnOverTime
impl Sync for SpawnOverTime
impl Unpin for SpawnOverTime
impl UnwindSafe for SpawnOverTime
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreimpl<T> Downcast for Twhere
T: Any,
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
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 morefn 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 morefn 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. Read morefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
diff --git a/rustdoc/sim/struct.TripInfo.html b/rustdoc/sim/struct.TripInfo.html
index eb945675cc..5aa6709113 100644
--- a/rustdoc/sim/struct.TripInfo.html
+++ b/rustdoc/sim/struct.TripInfo.html
@@ -1,13 +1,13 @@
TripInfo in sim - Rust pub struct TripInfo {
pub departure: Time,
- pub mode: TripMode,
- pub start: TripEndpoint,
- pub end: TripEndpoint,
- pub purpose: TripPurpose,
+ pub mode: TripMode,
+ pub start: TripEndpoint,
+ pub end: TripEndpoint,
+ pub purpose: TripPurpose,
pub modified: bool,
pub cancellation_reason: Option<String>,
}
Fields
departure: Time
Scheduled departure; the start may be delayed if the previous trip is taking too long.
-mode: TripMode
start: TripEndpoint
end: TripEndpoint
purpose: TripPurpose
modified: bool
Did a ScenarioModifier apply to this?
+mode: TripMode
start: TripEndpoint
end: TripEndpoint
purpose: TripPurpose
modified: bool
Did a ScenarioModifier apply to this?
cancellation_reason: Option<String>
Trait Implementations
sourceimpl<'de> Deserialize<'de> for TripInfo
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations
impl RefUnwindSafe for TripInfo
impl Send for TripInfo
impl Sync for TripInfo
impl Unpin for TripInfo
impl UnwindSafe for TripInfo
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreimpl<T> Downcast for Twhere
T: Any,
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
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 morefn 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 morefn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
diff --git a/rustdoc/sim/trips/struct.Person.html b/rustdoc/sim/trips/struct.Person.html
index 468702d9ca..919b7f31be 100644
--- a/rustdoc/sim/trips/struct.Person.html
+++ b/rustdoc/sim/trips/struct.Person.html
@@ -1,6 +1,6 @@
Person in sim::trips - Rust pub struct Person {
pub id: PersonID,
- pub orig_id: Option<OrigPersonID>,
+ pub orig_id: Option<OrigPersonID>,
pub trips: Vec<TripID>,
pub state: PersonState,
pub ped: PedestrianID,
@@ -8,7 +8,7 @@
pub vehicles: Vec<Vehicle>,
delayed_trips: Vec<(TripID, StartTripArgs)>,
on_bus: Option<CarID>,
-}
Fields
id: PersonID
orig_id: Option<OrigPersonID>
trips: Vec<TripID>
state: PersonState
ped: PedestrianID
ped_speed: Speed
vehicles: Vec<Vehicle>
Both cars and bikes
+}Fields
id: PersonID
orig_id: Option<OrigPersonID>
trips: Vec<TripID>
state: PersonState
ped: PedestrianID
ped_speed: Speed
vehicles: Vec<Vehicle>
Both cars and bikes
delayed_trips: Vec<(TripID, StartTripArgs)>
on_bus: Option<CarID>
Implementations
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Person
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations
impl RefUnwindSafe for Person
impl Send for Person
impl Sync for Person
impl Unpin for Person
impl UnwindSafe for Person
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreimpl<T> Downcast for Twhere
T: Any,
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
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 morefn 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 morefn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
diff --git a/rustdoc/sim/trips/struct.TripInfo.html b/rustdoc/sim/trips/struct.TripInfo.html
index c9731d68d7..92ff6ff1a8 100644
--- a/rustdoc/sim/trips/struct.TripInfo.html
+++ b/rustdoc/sim/trips/struct.TripInfo.html
@@ -1,13 +1,13 @@
TripInfo in sim::trips - Rust pub struct TripInfo {
pub departure: Time,
- pub mode: TripMode,
- pub start: TripEndpoint,
- pub end: TripEndpoint,
- pub purpose: TripPurpose,
+ pub mode: TripMode,
+ pub start: TripEndpoint,
+ pub end: TripEndpoint,
+ pub purpose: TripPurpose,
pub modified: bool,
pub cancellation_reason: Option<String>,
}
Fields
departure: Time
Scheduled departure; the start may be delayed if the previous trip is taking too long.
-mode: TripMode
start: TripEndpoint
end: TripEndpoint
purpose: TripPurpose
modified: bool
Did a ScenarioModifier apply to this?
+mode: TripMode
start: TripEndpoint
end: TripEndpoint
purpose: TripPurpose
modified: bool
Did a ScenarioModifier apply to this?
cancellation_reason: Option<String>
Trait Implementations
sourceimpl<'de> Deserialize<'de> for TripInfo
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations
impl RefUnwindSafe for TripInfo
impl Send for TripInfo
impl Sync for TripInfo
impl Unpin for TripInfo
impl UnwindSafe for TripInfo
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreimpl<T> Downcast for Twhere
T: Any,
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
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 morefn 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 morefn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
diff --git a/rustdoc/sim/trips/struct.TripManager.html b/rustdoc/sim/trips/struct.TripManager.html
index a1c6a48428..596b113f4c 100644
--- a/rustdoc/sim/trips/struct.TripManager.html
+++ b/rustdoc/sim/trips/struct.TripManager.html
@@ -9,13 +9,13 @@
down into legs – for example, a driving trip might start with somebody walking to their car,
driving somewhere, parking, and then walking to their final destination.
https://a-b-street.github.io/tech/docs/trafficsim/trips.html describes some of the variations.
-Fields
trips: Vec<Trip>
people: Vec<Person>
active_trip_mode: BTreeMap<AgentID, TripID>
unfinished_trips: usize
car_id_counter: usize
events: Vec<Event>
Implementations
sourceimpl TripManager
sourcepub fn new() -> TripManager
sourcepub fn new_person(
&mut self,
orig_id: Option<OrigPersonID>,
ped_speed: Speed,
vehicle_specs: Vec<VehicleSpec>
) -> &Person
sourcepub fn new_car_id(&mut self) -> usize
sourcepub fn new_trip(&mut self, person: PersonID, info: TripInfo) -> TripID
sourcepub fn start_trip(
&mut self,
now: Time,
trip: TripID,
args: StartTripArgs,
ctx: &mut Ctx<'_>
)
sourcepub fn collect_events(&mut self) -> Vec<Event>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourceimpl TripManager
sourcepub fn agent_starting_trip_leg(&mut self, agent: AgentID, t: TripID)
This is idempotent to handle the case of cars retrying their spawning.
+Fields
trips: Vec<Trip>
people: Vec<Person>
active_trip_mode: BTreeMap<AgentID, TripID>
unfinished_trips: usize
car_id_counter: usize
events: Vec<Event>
Implementations
sourceimpl TripManager
sourcepub fn new() -> TripManager
sourcepub fn new_person(
&mut self,
orig_id: Option<OrigPersonID>,
ped_speed: Speed,
vehicle_specs: Vec<VehicleSpec>
) -> &Person
sourcepub fn new_car_id(&mut self) -> usize
sourcepub fn new_trip(&mut self, person: PersonID, info: TripInfo) -> TripID
sourcepub fn start_trip(
&mut self,
now: Time,
trip: TripID,
args: StartTripArgs,
ctx: &mut Ctx<'_>
)
sourcepub fn collect_events(&mut self) -> Vec<Event>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourceimpl TripManager
sourcepub fn agent_starting_trip_leg(&mut self, agent: AgentID, t: TripID)
This is idempotent to handle the case of cars retrying their spawning.
sourcepub fn car_reached_parking_spot(
&mut self,
now: Time,
car: CarID,
spot: ParkingSpot,
blocked_time: Duration,
distance_crossed: Distance,
ctx: &mut Ctx<'_>
)
sourcepub fn ped_reached_parking_spot(
&mut self,
now: Time,
ped: PedestrianID,
spot: ParkingSpot,
blocked_time: Duration,
distance_crossed: Distance,
ctx: &mut Ctx<'_>
)
sourcepub fn ped_ready_to_bike(
&mut self,
now: Time,
ped: PedestrianID,
spot: SidewalkSpot,
blocked_time: Duration,
distance_crossed: Distance,
ctx: &mut Ctx<'_>
)
sourcepub fn bike_reached_end(
&mut self,
now: Time,
bike: CarID,
bike_rack: SidewalkSpot,
blocked_time: Duration,
distance_crossed: Distance,
ctx: &mut Ctx<'_>
)
sourcepub fn ped_reached_building(
&mut self,
now: Time,
ped: PedestrianID,
bldg: BuildingID,
blocked_time: Duration,
distance_crossed: Distance,
ctx: &mut Ctx<'_>
)
sourcepub fn ped_reached_bus_stop(
&mut self,
now: Time,
ped: PedestrianID,
stop: TransitStopID,
blocked_time: Duration,
distance_crossed: Distance,
ctx: &mut Ctx<'_>,
transit: &mut TransitSimState
) -> Option<TransitRouteID>
If no route is returned, the pedestrian boarded a bus immediately.
sourcepub fn ped_boarded_bus(
&mut self,
now: Time,
ped: PedestrianID,
bus: CarID,
blocked_time: Duration,
walking: &mut WalkingSimState
) -> (TripID, PersonID)
sourcepub fn person_left_bus(
&mut self,
now: Time,
person: PersonID,
bus: CarID,
ctx: &mut Ctx<'_>
)
sourcepub fn ped_reached_border(
&mut self,
now: Time,
ped: PedestrianID,
i: IntersectionID,
blocked_time: Duration,
distance_crossed: Distance,
ctx: &mut Ctx<'_>
)
sourcepub fn transit_rider_reached_border(
&mut self,
now: Time,
person: PersonID,
bus: CarID,
ctx: &mut Ctx<'_>
)
sourcepub fn car_or_bike_reached_border(
&mut self,
now: Time,
car: CarID,
i: IntersectionID,
blocked_time: Duration,
distance_crossed: Distance,
ctx: &mut Ctx<'_>
)
sourcefn trip_finished(&mut self, now: Time, id: TripID, ctx: &mut Ctx<'_>)
sourcefn start_delayed_trip(&mut self, now: Time, id: PersonID, ctx: &mut Ctx<'_>)
sourcefn spawn_ped(
&mut self,
now: Time,
id: TripID,
start: SidewalkSpot,
ctx: &mut Ctx<'_>
)
sourceimpl TripManager
sourcepub fn cancel_unstarted_trip(&mut self, id: TripID, reason: String)
Cancel a trip before it’s started. The person will stay where they are.
sourcepub fn cancel_trip(
&mut self,
now: Time,
id: TripID,
reason: String,
abandoned_vehicle: Option<Vehicle>,
ctx: &mut Ctx<'_>
)
Cancel a trip after it’s started. The person will be magically warped to their destination,
along with their car, as if the trip had completed normally.
sourcepub fn trip_abruptly_cancelled(&mut self, trip: TripID, agent: AgentID)
sourceimpl TripManager
sourcepub fn active_agents(&self) -> Vec<AgentID>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourcepub fn active_agents_and_trips(&self) -> &BTreeMap<AgentID, TripID>
sourcepub fn num_active_agents(&self) -> usize
sourcepub fn trip_to_agent(&self, id: TripID) -> TripResult<AgentID>
sourcepub fn agent_to_trip(&self, id: AgentID) -> Option<TripID>
This will be None for parked cars and buses. Should always work for pedestrians.
-sourcepub fn debug_trip(&self, id: AgentID)
sourcepub fn num_trips(&self) -> (usize, usize)
sourcepub fn num_agents(&self, transit: &TransitSimState) -> Counter<AgentType>
sourcepub fn num_commuters_vehicles(
&self,
transit: &TransitSimState,
walking: &WalkingSimState
) -> CommutersVehiclesCounts
sourcepub fn num_ppl(&self) -> (usize, usize, usize)
sourcepub fn is_done(&self) -> bool
sourcepub fn trip_info(&self, id: TripID) -> TripInfo
sourcepub fn all_trip_info(&self) -> Vec<(TripID, TripInfo)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourcepub fn finished_trip_details(
&self,
id: TripID
) -> Option<(Duration, Duration, Distance)>
sourcepub fn trip_blocked_time(&self, id: TripID) -> Duration
sourcepub fn bldg_to_people(&self, b: BuildingID) -> Vec<PersonID>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourcepub fn get_person(&self, p: PersonID) -> Option<&Person>
sourcepub fn get_all_people(&self) -> &Vec<Person>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourcepub fn trip_to_person(&self, id: TripID) -> Option<PersonID>
sourcepub fn all_arrivals_at_border(
&self,
at: IntersectionID
) -> Vec<(Time, AgentType)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourcepub fn generate_scenario(&self, map: &Map, name: String) -> Scenario
Recreate the Scenario from an instantiated simulation. The results should match the
+
sourcepub fn debug_trip(&self, id: AgentID)
sourcepub fn num_trips(&self) -> (usize, usize)
sourcepub fn num_agents(&self, transit: &TransitSimState) -> Counter<AgentType>
sourcepub fn num_commuters_vehicles(
&self,
transit: &TransitSimState,
walking: &WalkingSimState
) -> CommutersVehiclesCounts
sourcepub fn num_ppl(&self) -> (usize, usize, usize)
sourcepub fn is_done(&self) -> bool
sourcepub fn trip_info(&self, id: TripID) -> TripInfo
sourcepub fn all_trip_info(&self) -> Vec<(TripID, TripInfo)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourcepub fn finished_trip_details(
&self,
id: TripID
) -> Option<(Duration, Duration, Distance)>
sourcepub fn trip_blocked_time(&self, id: TripID) -> Duration
sourcepub fn bldg_to_people(&self, b: BuildingID) -> Vec<PersonID>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourcepub fn get_person(&self, p: PersonID) -> Option<&Person>
sourcepub fn get_all_people(&self) -> &Vec<Person>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourcepub fn trip_to_person(&self, id: TripID) -> Option<PersonID>
sourcepub fn all_arrivals_at_border(
&self,
at: IntersectionID
) -> Vec<(Time, AgentType)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
sourcepub fn generate_scenario(&self, map: &Map, name: String) -> Scenario
Recreate the Scenario from an instantiated simulation. The results should match the
original Scenario used.
Trait Implementations
sourceimpl Clone for TripManager
sourcefn clone(&self) -> TripManager
Returns a copy of the value. Read more1.0.0 · sourcefn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresourceimpl Debug for TripManager
sourceimpl<'de> Deserialize<'de> for TripManager
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresourceimpl Serialize for TripManager
Auto Trait Implementations
impl RefUnwindSafe for TripManager
impl Send for TripManager
impl Sync for TripManager
impl Unpin for TripManager
impl UnwindSafe for TripManager
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreimpl<T> Downcast for Twhere
T: Any,
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
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 morefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
diff --git a/rustdoc/src/geom/polygon.rs.html b/rustdoc/src/geom/polygon.rs.html
index cf8754deb9..751691ae8e 100644
--- a/rustdoc/src/geom/polygon.rs.html
+++ b/rustdoc/src/geom/polygon.rs.html
@@ -524,6 +524,22 @@
524
525
526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
use std::fmt;
use anyhow::Result;
@@ -795,11 +811,27 @@
}
pub fn intersection(&self, other: &Self) -> Result<Vec<Self>> {
- from_multi(self.to_geo().intersection(&other.to_geo()))
+ match std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| {
+ from_multi(self.to_geo().intersection(&other.to_geo()))
+ })) {
+ Ok(result) => result,
+ Err(err) => {
+ println!("BooleanOps crashed: {err:?}");
+ bail!("BooleanOps crashed: {err}");
+ }
+ }
}
pub fn difference(&self, other: &Self) -> Result<Vec<Self>> {
- from_multi(self.to_geo().difference(&other.to_geo()))
+ match std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| {
+ from_multi(self.to_geo().difference(&other.to_geo()))
+ })) {
+ Ok(result) => result,
+ Err(err) => {
+ println!("BooleanOps crashed: {err:?}");
+ bail!("BooleanOps crashed: {err}");
+ }
+ }
}
pub fn convex_hull(list: Vec<Self>) -> Result<Self> {
diff --git a/rustdoc/src/geom/tessellation.rs.html b/rustdoc/src/geom/tessellation.rs.html
index f234758c1c..fd4a06cfed 100644
--- a/rustdoc/src/geom/tessellation.rs.html
+++ b/rustdoc/src/geom/tessellation.rs.html
@@ -253,6 +253,15 @@
253
254
255
+256
+257
+258
+259
+260
+261
+262
+263
+264
use anyhow::Result;
use serde::{Deserialize, Serialize};
@@ -493,7 +502,16 @@
pub fn difference(&self, other: &Tessellation) -> Result<Vec<Polygon>> {
use geo::BooleanOps;
- crate::polygon::from_multi(self.to_geo().difference(&other.to_geo()))
+ // TODO Remove after https://github.com/georust/geo/issues/913
+ match std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| {
+ crate::polygon::from_multi(self.to_geo().difference(&other.to_geo()))
+ })) {
+ Ok(result) => result,
+ Err(err) => {
+ println!("BooleanOps crashed: {err:?}");
+ bail!("BooleanOps crashed: {err}");
+ }
+ }
}
}
diff --git a/rustdoc/src/map_gui/home/runner/work/abstreet/abstreet/target/debug/build/map_gui-63c5bcb4b09cf8fd/out/built.rs.html b/rustdoc/src/map_gui/home/runner/work/abstreet/abstreet/target/debug/build/map_gui-63c5bcb4b09cf8fd/out/built.rs.html
index 0ab7ccaf33..6331d67843 100644
--- a/rustdoc/src/map_gui/home/runner/work/abstreet/abstreet/target/debug/build/map_gui-63c5bcb4b09cf8fd/out/built.rs.html
+++ b/rustdoc/src/map_gui/home/runner/work/abstreet/abstreet/target/debug/build/map_gui-63c5bcb4b09cf8fd/out/built.rs.html
@@ -174,7 +174,7 @@
pub const RUSTDOC_VERSION: &str = r"rustdoc 1.65.0 (897e37553 2022-11-02)";
#[doc=r#"The build time in RFC2822, UTC."#]
#[allow(dead_code)]
-pub const BUILT_TIME_UTC: &str = r"Wed, 09 Nov 2022 12:11:28 +0000";
+pub const BUILT_TIME_UTC: &str = r"Thu, 10 Nov 2022 15:26:44 +0000";
#[doc=r#"The target architecture, given by `CARGO_CFG_TARGET_ARCH`."#]
#[allow(dead_code)]
pub const CFG_TARGET_ARCH: &str = r"x86_64";