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

Public Member Functions

synchronized void delete ()
 
void post ()
 
void initialPropagate ()
 
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 ()
 

Protected Member Functions

 Constraint (long cPtr, boolean cMemoryOwn)
 
void finalize ()
 
- 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)
 

Static Protected Member Functions

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)
 

Additional Inherited Members

- Protected Attributes inherited from com.google.ortools.constraintsolver.BaseObject
transient boolean swigCMemOwn
 

Detailed Description

A constraint is the main modeling object. It provides two methods:

  • Post() is responsible for creating the demons and attaching them to
    immediate demons().
  • InitialPropagate() is called once just after Post and performs
    the initial propagation. The subsequent propagations will be performed
    by the demons Posted during the post() method.

Definition at line 19 of file Constraint.java.

Constructor & Destructor Documentation

◆ Constraint()

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

Definition at line 22 of file Constraint.java.

Member Function Documentation

◆ accept()

void com.google.ortools.constraintsolver.Constraint.accept ( ModelVisitor visitor)

Accepts the given visitor.

Reimplemented in com.google.ortools.constraintsolver.Pack.

Definition at line 90 of file Constraint.java.

◆ delete()

◆ finalize()

◆ getCPtr()

static long com.google.ortools.constraintsolver.Constraint.getCPtr ( Constraint obj)
staticprotected

Definition at line 27 of file Constraint.java.

◆ initialPropagate()

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

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

Reimplemented in com.google.ortools.constraintsolver.GlobalVehicleBreaksConstraint, com.google.ortools.constraintsolver.Pack, and com.google.ortools.constraintsolver.TypeRegulationsConstraint.

Definition at line 71 of file Constraint.java.

◆ isCastConstraint()

boolean com.google.ortools.constraintsolver.Constraint.isCastConstraint ( )

Is the constraint created by a cast from expression to integer variable?

Definition at line 97 of file Constraint.java.

◆ post()

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

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

Reimplemented in com.google.ortools.constraintsolver.GlobalVehicleBreaksConstraint, com.google.ortools.constraintsolver.Pack, and com.google.ortools.constraintsolver.TypeRegulationsConstraint.

Definition at line 63 of file Constraint.java.

◆ postAndPropagate()

void com.google.ortools.constraintsolver.Constraint.postAndPropagate ( )

Calls Post and then Propagate to initialize the constraints. This
is usually done in the root node.

Definition at line 83 of file Constraint.java.

◆ swigRelease()

static long com.google.ortools.constraintsolver.Constraint.swigRelease ( Constraint obj)
staticprotected

Definition at line 31 of file Constraint.java.

◆ toString()

String com.google.ortools.constraintsolver.Constraint.toString ( )

◆ var()

IntVar com.google.ortools.constraintsolver.Constraint.var ( )

Creates a Boolean variable representing the status of the constraint
(false = constraint is violated, true = constraint is satisfied). It
returns nullptr if the constraint does not support this API.

Definition at line 106 of file Constraint.java.


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