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, toStringpublic SimpleCpVarDomain(SatWrapper wrapper, IntVar variable)
public SimpleCpVarDomain(SatWrapper wrapper, IntVar variable, boolean translate)
public final int cpValueToBoolVar(int value,
boolean isEquality)
SatCPBridgecpValueToBoolVar in class SatCPBridgevalue - 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)
SatCPBridgeboolVarToCpValue in class SatCPBridgeliteral - the literal standing for 'var = value'public final boolean isEqualityBoolVar(int literal)
SatCPBridgeisEqualityBoolVar in class SatCPBridgeliteral - the literal (among literals from this range)public void setDomain(int minValue,
int maxValue)
SatCPBridgesetDomain in class SatCPBridgeminValue - minimum value of the rangemaxValue - maximum value of the rangepublic void propagate(int literal)
propagate in class SatCPBridgeliteral - the literal that has been assertedpublic boolean isTranslated()
SatCPBridgeisTranslated in class SatCPBridgepublic void initialize(SatWrapper wrapper)
WrapperComponentinitialize in interface WrapperComponentinitialize in class SatCPBridgewrapper - the wrapperCopyright © 2022. All rights reserved.