Struct border::env::py_gym_env::base::PyGymEnv [−][src]
pub struct PyGymEnv<O, A, OF, AF> where
O: Obs,
A: Act,
OF: PyGymEnvObsFilter<O>,
AF: PyGymEnvActFilter<A>, { /* fields omitted */ }
Expand description
Represents an environment in OpenAI gym. The code is adapted from tch-rs RL example.
Implementations
impl<O, A, OF, AF> PyGymEnv<O, A, OF, AF> where
O: Obs,
A: Act,
OF: PyGymEnvObsFilter<O>,
AF: PyGymEnvActFilter<A>,
[src]
impl<O, A, OF, AF> PyGymEnv<O, A, OF, AF> where
O: Obs,
A: Act,
OF: PyGymEnvObsFilter<O>,
AF: PyGymEnvActFilter<A>,
[src]pub fn new(
name: &str,
obs_filter: OF,
act_filter: AF,
atari_wrapper: Option<AtariWrapper>
) -> PyResult<Self>
[src]
pub fn new(
name: &str,
obs_filter: OF,
act_filter: AF,
atari_wrapper: Option<AtariWrapper>
) -> PyResult<Self>
[src]Constructs an environment.
name
is the name of the environment, which is implemented in OpenAI gym.
pub fn set_render(&mut self, render: bool)
[src]
pub fn set_render(&mut self, render: bool)
[src]Set rendering mode.
If true
, it renders the state at every step.
pub fn max_steps(self, v: Option<usize>) -> Self
[src]
pub fn max_steps(self, v: Option<usize>) -> Self
[src]Set the maximum number of steps in the environment.
pub fn set_wait_in_render(&mut self, d: Duration)
[src]
pub fn set_wait_in_render(&mut self, d: Duration)
[src]Set time for sleep in rendering.
pub fn get_num_actions_atari(&self) -> i64
[src]
pub fn get_num_actions_atari(&self) -> i64
[src]Get the number of available actions of atari environments
Trait Implementations
impl<O: Debug, A: Debug, OF: Debug, AF: Debug> Debug for PyGymEnv<O, A, OF, AF> where
O: Obs,
A: Act,
OF: PyGymEnvObsFilter<O>,
AF: PyGymEnvActFilter<A>,
[src]
impl<O: Debug, A: Debug, OF: Debug, AF: Debug> Debug for PyGymEnv<O, A, OF, AF> where
O: Obs,
A: Act,
OF: PyGymEnvObsFilter<O>,
AF: PyGymEnvActFilter<A>,
[src]impl<O, A, OF, AF> Env for PyGymEnv<O, A, OF, AF> where
O: Obs,
A: Act + Debug,
OF: PyGymEnvObsFilter<O>,
AF: PyGymEnvActFilter<A>,
[src]
impl<O, A, OF, AF> Env for PyGymEnv<O, A, OF, AF> where
O: Obs,
A: Act + Debug,
OF: PyGymEnvObsFilter<O>,
AF: PyGymEnvActFilter<A>,
[src]fn reset(&mut self, is_done: Option<&Vec<i8>>) -> Result<O, Box<dyn Error>>
[src]
fn reset(&mut self, is_done: Option<&Vec<i8>>) -> Result<O, Box<dyn Error>>
[src]Resets the environment, the obs/act filters and returns the observation tensor.
In this environment, the length of is_done
is assumed to be 1.
TODO: defines appropriate error for the method and returns it.
fn step(&mut self, a: &A) -> (Step<Self>, Record)
[src]
fn step(&mut self, a: &A) -> (Step<Self>, Record)
[src]Runs a step of the environment’s dynamics.
It returns Step
and Record
objects.
The Record
is composed of Record
s constructed in PyGymEnvObsFilter
and
PyGymEnvActFilter
.
type Obs = O
type Obs = O
Observation of the environment.
type Act = A
type Act = A
Action of the environment.
type Info = PyGymInfo
type Info = PyGymInfo
Information in the self::Step object.
Auto Trait Implementations
impl<O, A, OF, AF> !RefUnwindSafe for PyGymEnv<O, A, OF, AF>
impl<O, A, OF, AF> Send for PyGymEnv<O, A, OF, AF> where
A: Send,
AF: Send,
O: Send,
OF: Send,
A: Send,
AF: Send,
O: Send,
OF: Send,
impl<O, A, OF, AF> !Sync for PyGymEnv<O, A, OF, AF>
impl<O, A, OF, AF> Unpin for PyGymEnv<O, A, OF, AF> where
A: Unpin,
AF: Unpin,
O: Unpin,
OF: Unpin,
A: Unpin,
AF: Unpin,
O: Unpin,
OF: Unpin,
impl<O, A, OF, AF> UnwindSafe for PyGymEnv<O, A, OF, AF> where
A: UnwindSafe,
AF: UnwindSafe,
O: UnwindSafe,
OF: UnwindSafe,
A: UnwindSafe,
AF: UnwindSafe,
O: UnwindSafe,
OF: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,