|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jopt.csp.spi.arcalgorithm.variable.VariableChangeBase jopt.csp.spi.arcalgorithm.variable.NumExprBase jopt.csp.spi.arcalgorithm.variable.IntExpr jopt.csp.spi.arcalgorithm.variable.BooleanExpr
A class used to create boolean expressions including AND, OR, NOT operations, etc. An expression usually does not have a concrete domain that can be modified, so it must be wrapped by a variable if it's value is to be directly altered.
Constructor Summary | |
BooleanExpr(java.lang.String name,
BooleanExpr aexpr,
int operation,
boolean bConst)
Constructor for building expressions based on an operation on one other variable and a constant |
|
BooleanExpr(java.lang.String name,
BooleanExpr aexpr,
int operation,
BooleanExpr bexpr,
boolean notB)
Constructor for building expressions based on an operation on two other variables |
|
BooleanExpr(java.lang.String name,
BooleanExpr aexpr,
int operation,
GenericBooleanConstant bConst)
Constructor for building expressions based on an operation on one other variable and a constant |
|
BooleanExpr(java.lang.String name,
jopt.csp.variable.CspConstraint constraint)
Constructor for expression that wraps a constraint and is based upon a domain computed from the constraint |
|
BooleanExpr(java.lang.String name,
int operation,
BooleanExpr bexpr)
Constructor for building an expression based on an operation on one other variable |
Method Summary | |
void |
addVariableChangeListener(VariableChangeListener listener)
Adds a listener interested in variable change events |
void |
addVariableChangeListener(VariableChangeListener listener,
boolean firstTime)
Adds a listener interested in variable change events |
jopt.csp.variable.CspBooleanExpr |
and(boolean val)
Creates a boolean expression resulting from anding a constant with this expression |
jopt.csp.variable.CspBooleanExpr |
and(jopt.csp.variable.CspBooleanExpr expr)
Creates a boolean expression resulting from anding a boolean expression with this expression |
jopt.csp.variable.CspBooleanExpr |
and(jopt.csp.variable.CspConstraint cons)
Creates a boolean expression resulting from anding a constraint with this expression |
jopt.csp.variable.CspBooleanExpr |
and(jopt.csp.variable.CspGenericBooleanConstant val)
Creates a boolean expression resulting from anding a constant with this expression |
jopt.csp.variable.CspConstraint |
createBuildingBlockConstraint()
|
jopt.csp.variable.CspConstraint |
createExternalConstraint()
|
jopt.csp.variable.CspBooleanExpr |
eq(boolean val)
Creates a boolean expression resulting from setting a boolean expression equal to this expression |
jopt.csp.variable.CspBooleanExpr |
eq(jopt.csp.variable.CspBooleanExpr expr)
Creates a boolean expression resulting from setting a boolean expression equal to this expression |
jopt.csp.variable.CspBooleanExpr |
eq(jopt.csp.variable.CspConstraint cons)
Creates a boolean expression resulting from setting a boolean expression equal to this expression |
BooleanDomain |
getBooleanDomain()
Returns the domain corresponding to this expression |
Arc[] |
getBooleanSourceArcs()
Returns array of arcs that will affect the boolean true / false value of this constraint upon a change |
Node |
getNode()
Returns node associated with this expression |
java.util.Collection |
getNodeCollection()
Returns collection of all nodes used to build this expression |
int |
getSize()
Returns the size of this variable's domain |
jopt.csp.variable.CspBooleanExpr |
implies(boolean val)
Creates a boolean expression resulting from this expression implying another expression |
jopt.csp.variable.CspBooleanExpr |
implies(jopt.csp.variable.CspBooleanExpr expr)
Creates a boolean expression resulting from this expression implying another expression |
jopt.csp.variable.CspBooleanExpr |
implies(jopt.csp.variable.CspConstraint cons)
Creates a boolean expression resulting from this expression implying a constraint |
jopt.csp.variable.CspBooleanExpr |
implies(jopt.csp.variable.CspGenericBooleanConstant val)
Creates a boolean expression resulting from anding a constant with this expression |
boolean |
isFalse()
Returns true if variable cannot be satisfied |
boolean |
isTrue()
Returns true if variable cannot be dissatisfied |
jopt.csp.variable.CspBooleanExpr |
not()
Returns a Boolean Variable equal to the Not of this one |
BoolExpr |
notExpr()
Returns a BoolExpr equal to the Not of this one |
jopt.csp.variable.CspBooleanExpr |
or(boolean val)
Creates a boolean expression resulting from oring a constant with this expression |
jopt.csp.variable.CspBooleanExpr |
or(jopt.csp.variable.CspBooleanExpr expr)
Creates a boolean expression resulting from oring a boolean expression with this expression |
jopt.csp.variable.CspBooleanExpr |
or(jopt.csp.variable.CspConstraint cons)
Creates a boolean expression resulting from oring a constraint with this expression |
jopt.csp.variable.CspBooleanExpr |
or(jopt.csp.variable.CspGenericBooleanConstant val)
Creates a boolean expression resulting from oring a constant with this expression |
jopt.csp.variable.CspConstraint |
toConstraint()
Returns a constraint that represents this boolean expression that can be used in the solver |
java.lang.String |
toString()
|
void |
updateGraph(NodeArcGraph graph)
Adds arcs representing this expression to the node arc graph |
jopt.csp.variable.CspBooleanExpr |
xor(boolean val)
Creates a boolean expression resulting from xoring a constant with this expression |
jopt.csp.variable.CspBooleanExpr |
xor(jopt.csp.variable.CspBooleanExpr expr)
Creates a boolean expression resulting from xoring a boolean expression with this expression |
jopt.csp.variable.CspBooleanExpr |
xor(jopt.csp.variable.CspConstraint cons)
Creates a boolean expression resulting from xoring a constraint with this expression |
jopt.csp.variable.CspBooleanExpr |
xor(jopt.csp.variable.CspGenericBooleanConstant val)
Creates a boolean expression resulting from xoring a constant with this expression |
Methods inherited from class jopt.csp.spi.arcalgorithm.variable.IntExpr |
add, add, add, add, add, add, add, add, between, between, divide, divide, divide, divide, divide, divide, divide, divide, eq, eq, geq, geq, getDoubleDomain, getFloatDomain, getIntDomain, getLongDomain, getMax, getMin, getNextHigher, getNextLower, getNumberType, getNumMax, getNumMin, getPrecision, gt, gt, isInDomain, leq, leq, lt, lt, multiply, multiply, multiply, multiply, multiply, multiply, multiply, multiply, neq, neq, notBetween, notBetween, setPrecision, subtract, subtract, subtract, subtract, subtract, subtract, subtract, subtract |
Methods inherited from class jopt.csp.spi.arcalgorithm.variable.NumExprBase |
between, between, between, between, eq, equals, geq, getDomain, getName, gt, hashCode, isBound, leq, lt, neq, notBetween, notBetween, notBetween, notBetween, removeVariableChangeListener, setName |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface jopt.csp.variable.CspIntExpr |
add, add, add, add, add, add, add, add, between, between, divide, divide, divide, divide, divide, divide, divide, divide, eq, eq, geq, geq, getMax, getMin, gt, gt, leq, leq, lt, lt, multiply, multiply, multiply, multiply, multiply, multiply, multiply, multiply, neq, neq, notBetween, notBetween, subtract, subtract, subtract, subtract, subtract, subtract, subtract, subtract |
Methods inherited from interface jopt.csp.variable.CspNumExpr |
between, between, between, between, eq, geq, getName, gt, isBound, leq, lt, neq, notBetween, notBetween, notBetween, notBetween, setName |
Methods inherited from interface jopt.csp.spi.arcalgorithm.constraint.bool.BoolExpr |
getName, isBound |
Methods inherited from interface jopt.csp.spi.arcalgorithm.constraint.num.NumExpr |
getName, isBound |
Constructor Detail |
public BooleanExpr(java.lang.String name, jopt.csp.variable.CspConstraint constraint)
name
- Unique name assigned to expressionconstraint
- Constraint this boolean expression wrapspublic BooleanExpr(java.lang.String name, BooleanExpr aexpr, int operation, BooleanExpr bexpr, boolean notB)
name
- Unique name assigned to expressionaexpr
- A variable of boolean expressionoperation
- Operation this expression represents such as AND, OR, etc.bexpr
- B variable of boolean expressionnotB
- True if operation is on !B instead of Bpublic BooleanExpr(java.lang.String name, BooleanExpr aexpr, int operation, boolean bConst)
name
- Unique name assigned to expressionaexpr
- A variable of boolean expressionoperation
- Operation this expression represents such as AND, OR, etc.bConst
- Constant b value of boolean expressionpublic BooleanExpr(java.lang.String name, BooleanExpr aexpr, int operation, GenericBooleanConstant bConst)
name
- Unique name assigned to expressionaexpr
- A variable of boolean expressionoperation
- Operation this expression represents such as AND, OR, etc.bConst
- Constant b value of boolean expressionpublic BooleanExpr(java.lang.String name, int operation, BooleanExpr bexpr)
name
- Unique name assigned to expressionoperation
- Operation this expression represents such as EQ, IMPLIES or NOTbexpr
- A variable of boolean expressionMethod Detail |
public Arc[] getBooleanSourceArcs()
getBooleanSourceArcs
in interface BoolExpr
getBooleanSourceArcs
in class NumExprBase
public Node getNode()
getNode
in interface BoolExpr
getNode
in class IntExpr
public jopt.csp.variable.CspBooleanExpr and(jopt.csp.variable.CspBooleanExpr expr)
and
in interface jopt.csp.variable.CspBooleanExpr
public jopt.csp.variable.CspBooleanExpr and(jopt.csp.variable.CspConstraint cons)
and
in interface jopt.csp.variable.CspBooleanExpr
public jopt.csp.variable.CspBooleanExpr and(boolean val)
and
in interface jopt.csp.variable.CspBooleanExpr
public jopt.csp.variable.CspBooleanExpr and(jopt.csp.variable.CspGenericBooleanConstant val)
and
in interface jopt.csp.variable.CspBooleanExpr
public jopt.csp.variable.CspBooleanExpr xor(jopt.csp.variable.CspBooleanExpr expr)
xor
in interface jopt.csp.variable.CspBooleanExpr
public jopt.csp.variable.CspBooleanExpr xor(jopt.csp.variable.CspConstraint cons)
xor
in interface jopt.csp.variable.CspBooleanExpr
public jopt.csp.variable.CspBooleanExpr xor(boolean val)
xor
in interface jopt.csp.variable.CspBooleanExpr
public jopt.csp.variable.CspBooleanExpr xor(jopt.csp.variable.CspGenericBooleanConstant val)
xor
in interface jopt.csp.variable.CspBooleanExpr
public jopt.csp.variable.CspBooleanExpr implies(jopt.csp.variable.CspBooleanExpr expr)
implies
in interface jopt.csp.variable.CspBooleanExpr
public jopt.csp.variable.CspBooleanExpr implies(boolean val)
implies
in interface jopt.csp.variable.CspBooleanExpr
public jopt.csp.variable.CspBooleanExpr implies(jopt.csp.variable.CspGenericBooleanConstant val)
implies
in interface jopt.csp.variable.CspBooleanExpr
public jopt.csp.variable.CspBooleanExpr implies(jopt.csp.variable.CspConstraint cons)
implies
in interface jopt.csp.variable.CspBooleanExpr
public jopt.csp.variable.CspBooleanExpr or(jopt.csp.variable.CspBooleanExpr expr)
or
in interface jopt.csp.variable.CspBooleanExpr
public jopt.csp.variable.CspBooleanExpr or(jopt.csp.variable.CspConstraint cons)
or
in interface jopt.csp.variable.CspBooleanExpr
public jopt.csp.variable.CspBooleanExpr or(boolean val)
or
in interface jopt.csp.variable.CspBooleanExpr
public jopt.csp.variable.CspBooleanExpr or(jopt.csp.variable.CspGenericBooleanConstant val)
or
in interface jopt.csp.variable.CspBooleanExpr
public jopt.csp.variable.CspBooleanExpr eq(jopt.csp.variable.CspBooleanExpr expr)
eq
in interface jopt.csp.variable.CspBooleanExpr
public jopt.csp.variable.CspBooleanExpr eq(jopt.csp.variable.CspConstraint cons)
eq
in interface jopt.csp.variable.CspBooleanExpr
public jopt.csp.variable.CspBooleanExpr eq(boolean val)
eq
in interface jopt.csp.variable.CspBooleanExpr
public jopt.csp.variable.CspConstraint toConstraint()
BoolExpr
toConstraint
in interface jopt.csp.variable.CspBooleanExpr
public jopt.csp.variable.CspConstraint createExternalConstraint()
public jopt.csp.variable.CspConstraint createBuildingBlockConstraint()
public jopt.csp.variable.CspBooleanExpr not()
not
in interface jopt.csp.variable.CspBooleanExpr
public BoolExpr notExpr()
notExpr
in interface BoolExpr
public boolean isFalse()
isFalse
in interface jopt.csp.variable.CspBooleanExpr
public boolean isTrue()
isTrue
in interface jopt.csp.variable.CspBooleanExpr
public int getSize()
public BooleanDomain getBooleanDomain()
public void updateGraph(NodeArcGraph graph)
updateGraph
in interface BoolExpr
updateGraph
in class NumExprBase
public java.lang.String toString()
toString
in class NumExprBase
public java.util.Collection getNodeCollection()
BoolExpr
getNodeCollection
in interface BoolExpr
getNodeCollection
in class NumExprBase
public void addVariableChangeListener(VariableChangeListener listener)
addVariableChangeListener
in interface VariableChangeSource
addVariableChangeListener
in class NumExprBase
public void addVariableChangeListener(VariableChangeListener listener, boolean firstTime)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |