Create a set in MiniZinc
rminizinc::Expression
-> Set
.setVal
the value of the set
.isv
the integer range set
.fsv
the float range set
.et
empty set
.delete_flag
used to delete items
.setVal
the value of the set
.isv
the integer range set
.fsv
the float range set
.et
empty set
.delete_flag
used to delete items
new()
constuctor
Set$new(val = NULL, empty_set = FALSE)
val
the set value
empty_set
bool to specify is set is empty(FALSE by default)
getSetVec()
get the set expression
Set$getSetVec()
setSetVec()
set the set expression
Set$setSetVec(val)
val
list of expressions
isEmpty()
is the set empty
Set$isEmpty()
makeEmpty()
make the set empty
Set$makeEmpty()
getIsv()
return the integer set range
Set$getIsv()
setIsv()
set the integer set range
Set$setIsv(val)
val
integer set range
getFsv()
get the float set range
Set$getFsv()
setFsv()
set the float set range
Set$setFsv(val)
val
float set range
c_str()
get the MiniZinc representation
Set$c_str()
getDeleteFlag()
delete flag for internal use
Set$getDeleteFlag()
delete()
delete the assignment item
Set$delete()
clone()
The objects of this class are cloneable with this method.
Set$clone(deep = FALSE)
deep
Whether to make a deep clone.
# NOT RUN {
newIntSet = Set$new(val = IntSetVal$new(1,5))
newIntSet$c_str()
newIntSet$setIsv(IntSetVal$new(2,6))
newIntSet$c_str()
newFloatSet = Set$new(val = FloatSetVal$new(1.1,5.1))
newFloatSet$c_str()
newFloatSet$setFsv(FloatSetVal$new(1.2,4.1))
# }
Run the code above in your browser using DataLab