Module es.upm.fi.cig.multictbnc
Package es.upm.fi.cig.multictbnc.nodes
Class NodeFactory<NodeType extends Node>
java.lang.Object
es.upm.fi.cig.multictbnc.nodes.NodeFactory<NodeType>
- Type Parameters:
NodeType
- type of nodes that will be created, e.g., nodes with conditional probability tables (CPTNode
) or conditional intensity matrices (@code CIMNode)
Provides static methods for the creation of nodes.
-
Method Summary
Modifier and TypeMethodDescriptioncreateEmptyNode
(Node node) Creates a node from a given one without storing its parameters or sufficient statistics.static <NodeType extends Node>
NodeFactory<NodeType>createFactory
(Class<NodeType> nodeClass) Constructs aNodeFactory
for nodes whoseClass
is passed as a parameter.createNode
(Node node) Creates a node from a given one.createNode
(String nameVariable, Dataset dataset) Creates a node given the name of its variable and the dataset where it appears.createNodes
(List<NodeType> nodes) Creates a list of nodes with the same attributes as those provided.
-
Method Details
-
createFactory
public static <NodeType extends Node> NodeFactory<NodeType> createFactory(Class<NodeType> nodeClass) Constructs aNodeFactory
for nodes whoseClass
is passed as a parameter.- Type Parameters:
NodeType
- type of nodes to be generated- Parameters:
nodeClass
-Class
of the nodes to be generated- Returns:
- a
NodeFactory
-
createNode
Creates a node given the name of its variable and the dataset where it appears.- Parameters:
nameVariable
- name of the nodedataset
- dataset where the variable of the node appears. It is used to extract the states of the variable and to define it as a class variable or not- Returns:
- node a
NodeType
-
createNode
Creates a node from a given one.- Parameters:
node
- aNodeType
- Returns:
- node a
NodeType
-
createEmptyNode
Creates a node from a given one without storing its parameters or sufficient statistics.- Parameters:
node
- aNode
- Returns:
- new node
-
createNodes
Creates a list of nodes with the same attributes as those provided.- Parameters:
nodes
- list ofNodeType
- Returns:
- list of
NodeType
-