DiscreteVariable.isLabel

DiscreteVariable.isLabel(s)

returns whether s is a label of the variable

Raises:

NotImplementedError – If the variable is not a pyagrum.LabelizedVariable

Return type:

bool

Returns:

bool

True if s is a label of the variable, False otherwise

Parameters:

s (str)

Example

import pyagrum as gum

v = gum.fastVariable("c{red|green}")  # a LabelizedVariable
v.isLabel("red")
# True
v.isLabel("blue")
# False

Used by

DiscreteVariable, DiscretizedVariable, IntegerVariable, NumericalDiscreteVariable, RangeVariable

Inheritance diagram of pyagrum.DiscreteVariable, pyagrum.DiscretizedVariable, pyagrum.IntegerVariable, pyagrum.NumericalDiscreteVariable, pyagrum.RangeVariable

Overridden in

LabelizedVariable.isLabel