public class IntVar extends Var
Modifier and Type | Field and Description |
---|---|
IntDomain |
domain
It stores pointer to a current domain, which has stamp equal to store
stamp.
|
SatCPBridge |
satBridge
It stores information about the variable in SAT domain.
|
Constructor and Description |
---|
IntVar()
No parameter, explicit, empty constructor for subclasses.
|
IntVar(Store store)
This constructor creates a variable with empty domain (standard
IntervalDomain domain), automatically generated name, and empty attached
constraint list.
|
IntVar(Store store,
IntDomain dom)
It creates a variable in a given store, with a given name and
a given domain.
|
IntVar(Store store,
int min,
int max)
This constructor creates a variable with a domain between min..max,
automatically generated name, and empty attached constraint list.
|
IntVar(Store store,
String name)
This constructor creates a variable with an empty domain (standard
IntervalDomain domain), the specified name, and an empty attached
constraint list.
|
IntVar(Store store,
String name,
IntDomain dom)
It creates a variable in a given store, with a given name and
a given domain.
|
IntVar(Store store,
String name,
int min,
int max)
This constructor creates a variable in a given store, with
the domain specified by min..max and with the given name.
|
Modifier and Type | Method and Description |
---|---|
void |
addDom(IntDomain dom)
It is possible to add the domain of variable.
|
void |
addDom(int min,
int max)
It is possible to add the domain of variable.
|
IntDomain |
dom()
This function returns current domain of the variable.
|
void |
domainHasChanged(int event)
It informs the variable that its variable has changed according to the specified event.
|
boolean |
eq(IntVar var)
It checks if the domains of variables are equal.
|
int |
getSize()
It returns the size of the current domain.
|
double |
getSizeFloat()
It returns the size of the current domain.
|
boolean |
isEmpty()
It checks if the domain is empty.
|
int |
level()
This function returns stamp of the current domain of variable.
|
int |
max()
This function returns current maximal value in the domain of the
variable.
|
int |
min()
This function returns current minimal value in the domain of the
variable.
|
void |
putConstraint(Constraint c)
It registers constraint with current variable, so anytime this variable
is changed the constraint is reevaluated.
|
void |
putModelConstraint(Constraint c,
int pruningEvent)
It registers constraint with current variable, so anytime this variable
is changed the constraint is reevaluated.
|
void |
putSearchConstraint(Constraint c)
It registers constraint with current variable, so always when this variable
is changed the constraint is reevaluated.
|
IntDomain |
recentDomainPruning()
It returns the values which have been removed at current store level.
|
void |
remove(int removedLevel)
It specifies the function being called by the manager upon backtracking.
|
void |
removeConstraint(Constraint c)
It detaches constraint from the current variable, so change in variable
will not cause constraint reevaluation.
|
void |
setDomain(IntDomain dom)
It is possible to set the domain of variable.
|
void |
setDomain(int min,
int max)
It is possible to set the domain of variable.
|
boolean |
singleton()
It checks if the domain contains only one value.
|
boolean |
singleton(int val)
It checks if the domain contains only one value equal to c.
|
int |
sizeConstraints()
It returns current number of constraints which are associated with
variable and are not yet satisfied.
|
int |
sizeConstraintsOriginal()
It returns all constraints which are associated with variable, even the
ones which are already satisfied.
|
int |
sizeSearchConstraints()
It returns current number of constraints which are associated with
variable and are not yet satisfied.
|
String |
toString() |
String |
toStringFull()
It returns the string representation of the variable using the full representation
of the domain.
|
int |
value()
This function returns current value in the domain of the variable.
|
activity, addPositionMapping, addPositionMapping, afcValue, applyDecay, createEmptyPositioning, getStore, id, index, positionMapping, positionMapping, updateActivity
public IntDomain domain
public SatCPBridge satBridge
public IntVar(Store store, String name, IntDomain dom)
store
- store in which the variable is created.name
- the name for the variable being created.dom
- the domain of the variable being created.public IntVar(Store store, IntDomain dom)
store
- store in which the variable is created.dom
- the domain of the variable being created.public IntVar()
public IntVar(Store store)
store
- store in which the variable is created.public IntVar(Store store, int min, int max)
store
- store in which the variable is created.min
- the minimum value of the domain.max
- the maximum value of the domain.public IntVar(Store store, String name)
store
- store in which the variable is created.name
- the name for the variable being created.public IntVar(Store store, String name, int min, int max)
store
- the store in which the variable is created.name
- the name of the variable being created.min
- the minimum value of the variables domain.max
- the maximum value of the variables domain.public void addDom(int min, int max)
min
- the left bound of the interval being added.max
- the right bound of the interval being added.public void setDomain(int min, int max)
min
- the left bound of the interval used to set this variable domain to.max
- the right bound of the interval used to set this variable domain to.public int value()
public boolean singleton(int val)
val
- value to which we compare the singleton of the variable.public int max()
public int min()
public void setDomain(IntDomain dom)
dom
- domain to which the current variable domain is set to.public void addDom(IntDomain dom)
dom
- the added domain.public IntDomain dom()
public boolean eq(IntVar var)
var
- the variable to which current variable is compared to.public int getSize()
public double getSizeFloat()
getSizeFloat
in class Var
public boolean isEmpty()
public void putModelConstraint(Constraint c, int pruningEvent)
putModelConstraint
in class Var
c
- the constraint which is being attached to the variable.pruningEvent
- type of the event which must occur to trigger the execution of the consistency function.public void putSearchConstraint(Constraint c)
putSearchConstraint
in class Var
c
- the constraint which is added as a search constraint.public IntDomain recentDomainPruning()
public void removeConstraint(Constraint c)
removeConstraint
in class Var
c
- the constraint being detached from the variable.public boolean singleton()
public int sizeConstraints()
sizeConstraints
in class Var
public int sizeConstraintsOriginal()
sizeConstraintsOriginal
in class Var
public int sizeSearchConstraints()
sizeSearchConstraints
in class Var
public int level()
level
in interface Backtrackable
level
in class Var
public String toStringFull()
toStringFull
in class Var
public void remove(int removedLevel)
Backtrackable
removedLevel
- level that is being removed.public void domainHasChanged(int event)
domainHasChanged
in class Var
event
- the type of the change (GROUND, BOUND, ANY).public void putConstraint(Constraint c)
Var
putConstraint
in class Var
c
- the constraint being attached to this variable.Copyright © 2022. All rights reserved.