Trait rurel::mdp::Agent

source ·
pub trait Agent<S: State> {
    // Required methods
    fn current_state(&self) -> &S;
    fn take_action(&mut self, action: &S::A);

    // Provided method
    fn pick_random_action(&mut self) -> S::A { ... }
}
Expand description

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§

source

fn current_state(&self) -> &S

Returns the current state of this Agent.

source

fn take_action(&mut self, action: &S::A)

Takes the given action, possibly mutating the current State.

Provided Methods§

source

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.

Implementors§