InfluenceDiagram.erase
- InfluenceDiagram.erase(*args)
Erase a Variable from the network and remove the variable from all his childs.
If no variable matches the id, then nothing is done.
- Parameters:
id (
int) – The id of the variable to erase.var (
int | str | pyagrum.DiscreteVariable) – a variable’s id (int) or name or th reference on the variable to remove.
- Return type:
None
Example
import pyagrum as gum
diag = gum.fastID("C->*D->$U<-C")
diag.erase("U")
sorted(diag.names())
# ['C', 'D']
sorted(diag.arcs())
# [(0, 1)]
Class