pub struct Route {
pub cost: i64,
pub states: Vec<GcRef>,
}Expand description
What a goal-directed search found: the route from the start to the goal it stopped at, and what that route cost.
One answer for both halves of a goal-directed family. X_distance projects
cost and X_path projects states, so the number and the route are
always the same route’s — two searches, one run apart, could disagree
about which goal they stopped at, and this makes that unrepresentable.
states runs from the start to the goal, both included, so a start that is
itself a goal is a one-element route at cost 0. cost is the route’s own
price in the units the search counts: edges for the unweighted walks, the
sum of the weights for the weighted ones.
Fields§
§cost: i64What the route cost, in the search’s own units.
states: Vec<GcRef>The states from the start to the goal, in order, inclusive of both.