[−][src]Trait ratel_bandit::Agent
A trait for common members of the Agents.
Required methods
fn action(&self) -> usize
The action chosen by the Agent.
fn q_star(&self) -> &Vec<f64>
The Agent's current estimate of all the Bandit's arms.
fn reset(&mut self, q_init: Vec<f64>)
Reset the Agent's history and give it a new initial guess of the Bandit's arm values.
fn step(&mut self, arm: usize, reward: T)
Update the Agent's estimate of a Bandit arm based on a given reward.
fn stepper(&mut self) -> &mut dyn Stepper
Returns a reference to the Agent's step size update rule.
Provided methods
fn arms(&self) -> usize
The number of arms in the Bandit the Agent is playing.
fn current_estimate(&self, arm: usize) -> f64
The Agent's current estimate of the value of a Bandit's arm.
fn update(&mut self, arm: usize, reward: T) -> f64
Calculate the update of the Agent's guess of a Bandit arm based on a given reward.
Implementors
impl<'a, T: ToPrimitive> Agent<T> for EpsilonGreedyAgent<'a, T>
[src]
fn action(&self) -> usize
[src]
The action chosen by the Agent. A random action with probability epsilon
and the greedy
action otherwise.
fn q_star(&self) -> &Vec<f64>
[src]
The Agent's current estimate of all the Bandit's arms.
fn reset(&mut self, q_init: Vec<f64>)
[src]
Reset the Agent's history and give it a new initial guess of the Bandit's arm values.
fn step(&mut self, arm: usize, reward: T)
[src]
Update the Agent's estimate of a Bandit arm based on a given reward.
fn stepper(&mut self) -> &mut dyn Stepper
[src]
Returns a reference to the Agent's step size update rule.
impl<'a, T: ToPrimitive> Agent<T> for GreedyAgent<'a, T>
[src]
fn action(&self) -> usize
[src]
The action chosen by the Agent. Picks the arm with the highest estimated return.
fn q_star(&self) -> &Vec<f64>
[src]
The Agent's current estimate of all the Bandit's arms.
fn reset(&mut self, q_init: Vec<f64>)
[src]
Reset the Agent's history and give it a new initial guess of the Bandit's arm values.
fn step(&mut self, arm: usize, reward: T)
[src]
Update the Agent's estimate of a Bandit arm based on a given reward.
fn stepper(&mut self) -> &mut dyn Stepper
[src]
Returns a reference to the Agent's step size update rule.
impl<'a, T: ToPrimitive> Agent<T> for OptimisticAgent<'a, T>
[src]
fn action(&self) -> usize
[src]
The action chosen by the Agent. The agent chooses the action with the highest confidence bound.
fn q_star(&self) -> &Vec<f64>
[src]
The Agent's current estimate of all the Bandit's arms.
fn reset(&mut self, q_init: Vec<f64>)
[src]
Reset the Agent's history and give it a new initial guess of the Bandit's arm values.
fn step(&mut self, arm: usize, reward: T)
[src]
Update the Agent's totals and estimate of a Bandit arm based on a given reward.
fn stepper(&mut self) -> &mut dyn Stepper
[src]
Returns a reference to the Agent's step size update rule.