public class SimpleCpVarDomain extends SatCPBridge
Modifier and Type | Field and Description |
---|---|
boolean |
isTranslated |
hasSetDomain, initialDomain, max, min, variable, wrapper
Constructor and Description |
---|
SimpleCpVarDomain(SatWrapper wrapper,
IntVar variable) |
SimpleCpVarDomain(SatWrapper wrapper,
IntVar variable,
boolean translate) |
Modifier and Type | Method and Description |
---|---|
int |
boolVarToCpValue(int literal)
return the value corresponding to given literal (variable)
|
int |
cpValueToBoolVar(int value,
boolean isEquality)
return the literal that represents the assertion 'var = value'.
|
void |
initialize(SatWrapper wrapper)
connect the component to the wrapper
|
boolean |
isEqualityBoolVar(int literal)
checks if the literal stands for a 'x=d' proposition, or a
'x<=d' proposition
|
boolean |
isTranslated()
predicate for whether this variable should be handled by the
DomainClausesDatabase or not
|
void |
propagate(int literal)
given some literal has a value, what other literals should be asserted ?
|
void |
setDomain(int minValue,
int maxValue)
set the domain to be between minValue and maxValue.
|
getLeftLimit, getRightLimit, isInThisRange, toString
public SimpleCpVarDomain(SatWrapper wrapper, IntVar variable)
public SimpleCpVarDomain(SatWrapper wrapper, IntVar variable, boolean translate)
public final int cpValueToBoolVar(int value, boolean isEquality)
SatCPBridge
cpValueToBoolVar
in class SatCPBridge
value
- the value for the variable this range representsisEquality
- true if we want the literal for 'x=d
' kind of
propositions, false for 'x<=d
'public final int boolVarToCpValue(int literal)
SatCPBridge
boolVarToCpValue
in class SatCPBridge
literal
- the literal standing for 'var = value'public final boolean isEqualityBoolVar(int literal)
SatCPBridge
isEqualityBoolVar
in class SatCPBridge
literal
- the literal (among literals from this range)public void setDomain(int minValue, int maxValue)
SatCPBridge
setDomain
in class SatCPBridge
minValue
- minimum value of the rangemaxValue
- maximum value of the rangepublic void propagate(int literal)
propagate
in class SatCPBridge
literal
- the literal that has been assertedpublic boolean isTranslated()
SatCPBridge
isTranslated
in class SatCPBridge
public void initialize(SatWrapper wrapper)
WrapperComponent
initialize
in interface WrapperComponent
initialize
in class SatCPBridge
wrapper
- the wrapperCopyright © 2022. All rights reserved.