Trait rurel::mdp::Agent
[−]
[src]
pub trait Agent<S: State> { fn current_state(&self) -> &S; fn take_action(&mut self, action: &S::A); fn pick_random_action(&mut self) -> S::A { ... } }
An Agent
is something which hold a certain state, and is able to take actions from that
state. After taking an action, the agent arrives at another state.
Required Methods
fn current_state(&self) -> &S
Returns the current state of this Agent
.
fn take_action(&mut self, action: &S::A)
Takes the given action, possibly mutating the current State
.
Provided Methods
fn pick_random_action(&mut self) -> S::A
Takes a random action from the set of possible actions from this State
. The default
implementation uses State::random_action() to
determine the action to be taken.