public class IntLVar extends LVar
USEJOLLYTOKEN
Constructor | Description |
---|---|
IntLVar() |
Constructs a not initialized integer logical variable with a default name.
|
IntLVar(java.lang.Integer value) |
Constructs a logical variable with an integer value and default name.
|
IntLVar(java.lang.Integer glb,
java.lang.Integer lub) |
Constructs an (unbound) logical variable with domain [
glb, lub ] with default name. |
IntLVar(java.lang.String name) |
Constructs a not initialized integer logical variable with the given name name.
|
IntLVar(java.lang.String name,
java.lang.Integer value) |
Constructs a logical variable with an integer value
value and a specified name. |
IntLVar(java.lang.String name,
java.lang.Integer glb,
java.lang.Integer lub) |
Constructs an (unbound) logical variable with domain [glb,lub] and with glb specified name.
|
IntLVar(java.lang.String name,
IntLVar intLVar) |
Constructs a logical variable equal to the logical variable
intLVar and with a specified name. |
IntLVar(java.lang.String name,
MultiInterval domain) |
Constructs an (unbound) logical variable with given domain and with a specified name.
|
IntLVar(IntLVar intLVar) |
Constructs a logical variable equal to the logical variable intLVar.
|
IntLVar(MultiInterval domain) |
Constructs an (unbound) logical variable with a given domain and default name.
|
Modifier and Type | Method | Description |
---|---|---|
IntLVar |
abs() |
Constructs and returns a logical variable which is the absolute value of
this . |
java.lang.Object |
accept(jsetl.Visitor visitor) |
Needed for the Visitor pattern.
|
IntLVar |
clone() |
Constructs and returns a (shallow) copy of this variable.
|
IntLVar |
div(java.lang.Integer integer) |
Constructs and returns a logical variable which is the (exact) division of
this with the parameter integer . |
IntLVar |
div(IntLVar intLVar) |
Constructs and returns a logical variable which is the (exact) division of
this with the parameter intLVar . |
Constraint |
dom(java.lang.Integer glb,
java.lang.Integer lub) |
Generates glb constraint which is satisfiable if and only if
this is in the interval [glb,lub] . |
Constraint |
dom(java.util.Set<java.lang.Integer> integers) |
Generates a constraint which is satisfiable if and only if
this is in the set integers . |
Constraint |
dom(MultiInterval multiInterval) |
Generates a constraint which is satisfiable if and only if
this is in the multi-interval multiInterval . |
Constraint |
eq(java.lang.Integer integer) |
Constraint of equality between
this and integer . |
Constraint |
eq(IntLVar intLVar) |
Constraint of equality between
this and intLVar . |
boolean |
equals(java.lang.Object other) |
Checks whether this variable is equal to the parameter
other . |
Constraint |
ge(java.lang.Integer integer) |
Constraint which is satisfied if and only if
this is greater than or equal to integer . |
Constraint |
ge(IntLVar intLVar) |
Constraint which is satisfied if and only if
this is greater than or equal to intLVar . |
Constraint |
getConstraint() |
Returns the constraint conjunction associated with this variable.
|
MultiInterval |
getDomain() |
Getter for domain.
|
java.lang.Integer |
getValue() |
returns the value of this variable, if it is initialized,
null otherwise. |
Constraint |
gt(java.lang.Integer integer) |
Constraint which is satisfied if and only if
this is greater than integer . |
Constraint |
gt(IntLVar intLVar) |
Constraint which is satisfied if and only if
this is greater than intLVar . |
Constraint |
in(MultiInterval multiInterval) |
Creates a constraint which is satisfiable if and only if
this is an element of multiInterval . |
Constraint |
in(SetLVar setLVar) |
Creates a constraint which is satisfiable if and only if
this is an element of setLVar . |
Constraint |
label() |
A constraint which labels this variable giving it subsequent values taken from its domain.
|
static Constraint |
label(java.util.List<IntLVar> list) |
A constraint which labels each variable in
list giving them subsequent values taken from their domains. |
static Constraint |
label(IntLVar... intLVars) |
A constraint which labels each variable in
intLVars giving them subsequent values taken from their domains. |
Constraint |
label(LabelingOptions labelingOptions) |
A constraint which labels this variable giving it subsequent values taken from its domain using the given labeling options.
|
static Constraint |
label(LabelingOptions labelingOptions,
java.util.List<IntLVar> list) |
A constraint which labels each variable in
list giving them subsequent values taken from their domains. |
static Constraint |
label(LabelingOptions labelingOptions,
IntLVar... intLVars) |
A constraint which labels each variable in
intLVars giving them subsequent values taken from their domains. |
Constraint |
label(ValHeuristic valHeuristic) |
A constraint which labels this variable giving it subsequent values taken from its domain using the given heuristic.
|
Constraint |
le(java.lang.Integer integer) |
Constraint which is satisfied if and only if
this is less than or equal to integer . |
Constraint |
le(IntLVar intLVar) |
Constraint which is satisfied if and only if
this is less than or equal to intLVar . |
Constraint |
lt(java.lang.Integer integer) |
Constraint which is satisfied if and only if
this is less than integer . |
Constraint |
lt(IntLVar intLVar) |
Constraint which is satisfied if and only if
this is less than intLVar . |
IntLVar |
mod(java.lang.Integer integer) |
Constructs and returns a logical variable which is equal to
this mod integer . |
IntLVar |
mod(IntLVar intLVar) |
Constructs and returns a logical variable which is equal to
this mod intLVar . |
IntLVar |
mul(java.lang.Integer integer) |
Constructs and returns a logical variable which is the multiplication of
this with the parameter integer . |
IntLVar |
mul(IntLVar intLVar) |
Constructs and returns a logical variable which is the multiplication of
this with the parameter intLVar . |
Constraint |
ndom(java.lang.Integer glb,
java.lang.Integer lub) |
Generates glb constraint which is satisfiable if and only if
this is not in the interval [glb,lub] . |
Constraint |
ndom(MultiInterval multiInterval) |
Generates a constraint which is satisfiable if and only if
this is not in the multi-interval multiInterval . |
Constraint |
neq(java.lang.Integer integer) |
Constraint of inequality between
this and integer . |
Constraint |
neq(IntLVar intLVar) |
Constraint of inequality between
this and intLVar . |
Constraint |
nin(MultiInterval multiInterval) |
Creates a constraint which is satisfiable if and only if
this is not an element of multiInterval . |
Constraint |
nin(SetLVar setLVar) |
Creates a constraint which is satisfiable if and only if
this is not an element of setLVar . |
void |
output() |
Prints the name, the value and the domain of this variable to standard output.
|
IntLVar |
setName(java.lang.String name) |
Sets the name of this logical variable to the given name, then returns it.
|
IntLVar |
setValue(java.lang.Object value) |
Sets the value of this logical variable then returns it.
|
IntLVar |
sub(java.lang.Integer integer) |
Constructs and returns a logical variable which is the subtraction of
this with the parameter integer . |
IntLVar |
sub(IntLVar intLVar) |
Constructs and returns a logical variable which is the subtraction of
this with the parameter intLVar . |
IntLVar |
sum(java.lang.Integer integer) |
Constructs and returns a logical variable which is the sum of
this with the parameter integer . |
IntLVar |
sum(IntLVar intLVar) |
Constructs and returns a logical variable which is the sum of
this with the parameter intLVar . |
IntLVar |
truncDiv(java.lang.Integer integer) |
Constructs and returns a logical variable which is the truncated division of
this with the parameter integer . |
IntLVar |
truncDiv(IntLVar intLVar) |
Constructs and returns a logical variable which is the truncated division of
this with the parameter intLVar |
public IntLVar()
public IntLVar(@NotNull java.lang.String name)
name
- the name of the variable.public IntLVar(@NotNull java.lang.Integer value) throws NotValidDomainException
value
- the value of the logical variable.NotValidDomainException
- if value
is not representable by MultiInterval
.public IntLVar(@NotNull java.lang.String name, @NotNull java.lang.Integer value) throws NotValidDomainException
value
and a specified name.name
- the name of the variable.value
- the value of the variable.NotValidDomainException
- if value
is not representable by MultiInterval
.public IntLVar(@NotNull IntLVar intLVar)
IntLVar
and posting and solving the constraint this.eq(intLVar)
.intLVar
- the logical variable to copy.public IntLVar(@NotNull java.lang.String name, @NotNull IntLVar intLVar)
intLVar
and with a specified name.
Using this constructor is equivalent to creating an unbound IntLVar
and posting and solving the constraint this.eq(intLVar)
.name
- the name of the variable.intLVar
- the logical variable to copy.public IntLVar(@NotNull java.lang.Integer glb, @NotNull java.lang.Integer lub) throws NotValidDomainException
glb, lub
] with default name.glb
- greatest lower bound of the domain.lub
- least upper bound of the domain.NotValidDomainException
- if [glb, lub
] is empty.public IntLVar(@NotNull java.lang.String name, @NotNull java.lang.Integer glb, @NotNull java.lang.Integer lub) throws NotValidDomainException
name
- name of the variable.glb
- greatest lower bound of the domain.lub
- least upper bound of the domain.NotValidDomainException
- if [glb, lub
] is empty.public IntLVar(@NotNull MultiInterval domain) throws NotValidDomainException
domain
- domain of the variable.NotValidDomainException
- if domain
is empty.public IntLVar(@NotNull java.lang.String name, @NotNull MultiInterval domain) throws NotValidDomainException
name
- name of the variable.domain
- domain of the variable.NotValidDomainException
- if domain
is empty.@NotNull public static Constraint label(@NotNull java.util.List<IntLVar> list)
list
giving them subsequent values taken from their domains.list
- list of integer variables to label. None of them can be null
.java.lang.NullPointerException
- if some of the values in list
is null
.@NotNull public static Constraint label(@NotNull LabelingOptions labelingOptions, @NotNull java.util.List<IntLVar> list)
list
giving them subsequent values taken from their domains.
It uses the given labeling options.labelingOptions
- labeling options to use.list
- list of integer variables to label. None of them can be null
.java.lang.NullPointerException
- if some of the values in list
is null
.@NotNull public static Constraint label(@NotNull IntLVar... intLVars)
intLVars
giving them subsequent values taken from their domains.intLVars
- array of integer variables to label. None of them can be null
.java.lang.NullPointerException
- if some of the values in intLVars
is null
.@NotNull public static Constraint label(@NotNull LabelingOptions labelingOptions, @NotNull IntLVar... intLVars)
intLVars
giving them subsequent values taken from their domains.
It uses the given labeling options.labelingOptions
- labeling options to use.intLVars
- array of integer variables to label. None of them can be null
.java.lang.NullPointerException
- if some of the values in intLVars
is null
.@NotNull public java.lang.Object accept(@NotNull jsetl.Visitor visitor)
@Nullable public java.lang.Integer getValue()
null
otherwise.@NotNull public IntLVar setName(@NotNull java.lang.String name)
@NotNull public IntLVar setValue(@NotNull java.lang.Object value)
@NotNull public Constraint getConstraint()
@NotNull public MultiInterval getDomain()
public boolean equals(@Nullable java.lang.Object other)
other
.public void output()
@NotNull public IntLVar sum(@NotNull IntLVar intLVar)
this
with the parameter intLVar
.intLVar
- the second parameter of the sum.this
with the parameter intLVar
.@NotNull public IntLVar sum(@NotNull java.lang.Integer integer)
this
with the parameter integer
.integer
- the second parameter of the sum.this
with the parameter integer
.@NotNull public IntLVar sub(@NotNull IntLVar intLVar)
this
with the parameter intLVar
.intLVar
- the second parameter of the subtraction.this
with the parameter intLVar
.@NotNull public IntLVar sub(@NotNull java.lang.Integer integer)
this
with the parameter integer
.integer
- the second parameter of the subtraction.this
with the parameter integer
.@NotNull public IntLVar mul(@NotNull IntLVar intLVar)
this
with the parameter intLVar
.intLVar
- the second parameter of the multiplication.this
with the parameter intLVar
.@NotNull public IntLVar mul(@NotNull java.lang.Integer integer)
this
with the parameter integer
.integer
- the second parameter of the multiplication.this
with the parameter integer
.@NotNull public IntLVar div(@NotNull IntLVar intLVar)
this
with the parameter intLVar
.intLVar
- the second parameter of the division.this
with the parameter intLVar
.@NotNull public IntLVar div(@NotNull java.lang.Integer integer)
this
with the parameter integer
.integer
- the second parameter of the division.this
with the parameter integer
.@NotNull public IntLVar truncDiv(@NotNull IntLVar intLVar)
this
with the parameter intLVar
intLVar
- the second parameter of the truncated divisionthis
with the parameter intLVar
@NotNull public IntLVar truncDiv(@NotNull java.lang.Integer integer)
this
with the parameter integer
.integer
- the second parameter of the truncated division.this
with the parameter integer
.@NotNull public IntLVar mod(@NotNull IntLVar intLVar)
this
mod intLVar
.intLVar
- the second parameter of the module.this
with the parameter intLVar
.@NotNull public IntLVar mod(@NotNull java.lang.Integer integer)
this
mod integer
.integer
- the second parameter of the module.this
with the parameter integer
.@NotNull public IntLVar abs()
this
.this
.@NotNull public Constraint eq(@NotNull IntLVar intLVar)
this
and intLVar
.intLVar
- second argument of equality.@NotNull public Constraint eq(@NotNull java.lang.Integer integer)
this
and integer
.integer
- second argument of equality.@NotNull public Constraint neq(@NotNull IntLVar intLVar)
this
and intLVar
.intLVar
- second argument of inequality.@NotNull public Constraint neq(@NotNull java.lang.Integer integer)
this
and integer
.integer
- second argument of inequality.@NotNull public Constraint le(@NotNull IntLVar intLVar)
this
is less than or equal to intLVar
.intLVar
- second argument of the constraint.@NotNull public Constraint le(@NotNull java.lang.Integer integer)
this
is less than or equal to integer
.integer
- second argument of the constraint.@NotNull public Constraint lt(@NotNull IntLVar intLVar)
this
is less than intLVar
.intLVar
- second argument of the constraint.@NotNull public Constraint lt(@NotNull java.lang.Integer integer)
this
is less than integer
.integer
- second argument of the constraint.@NotNull public Constraint ge(@NotNull IntLVar intLVar)
this
is greater than or equal to intLVar
.intLVar
- second argument of the constraint.@NotNull public Constraint ge(@NotNull java.lang.Integer integer)
this
is greater than or equal to integer
.integer
- second argument of the constraint.@NotNull public Constraint gt(@NotNull IntLVar intLVar)
this
is greater than intLVar
.intLVar
- second argument of the constraint.@NotNull public Constraint gt(@NotNull java.lang.Integer integer)
this
is greater than integer
.integer
- second argument of the constraint.@NotNull public Constraint in(@NotNull SetLVar setLVar)
this
is an element of setLVar
.setLVar
- a logical set, possibly uninitialized.this
is an element of setLVar
.@NotNull public Constraint in(@NotNull MultiInterval multiInterval)
this
is an element of multiInterval
.multiInterval
- a multi-interval.this
is an element of multiInterval
.@NotNull public Constraint nin(@NotNull SetLVar setLVar)
this
is not an element of setLVar
.setLVar
- a logical set, possibly uninitialized.this
is not an element of setLVar
.@NotNull public Constraint nin(@NotNull MultiInterval multiInterval)
this
is not an element of multiInterval
.multiInterval
- a multi-interval.this
is not an element of multiInterval
.@NotNull public Constraint dom(@NotNull java.lang.Integer glb, @NotNull java.lang.Integer lub) throws NotValidDomainException
this
is in the interval [glb,lub]
.glb
- greatest lower bound of the interval.lub
- least upper bound of the interval.NotValidDomainException
- if [glb, lub]
is empty.@NotNull public Constraint dom(@NotNull MultiInterval multiInterval) throws NotValidDomainException
this
is in the multi-interval multiInterval
.multiInterval
- the multi-interval.NotValidDomainException
- if multiInterval
is empty.@NotNull public Constraint dom(@NotNull java.util.Set<java.lang.Integer> integers)
this
is in the set integers
.integers
- the set of integers. It must not contain null
values.NotValidDomainException
- if integers
is empty.java.lang.NullPointerException
- if integers
contains null
values.@NotNull public Constraint ndom(@NotNull java.lang.Integer glb, @NotNull java.lang.Integer lub)
this
is not in the interval [glb,lub]
.glb
- greatest lower bound of the interval.lub
- least upper bound of the interval.@NotNull public Constraint ndom(@NotNull MultiInterval multiInterval) throws NotValidDomainException
this
is not in the multi-interval multiInterval
.multiInterval
- the multi-interval.NotValidDomainException
@NotNull public Constraint label()
@NotNull public Constraint label(@NotNull ValHeuristic valHeuristic)
valHeuristic
- the heuristic to use when labeling.@NotNull public Constraint label(@NotNull LabelingOptions labelingOptions)
labelingOptions
- labeling options to use.