Struct rurel::AgentTrainer
[−]
[src]
pub struct AgentTrainer<S> where
S: State, { /* fields omitted */ }
An AgentTrainer
can be trained for using a certain Agent. After
training, the AgentTrainer
contains learned knowledge about the process, and can be queried
for this. For example, you can ask the AgentTrainer
the expected values of all possible
actions in a given state.
Methods
impl<S> AgentTrainer<S> where
S: State,
[src]
S: State,
fn new() -> AgentTrainer<S>
fn expected_values(&self, state: &S) -> Option<&HashMap<S::A, f64>>
Fetches the learned values for the given state, by Action
, or None
if no value was
learned.
fn expected_value(&self, state: &S, action: &S::A) -> Option<f64>
Fetches the learned value for the given Action
in the given State
, or None
if no
value was learned.
fn train(
&mut self,
agent: &mut Agent<S>,
learning_strategy: &LearningStrategy<S>,
termination_strategy: &mut TerminationStrategy<S>,
exploration_strategy: &ExplorationStrategy<S>
)
&mut self,
agent: &mut Agent<S>,
learning_strategy: &LearningStrategy<S>,
termination_strategy: &mut TerminationStrategy<S>,
exploration_strategy: &ExplorationStrategy<S>
)
Trains this AgentTrainer
using the given ExplorationStrategy
, LearningStrategy
and
Agent
for iters
iterations.