Struct synthpop::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
sourceimpl 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
sourceimpl Clone for TrafficCounts
impl Clone for TrafficCounts
sourcefn clone(&self) -> TrafficCounts
fn clone(&self) -> TrafficCounts
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Default for TrafficCounts
impl Default for TrafficCounts
sourceimpl<'de> Deserialize<'de> for TrafficCounts
impl<'de> Deserialize<'de> for TrafficCounts
sourcefn 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
sourceimpl Serialize for TrafficCounts
impl Serialize for TrafficCounts
Auto Trait Implementations
impl RefUnwindSafe for TrafficCounts
impl Send for TrafficCounts
impl Sync for TrafficCounts
impl Unpin for TrafficCounts
impl UnwindSafe for TrafficCounts
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more