Class BooleanVar
- java.lang.Object
-
- com.google.ortools.constraintsolver.BaseObject
-
- com.google.ortools.constraintsolver.PropagationBaseObject
-
- com.google.ortools.constraintsolver.IntExpr
-
- com.google.ortools.constraintsolver.IntVar
-
- com.google.ortools.constraintsolver.BooleanVar
-
public class BooleanVar extends IntVar
-
-
Field Summary
-
Fields inherited from class com.google.ortools.constraintsolver.BaseObject
swigCMemOwn
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBooleanVar(long cPtr, boolean cMemoryOwn)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringbaseName()Returns a base name for automatic naming.booleanbound()Returns true if the min and the max of the expression are equal.booleancontains(long v)This method returns whether the value 'v' is in the domain of the
variable.voiddelete()protected voidfinalize()protected static longgetCPtr(BooleanVar obj)static intgetKUnboundBooleanVarValue()IntVarisDifferent(long constant)IntVarisEqual(long constant)IsEqualIntVarisGreaterOrEqual(long constant)IntVarisLessOrEqual(long constant)IntVarIteratormakeDomainIterator(boolean reversible)Creates a domain iterator.IntVarIteratormakeHoleIterator(boolean reversible)Creates a hole iterator.longmax()longmin()intrawValue()voidremoveInterval(long l, long u)This method removes the interval 'l' ..voidremoveValue(long v)This method removes the value 'v' from the domain of the variable.voidrestoreValue()voidsetMax(long m)voidsetMin(long m)voidsetRange(long mi, long ma)This method sets both the min and the max of the expression.java.math.BigIntegersize()This method returns the number of values in the domain of the variable.protected static longswigRelease(BooleanVar obj)java.lang.StringtoString()longvalue()This method returns the value of the variable.intvarType()voidwhenBound(Demon d)This method attaches a demon that will be awakened when the
variable is bound.voidwhenDomain(Demon d)This method attaches a demon that will watch any domain
modification of the domain of the variable.voidwhenRange(Demon d)Attach a demon that will watch the min or the max of the expression.-
Methods inherited from class com.google.ortools.constraintsolver.IntVar
accept, getCPtr, index, isVar, oldMax, oldMin, removeValues, setValue, swigRelease, var, whenBound, whenDomain
-
Methods inherited from class com.google.ortools.constraintsolver.IntExpr
getCPtr, range, setValue, swigRelease, varWithName, whenRange
-
Methods inherited from class com.google.ortools.constraintsolver.PropagationBaseObject
enqueueDelayedDemon, enqueueVar, freezeQueue, getCPtr, hasName, name, reset_action_on_fail, set_variable_to_clean_on_fail, setName, solver, swigRelease, unfreezeQueue
-
Methods inherited from class com.google.ortools.constraintsolver.BaseObject
getCPtr, swigRelease
-
-
-
-
Method Detail
-
getCPtr
protected static long getCPtr(BooleanVar obj)
-
swigRelease
protected static long swigRelease(BooleanVar obj)
-
getKUnboundBooleanVarValue
public static int getKUnboundBooleanVarValue()
-
setRange
public void setRange(long mi, long ma)Description copied from class:IntExprThis method sets both the min and the max of the expression.
-
bound
public boolean bound()
Description copied from class:IntExprReturns true if the min and the max of the expression are equal.
-
value
public long value()
Description copied from class:IntVarThis method returns the value of the variable. This method checks
before that the variable is bound.
-
removeValue
public void removeValue(long v)
Description copied from class:IntVarThis method removes the value 'v' from the domain of the variable.- Overrides:
removeValuein classIntVar
-
removeInterval
public void removeInterval(long l, long u)Description copied from class:IntVarThis method removes the interval 'l' .. 'u' from the domain of
the variable. It assumes that 'l' <= 'u'.- Overrides:
removeIntervalin classIntVar
-
whenBound
public void whenBound(Demon d)
Description copied from class:IntVarThis method attaches a demon that will be awakened when the
variable is bound.
-
whenRange
public void whenRange(Demon d)
Description copied from class:IntExprAttach a demon that will watch the min or the max of the expression.
-
whenDomain
public void whenDomain(Demon d)
Description copied from class:IntVarThis method attaches a demon that will watch any domain
modification of the domain of the variable.- Overrides:
whenDomainin classIntVar
-
size
public java.math.BigInteger size()
Description copied from class:IntVarThis method returns the number of values in the domain of the variable.
-
contains
public boolean contains(long v)
Description copied from class:IntVarThis method returns whether the value 'v' is in the domain of the
variable.
-
makeHoleIterator
public IntVarIterator makeHoleIterator(boolean reversible)
Description copied from class:IntVarCreates 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.- Overrides:
makeHoleIteratorin classIntVar
-
makeDomainIterator
public IntVarIterator makeDomainIterator(boolean reversible)
Description copied from class:IntVarCreates 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.- Overrides:
makeDomainIteratorin classIntVar
-
toString
public java.lang.String toString()
- Overrides:
toStringin classPropagationBaseObject
-
isDifferent
public IntVar isDifferent(long constant)
- Overrides:
isDifferentin classIntVar
-
isGreaterOrEqual
public IntVar isGreaterOrEqual(long constant)
- Overrides:
isGreaterOrEqualin classIntVar
-
isLessOrEqual
public IntVar isLessOrEqual(long constant)
- Overrides:
isLessOrEqualin classIntVar
-
restoreValue
public void restoreValue()
-
baseName
public java.lang.String baseName()
Description copied from class:PropagationBaseObjectReturns a base name for automatic naming.- Overrides:
baseNamein classPropagationBaseObject
-
rawValue
public int rawValue()
-
-