pub struct CirculationMap { /* private fields */ }Expand description
The circulation map of one space for one path width.
Implementations§
Source§impl CirculationMap
impl CirculationMap
Sourcepub fn try_new(
request: CirculationRequest,
pieces: usize,
possible_pieces: usize,
nodes: Vec<CirculationNode>,
edges: Vec<(usize, usize)>,
spacing_metres: f64,
contacts: Vec<CirculationContact>,
unmapped: Vec<(usize, String)>,
evidence: Evidence,
) -> Result<Self, FreeSpaceError>
pub fn try_new( request: CirculationRequest, pieces: usize, possible_pieces: usize, nodes: Vec<CirculationNode>, edges: Vec<(usize, usize)>, spacing_metres: f64, contacts: Vec<CirculationContact>, unmapped: Vec<(usize, String)>, evidence: Evidence, ) -> Result<Self, FreeSpaceError>
Validates a map for request: every node in a piece, every edge
within one piece, kinds matching the number of neighbours, one
contact per subject in order, and exact evidence. spacing_metres
is the boundary sample spacing the skeleton was built with.
unmapped names the pieces whose skeleton could not be built, with
why; they have no nodes, and where their paths end is unknown.
§Errors
FreeSpaceError::InexactPlacementEvidence for approximate or
blank evidence, FreeSpaceError::Unavailable for a malformed map.
Sourcepub fn request(&self) -> &CirculationRequest
pub fn request(&self) -> &CirculationRequest
The request this map answers.
Sourcepub fn pieces(&self) -> usize
pub fn pieces(&self) -> usize
How many pieces there are: connected parts of a region inside the free area eroded by half the width.
Sourcepub fn possible_pieces(&self) -> usize
pub fn possible_pieces(&self) -> usize
How many possible pieces there are: connected parts of a region containing that erosion.
Sourcepub fn nodes(&self) -> &[CirculationNode]
pub fn nodes(&self) -> &[CirculationNode]
The skeleton nodes.
Sourcepub fn edges(&self) -> &[(usize, usize)]
pub fn edges(&self) -> &[(usize, usize)]
The skeleton edges, as node index pairs, lower first, sorted.
Sourcepub fn neighbours(&self, node: usize) -> Vec<usize>
pub fn neighbours(&self, node: usize) -> Vec<usize>
The neighbours of node, ascending.
Sourcepub fn spacing_metres(&self) -> f64
pub fn spacing_metres(&self) -> f64
The boundary sample spacing the skeleton was built with: how far node positions may stray is of this order, but not proven.
Sourcepub fn contacts(&self) -> &[CirculationContact]
pub fn contacts(&self) -> &[CirculationContact]
One contact per subject, in subject order.
Sourcepub fn contact(&self, subject: &ObjectId) -> Option<&CirculationContact>
pub fn contact(&self, subject: &ObjectId) -> Option<&CirculationContact>
The contact of subject, if the request names it.
Sourcepub fn unmapped(&self) -> &[(usize, String)]
pub fn unmapped(&self) -> &[(usize, String)]
The pieces without a skeleton, with why: where their paths end is unknown.
Sourcepub fn unmapped_reason(&self, piece: usize) -> Option<&str>
pub fn unmapped_reason(&self, piece: usize) -> Option<&str>
Why piece has no skeleton, if it has none.