Trait ValueFn
pub trait ValueFn {
type Weight: EdgeObservableRead + Send;
type Value: Clone + PartialOrd + Send + Sync;
// Required methods
fn initial_value(&self) -> Self::Value;
fn min_value(&self) -> Option<Self::Value>;
fn into_value_fn(
self,
) -> Arc<dyn Fn(Self::Value, &Self::Weight, usize) -> Self::Value + Sync + Send>;
}Expand description
A fold-like value function for graph traversal path scoring.
A value function produces scores where higher is better (to be maximized),
as opposed to a cost function where lower is better (to be minimized).
The accumulated value is folded over each edge in the path: edges that improve
the path increase the value, while poor-quality edges decrease it.
Paths whose value drops below min_value are discarded.
Required Associated Types§
type Weight: EdgeObservableRead + Send
type Value: Clone + PartialOrd + Send + Sync
Required Methods§
fn initial_value(&self) -> Self::Value
fn initial_value(&self) -> Self::Value
The initial value that will be modified by the value function.