Skip to main content

ActionValue

Trait ActionValue 

Source
pub trait ActionValue<B: Backend>: Sized {
    // Required methods
    fn pattern(space: &ActionSpace, i: u64) -> Self;
    fn from_flat(actions: Actions<'_>, i: usize) -> Self;
    fn from_joint(space: &ActionSpace, index: usize) -> Self;
}
Expand description

A type of actions (crate::Environment::Action).

Required Methods§

Source

fn pattern(space: &ActionSpace, i: u64) -> Self

Action i of a fixed pseudo-random sequence in space, for tests and benchmarks.

Source

fn from_flat(actions: Actions<'_>, i: usize) -> Self

The action of environment i in a flat buffer.

§Panics

Panics if the buffer has the other kind of actions.

Source

fn from_joint(space: &ActionSpace, index: usize) -> Self

The joint action index (see choose_legal): the index itself, or its components in row-major order of nvec.

§Panics

Panics for continuous actions.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<B: Backend> ActionValue<B> for Array<B, f32>

Source§

fn pattern(space: &ActionSpace, i: u64) -> Self

Source§

fn from_flat(actions: Actions<'_>, i: usize) -> Self

Source§

fn from_joint(_: &ActionSpace, _: usize) -> Self

Source§

impl<B: Backend> ActionValue<B> for Array<B, i32>

Source§

fn pattern(space: &ActionSpace, i: u64) -> Self

Source§

fn from_flat(actions: Actions<'_>, i: usize) -> Self

Source§

fn from_joint(space: &ActionSpace, index: usize) -> Self

Source§

impl<B: Backend> ActionValue<B> for I32<B>

Source§

fn pattern(space: &ActionSpace, i: u64) -> Self

Source§

fn from_flat(actions: Actions<'_>, i: usize) -> Self

Source§

fn from_joint(_: &ActionSpace, index: usize) -> Self

Implementors§