[][src]Struct coliseum::space::Box

pub struct Box<D: Dimension, Shape: ShapeBuilder<Dim = D>> { /* fields omitted */ }

A (possibly unbounded) box in R^n. Specifically, a Box represents the Cartesian product of n closed intervals. Each interval has the form of one of [a, b], (-oo, b], [a, oo), or (-oo, oo). E.g. low = [-oo, -oo], high=[oo,oo] is a 2D Cartesian plane

Examples

Trait Implementations

impl<D, Shape> Space<ArrayBase<OwnedRepr<f64>, D>> for Box<D, Shape> where
    D: Dimension,
    Shape: ShapeBuilder<Dim = D>, 
[src]

fn sample(self) -> ArrayBase<OwnedRepr<f64>, D>[src]

Samples using a uniform distribution with self.low and self.high. We should be able to return a different distribution based on the bounds in Box, e.g. Gym uses:

unbounded   = ~self.bounded_below & ~self.bounded_above
upp_bounded = ~self.bounded_below &  self.bounded_above
low_bounded =  self.bounded_below & ~self.bounded_above
bounded     =  self.bounded_below &  self.bounded_above

#### Vectorized sampling by interval type

sample[unbounded] = self.np_random.normal(
    size=unbounded[unbounded].shape)

sample[low_bounded] = self.np_random.exponential(
    size=low_bounded[low_bounded].shape) + self.low[low_bounded]

....

fn contains(self, sample: Array<f64, D>) -> bool[src]

Whether the sample exists in the Box

Auto Trait Implementations

impl<D, Shape> Send for Box<D, Shape> where
    Shape: Send

impl<D, Shape> Sync for Box<D, Shape> where
    Shape: Sync

impl<D, Shape> Unpin for Box<D, Shape> where
    Shape: Unpin

impl<D, Shape> UnwindSafe for Box<D, Shape> where
    Shape: UnwindSafe

impl<D, Shape> RefUnwindSafe for Box<D, Shape> where
    Shape: RefUnwindSafe

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,