public abstract class SatCPBridge extends Object implements WrapperComponent
Modifier and Type | Field and Description |
---|---|
protected boolean |
hasSetDomain |
IntDomain |
initialDomain |
int |
max |
int |
min |
IntVar |
variable |
protected SatWrapper |
wrapper |
Constructor and Description |
---|
SatCPBridge(IntVar variable)
simple constructor with a variable
|
Modifier and Type | Method and Description |
---|---|
abstract int |
boolVarToCpValue(int literal)
return the value corresponding to given literal (variable)
|
abstract int |
cpValueToBoolVar(int value,
boolean isEquality)
return the literal that represents the assertion 'var = value'.
|
int |
getLeftLimit()
the left limit of the range
|
int |
getRightLimit()
the right limit of the range
|
abstract void |
initialize(SatWrapper wrapper)
connect the component to the wrapper
|
abstract boolean |
isEqualityBoolVar(int literal)
checks if the literal stands for a 'x=d' proposition, or a
'x<=d' proposition
|
boolean |
isInThisRange(int literal)
checks if the literal represents a proposition about the variable
this object manages
|
abstract boolean |
isTranslated()
predicate for whether this variable should be handled by the
DomainClausesDatabase or not
|
abstract void |
propagate(int literal)
does all propagation required, in a way specific to this range.
|
void |
setDomain(int minValue,
int maxValue)
set the domain to be between minValue and maxValue.
|
String |
toString() |
protected SatWrapper wrapper
public final IntVar variable
public final IntDomain initialDomain
public int min
public int max
protected boolean hasSetDomain
public SatCPBridge(IntVar variable)
variable
- the variable of which this is the rangepublic final int getLeftLimit()
public final int getRightLimit()
public void setDomain(int minValue, int maxValue)
minValue
- minimum value of the rangemaxValue
- maximum value of the rangepublic abstract int cpValueToBoolVar(int value, boolean isEquality)
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 abstract int boolVarToCpValue(int literal)
literal
- the literal standing for 'var = value'public abstract boolean isEqualityBoolVar(int literal)
literal
- the literal (among literals from this range)public final boolean isInThisRange(int literal)
literal
- a literalpublic abstract void propagate(int literal)
this.isTranslated()
is false.literal
- the literal that has been assertedpublic abstract boolean isTranslated()
public abstract void initialize(SatWrapper wrapper)
WrapperComponent
initialize
in interface WrapperComponent
wrapper
- the wrapperCopyright © 2022. All rights reserved.