Struct spaces::dimensions::Partitioned
[−]
[src]
pub struct Partitioned { /* fields omitted */ }A finite, uniformly partitioned continous dimension.
Methods
impl Partitioned[src]
pub fn new(lb: f64, ub: f64, density: usize) -> Partitioned[src]
pub fn from_continuous(d: Continuous, density: usize) -> Partitioned[src]
pub fn density(&self) -> usize[src]
pub fn partition_width(&self) -> f64[src]
pub fn centres(&self) -> Vec<f64>[src]
pub fn to_partition(&self, val: f64) -> usize[src]
Trait Implementations
impl Clone for Partitioned[src]
fn clone(&self) -> Partitioned[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl Copy for Partitioned[src]
impl Space for Partitioned[src]
type Value = usize
The data representation of the space.
fn dim(&self) -> usize[src]
Return the number of dimensions in the space.
fn span(&self) -> Span[src]
Return the number of linear combinations of values in the space.
fn sample(&self, rng: &mut ThreadRng) -> usize[src]
Generate a random sample from the space.
impl BoundedSpace for Partitioned[src]
type BoundValue = f64
The upper/lower bound type; not necessarily equal to Space::Value.
fn lb(&self) -> &f64[src]
Returns a reference to the dimension's lower value bound (inclusive).
fn ub(&self) -> &f64[src]
Returns a reference to the dimension's upper value bound (exclusive).
fn contains(&self, val: Self::BoundValue) -> bool[src]
Returns true iff val is within the dimension's bounds.
impl FiniteSpace for Partitioned[src]
impl Surjection<f64, usize> for Partitioned[src]
impl Surjection<usize, usize> for Partitioned[src]
impl<'de> Deserialize<'de> for Partitioned[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>, [src]
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl PartialEq for Partitioned[src]
fn eq(&self, other: &Partitioned) -> bool[src]
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.