pub struct ConstraintPipeline {
    pub modules: Vec<Arc<dyn ConstraintModule + Send + Sync>>,
    pub state_keys: HashSet<i32>,
    pub hard_route_constraints: Vec<Arc<dyn HardRouteConstraint + Send + Sync>>,
    pub hard_activity_constraints: Vec<Arc<dyn HardActivityConstraint + Send + Sync>>,
    pub soft_route_constraints: Vec<Arc<dyn SoftRouteConstraint + Send + Sync>>,
    pub soft_activity_constraints: Vec<Arc<dyn SoftActivityConstraint + Send + Sync>>,
}
Expand description

Provides the way to work with multiple constraints.

Fields

modules: Vec<Arc<dyn ConstraintModule + Send + Sync>>

Pipeline modules.

state_keys: HashSet<i32>

Registered state keys.

hard_route_constraints: Vec<Arc<dyn HardRouteConstraint + Send + Sync>>

Hard route constraints.

hard_activity_constraints: Vec<Arc<dyn HardActivityConstraint + Send + Sync>>

Hard activity constraints.

soft_route_constraints: Vec<Arc<dyn SoftRouteConstraint + Send + Sync>>

Soft route constraints.

soft_activity_constraints: Vec<Arc<dyn SoftActivityConstraint + Send + Sync>>

Soft activity constraints.

Implementations

Accepts job insertion.

Accepts route state.

Accepts solution state.

Tries to merge two jobs taking into account common constraints. Returns a new job, if it is possible to merge them together having theoretically assignable job. Otherwise returns violation error code.

Adds constraint module.

Adds constraint into pipeline.

Checks whether all hard route constraints are fulfilled. Returns result of first failed constraint or empty value.

Checks whether all activity route constraints are fulfilled. Returns result of first failed constraint or empty value.

Checks soft route constraints and aggregates associated actual and penalty costs.

Checks soft route constraints and aggregates associated actual and penalty costs.

Gets all constraint variants as a single iterator.

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.