Struct border::env::py_gym_env::vec::PyVecGymEnv [−][src]
A vectorized environment using multiprocess module in Python. The code is adapted from tch-rs RL example.
Implementations
impl<O, A, OF, AF> PyVecGymEnv<O, A, OF, AF> where
O: Obs,
A: Act,
OF: PyGymEnvObsFilter<O>,
AF: PyGymEnvActFilter<A>,
[src]
O: Obs,
A: Act,
OF: PyGymEnvObsFilter<O>,
AF: PyGymEnvActFilter<A>,
pub fn new(
name: &str,
n_procs: usize,
obs_filter: OF,
act_filter: AF,
atari_wrapper: bool
) -> PyResult<Self>
[src]
name: &str,
n_procs: usize,
obs_filter: OF,
act_filter: AF,
atari_wrapper: bool
) -> PyResult<Self>
Constructs a vectorized environment.
This function invl
name
- Name of a gym environment.atari_wrapper
- Iftrue
,wrap_deepmind()
is applied to the environment. Seeatari_wrapper.py
.
pub fn close(&self)
[src]
Close all subprocesses.
TODO: Consider implementing the method in Drop
trait.
Trait Implementations
impl<O: Clone, A: Clone, OF: Clone, AF: Clone> Clone for PyVecGymEnv<O, A, OF, AF>
[src]
fn clone(&self) -> PyVecGymEnv<O, A, OF, AF>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<O: Debug, A: Debug, OF: Debug, AF: Debug> Debug for PyVecGymEnv<O, A, OF, AF>
[src]
impl<O, A, OF, AF> Env for PyVecGymEnv<O, A, OF, AF> where
O: Obs,
A: Act,
OF: PyGymEnvObsFilter<O>,
AF: PyGymEnvActFilter<A>,
[src]
O: Obs,
A: Act,
OF: PyGymEnvObsFilter<O>,
AF: PyGymEnvActFilter<A>,
type Obs = O
Observation of the environment.
type Act = A
Action of the environment.
type Info = PyGymInfo
Information in the self::Step object.
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.
If is_done
is None, all environemnts are resetted.
Otherwise, is_done
is Vec<f32>
and environments with is_done[i] == 1.0
are resetted.
fn step(&mut self, a: &A) -> (Step<Self>, Record)
[src]
Auto Trait Implementations
impl<O, A, OF, AF> !RefUnwindSafe for PyVecGymEnv<O, A, OF, AF>
impl<O, A, OF, AF> Send for PyVecGymEnv<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 PyVecGymEnv<O, A, OF, AF> where
A: Sync,
AF: Sync,
O: Sync,
OF: Sync,
A: Sync,
AF: Sync,
O: Sync,
OF: Sync,
impl<O, A, OF, AF> Unpin for PyVecGymEnv<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 PyVecGymEnv<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> 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,
pub 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> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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.
pub 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>,