pub struct HypervolumeCalculator<T: Float + Debug + Send + Sync + 'static> { /* private fields */ }Expand description
Hypervolume calculator
Implementations§
Source§impl<T: Float + Debug + Send + Sync + 'static> HypervolumeCalculator<T>
impl<T: Float + Debug + Send + Sync + 'static> HypervolumeCalculator<T>
Sourcepub const DEFAULT_MONTE_CARLO_SAMPLES: usize = 100_000
pub const DEFAULT_MONTE_CARLO_SAMPLES: usize = 100_000
Default number of Monte Carlo samples.
Sourcepub fn new(method: HypervolumeMethod, reference_point: Vec<T>) -> Self
pub fn new(method: HypervolumeMethod, reference_point: Vec<T>) -> Self
Create a calculator for method measuring against reference_point
(expressed in the pure-minimization convention).
Sourcepub fn method(&self) -> HypervolumeMethod
pub fn method(&self) -> HypervolumeMethod
The configured calculation method.
Sourcepub fn reference_point(&self) -> &[T]
pub fn reference_point(&self) -> &[T]
The reference point currently in use.
Sourcepub fn set_reference_point(&mut self, reference_point: Vec<T>)
pub fn set_reference_point(&mut self, reference_point: Vec<T>)
Replace the reference point. The cache is invalidated because cached values are only meaningful for the reference they were computed against.
Sourcepub fn set_monte_carlo_samples(&mut self, samples: usize)
pub fn set_monte_carlo_samples(&mut self, samples: usize)
Configure the Monte Carlo sample count (ignored by the exact methods).
Sourcepub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
Drop every cached hypervolume.
Sourcepub fn calculate(&mut self, points: &[Vec<T>]) -> Result<T>
pub fn calculate(&mut self, points: &[Vec<T>]) -> Result<T>
Compute the hypervolume of points (pure-minimization convention).
Returns an error rather than a fabricated number when the reference point is missing or a point has fewer objectives than the reference.
Sourcepub fn contribution(&mut self, points: &[Vec<T>], index: usize) -> Result<T>
pub fn contribution(&mut self, points: &[Vec<T>], index: usize) -> Result<T>
Exclusive hypervolume contribution of points[index]: how much
hypervolume is lost when that single point is removed. This is the
quantity SMS-EMOA’s environmental selection ranks on.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for HypervolumeCalculator<T>
impl<T> RefUnwindSafe for HypervolumeCalculator<T>
impl<T> Send for HypervolumeCalculator<T>
impl<T> Sync for HypervolumeCalculator<T>
impl<T> Unpin for HypervolumeCalculator<T>
impl<T> UnsafeUnpin for HypervolumeCalculator<T>
impl<T> UnwindSafe for HypervolumeCalculator<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more