Trait ratel_bandit::Bandit

source ·
pub trait Bandit<T: ToPrimitive> {
    // Required methods
    fn arms(&self) -> usize;
    fn best_arm(&self) -> usize;
    fn mean(&self, arm: usize) -> f64;
    fn reward(&self, arm: usize) -> T;
    fn std(&self, arm: usize) -> f64;

    // Provided methods
    fn max_reward(&self) -> f64 { ... }
    fn means(&self) -> Vec<f64> { ... }
    fn stds(&self) -> Vec<f64> { ... }
}
Expand description

A trait for common members of the Bandits

Required Methods§

source

fn arms(&self) -> usize

The number of arms of the Bandit

source

fn best_arm(&self) -> usize

The arm with the highest average reward.

source

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

The average reward of a given arm.

source

fn reward(&self, arm: usize) -> T

The reward from a pull of a given arm.

source

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

The standard deviation of a given arm.

Provided Methods§

source

fn max_reward(&self) -> f64

The maximum average reward of all the arms.

source

fn means(&self) -> Vec<f64>

The average rewards of all the arms.

source

fn stds(&self) -> Vec<f64>

the standard deviations of all the arms.

Implementors§