IntegerVariable.addValue

IntegerVariable.addValue(*args)

Add a value to the list of values for the variable.

Parameters:

value (int) – the new value

Returns:

the Integer variable

Return type:

pyagrum.IntegerVariable

Raises:

pyagrum.DuplicateElement – If the variable already contains the value

Example

import pyagrum as gum

n = gum.IntegerVariable("n", "n", [1, 3, 10])
n.addValue(5)
print(n)
# n:Integer({1|3|5|10})

Class

IntegerVariable