Types of variables
Posted on Mon 17 April 2017 in pyAgrum
There are 3 types of discrete random variables in aGrUM/pyAgrum : LabelizedVariable
, DiscretizedVariable
and RangeVariable
. The 3 types are mainly provided in order to ease the modelisation. Derived from DiscreteVariable
, they share a common API
{% include_code types-of-variables_common.pytest lang:python lines:5-100 %}
They essentially differ by the means to create, name and access to their modalities.
- Labelized variables
gum.LabelizedVariable
represents a variable with a list of labels that can be managed.
{% include_code types-of-variables_labelized.pytest lang:python lines:3-100 %}
- Discretized variables
gum.DiscretizedVariable
represents a variable with a list of ticks that discretize the variable domain.
{% include_code types-of-variables_discretized.pytest lang:python lines:3-100 %}
- Range variables
gum.RangeVariable
represents a variable with a range of integers as domain.
{% include_code types-of-variables_range.pytest lang:python lines:3-100 %}