public class SetVar extends Var
Modifier and Type | Field and Description |
---|---|
SetDomain |
domain
It specifies the current domain associated with this set variable.
|
Constructor and Description |
---|
SetVar()
No parameter, explicit, empty constructor for subclasses.
|
SetVar(Store store)
This constructor creates a variable with empty domain (standard
IntervalDomain domain), automatically generated name, and empty attached
constraint list.
|
SetVar(Store store,
int min,
int max)
This constructor creates a set variable with domain a set min..max
automatically generated name, and empty attached constraint list.
|
SetVar(Store store,
SetDomain dom)
It creates a variable in a given store, with a given name and
a given domain.
|
SetVar(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.
|
SetVar(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.
|
SetVar(Store store,
String name,
SetDomain dom)
It creates a variable in a given store, with a given name and
a given domain.
|
Modifier and Type | Method and Description |
---|---|
void |
addDom(int min,
int max)
It is possible to add the domain of variable.
|
void |
addDom(SetDomain dom)
It is possible to add the domain of variable.
|
SetDomain |
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(SetVar 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.
|
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.
|
SetDomain |
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(int min,
int max)
It is possible to set the domain of variable.
|
void |
setDomain(SetDomain dom)
It is possible to set the domain of variable.
|
boolean |
singleton()
It checks if the domain contains only one value.
|
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.
|
activity, addPositionMapping, addPositionMapping, afcValue, applyDecay, createEmptyPositioning, getStore, id, index, positionMapping, positionMapping, updateActivity
public SetDomain domain
public SetVar(Store store, String name, SetDomain 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 SetVar(Store store, SetDomain dom)
store
- store in which the variable is created.dom
- the domain of the variable being created.public SetVar()
public SetVar(Store store)
store
- store in which the variable is created.public SetVar(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 SetVar(Store store, String name)
store
- store in which the variable is created.name
- the name for the variable being created.public SetVar(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 void setDomain(SetDomain dom)
dom
- domain to which the current variable domain is set to.public void addDom(SetDomain dom)
dom
- the added domain.public SetDomain dom()
public boolean eq(SetVar 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 SetDomain 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.