kaos.autonomy.utility
Class InfluenceDiagramBuildingTools

java.lang.Object
  extended by kaos.autonomy.utility.InfluenceDiagramBuildingTools

public class InfluenceDiagramBuildingTools
extends java.lang.Object


Constructor Summary
InfluenceDiagramBuildingTools()
           
 
Method Summary
 void buildIndividualLink(Node[] childNode, Node[] parentNode)
          build link from child nodes to parent nodes (one-to-one)
 java.lang.String createStateList(java.lang.String[] states)
          create a single string that includes all individual states distinguished by comma
 void deleteNodes(Node[] tempNode)
          Removes all the nodes in node array from their net, and deletes them.
 void discretizeNode(Node[] tempNode, int num, double maxCostValue)
          discretize given nodes
 java.lang.String[] getParentStateList(NodeList parents)
          get the list of parents' state indices
 void instantiateNode(Net tempNet, Node[] tempNode, java.lang.String[] nodeType, int size, int num)
          instantiate Netica nodes
 void instantiateNode(Net tempNet, Node[] tempNode, java.lang.String[] nodeType, java.lang.String states, int num)
          instantiate Netica nodes
 boolean nextStates(int[] states, NodeList nodeList)
          get next states used for "enterValueToNodeFromParents()
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InfluenceDiagramBuildingTools

public InfluenceDiagramBuildingTools()
Method Detail

instantiateNode

public void instantiateNode(Net tempNet,
                            Node[] tempNode,
                            java.lang.String[] nodeType,
                            java.lang.String states,
                            int num)
instantiate Netica nodes

Parameters:
tempNet - A Bayesian decision network
tempNode - List of Netica nodes
nodeType - List of node features represented by strings (e.g., resource/service name)
states - List of states for the node features
num - Number of nodes to instantiate

instantiateNode

public void instantiateNode(Net tempNet,
                            Node[] tempNode,
                            java.lang.String[] nodeType,
                            int size,
                            int num)
instantiate Netica nodes

Parameters:
tempNet - A Bayesian decision network
tempNode - List of Netica nodes
nodeType - List of node features (e.g., resource/service name)
size - Number of levels (i.e., number of numeric values...mainly for cost node)
num - Number of nodes to instantiate

discretizeNode

public void discretizeNode(Node[] tempNode,
                           int num,
                           double maxCostValue)
discretize given nodes

Parameters:
tempNode - List of Netica nodes
num - Number of levels in discretization
maxCostValue - The value of the last level

buildIndividualLink

public void buildIndividualLink(Node[] childNode,
                                Node[] parentNode)
build link from child nodes to parent nodes (one-to-one)

Parameters:
childNode - List of child nodes
parentNode - List of parent nodes

nextStates

public boolean nextStates(int[] states,
                          NodeList nodeList)
                   throws NeticaException
get next states used for "enterValueToNodeFromParents()

Parameters:
states - States of the next node in a node list
nodeList - List of nodes
Returns:
boolean value wich tells success or failure
Throws:
NeticaException - if error in getting a node from a node list

createStateList

public java.lang.String createStateList(java.lang.String[] states)
create a single string that includes all individual states distinguished by comma

Parameters:
states - List of states
Returns:
String of list of states

getParentStateList

public java.lang.String[] getParentStateList(NodeList parents)
get the list of parents' state indices

Parameters:
parents - List of parent nodes
Returns:
Array of strings for parent node states

deleteNodes

public void deleteNodes(Node[] tempNode)
                 throws NeticaException
Removes all the nodes in node array from their net, and deletes them.

Parameters:
tempNode - the nodes to delete
Throws:
NeticaException