Instantiation.contains

Instantiation.contains(*args)

Indicates whether a given variable belongs to the Instantiation.

Parameters:

v (pyagrum.DiscreteVariable) – The variable for which the test is made.

Returns:

True if the variable is in the Instantiation.

Return type:

bool

Example

import pyagrum as gum

a, b = gum.LabelizedVariable("a", "a", 2), gum.LabelizedVariable("b", "b", 3)
i = gum.Instantiation()
i.add(a)
i.add(b)
i.contains(a)
# True
i.contains(gum.LabelizedVariable("c", "c", 2))
# False

Class

Instantiation