[−][src]Struct coliseum::space::Box
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]
D: Dimension,
Shape: ShapeBuilder<Dim = D>,
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,
Shape: Send,
impl<D, Shape> Sync for Box<D, Shape> where
Shape: Sync,
Shape: Sync,
impl<D, Shape> Unpin for Box<D, Shape> where
Shape: Unpin,
Shape: Unpin,
impl<D, Shape> UnwindSafe for Box<D, Shape> where
Shape: UnwindSafe,
Shape: UnwindSafe,
impl<D, Shape> RefUnwindSafe for Box<D, Shape> where
Shape: RefUnwindSafe,
Shape: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for 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<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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,