pub struct PBTParameterSpace {
pub continuous: HashMap<String, (f64, f64)>,
pub discrete: HashMap<String, Vec<f64>>,
}Expand description
Parameter space definition for PBT
Fields§
§continuous: HashMap<String, (f64, f64)>Continuous parameters with their bounds
discrete: HashMap<String, Vec<f64>>Discrete parameters with their possible values
Implementations§
Source§impl PBTParameterSpace
impl PBTParameterSpace
pub fn new() -> Self
Sourcepub fn add_continuous(self, name: &str, low: f64, high: f64) -> Self
pub fn add_continuous(self, name: &str, low: f64, high: f64) -> Self
Add a continuous parameter with bounds
Sourcepub fn add_discrete(self, name: &str, values: Vec<f64>) -> Self
pub fn add_discrete(self, name: &str, values: Vec<f64>) -> Self
Add a discrete parameter with possible values
Sourcepub fn sample<R: RngExt>(&self, rng: &mut R) -> PBTParameters
pub fn sample<R: RngExt>(&self, rng: &mut R) -> PBTParameters
Sample a random parameter configuration
Sourcepub fn perturb<R: RngExt>(
&self,
params: &PBTParameters,
factor: f64,
rng: &mut R,
) -> PBTParameters
pub fn perturb<R: RngExt>( &self, params: &PBTParameters, factor: f64, rng: &mut R, ) -> PBTParameters
Perturb parameters with exploration
Trait Implementations§
Source§impl Clone for PBTParameterSpace
impl Clone for PBTParameterSpace
Source§fn clone(&self) -> PBTParameterSpace
fn clone(&self) -> PBTParameterSpace
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PBTParameterSpace
impl Debug for PBTParameterSpace
Auto Trait Implementations§
impl Freeze for PBTParameterSpace
impl RefUnwindSafe for PBTParameterSpace
impl Send for PBTParameterSpace
impl Sync for PBTParameterSpace
impl Unpin for PBTParameterSpace
impl UnsafeUnpin for PBTParameterSpace
impl UnwindSafe for PBTParameterSpace
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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