Trait TransitionSystem

Source
pub trait TransitionSystem<S, A, C, DC>
where C: Ord + LimitValues + Sub<C, Output = DC> + Copy,
{ // Required methods fn actions_from(&self, state: &S) -> Iter<'_, A>; fn transition(&self, state: &S, action: &A) -> S; fn transition_cost(&self, state: &S, action: &A) -> DC; fn reverse_actions_from(&self, state: &S) -> Iter<'_, A>; fn reverse_transition(&self, state: &S, action: &A) -> S; fn reverse_transition_cost(&self, state: &S, action: &A) -> DC; fn can_wait_at(&self, state: &S) -> bool; fn conflict(&self, moves: A2<&Move<S, A, C, DC>>) -> bool; }
Expand description

Definition of a transition system that contains a set of states and actions, and transition functions that describe the result of any action applied to any state. The reverse transitions must also be described to allow using the reverse search as a heuristic.

Required Methods§

Source

fn actions_from(&self, state: &S) -> Iter<'_, A>

Returns the actions that can be applied from the given state.

Source

fn transition(&self, state: &S, action: &A) -> S

Returns the state resulting from applying the given action to the given state.

Source

fn transition_cost(&self, state: &S, action: &A) -> DC

Returns the cost of applying the given action to the given state (i.e. the duration of the action).

Source

fn reverse_actions_from(&self, state: &S) -> Iter<'_, A>

Returns the actions that can be applied to reach the given state.

Source

fn reverse_transition(&self, state: &S, action: &A) -> S

Returns the state resulting from applying the given reverse action to the given state.

Source

fn reverse_transition_cost(&self, state: &S, action: &A) -> DC

Returns the cost of applying the given reverse action to the given state (i.e. the duration of the action).

Source

fn can_wait_at(&self, state: &S) -> bool

Returns true if agents can wait at the given state.

Source

fn conflict(&self, moves: A2<&Move<S, A, C, DC>>) -> bool

Returns true if the two moves lead to a collision.

Implementors§