Struct synthpop::counts::TrafficCounts
source · pub struct TrafficCounts {
pub map: MapName,
pub description: String,
pub per_road: Counter<RoadID>,
pub per_intersection: Counter<IntersectionID>,
}
Expand description
This represents the number of vehicles (or trips, or something else) crossing roads and intersections over some span of time. The data could represent real observations or something from a simulation.
There’s some nice UIs in other crates to compare counts.
Fields§
§map: MapName
§description: String
§per_road: Counter<RoadID>
§per_intersection: Counter<IntersectionID>
Implementations§
source§impl TrafficCounts
impl TrafficCounts
sourcepub fn from_path_requests(
map: &Map,
description: String,
requests: &[(PathRequest, usize)],
pathfinder: &Pathfinder,
timer: &mut Timer<'_>
) -> Self
pub fn from_path_requests( map: &Map, description: String, requests: &[(PathRequest, usize)], pathfinder: &Pathfinder, timer: &mut Timer<'_> ) -> Self
Run pathfinding on all of the requests, then count the throughput on every road and
intersection. Each request has the count it should contribute – use
PathRequest::deduplicate
to easily generate this.
pub fn update_with_path(&mut self, path: PathV2, count: usize, map: &Map)
sourcepub fn quickly_compare(&self, other: &TrafficCounts)
pub fn quickly_compare(&self, other: &TrafficCounts)
Print a comparison of counts. Only look at roads/intersections in self
.
Trait Implementations§
source§impl Clone for TrafficCounts
impl Clone for TrafficCounts
source§fn clone(&self) -> TrafficCounts
fn clone(&self) -> TrafficCounts
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Default for TrafficCounts
impl Default for TrafficCounts
source§impl<'de> Deserialize<'de> for TrafficCounts
impl<'de> Deserialize<'de> for TrafficCounts
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TrafficCounts
impl RefUnwindSafe for TrafficCounts
impl Send for TrafficCounts
impl Sync for TrafficCounts
impl Unpin for TrafficCounts
impl UnwindSafe for TrafficCounts
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more