VarDecl function

VarDecl

VarDecl

Contains different fields to create a variable declaration

Examples

newVarDecl = VarDecl$new(name = "n", type_inst = TypeInst$new(Type$new(base_type = "int", kind = "par"))) newVarDecl$c_str()

Super class

rminizinc::Expression -> VarDecl

Public fields

  • .ti: type instantiation information

  • id: name of the variable

  • .expression: the initialization expression

  • .delete_flag: used to delete items

Active bindings

  • .ti: type instantiation information

  • id: name of the variable

  • .expression: the initialization expression

  • .delete_flag: used to delete items

Methods

Public methods

Method new()

constructor

Usage

VarDecl$new(name, type_inst, value = NULL)

Arguments

  • name: the identifier/name

  • type_inst: type instantiation of the variable

  • value: value of variable, NULL by default

Method getId()

get the identifier object

Usage

VarDecl$getId()

Method setId()

set the identifier object name

Usage

VarDecl$setId(name)

Arguments

  • name: name to be set

Method isPar()

check if it's a parameter

Usage

VarDecl$isPar()

Method isVar()

check if it's a decision variable

Usage

VarDecl$isVar()

Method setDomain()

overwrite the existing domain

Usage

VarDecl$setDomain(dom)

Arguments

  • dom: domain expression to be set

Method getDomain()

get the variable domain

Usage

VarDecl$getDomain()

Method getValue()

get the value

Usage

VarDecl$getValue()

Method setValue()

set the value

Usage

VarDecl$setValue(val)

Arguments

  • val: expression to be set (NULL to remove value)

Method ti()

get the type-inst of the variable declaration

Usage

VarDecl$ti()

Method c_str()

get the domain of the variable

return string representation of MiniZinc

Usage

VarDecl$c_str()

Method getDeleteFlag()

delete flag for internal use

Usage

VarDecl$getDeleteFlag()

Method delete()

delete the assignment item

Usage

VarDecl$delete()

Method clone()

The objects of this class are cloneable with this method.

Usage

VarDecl$clone(deep = FALSE)

Arguments

  • deep: Whether to make a deep clone.

  • Maintainer: Akshit Achara
  • License: Mozilla Public License Version 2.0
  • Last published: 2021-10-15