public abstract class Var extends Object implements Backtrackable
Modifier and Type | Field and Description |
---|---|
String |
id
Id string of the variable.
|
static AtomicInteger |
idNumber
It is a counter to indicate number of created variables.
|
int |
index
It specifies the index at which it is stored in Store.
|
Store |
store
Each variable is created in a store.
|
int |
weight
It specifies the current weight of the variable.
|
Constructor and Description |
---|
Var() |
Modifier and Type | Method and Description |
---|---|
double |
activity() |
static <T extends Var> |
addPositionMapping(Map<T,Integer> position,
T[] list,
boolean skipSingletons,
Class clazz) |
static <T extends Var,R> |
addPositionMapping(Map<T,R> position,
T[] list,
Function<T,R> function,
boolean skipSingletons,
Class clazz) |
float |
afcValue() |
void |
applyDecay() |
static <T extends Var,R> |
createEmptyPositioning() |
abstract Domain |
dom()
This function returns current domain of the variable.
|
abstract void |
domainHasChanged(int event)
It informs the variable that its variable has changed according to the specified event.
|
abstract int |
getSize()
It returns the size of the current domain.
|
abstract double |
getSizeFloat()
It returns the size of the current domain.
|
Store |
getStore()
This function returns store used by this variable.
|
String |
id()
This function returns variable id.
|
int |
index()
This function returns the index of variable in store array.
|
abstract boolean |
isEmpty()
It checks if the domain is empty.
|
abstract int |
level()
This function returns stamp of the current domain of variable.
|
static <T extends Var> |
positionMapping(T[] list,
boolean skipSingletons,
Class clazz) |
static <T extends Var,R> |
positionMapping(T[] list,
Function<T,R> function,
boolean skipSingletons,
Class clazz) |
abstract void |
putConstraint(Constraint c)
It registers constraint with current variable, so anytime this variable
is changed the constraint is reevaluated.
|
abstract void |
putModelConstraint(Constraint c,
int pruningEvent)
It registers constraint with current variable, so anytime this variable
is changed the constraint is reevaluated.
|
abstract void |
putSearchConstraint(Constraint c)
It registers constraint with current variable, so always when this variable
is changed the constraint is reevaluated.
|
abstract void |
removeConstraint(Constraint c)
It detaches constraint from the current variable, so change in variable
will not cause constraint reevaluation.
|
abstract boolean |
singleton()
It checks if the domain contains only one value.
|
abstract int |
sizeConstraints()
It returns current number of constraints which are associated with
variable and are not yet satisfied.
|
abstract int |
sizeConstraintsOriginal()
It returns all constraints which are associated with variable, even the
ones which are already satisfied.
|
abstract int |
sizeSearchConstraints()
It returns current number of constraints which are associated with
variable and are not yet satisfied.
|
abstract String |
toStringFull()
It returns the string representation of the variable using the full representation
of the domain.
|
void |
updateActivity() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
remove
public static final AtomicInteger idNumber
public String id
public int index
public int weight
public Store store
public abstract Domain dom()
public abstract int getSize()
public abstract double getSizeFloat()
public abstract boolean isEmpty()
public abstract void putModelConstraint(Constraint c, int pruningEvent)
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 abstract void putSearchConstraint(Constraint c)
c
- the constraint which is added as a search constraint.public abstract void removeConstraint(Constraint c)
c
- the constraint being detached from the variable.public abstract boolean singleton()
public abstract int sizeConstraints()
public abstract int sizeConstraintsOriginal()
public abstract int sizeSearchConstraints()
public abstract int level()
level
in interface Backtrackable
public abstract String toStringFull()
public abstract void domainHasChanged(int event)
event
- the type of the change (GROUND, BOUND, ANY).public abstract void putConstraint(Constraint c)
c
- the constraint being attached to this variable.public Store getStore()
public String id()
public int index()
index
in interface Backtrackable
public float afcValue()
public void updateActivity()
public double activity()
public void applyDecay()
public static <T extends Var> Map<T,Integer> positionMapping(T[] list, boolean skipSingletons, Class clazz)
public static <T extends Var> void addPositionMapping(Map<T,Integer> position, T[] list, boolean skipSingletons, Class clazz)
public static <T extends Var,R> Map<T,R> positionMapping(T[] list, Function<T,R> function, boolean skipSingletons, Class clazz)
Copyright © 2022. All rights reserved.