KTBN.variable
- KTBN.variable(*args)
Returns the variable of a (process, slice) couple.
- Parameters:
base (
str) – the base name of the nodeslice (
int) – the slice of the node (ATEMPORALfor an atemporal node)node_name (
str) – alternatively, the node’s engine name
- Returns:
the variable
- Return type:
- Raises:
pyagrum.NotFound – if no such variable exists
pyagrum.OutOfBounds – if slice is out of range for a temporal variable
pyagrum.OperationNotAllowed – if the temporal/atemporal kind does not match slice
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