Google OR-Tools v9.9
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
com.google.ortools.constraintsolver.TypeRegulationsConstraint Class Reference
Inheritance diagram for com.google.ortools.constraintsolver.TypeRegulationsConstraint:
com.google.ortools.constraintsolver.Constraint com.google.ortools.constraintsolver.PropagationBaseObject com.google.ortools.constraintsolver.BaseObject

Public Member Functions

 TypeRegulationsConstraint (long cPtr, boolean cMemoryOwn)
 
synchronized void delete ()
 
 TypeRegulationsConstraint (RoutingModel model)
 
void post ()
 
void initialPropagate ()
 
- Public Member Functions inherited from com.google.ortools.constraintsolver.Constraint
String toString ()
 
void postAndPropagate ()
 
void accept (ModelVisitor visitor)
 
boolean isCastConstraint ()
 
IntVar var ()
 
- Public Member Functions inherited from com.google.ortools.constraintsolver.PropagationBaseObject
 PropagationBaseObject (Solver s)
 
Solver solver ()
 
void freezeQueue ()
 
void unfreezeQueue ()
 
void enqueueDelayedDemon (Demon d)
 
void enqueueVar (Demon d)
 
void reset_action_on_fail ()
 
void set_variable_to_clean_on_fail (IntVar v)
 
String name ()
 
void setName (String name)
 
boolean hasName ()
 
String baseName ()
 
- Public Member Functions inherited from com.google.ortools.constraintsolver.BaseObject
 BaseObject ()
 

Static Public Member Functions

static long getCPtr (TypeRegulationsConstraint obj)
 
static long swigRelease (TypeRegulationsConstraint obj)
 

Protected Member Functions

void finalize ()
 
- Protected Member Functions inherited from com.google.ortools.constraintsolver.Constraint
 Constraint (long cPtr, boolean cMemoryOwn)
 
- Protected Member Functions inherited from com.google.ortools.constraintsolver.PropagationBaseObject
 PropagationBaseObject (long cPtr, boolean cMemoryOwn)
 
- Protected Member Functions inherited from com.google.ortools.constraintsolver.BaseObject
 BaseObject (long cPtr, boolean cMemoryOwn)
 

Additional Inherited Members

- Static Protected Member Functions inherited from com.google.ortools.constraintsolver.Constraint
static long getCPtr (Constraint obj)
 
static long swigRelease (Constraint obj)
 
- Static Protected Member Functions inherited from com.google.ortools.constraintsolver.PropagationBaseObject
static long getCPtr (PropagationBaseObject obj)
 
static long swigRelease (PropagationBaseObject obj)
 
- Static Protected Member Functions inherited from com.google.ortools.constraintsolver.BaseObject
static long getCPtr (BaseObject obj)
 
static long swigRelease (BaseObject obj)
 
- Protected Attributes inherited from com.google.ortools.constraintsolver.BaseObject
transient boolean swigCMemOwn
 

Detailed Description

The following constraint ensures that incompatibilities and requirements
between types are respected.

It verifies both "hard" and "temporal" incompatibilities.
Two nodes with hard incompatible types cannot be served by the same vehicle
at all, while with a temporal incompatibility they can't be on the same
route at the same time.
The VisitTypePolicy of a node determines how visiting it impacts the type
count on the route.

For example, for

  • three temporally incompatible types T1 T2 and T3
  • 2 pairs of nodes a1/r1 and a2/r2 of type T1 and T2 respectively, with
    • a1 and a2 of VisitTypePolicy TYPE_ADDED_TO_VEHICLE
    • r1 and r2 of policy ADDED_TYPE_REMOVED_FROM_VEHICLE
  • 3 nodes A, UV and AR of type T3, respectively with type policies
    TYPE_ADDED_TO_VEHICLE, TYPE_ON_VEHICLE_UP_TO_VISIT and
    TYPE_SIMULTANEOUSLY_ADDED_AND_REMOVED
    the configurations
    UV –> a1 –> r1 –> a2 –> r2, a1 –> r1 –> a2 –> r2 –> A and
    a1 –> r1 –> AR –> a2 –> r2 are acceptable, whereas the configurations
    a1 –> a2 –> r1 –> ..., or A –> a1 –> r1 –> ..., or
    a1 –> r1 –> UV –> ... are not feasible.

    It also verifies same-vehicle and temporal type requirements.
    A node of type T_d with a same-vehicle requirement for type T_r needs to be
    served by the same vehicle as a node of type T_r.
    Temporal requirements, on the other hand, can take effect either when the
    dependent type is being added to the route or when it's removed from it,
    which is determined by the dependent node's VisitTypePolicy.
    In the above example:
  • If T3 is required on the same vehicle as T1, A, AR or UV must be on the
    same vehicle as a1.
  • If T2 is required when adding T1, a2 must be visited before a1, and if
    r2 is also visited on the route, it must be after a1, i.e. T2 must be on
    the vehicle when a1 is visited:
    ... –> a2 –> ... –> a1 –> ... –> r2 –> ...
  • If T3 is required when removing T1, T3 needs to be on the vehicle when
    r1 is visited:
    ... –> A –> ... –> r1 –> ... OR ... –> r1 –> ... –> UV –> ...

Definition at line 53 of file TypeRegulationsConstraint.java.

Constructor & Destructor Documentation

◆ TypeRegulationsConstraint() [1/2]

com.google.ortools.constraintsolver.TypeRegulationsConstraint.TypeRegulationsConstraint ( long cPtr,
boolean cMemoryOwn )

Definition at line 56 of file TypeRegulationsConstraint.java.

◆ TypeRegulationsConstraint() [2/2]

com.google.ortools.constraintsolver.TypeRegulationsConstraint.TypeRegulationsConstraint ( RoutingModel model)

Definition at line 93 of file TypeRegulationsConstraint.java.

Member Function Documentation

◆ delete()

synchronized void com.google.ortools.constraintsolver.TypeRegulationsConstraint.delete ( )

Reimplemented from com.google.ortools.constraintsolver.Constraint.

Definition at line 82 of file TypeRegulationsConstraint.java.

◆ finalize()

void com.google.ortools.constraintsolver.TypeRegulationsConstraint.finalize ( )
protected

Reimplemented from com.google.ortools.constraintsolver.Constraint.

Definition at line 78 of file TypeRegulationsConstraint.java.

◆ getCPtr()

static long com.google.ortools.constraintsolver.TypeRegulationsConstraint.getCPtr ( TypeRegulationsConstraint obj)
static

Definition at line 61 of file TypeRegulationsConstraint.java.

◆ initialPropagate()

void com.google.ortools.constraintsolver.TypeRegulationsConstraint.initialPropagate ( )

This method performs the initial propagation of the
constraint. It is called just after the post.

Reimplemented from com.google.ortools.constraintsolver.Constraint.

Definition at line 101 of file TypeRegulationsConstraint.java.

◆ post()

void com.google.ortools.constraintsolver.TypeRegulationsConstraint.post ( )

This method is called when the constraint is processed by the
solver. Its main usage is to attach demons to variables.

Reimplemented from com.google.ortools.constraintsolver.Constraint.

Definition at line 97 of file TypeRegulationsConstraint.java.

◆ swigRelease()

static long com.google.ortools.constraintsolver.TypeRegulationsConstraint.swigRelease ( TypeRegulationsConstraint obj)
static

Definition at line 65 of file TypeRegulationsConstraint.java.


The documentation for this class was generated from the following file: