[−][src]Struct ratel_bandit::Game
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]
agent: &'a mut dyn Agent<T>,
bandit: &'a dyn Bandit<T>
) -> Game<'a, T>
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,
T: Unpin,
impl<'a, T> !UnwindSafe for Game<'a, T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,