pub struct FalliblePreference<F, E>{ /* private fields */ }Expand description
Consumer preference backed by a fallible utility function.
This variant is intended for frontends that need utility evaluation to return errors instead of assuming the utility function is infallible.
Implementations§
Source§impl<F, E> FalliblePreference<F, E>
impl<F, E> FalliblePreference<F, E>
pub fn with_validation( utility_func: F, min_bounds: Vec<f64>, max_bounds: Vec<f64>, validate: bool, ) -> Result<Self, PreferenceError<E>>
pub fn with_config( utility_func: F, min_bounds: Vec<f64>, max_bounds: Vec<f64>, config: ValidationConfig, calc_config: CalcConfig, ) -> Result<Self, PreferenceError<E>>
pub fn get_utility(&self, bundle: &[f64]) -> Result<f64, PreferenceError<E>>
pub fn min_bounds(&self) -> &[f64]
pub fn max_bounds(&self) -> &[f64]
pub fn get_mu( &self, bundle: &[f64], good: usize, ) -> Result<f64, PreferenceError<E>>
pub fn get_mrs( &self, bundle: &[f64], good_i: usize, good_j: usize, ) -> Result<f64, PreferenceError<E>>
Auto Trait Implementations§
impl<F, E> Freeze for FalliblePreference<F, E>where
F: Freeze,
impl<F, E> RefUnwindSafe for FalliblePreference<F, E>where
F: RefUnwindSafe,
impl<F, E> Send for FalliblePreference<F, E>where
F: Send,
impl<F, E> Sync for FalliblePreference<F, E>where
F: Sync,
impl<F, E> Unpin for FalliblePreference<F, E>where
F: Unpin,
impl<F, E> UnsafeUnpin for FalliblePreference<F, E>where
F: UnsafeUnpin,
impl<F, E> UnwindSafe for FalliblePreference<F, E>where
F: UnwindSafe,
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
Mutably borrows from an owned value. Read more