DiscreteVariable.isTick

DiscreteVariable.isTick(x)

Returns whether x is a tick for the variable

Parameters:

x (float) – the value for which we want to know if it is a tick for the variable

Raises:

NotImplementedError – If the variable is not a pyagrum.DiscretizedVariable

Returns:

bool

whether x is a tick for the variable, i.e. whether x belongs to the variable’s domain

Example

import pyagrum as gum

v = gum.fastVariable("x[0:10:5]")  # a DiscretizedVariable
v.isTick(4)
# True
v.isTick(5)
# False

Used by

DiscreteVariable, IntegerVariable, LabelizedVariable, NumericalDiscreteVariable, RangeVariable

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

Overridden in

DiscretizedVariable.isTick