CTBN.parentNames

CTBN.parentNames(val)
Parameters:

val (int | str) – The variable’s name or id.

Returns:

A list containing the names of the variable’s parents.

Return type:

list[str]

Raises:

pyagrum.NotFound – If the variable isn’t in the CTBN.

Example

import pyagrum as gum
import pyagrum.ctbn as ct

ctbn = ct.CTBN()
ctbn.add(gum.LabelizedVariable("A", "A", ["a0", "a1"]))
ctbn.add(gum.LabelizedVariable("B", "B", ["b0", "b1"]))
ctbn.addArc("A", "B")
ctbn.parentNames("B")
# ['A']

Class

CTBN