Struct kurobako_core::domain::VariableBuilder
source · [−]pub struct VariableBuilder { /* private fields */ }
Expand description
Variable
builder.
Implementations
sourceimpl VariableBuilder
impl VariableBuilder
sourcepub fn uniform(self) -> Self
pub fn uniform(self) -> Self
Sets the distribution of this variable to Distribution::Uniform
.
Note that Distribution::Uniform
is the default distribution.
sourcepub fn log_uniform(self) -> Self
pub fn log_uniform(self) -> Self
Sets the distribution of this variable to Distribution::LogUniform
.
sourcepub fn continuous(self, low: f64, high: f64) -> Self
pub fn continuous(self, low: f64, high: f64) -> Self
Sets the range of this variable to the given continuous numerical range.
sourcepub fn discrete(self, low: i64, high: i64) -> Self
pub fn discrete(self, low: i64, high: i64) -> Self
Sets the range of this variable to the given discrete numerical range.
sourcepub fn categorical<I, T>(self, choices: I) -> Self where
I: IntoIterator<Item = T>,
T: AsRef<str>,
pub fn categorical<I, T>(self, choices: I) -> Self where
I: IntoIterator<Item = T>,
T: AsRef<str>,
Sets the range of this variable to the given categorical range.
sourcepub fn boolean(self) -> Self
pub fn boolean(self) -> Self
Sets the range of this variable to boolean.
This is equivalent to self.categorical(&["false", "true"])
.
sourcepub fn constraint(self, constraint: Constraint) -> Self
pub fn constraint(self, constraint: Constraint) -> Self
Sets the evaluation constraint to this variable.
Trait Implementations
sourceimpl Debug for VariableBuilder
impl Debug for VariableBuilder
Auto Trait Implementations
impl RefUnwindSafe for VariableBuilder
impl Send for VariableBuilder
impl Sync for VariableBuilder
impl Unpin for VariableBuilder
impl UnwindSafe for VariableBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more