pub trait TraversalModel: Send + Sync {
// Required methods
fn state_features(&self) -> Vec<(String, StateFeature)>;
fn traverse_edge(
&self,
trajectory: (&Vertex, &Edge, &Vertex),
state: &mut Vec<StateVar>,
state_model: &StateModel
) -> Result<(), TraversalModelError>;
fn estimate_traversal(
&self,
od: (&Vertex, &Vertex),
state: &mut Vec<StateVar>,
state_model: &StateModel
) -> Result<(), TraversalModelError>;
}
Expand description
Dictates how state transitions occur while traversing a graph in a search algorithm.
see the super::default
module for implementations bundled with RouteE Compass:
- DistanceModel: uses Edge distances to find the route with the shortest distance
- SpeedLookupModel: retrieves link speeds via lookup from a file
Required Methods§
sourcefn state_features(&self) -> Vec<(String, StateFeature)>
fn state_features(&self) -> Vec<(String, StateFeature)>
lists the state variables expected by this traversal model that are not defined on the base configuration. for example, if this traversal model has state variables that differ based on the query, they can be injected into the state model by listing them here.