[−][src]Struct ggpf::game::openai::Gym
OpenAI Gym game instance.
Each instance is connected to a remote runner. This is because of Rust limitations
somehow it's not possible to have both tensorflow
and pyo3
in the same crate..
Methods
impl Gym
[src]
pub async fn new(__arg0: GymRunnerClient, game: String) -> Self
[src]
Given a connected client, build a game based on Gym.
Trait Implementations
impl Base for Gym
[src]
type Move = usize
The type for a Move. Read more
fn possible_moves(&self) -> Vec<Self::Move>
[src]
fn is_finished(&self) -> bool
[src]
impl Clone for Gym
[src]
impl Debug for Gym
[src]
impl Features for Gym
[src]
type StateDim = Ix3
Type dimension of the game state feature space. Read more
type ActionDim = Ix1
Type dimension of the action feature space. Read more
type Descriptor = (Vec<usize>, Ix3, Ix1)
Game features descriptor, that can be used to retrieve dimensions without having access to a game instance. Read more
fn get_features(&self) -> Self::Descriptor
[src]
fn state_dimension(descr: &Self::Descriptor) -> Self::StateDim
[src]
fn action_dimension(descr: &Self::Descriptor) -> Self::ActionDim
[src]
fn state_to_feature(&self, _pov: Self::Player) -> Array<f32, Self::StateDim>
[src]
fn all_possible_moves(descr: &Self::Descriptor) -> Vec<Self::Move>
[src]
fn moves_to_feature(
descr: &Self::Descriptor,
moves: &HashMap<Self::Move, f32>
) -> Array<f32, Self::ActionDim>
[src]
descr: &Self::Descriptor,
moves: &HashMap<Self::Move, f32>
) -> Array<f32, Self::ActionDim>
fn all_feature_to_moves(
_descr: &Self::Descriptor,
features: &Array<f32, Self::ActionDim>
) -> HashMap<Self::Move, f32>
[src]
_descr: &Self::Descriptor,
features: &Array<f32, Self::ActionDim>
) -> HashMap<Self::Move, f32>
fn feature_to_moves(
&self,
features: &Array<f32, Self::ActionDim>
) -> HashMap<Self::Move, f32>
[src]
&self,
features: &Array<f32, Self::ActionDim>
) -> HashMap<Self::Move, f32>
fn move_to_feature(
descr: &Self::Descriptor,
action: Self::Move
) -> Array<f32, Self::ActionDim>
[src]
descr: &Self::Descriptor,
action: Self::Move
) -> Array<f32, Self::ActionDim>
impl Playable for Gym
[src]
fn play<'life0, 'life1, 'async_trait>(
&'life0 mut self,
action: &'life1 usize
) -> Pin<Box<dyn Future<Output = f32> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self,
action: &'life1 usize
) -> Pin<Box<dyn Future<Output = f32> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
#[must_use]fn random_move<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = (Self::Move, f32)> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Send + 'async_trait,
[src]
&'life0 mut self
) -> Pin<Box<dyn Future<Output = (Self::Move, f32)> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Send + 'async_trait,
impl Singleplayer for Gym
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Gym
impl Send for Gym
impl Sync for Gym
impl Unpin for Gym
impl !UnwindSafe for Gym
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> Erased for T
impl<T> From<T> for T
[src]
impl<T> FromPy<T> for T
fn from_py(t: T, Python) -> T
impl<G> Game for G where
G: Singleplayer,
[src]
G: Singleplayer,
type Player = u8
The type representing each player. Read more
fn players() -> Vec<<G as Game>::Player>
[src]
fn player_after(<G as Game>::Player) -> <G as Game>::Player
[src]
fn turn(&Self) -> <G as Game>::Player
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> IntoPy<U> for T where
U: FromPy<T>,
U: FromPy<T>,
fn into_py(self, py: Python) -> U
impl<G> Playout for G where
G: Game + Clone + Send,
[src]
G: Game + Clone + Send,
#[must_use]fn playout_history<'life0, 'async_trait>(
&'life0 self,
pov: Self::Player
) -> Pin<Box<dyn Future<Output = (Self, Vec<(Self, Self::Move)>, f32)> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'life0 self,
pov: Self::Player
) -> Pin<Box<dyn Future<Output = (Self, Vec<(Self, Self::Move)>, f32)> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
#[must_use]fn playout_board<'life0, 'async_trait>(
&'life0 self,
pov: Self::Player
) -> Pin<Box<dyn Future<Output = (Self, f32)> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'life0 self,
pov: Self::Player
) -> Pin<Box<dyn Future<Output = (Self, f32)> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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>,