pub struct Solution<S, A> { /* private fields */ }Expand description
A value function and a greedy policy over the states a run touched.
See docs/design.md, section “Convergence criterion”, for what a converged solution
guarantees.
Implementations§
Source§impl<S, A> Solution<S, A>
impl<S, A> Solution<S, A>
Sourcepub fn is_converged(&self) -> bool
pub fn is_converged(&self) -> bool
Returns true if the run met its convergence criterion with a finite initial value.
Sourcepub fn initial_state(&self) -> &S
pub fn initial_state(&self) -> &S
The initial state.
Sourcepub fn initial_value(&self) -> f64
pub fn initial_value(&self) -> f64
The value of the initial state: the expected cost to reach a goal.
Infinite exactly when the status is Status::Unsolvable (which relies on the
heuristic returning None only for real dead ends).
Sourcepub fn initial_upper_bound(&self) -> Option<f64>
pub fn initial_upper_bound(&self) -> Option<f64>
The upper bound on the initial state’s optimal value, for brtdp;
None for the other algorithms, which keep no upper bound.
Sourcepub fn initial_action(&self) -> Option<&A>
pub fn initial_action(&self) -> Option<&A>
The policy’s action in the initial state; see Solution::action.
Source§impl<S: Hash + Eq, A> Solution<S, A>
impl<S: Hash + Eq, A> Solution<S, A>
Sourcepub fn value(&self, state: &S) -> Option<f64>
pub fn value(&self, state: &S) -> Option<f64>
The value of state, or None if the run never touched it.
For LRTDP, RTDP, LAO* and iLAO*, values outside the policy’s reachable states are only
bounds (lower bounds with an admissible heuristic), not converged values. For the bounded algorithms this is the lower
bound; see Solution::upper_bound.
Sourcepub fn upper_bound(&self, state: &S) -> Option<f64>
pub fn upper_bound(&self, state: &S) -> Option<f64>
The upper bound on the optimal value of state, for brtdp.
None if the run never touched state, and always for the other algorithms. With
Solution::value as the lower bound, the bounded algorithms bracket the optimal value of every
stored state; see brtdp, section “Guarantee”.
Sourcepub fn action(&self, state: &S) -> Option<&A>
pub fn action(&self, state: &S) -> Option<&A>
The policy’s action in state.
None at goals, dead ends, states where giving up is cheaper (under
DeadEnds::Penalty) and states the run never backed up.
Every state reachable from the initial state under the policy of a converged run has
an action unless it is one of the first three. The policy of BRTDP, FRTDP and VPI-RTDP
is greedy on the upper bound; their fill pass gives a converged run the same
coverage (see brtdp).