![]() |
Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
|
The class IntVar is a subset of IntExpr. In addition to the
IntExpr protocol, it offers persistence, removing values from the domains,
and a finer model for events.
Definition at line 16 of file IntVar.java.
Public Member Functions | |
| IntVar (long cPtr, boolean cMemoryOwn) | |
| synchronized void | delete () |
| boolean | isVar () |
| IntVar | var () |
| long | value () |
| void | removeValue (long v) |
| void | removeInterval (long l, long u) |
| void | removeValues (long[] values) |
| void | setValue (long[] values) |
| void | whenBound (Demon d) |
| void | whenBound (Runnable closure) |
| void | whenDomain (Demon d) |
| void | whenDomain (Runnable closure) |
| long | size () |
| boolean | contains (long v) |
| IntVarIterator | makeHoleIterator (boolean reversible) |
| IntVarIterator | makeDomainIterator (boolean reversible) |
| long | oldMin () |
| long | oldMax () |
| int | varType () |
| void | accept (ModelVisitor visitor) |
| IntVar | isEqual (long constant) |
| IntVar | isDifferent (long constant) |
| IntVar | isGreaterOrEqual (long constant) |
| IntVar | isLessOrEqual (long constant) |
| int | index () |
| Public Member Functions inherited from com.google.ortools.constraintsolver.IntExpr | |
| IntExpr (long cPtr, boolean cMemoryOwn) | |
| long | min () |
| void | setMin (long m) |
| long | max () |
| void | setMax (long m) |
| void | range (long[] l, long[] u) |
| void | setRange (long l, long u) |
| void | setValue (long v) |
| boolean | bound () |
| IntVar | varWithName (String name) |
| void | whenRange (Demon d) |
| void | whenRange (Runnable closure) |
| Public Member Functions inherited from com.google.ortools.constraintsolver.PropagationBaseObject | |
| PropagationBaseObject (long cPtr, boolean cMemoryOwn) | |
| PropagationBaseObject (Solver s) | |
| String | toString () |
| 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 (long cPtr, boolean cMemoryOwn) | |
| BaseObject () | |
Static Public Member Functions | |
| static long | getCPtr (IntVar obj) |
| static long | swigRelease (IntVar obj) |
| Static Public Member Functions inherited from com.google.ortools.constraintsolver.IntExpr | |
| static long | getCPtr (IntExpr obj) |
| static long | swigRelease (IntExpr obj) |
| Static Public Member Functions inherited from com.google.ortools.constraintsolver.PropagationBaseObject | |
| static long | getCPtr (PropagationBaseObject obj) |
| static long | swigRelease (PropagationBaseObject obj) |
| Static Public Member Functions inherited from com.google.ortools.constraintsolver.BaseObject | |
| static long | getCPtr (BaseObject obj) |
| static long | swigRelease (BaseObject obj) |
Protected Member Functions | |
| void | finalize () |
Additional Inherited Members | |
| Protected Attributes inherited from com.google.ortools.constraintsolver.BaseObject | |
| transient boolean | swigCMemOwn |
| com.google.ortools.constraintsolver.IntVar.IntVar | ( | long | cPtr, |
| boolean | cMemoryOwn ) |
Definition at line 19 of file IntVar.java.
| void com.google.ortools.constraintsolver.IntVar.accept | ( | ModelVisitor | visitor | ) |
Accepts the given visitor.
Reimplemented from com.google.ortools.constraintsolver.IntExpr.
Definition at line 190 of file IntVar.java.
| boolean com.google.ortools.constraintsolver.IntVar.contains | ( | long | v | ) |
This method returns whether the value 'v' is in the domain of the
variable.
Reimplemented in com.google.ortools.constraintsolver.BooleanVar.
Definition at line 145 of file IntVar.java.
| synchronized void com.google.ortools.constraintsolver.IntVar.delete | ( | ) |
Reimplemented from com.google.ortools.constraintsolver.IntExpr.
Reimplemented in com.google.ortools.constraintsolver.BooleanVar.
Definition at line 45 of file IntVar.java.
|
protected |
Reimplemented from com.google.ortools.constraintsolver.IntExpr.
Reimplemented in com.google.ortools.constraintsolver.BooleanVar.
Definition at line 41 of file IntVar.java.
|
static |
Definition at line 24 of file IntVar.java.
| int com.google.ortools.constraintsolver.IntVar.index | ( | ) |
Returns the index of the variable.
Definition at line 220 of file IntVar.java.
| IntVar com.google.ortools.constraintsolver.IntVar.isDifferent | ( | long | constant | ) |
Reimplemented in com.google.ortools.constraintsolver.BooleanVar.
Definition at line 202 of file IntVar.java.
| IntVar com.google.ortools.constraintsolver.IntVar.isEqual | ( | long | constant | ) |
IsEqual
Reimplemented in com.google.ortools.constraintsolver.BooleanVar.
Definition at line 197 of file IntVar.java.
| IntVar com.google.ortools.constraintsolver.IntVar.isGreaterOrEqual | ( | long | constant | ) |
Reimplemented in com.google.ortools.constraintsolver.BooleanVar.
Definition at line 207 of file IntVar.java.
| IntVar com.google.ortools.constraintsolver.IntVar.isLessOrEqual | ( | long | constant | ) |
Reimplemented in com.google.ortools.constraintsolver.BooleanVar.
Definition at line 212 of file IntVar.java.
| boolean com.google.ortools.constraintsolver.IntVar.isVar | ( | ) |
Returns true if the expression is indeed a variable.
Reimplemented from com.google.ortools.constraintsolver.IntExpr.
Definition at line 56 of file IntVar.java.
| IntVarIterator com.google.ortools.constraintsolver.IntVar.makeDomainIterator | ( | boolean | reversible | ) |
Creates a domain iterator. When 'reversible' is false, the
returned object is created on the normal C++ heap and the solver
does NOT take ownership of the object.
Reimplemented in com.google.ortools.constraintsolver.BooleanVar.
Definition at line 164 of file IntVar.java.
| IntVarIterator com.google.ortools.constraintsolver.IntVar.makeHoleIterator | ( | boolean | reversible | ) |
Creates a hole iterator. When 'reversible' is false, the returned
object is created on the normal C++ heap and the solver does NOT
take ownership of the object.
Reimplemented in com.google.ortools.constraintsolver.BooleanVar.
Definition at line 154 of file IntVar.java.
| long com.google.ortools.constraintsolver.IntVar.oldMax | ( | ) |
Returns the previous max.
Definition at line 179 of file IntVar.java.
| long com.google.ortools.constraintsolver.IntVar.oldMin | ( | ) |
Returns the previous min.
Definition at line 172 of file IntVar.java.
| void com.google.ortools.constraintsolver.IntVar.removeInterval | ( | long | l, |
| long | u ) |
This method removes the interval 'l' .. 'u' from the domain of
the variable. It assumes that 'l' <= 'u'.
Reimplemented in com.google.ortools.constraintsolver.BooleanVar.
Definition at line 84 of file IntVar.java.
| void com.google.ortools.constraintsolver.IntVar.removeValue | ( | long | v | ) |
This method removes the value 'v' from the domain of the variable.
Reimplemented in com.google.ortools.constraintsolver.BooleanVar.
Definition at line 76 of file IntVar.java.
| void com.google.ortools.constraintsolver.IntVar.removeValues | ( | long[] | values | ) |
This method remove the values from the domain of the variable.
Definition at line 91 of file IntVar.java.
| void com.google.ortools.constraintsolver.IntVar.setValue | ( | long[] | values | ) |
This method intersects the current domain with the values in the array.
Definition at line 98 of file IntVar.java.
| long com.google.ortools.constraintsolver.IntVar.size | ( | ) |
This method returns the number of values in the domain of the variable.
Reimplemented in com.google.ortools.constraintsolver.BooleanVar.
Definition at line 137 of file IntVar.java.
|
static |
Definition at line 28 of file IntVar.java.
| long com.google.ortools.constraintsolver.IntVar.value | ( | ) |
This method returns the value of the variable. This method checks
before that the variable is bound.
Reimplemented in com.google.ortools.constraintsolver.BooleanVar.
Definition at line 69 of file IntVar.java.
| IntVar com.google.ortools.constraintsolver.IntVar.var | ( | ) |
Creates a variable from the expression.
Reimplemented from com.google.ortools.constraintsolver.IntExpr.
Definition at line 60 of file IntVar.java.
| int com.google.ortools.constraintsolver.IntVar.varType | ( | ) |
Reimplemented in com.google.ortools.constraintsolver.BooleanVar.
Definition at line 183 of file IntVar.java.
| void com.google.ortools.constraintsolver.IntVar.whenBound | ( | Demon | d | ) |
This method attaches a demon that will be awakened when the
variable is bound.
Reimplemented in com.google.ortools.constraintsolver.BooleanVar.
Definition at line 106 of file IntVar.java.
| void com.google.ortools.constraintsolver.IntVar.whenBound | ( | Runnable | closure | ) |
This method attaches a closure that will be awakened when the
variable is bound.
Definition at line 114 of file IntVar.java.
| void com.google.ortools.constraintsolver.IntVar.whenDomain | ( | Demon | d | ) |
This method attaches a demon that will watch any domain
modification of the domain of the variable.
Reimplemented in com.google.ortools.constraintsolver.BooleanVar.
Definition at line 122 of file IntVar.java.
| void com.google.ortools.constraintsolver.IntVar.whenDomain | ( | Runnable | closure | ) |
This method attaches a closure that will watch any domain
modification of the domain of the variable.
Definition at line 130 of file IntVar.java.