[][src]Struct ratel_bandit::Game

pub struct Game<'a, T: AddAssign + Num + ToPrimitive> { /* fields omitted */ }

Structure to make the Agent interact with the Bandit.

Implementations

impl<'a, T: AddAssign + Copy + Num + ToPrimitive> Game<'a, T>[src]

pub fn new(
    agent: &'a mut dyn Agent<T>,
    bandit: &'a dyn Bandit<T>
) -> Game<'a, T>
[src]

Initializes a Game with an Agent, Bandit, and new counters.

pub fn arms(&self) -> usize[src]

Returns the number of bandit arms.

pub fn reset(&mut self, q_init: Vec<f64>)[src]

Resets Game. Resets Agent with new initial guess and resets counters.

pub fn rewards(&self) -> &Vec<T>[src]

Returns vector of rewards.

pub fn run(&mut self, steps: u32)[src]

Run game for a certain number of steps.

pub fn wins(&self) -> &Vec<u32>[src]

Returns vector of wins.

Auto Trait Implementations

impl<'a, T> !RefUnwindSafe for Game<'a, T>

impl<'a, T> !Send for Game<'a, T>

impl<'a, T> !Sync for Game<'a, T>

impl<'a, T> Unpin for Game<'a, T> where
    T: Unpin

impl<'a, T> !UnwindSafe for Game<'a, T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,