java.lang.Cloneable
public class SetLVar extends LVar implements java.lang.Cloneable
SetInterval
USEJOLLYTOKEN
Constructor | Description |
---|---|
SetLVar() |
Constructs an unspecified logical set with default name.
|
SetLVar(java.lang.String name) |
Constructs an unspecified logical set with given name.
|
SetLVar(java.lang.String name,
java.util.Set<java.lang.Integer> integers) |
Constructs a new logical set with the given value and name.
|
SetLVar(java.lang.String name,
java.util.Set<java.lang.Integer> glb,
java.util.Set<java.lang.Integer> lub) |
Constructs glb logical variable set with domain
[glb,lub] with given name. |
SetLVar(java.lang.String name,
MultiInterval multiInterval) |
Constructs a new logical set with the given value and name.
|
SetLVar(java.lang.String name,
MultiInterval glb,
MultiInterval lub) |
Constructs glb logical variable set with domain
[glb,lub] with given name. |
SetLVar(java.lang.String name,
SetInterval domain) |
Constructs a set logical variable with the given domain and name.
|
SetLVar(java.lang.String name,
SetInterval domain,
java.lang.Integer cardinality) |
Constructs a set logical variable with the given domain, cardinality and name.
|
SetLVar(java.lang.String name,
SetInterval domain,
MultiInterval cardinalityDomain) |
Constructs a set logical variable with the given domain, cardinality domain and name.
|
SetLVar(java.lang.String name,
SetLVar setLVar) |
Constructs a copy of the parameter
setLVar with given name. |
SetLVar(java.util.Set<java.lang.Integer> integers) |
Constructs a new logical set with the given value and default name.
|
SetLVar(java.util.Set<java.lang.Integer> glb,
java.util.Set<java.lang.Integer> lub) |
Constructs glb logical variable set with domain
[glb,lub] with default name. |
SetLVar(MultiInterval multiInterval) |
Constructs a new logical set with the given value and default name.
|
SetLVar(MultiInterval glb,
MultiInterval lub) |
Constructs glb logical variable set with domain
[glb,lub] with default name. |
SetLVar(SetInterval domain) |
Constructs a set logical variable with the given domain and default name.
|
SetLVar(SetInterval domain,
java.lang.Integer cardinality) |
Constructs a domain logical variable with the given domain, cardinality and with default name.
|
SetLVar(SetInterval domain,
MultiInterval cardinalityDomain) |
Constructs a domain logical variable with the given domain, cardinality domain and with default name.
|
SetLVar(SetLVar setLVar) |
Constructs a copy of the parameter
setLVar with default name. |
Modifier and Type | Method | Description |
---|---|---|
java.lang.Object |
accept(jsetl.Visitor visitor) |
Needed for the visitor pattern.
|
IntLVar |
card() |
Creates and returns an integer logical variable representing the set cardinality.
|
SetLVar |
clone() |
Constructs and returns a bit-by-bit clone of
this . |
SetLVar |
compl() |
Returns a new logical set variable representing the complement of
this . |
SetLVar |
diff(MultiInterval multiInterval) |
Constructs and returns a new integer set logical variable which is equal to the difference
this - multiInterval . |
SetLVar |
diff(SetLVar setLVar) |
Constructs and returns a new integer set logical variable which is equal to the difference
this - setLVar . |
Constraint |
disj(MultiInterval multiInterval) |
Returns a new constraint which demands that
this and multiInterval are disjoint. |
Constraint |
disj(SetLVar setLVar) |
Returns a new constraint which demands that
this and setLVar are disjoint. |
Constraint |
dom(MultiInterval glb,
MultiInterval lub) |
Returns glb new constraint which demands that the domain of
this is contained in the set interval [glb,lub] . |
Constraint |
dom(SetInterval domain) |
Returns a new constraint which demands that the domain of
this is contained in the domain interval domain . |
Constraint |
eq(java.util.Collection<IntLVar> intLVars) |
Constructs and returns a constraint of the kind
this = {x_1, x_2, ..., x_n} where intLVars
is a collection of integer logical variables x_1, x_2, ..., x_n . |
Constraint |
eq(java.util.Collection<IntLVar> elements,
SetLVar rest) |
Constructs and returns a constraint of the kind
this = {x_1, x_2, ..., x_n | rest} where elements
is a collection of integer logical variables x_1, x_2, ..., x_n . |
Constraint |
eq(IntLVar element) |
Constructs and returns a constraint of the kind
this = {element} . |
Constraint |
eq(IntLVar[] intLVars) |
Constructs and returns a constraint of the kind
this = {x_1, x_2, ..., x_n} where intLVars
is an array of integer logical variables x_1, x_2, ..., x_n . |
Constraint |
eq(IntLVar[] elements,
SetLVar rest) |
Constructs and returns a constraint of the kind
this = {x_1, x_2, ..., x_n | R} where coll
is an array of integer logical variables x_1, x_2, ..., x_n . |
Constraint |
eq(IntLVar element,
SetLVar rest) |
Constructs and returns a constraint of the kind
this = {element | rest} . |
Constraint |
eq(MultiInterval multiInterval) |
Returns a new constraint which demands that
this == multiInterval . |
Constraint |
eq(SetLVar setLVar) |
Returns a new constraint which demands that
this == setLVar . |
boolean |
equals(java.lang.Object other) |
Tests whether
this is equal to other . |
Constraint |
getConstraint() |
Gets the constraint associated with this logical set variable.
|
SetInterval |
getDomain() |
Gets the domain of this logical set variable.
|
MultiInterval |
getValue() |
Returns the value of the set (as a multi-interval).
|
SetLVar |
intersect(MultiInterval multiInterval) |
Creates and returns a new integer set variable which is the intersection of
this and multiInterval . |
SetLVar |
intersect(SetLVar setLVar) |
Creates and returns a new integer set variable which is the intersection of
this and setLVar . |
Constraint |
label() |
Returns a labeling constraint for this with default labeling options.
|
static Constraint |
label(java.util.List<SetLVar> setLVars) |
Returns a labeling constraint for each
SetLVar in setLVars with default labeling options. |
Constraint |
label(LabelingOptions labelingOptions) |
Returns a labeling constraint for this with given labeling options.
|
static Constraint |
label(LabelingOptions labelingOptions,
java.util.List<SetLVar> setLVars) |
Returns a labeling constraint for each
SetLVar in setLVars with given labeling options. |
static Constraint |
label(LabelingOptions labelingOptions,
SetLVar... setLVars) |
Returns a labeling constraint for each
SetLVar in setLVars with given labeling options. |
static Constraint |
label(SetLVar... setLVars) |
Returns a labeling constraint for each
SetLVar in setLVars with default labeling options. |
Constraint |
neq(MultiInterval multiInterval) |
Returns a new constraint which demands that
this != multiInterval . |
Constraint |
neq(SetLVar setLVar) |
Returns a new constraint which demands that
this != setLVar . |
void |
output() |
Outputs info about
this to standard output. |
SetLVar |
setName(java.lang.String name) |
Sets the name of the set.
|
static SetLVar |
singleton(IntLVar element) |
Constructs and returns a new integer set variable which is the singleton
{element} . |
Constraint |
strictSubset(MultiInterval multiInterval) |
Returns a new constraint which demands that
this is a strict subset of multiInterval . |
Constraint |
strictSubset(SetLVar setLVar) |
Returns a new constraint which demands that
this is a strict subset of setLVar . |
Constraint |
subset(MultiInterval multiInterval) |
Returns a new constraint which demands that
this is a subset of multiInterval . |
Constraint |
subset(SetLVar setLVar) |
Returns a new constraint which demands that
this is a subset of setLVar . |
SetLVar |
union(MultiInterval multiInterval) |
Constructs and returns a new integer set variable which is the result of the union of
this and multiInterval . |
SetLVar |
union(SetLVar setLVar) |
Constructs and returns a new integer set variable which is the result of the union of
this and setLVar . |
public SetLVar()
public SetLVar(@NotNull java.lang.String name)
name
- name of the set.public SetLVar(@NotNull MultiInterval multiInterval) throws NotValidDomainException
multiInterval
- the value of this logical set.NotValidDomainException
public SetLVar(@NotNull java.lang.String name, @NotNull MultiInterval multiInterval) throws NotValidDomainException
name
- name of the set.multiInterval
- the value of this logical set.NotValidDomainException
public SetLVar(@NotNull java.util.Set<java.lang.Integer> integers) throws NotValidDomainException
integers
- the value of this logical set.NotValidDomainException
public SetLVar(@NotNull java.lang.String name, @NotNull java.util.Set<java.lang.Integer> integers) throws NotValidDomainException
name
- name of the set.integers
- the value of this logical set.NotValidDomainException
public SetLVar(@NotNull SetLVar setLVar)
setLVar
with default name.
Using this constructor is equivalent to creating a new unbound SetLVar
and posting and solving the constraint this.eq(setLVar)
.setLVar
- set to copy.public SetLVar(@NotNull java.lang.String name, @NotNull SetLVar setLVar)
setLVar
with given name.
Using this constructor is equivalent to creating a new unbound SetLVar
and posting and solving the constraint this.eq(setLVar)
.name
- name of the set.setLVar
- set to copy.public SetLVar(@NotNull MultiInterval glb, @NotNull MultiInterval lub) throws NotValidDomainException
[glb,lub]
with default name.glb
- greatest lower bound of the domain set interval.lub
- least upper bound of the domain set interval.NotValidDomainException
- if the domain [glb,lub]
is empty.public SetLVar(@NotNull java.lang.String name, @NotNull MultiInterval glb, @NotNull MultiInterval lub) throws NotValidDomainException
[glb,lub]
with given name.name
- name of the sglb
- greatest lower bound of the domain set intervallub
- least upper bound of the domain set intervalNotValidDomainException
- if the domain [glb,lub]
is empty.public SetLVar(@NotNull java.util.Set<java.lang.Integer> glb, @NotNull java.util.Set<java.lang.Integer> lub) throws NotValidDomainException
[glb,lub]
with default name.glb
- greatest lower bound of the domain set interval.lub
- least upper bound of the domain set interval.NotValidDomainException
- if the domain [glb,lub]
is empty.public SetLVar(@NotNull java.lang.String name, @NotNull java.util.Set<java.lang.Integer> glb, @NotNull java.util.Set<java.lang.Integer> lub) throws NotValidDomainException
[glb,lub]
with given name.name
- name of the sglb
- greatest lower bound of the domain set intervallub
- least upper bound of the domain set intervalNotValidDomainException
- if the domain [glb,lub]
is empty.public SetLVar(@NotNull SetInterval domain) throws NotValidDomainException
domain
- the domain of the set.NotValidDomainException
- if the domain set
is empty.public SetLVar(@NotNull java.lang.String name, @NotNull SetInterval domain) throws NotValidDomainException
name
- name of the set.domain
- the domain of the set.NotValidDomainException
- if the domain set
is empty.public SetLVar(@NotNull SetInterval domain, @NotNull java.lang.Integer cardinality) throws NotValidDomainException
domain
- the domain of the domain.cardinality
- cardinality of the domain.NotValidDomainException
- if the domain domain
is empty.public SetLVar(java.lang.String name, SetInterval domain, java.lang.Integer cardinality)
name
- name of the set.domain
- the domain of the set.cardinality
- cardinality of the set.NotValidDomainException
- if the domain set
is empty.public SetLVar(@NotNull SetInterval domain, @NotNull MultiInterval cardinalityDomain) throws NotValidDomainException
domain
- the domain of the domaincardinalityDomain
- domain of the cardinalityNotValidDomainException
- if the domain domain
or the domain of cardinality are emptypublic SetLVar(@NotNull java.lang.String name, @NotNull SetInterval domain, @NotNull MultiInterval cardinalityDomain) throws NotValidDomainException
name
- name of the set.domain
- the domain of the set.cardinalityDomain
- domain of the cardinality.NotValidDomainException
- if the domain set
or the domain of cardinality are empty.@NotNull public static SetLVar singleton(@NotNull IntLVar element)
{element}
.element
- the only element of the singleton.@NotNull public static Constraint label(@NotNull java.util.List<SetLVar> setLVars)
SetLVar
in setLVars
with default labeling options.setLVars
- list containing the set logical variables to label. It must not contain null
values.java.lang.NullPointerException
- if setLVars
contains null
values.@NotNull public static Constraint label(@NotNull LabelingOptions labelingOptions, @NotNull java.util.List<SetLVar> setLVars)
SetLVar
in setLVars
with given labeling options.labelingOptions
- labeling options to use.setLVars
- list containing the set logical variables to label. It must not contain null
values.java.lang.NullPointerException
- if setLVars
contains null
values.@NotNull public static Constraint label(@NotNull SetLVar... setLVars)
SetLVar
in setLVars
with default labeling options.setLVars
- array containing the set logical variables to label. It must not contain null
values.java.lang.NullPointerException
- if setLVars
contains null
values.@NotNull public static Constraint label(@NotNull LabelingOptions labelingOptions, @NotNull SetLVar... setLVars)
SetLVar
in setLVars
with given labeling options.labelingOptions
- labeling options to use.setLVars
- array containing the set logical variables to label. It must not contain null
values.java.lang.NullPointerException
- if setLVars
contains null
values.@Nullable public MultiInterval getValue()
@NotNull public SetInterval getDomain()
@NotNull public Constraint getConstraint()
@Nullable public java.lang.Object accept(@NotNull jsetl.Visitor visitor)
public boolean equals(@Nullable java.lang.Object other)
this
is equal to other
.public SetLVar clone()
this
.public void output()
this
to standard output.
The output is of the form
"name = value -- Domain : domain -- Size: cardinality_size[ -- Constraint: constraint]\n"@NotNull public IntLVar card()
@NotNull public Constraint dom(@NotNull MultiInterval glb, @NotNull MultiInterval lub)
this
is contained in the set interval [glb,lub]
.glb
- greatest lower bound of the set interval.lub
- least upper bound of the set interval.@NotNull public Constraint dom(@NotNull SetInterval domain)
this
is contained in the domain interval domain
.domain
- domain interval.@NotNull public Constraint eq(@NotNull SetLVar setLVar)
this == setLVar
.setLVar
- logical set variable.@NotNull public Constraint eq(@NotNull MultiInterval multiInterval)
this == multiInterval
.multiInterval
- multi-interval.@NotNull public Constraint neq(@NotNull SetLVar setLVar)
this != setLVar
.setLVar
- logical set variable.@NotNull public Constraint neq(@NotNull MultiInterval multiInterval)
this != multiInterval
.multiInterval
- multi-interval.@NotNull public SetLVar compl()
this
.this
.@NotNull public Constraint disj(@NotNull SetLVar setLVar)
this
and setLVar
are disjoint.setLVar
- the other integer set.@NotNull public Constraint disj(@NotNull MultiInterval multiInterval)
this
and multiInterval
are disjoint.multiInterval
- the other integer set.@NotNull public Constraint strictSubset(@NotNull SetLVar setLVar)
this
is a strict subset of setLVar
.setLVar
- the other integer set.@NotNull public Constraint strictSubset(@NotNull MultiInterval multiInterval)
this
is a strict subset of multiInterval
.multiInterval
- the other integer set.@NotNull public Constraint subset(@NotNull SetLVar setLVar)
this
is a subset of setLVar
.setLVar
- the other integer set.@NotNull public Constraint subset(@NotNull MultiInterval multiInterval)
this
is a subset of multiInterval
.multiInterval
- the other integer set.@NotNull public SetLVar intersect(@NotNull SetLVar setLVar)
this
and setLVar
.setLVar
- the other argument of the intersection.SetLVar
, i.e. the intersection.@NotNull public SetLVar intersect(@NotNull MultiInterval multiInterval)
this
and multiInterval
.multiInterval
- the other argument of the intersection.SetLVar
, i.e. the intersection.@NotNull public SetLVar union(@NotNull SetLVar setLVar)
this
and setLVar
.setLVar
- the other argument of union.SetLVar
, i.e. the union.@NotNull public SetLVar union(@NotNull MultiInterval multiInterval)
this
and multiInterval
.multiInterval
- the other argument of union.SetLVar
, i.e. the union.@NotNull public Constraint eq(@NotNull IntLVar element)
this = {element}
.element
- an integer logical variable.@NotNull public Constraint eq(@NotNull IntLVar[] intLVars)
this = {x_1, x_2, ..., x_n}
where intLVars
is an array of integer logical variables x_1, x_2, ..., x_n
.intLVars
- an array of integer logical variables. None of its elements can be null
.@NotNull public Constraint eq(@NotNull java.util.Collection<IntLVar> intLVars)
this = {x_1, x_2, ..., x_n}
where intLVars
is a collection of integer logical variables x_1, x_2, ..., x_n
.intLVars
- a collection of integer logical variables.@NotNull public Constraint eq(@NotNull IntLVar element, @NotNull SetLVar rest)
this = {element | rest}
.element
- one known element of the second set.rest
- the rest of the second set.@NotNull public Constraint eq(@NotNull java.util.Collection<IntLVar> elements, @NotNull SetLVar rest)
this = {x_1, x_2, ..., x_n | rest}
where elements
is a collection of integer logical variables x_1, x_2, ..., x_n
.elements
- a collection of integer logical variables. None of its elements can be null
.rest
- the rest of the second set in the equality.@NotNull public Constraint eq(@NotNull IntLVar[] elements, @NotNull SetLVar rest)
this = {x_1, x_2, ..., x_n | R}
where coll
is an array of integer logical variables x_1, x_2, ..., x_n
.elements
- an array of integer logical variables. None of its elements can be null
.rest
- the rest of the second set in the equality.@NotNull public SetLVar diff(@NotNull SetLVar setLVar)
this - setLVar
.setLVar
- second argument of the difference.@NotNull public SetLVar diff(@NotNull MultiInterval multiInterval)
this - multiInterval
.multiInterval
- second argument of the difference.@NotNull public Constraint label()
@NotNull public Constraint label(@NotNull LabelingOptions labelingOptions)
labelingOptions
- labeling options to use.