Class FixedBoolVarImpl
- java.lang.Object
-
- org.chocosolver.solver.variables.impl.AbstractVariable
-
- org.chocosolver.solver.variables.impl.FixedIntVarImpl
-
- org.chocosolver.solver.variables.impl.FixedBoolVarImpl
-
- All Implemented Interfaces:
Cloneable,Comparable<Variable>,Iterable<Integer>,ILogical,ArExpression,ReExpression,ICause,Identity,BoolVar,IntVar,Variable
public class FixedBoolVarImpl extends FixedIntVarImpl implements BoolVar
A constant view specific to boolean variable Based on "Views and Iterators for Generic Constraint Implementations", C. Schulte and G. Tack- Since:
- 04/02/11
- Author:
- Charles Prud'homme
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.chocosolver.solver.expression.discrete.arithmetic.ArExpression
ArExpression.Operator
-
Nested classes/interfaces inherited from interface org.chocosolver.solver.expression.discrete.relational.ReExpression
ReExpression.Operator
-
-
Field Summary
-
Fields inherited from class org.chocosolver.solver.variables.impl.FixedIntVarImpl
constante
-
Fields inherited from class org.chocosolver.solver.variables.impl.AbstractVariable
mIdx, model, monitors, MSG_EMPTY, MSG_INST, name, propagators
-
Fields inherited from interface org.chocosolver.solver.expression.discrete.arithmetic.ArExpression
NO_CHILD
-
Fields inherited from interface org.chocosolver.solver.variables.IntVar
MAX_INT_BOUND, MIN_INT_BOUND
-
-
Constructor Summary
Constructors Constructor Description FixedBoolVarImpl(String name, int constant, Model model)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void_setNot(BoolVar not)protected EvtSchedulercreateScheduler()ESatgetBooleanValue()intgetTypeAndKind()Return a MASK composed of 2 main information: TYPE and KIND.booleanhasNot()booleanisLit()Current tree is a literalbooleanisNot()Current tree is rooted with NOT logical operator This is a one way relationship: in case a = not(b) a.isNot() returns true whereas b.isNot() returns false (unless b = not(c)...)BoolVarnot()voidsetNot(boolean isNot)States whether or not this variable is the negation of another.booleansetToFalse(ICause cause)booleansetToTrue(ICause cause)StringtoString()-
Methods inherited from class org.chocosolver.solver.variables.impl.FixedIntVarImpl
addMonitor, contains, createDelta, getDelta, getDomainSize, getLB, getRange, getRangeIterator, getUB, getValue, getValueIterator, hasEnumeratedDomain, instantiateTo, isInstantiated, isInstantiatedTo, iterator, monitorDelta, nextValue, nextValueOut, notifyMonitors, notifyPropagators, notifyViews, previousValue, previousValueOut, removeAllValuesBut, removeInterval, removeValue, removeValues, subscribeView, updateBounds, updateLowerBound, updateUpperBound
-
Methods inherited from class org.chocosolver.solver.variables.impl.AbstractVariable
asBoolVar, asIntVar, asRealVar, asSetVar, clearEvents, compareTo, contradiction, getCause, getDindex, getEvtScheduler, getId, getIndexInPropagator, getMask, getModel, getName, getNbProps, getPIndices, getPropagator, getPropagators, getViews, isAConstant, isBool, link, removeMonitor, setPIndice, storeEvents, swapOnActivate, swapOnPassivate, unlink
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.chocosolver.solver.expression.discrete.arithmetic.ArExpression
abs, add, add, add, dist, dist, div, div, eq, eq, eq, ge, ge, getExpressionChild, gt, gt, le, le, lt, lt, max, max, max, min, min, min, mod, mod, mul, mul, mul, ne, ne, neg, pow, pow, sqr, sub, sub
-
Methods inherited from interface org.chocosolver.solver.variables.BoolVar
boolVar, extractVar, intVar
-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface org.chocosolver.solver.variables.IntVar
contains, getDomainSize, getLB, getNoChild, getRange, getRangeIterator, getUB, getValue, getValueIterator, hasEnumeratedDomain, instantiateTo, isBool, isExpressionLeaf, isInstantiatedTo, monitorDelta, nextValue, nextValueOut, previousValue, previousValueOut, removeAllValuesBut, removeInterval, removeValue, removeValues, reverseValue, transformEvent, transformValue, updateBounds, updateLowerBound, updateUpperBound, why
-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Methods inherited from interface org.chocosolver.solver.expression.discrete.relational.ReExpression
and, beval, decompose, extension, getModel, ieval, iff, ift, ift, ift, ift, imp, or, post, xor
-
Methods inherited from interface org.chocosolver.solver.variables.Variable
addMonitor, asBoolVar, asIntVar, asRealVar, asSetVar, clearEvents, contradiction, createDelta, getCause, getDelta, getDindex, getEnvironment, getEvtScheduler, getIndexInPropagator, getMask, getModel, getName, getNbProps, getPIndices, getPropagator, getPropagators, getViews, isAConstant, isInstantiated, link, notifyMonitors, notifyPropagators, notifyViews, removeMonitor, setPIndice, storeEvents, subscribeView, swapOnActivate, swapOnPassivate, unlink
-
-
-
-
Method Detail
-
getTypeAndKind
public int getTypeAndKind()
Description copied from interface:VariableReturn a MASK composed of 2 main information: TYPE and KIND.
TYPE is defined in the 3 first bits : VAR ( 1 << 0), CSTE (1 << 1) or VIEW (1 << 2)
KIND is defined on the other bits : INT (1 << 3), BOOL (INT + 1 << 4), GRAPH (1 << 5) or META (1 << 6) To get the TYPE of a variable:int type = var.getTypeAndKind() & Variable.TYPE;
To get the KIND of a variable:int kind = var.getTypeAndKind() & Variable.KIND;
To check a specific type or kind of a variable:boolean isVar = (var.getTypeAndKind() & Variable.VAR) !=0; boolean isInt = (var.getTypeAndKind() & Variable.INT) !=0;- Specified by:
getTypeAndKindin interfaceVariable- Overrides:
getTypeAndKindin classFixedIntVarImpl- Returns:
- an int representing the type and kind of the variable
-
createScheduler
protected EvtScheduler createScheduler()
- Overrides:
createSchedulerin classFixedIntVarImpl
-
getBooleanValue
public ESat getBooleanValue()
- Specified by:
getBooleanValuein interfaceBoolVar
-
setToTrue
public boolean setToTrue(ICause cause) throws ContradictionException
- Specified by:
setToTruein interfaceBoolVar- Throws:
ContradictionException
-
setToFalse
public boolean setToFalse(ICause cause) throws ContradictionException
- Specified by:
setToFalsein interfaceBoolVar- Throws:
ContradictionException
-
not
public BoolVar not()
- Specified by:
notin interfaceBoolVar- Specified by:
notin interfaceReExpression- Returns:
- return the expression "¬x" where this is "x"
-
isLit
public boolean isLit()
Description copied from interface:ILogicalCurrent tree is a literal
-
isNot
public boolean isNot()
Description copied from interface:ILogicalCurrent tree is rooted with NOT logical operator This is a one way relationship: in case a = not(b) a.isNot() returns true whereas b.isNot() returns false (unless b = not(c)...)
-
setNot
public void setNot(boolean isNot)
Description copied from interface:ILogicalStates whether or not this variable is the negation of another. This is a one way relationship: in case a = not(b) a.isNot() returns true whereas b.isNot() returns false (unless b = not(c)...)
-
toString
public String toString()
- Overrides:
toStringin classFixedIntVarImpl
-
-