Trait ratel_bandit::Agent

source ·
pub trait Agent<T: ToPrimitive> {
    // Required methods
    fn action(&self) -> usize;
    fn arms(&self) -> usize;
    fn current_estimate(&self, arm: usize) -> f64;
    fn reset(&mut self, q_init: &[f64]);
    fn step(&mut self, arm: usize, reward: T);
}
Expand description

A trait for common members of the Agents.

Required Methods§

source

fn action(&self) -> usize

The action chosen by the Agent.

source

fn arms(&self) -> usize

The number of arms in the Bandit the Agent is playing.

source

fn current_estimate(&self, arm: usize) -> f64

The Agent’s current estimate of the value of a Bandit’s arm.

source

fn reset(&mut self, q_init: &[f64])

Reset the Agent’s history and give it a new initial guess of the Bandit’s arm values.

source

fn step(&mut self, arm: usize, reward: T)

Update the Agent’s estimate of a Bandit arm based on a given reward.

Implementors§