[][src]Trait vrp_core::construction::constraints::ConstraintModule

pub trait ConstraintModule {
    pub fn accept_insertion(
        &self,
        solution_ctx: &mut SolutionContext,
        route_index: usize,
        job: &Job
    );
pub fn accept_route_state(&self, ctx: &mut RouteContext);
pub fn accept_solution_state(&self, ctx: &mut SolutionContext);
pub fn state_keys(&self) -> Iter<'_, i32>;
pub fn get_constraints(&self) -> Iter<'_, ConstraintVariant>; }

Represents a constraint module which can be added to constraint pipeline.

Required methods

pub fn accept_insertion(
    &self,
    solution_ctx: &mut SolutionContext,
    route_index: usize,
    job: &Job
)
[src]

Accept insertion of specific job into the route. Called once job has been inserted into solution represented via solution_ctx. Target route is defined by route_index which refers to routes collection in solution context. Inserted job is job. This method should call accept_route_state internally.

pub fn accept_route_state(&self, ctx: &mut RouteContext)[src]

Accept route and updates its state to allow more efficient constraint checks.

pub fn accept_solution_state(&self, ctx: &mut SolutionContext)[src]

Accepts insertion solution context allowing to update job insertion data. This method called twice: before insertion of all jobs starts and when it ends. Please note, that it is important to update only stale routes as this allows to avoid updating non changed route states.

pub fn state_keys(&self) -> Iter<'_, i32>[src]

Returns unique constraint state keys. Used to avoid state key interference.

pub fn get_constraints(&self) -> Iter<'_, ConstraintVariant>[src]

Returns list of constraints to be used.

Loading content...

Implementors

impl ConstraintModule for AreaModule[src]

impl ConstraintModule for ConditionalJobModule[src]

impl ConstraintModule for FleetUsageConstraintModule[src]

impl ConstraintModule for StrictLockingModule[src]

impl ConstraintModule for TourSizeModule[src]

impl ConstraintModule for TransportConstraintModule[src]

impl<T: Load + Add<Output = T> + Sub<Output = T> + 'static> ConstraintModule for CapacityConstraintModule<T>[src]

Loading content...