pub struct GoalBuilder { /* private fields */ }
Expand description
Builds a Goal - a goal of optimization - composing multiple layers from objective functions in lexicographical order.
Implementations§
Source§impl GoalBuilder
impl GoalBuilder
Sourcepub fn add_single(self, objective: Arc<dyn FeatureObjective>) -> Self
pub fn add_single(self, objective: Arc<dyn FeatureObjective>) -> Self
Add a layer which consists of one objective function with a given feature name.
Sourcepub fn add_multi<TO, CE>(
self,
objectives: &[Arc<dyn FeatureObjective>],
total_order_fn: TO,
cost_estimate_fn: CE,
) -> Selfwhere
TO: Fn(&[Arc<dyn FeatureObjective>], &InsertionContext, &InsertionContext) -> Ordering + Send + Sync + 'static,
CE: Fn(&[Arc<dyn FeatureObjective>], &MoveContext<'_>) -> Cost + Send + Sync + 'static,
pub fn add_multi<TO, CE>(
self,
objectives: &[Arc<dyn FeatureObjective>],
total_order_fn: TO,
cost_estimate_fn: CE,
) -> Selfwhere
TO: Fn(&[Arc<dyn FeatureObjective>], &InsertionContext, &InsertionContext) -> Ordering + Send + Sync + 'static,
CE: Fn(&[Arc<dyn FeatureObjective>], &MoveContext<'_>) -> Cost + Send + Sync + 'static,
Add a layer which consists of one or many objective function with a given feature name and
a custom GoalResolver
.
Sourcepub fn build(self) -> GenericResult<Goal>
pub fn build(self) -> GenericResult<Goal>
Builds a Goal of optimization using features provided.
Trait Implementations§
Source§impl Default for GoalBuilder
impl Default for GoalBuilder
Source§fn default() -> GoalBuilder
fn default() -> GoalBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for GoalBuilder
impl !RefUnwindSafe for GoalBuilder
impl Send for GoalBuilder
impl Sync for GoalBuilder
impl Unpin for GoalBuilder
impl !UnwindSafe for GoalBuilder
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> 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