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)

public class NodeFactory<NodeType extends Node> extends Object
Provides static methods for the creation of nodes.
  • Method Details

    • createFactory

      public static <NodeType extends Node> NodeFactory<NodeType> createFactory(Class<NodeType> nodeClass)
      Constructs a NodeFactory for nodes whose Class 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

      public NodeType createNode(String nameVariable, Dataset dataset)
      Creates a node given the name of its variable and the dataset where it appears.
      Parameters:
      nameVariable - name of the node
      dataset - 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

      public NodeType createNode(Node node)
      Creates a node from a given one.
      Parameters:
      node - a NodeType
      Returns:
      node a NodeType
    • createEmptyNode

      public NodeType createEmptyNode(Node node)
      Creates a node from a given one without storing its parameters or sufficient statistics.
      Parameters:
      node - a Node
      Returns:
      new node
    • createNodes

      public List<NodeType> createNodes(List<NodeType> nodes)
      Creates a list of nodes with the same attributes as those provided.
      Parameters:
      nodes - list of NodeType
      Returns:
      list of NodeType