public interface IntVar
Modifier and Type | Method and Description |
---|---|
void |
assign(int v)
Assigns the specified value
|
boolean |
contains(int v)
Returns true if the domain contains the specified value.
|
int |
fillArray(int[] dest)
Copies the values of the domain into an array.
|
Solver |
getSolver()
Returns the solver in which this variable was created.
|
boolean |
isBound()
Returns true if the domain of the variable has a single value.
|
int |
max()
Returns the maximum of the domain of the variable
|
int |
min()
Returns the minimum of the domain of the variable
|
void |
propagateOnBind(Constraint c)
Asks that
Constraint.propagate() is called whenever the domain
of this variable is reduced to a singleton. |
void |
propagateOnBoundChange(Constraint c)
Asks that
Constraint.propagate() is called whenever the
bound (maximum or minimum values) of the domain
of this variable is changes. |
void |
propagateOnDomainChange(Constraint c)
Asks that
Constraint.propagate() is called whenever the domain
of this variable changes. |
void |
remove(int v)
Removes the specified value.
|
void |
removeAbove(int v)
Remove all the values above a given value
|
void |
removeBelow(int v)
Remove all the values less than a given value
|
int |
size()
Returns the size of the domain of the variable
|
void |
whenBind(Procedure f)
Asks that the closure is called whenever the domain
of this variable is reduced to a single setValue
|
void |
whenBoundsChange(Procedure f)
Asks that the closure is called whenever
the max or min setValue of the domain of this variable changes
|
void |
whenDomainChange(Procedure f)
Asks that the closure is called whenever the domain change
of this variable changes
|
Solver getSolver()
void whenBind(Procedure f)
f
- the closurevoid whenBoundsChange(Procedure f)
f
- the closurevoid whenDomainChange(Procedure f)
f
- the closurevoid propagateOnDomainChange(Constraint c)
Constraint.propagate()
is called whenever the domain
of this variable changes.
We say that a change event occurs.c
- the constraint for which the Constraint.propagate()
method should be called on change events of this variable.void propagateOnBind(Constraint c)
Constraint.propagate()
is called whenever the domain
of this variable is reduced to a singleton.
In such a state the variable is bind and we say that a bind event occurs.c
- the constraint for which the Constraint.propagate()
method should be called on bind events of this variable.void propagateOnBoundChange(Constraint c)
Constraint.propagate()
is called whenever the
bound (maximum or minimum values) of the domain
of this variable is changes.
We say that a bound change event occurs in this case.c
- the constraint for which the Constraint.propagate()
method should be called on bound change events of this variable.int min()
int max()
int size()
int fillArray(int[] dest)
dest
- an array large enough dest.length >= size()
dest[0,...,size-1]
contains
the values in the domain in an arbitrary orderboolean isBound()
boolean contains(int v)
v
- the value whose presence in the domain is to be testedvoid remove(int v)
v
- the value to removeInconsistencyException
- is thrown if the domain becomes emptyvoid assign(int v)
v
- the value to assign.InconsistencyException
- is thrown if the value is not in the domainvoid removeBelow(int v)
v
- the value such that all the values less than v are removedInconsistencyException
- is thrown if the domain becomes emptyvoid removeAbove(int v)
v
- the value such that all the values larger than v are removedInconsistencyException
- is thrown if the domain becomes emptyCopyright © 2018 Laurent Michel, Pierre Schaus, Pascal Van Hentenryck. All rights reserved.