VarDecl
Contains different fields to create a variable declaration
newVarDecl = VarDecl$new(name = "n", type_inst = TypeInst$new(Type$new(base_type = "int", kind = "par"))) newVarDecl$c_str()
rminizinc::Expression
-> VarDecl
.ti
: type instantiation information
id
: name of the variable
.expression
: the initialization expression
.delete_flag
: used to delete items
.ti
: type instantiation information
id
: name of the variable
.expression
: the initialization expression
.delete_flag
: used to delete items
new()
constructor
VarDecl$new(name, type_inst, value = NULL)
name
: the identifier/name
type_inst
: type instantiation of the variable
value
: value of variable, NULL by default
getId()
get the identifier object
VarDecl$getId()
setId()
set the identifier object name
VarDecl$setId(name)
name
: name to be set
isPar()
check if it's a parameter
VarDecl$isPar()
isVar()
check if it's a decision variable
VarDecl$isVar()
setDomain()
overwrite the existing domain
VarDecl$setDomain(dom)
dom
: domain expression to be set
getDomain()
get the variable domain
VarDecl$getDomain()
getValue()
get the value
VarDecl$getValue()
setValue()
set the value
VarDecl$setValue(val)
val
: expression to be set (NULL to remove value)
ti()
get the type-inst of the variable declaration
VarDecl$ti()
c_str()
get the domain of the variable
return string representation of MiniZinc
VarDecl$c_str()
getDeleteFlag()
delete flag for internal use
VarDecl$getDeleteFlag()
delete()
delete the assignment item
VarDecl$delete()
clone()
The objects of this class are cloneable with this method.
VarDecl$clone(deep = FALSE)
deep
: Whether to make a deep clone.
Useful links