KTBN.variable

KTBN.variable(*args)

Returns the variable of a (process, slice) couple.

Parameters:
  • base (str) – the base name of the node

  • slice (int) – the slice of the node (ATEMPORAL for an atemporal node)

  • node_name (str) – alternatively, the node’s engine name

Returns:

the variable

Return type:

pyagrum.DiscreteVariable

Raises:

Example

import pyagrum as gum
import pyagrum.ktbn as ktbn

model = ktbn.KTBN.fromBN(gum.fastBN("X0->X1<-C"))  # a 2-TBN: process X, atemporal C
model.variable("X", 1).name()
# 'X[1]'
model.variable("C", ktbn.KTBN.ATEMPORAL).name()
# 'C'

Class

KTBN