kaos.autonomy.utility
Class InfluenceDiagramBuildingTools

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

public class InfluenceDiagramBuildingTools
extends java.lang.Object


Constructor Summary
InfluenceDiagramBuildingTools(KaaGUI g)
           
 
Method Summary
 void buildIndividualLink(Node[] childNode, Node parentNode)
          build link from child nodes to a parent
 void buildIndividualLink(Node[] childNode, Node[] parentNode)
          build link from child nodes to parent nodes (one-to-one)
 void buildIndividualLink(Node childNode, Node parentNode)
          build link from a child nodes to a parent node
 void buildIndividualLink(Node childNode, Node[] parentNode)
          build link from a child nodes to parent nodes
 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 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
 void discretizeNode(Node tempNode, int num, double maxCostValue)
          discretize a given node
 java.lang.String[] getParentStateList(NodeList parents)
          get the list of parents' state indices
 java.util.Vector getParentStateVector(NodeList parents)
           
 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(KaaGUI g)
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

discretizeNode

public void discretizeNode(Node tempNode,
                           int num,
                           double maxCostValue)
discretize a given node

Parameters:
tempNode - A 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

buildIndividualLink

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

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

buildIndividualLink

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

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

buildIndividualLink

public void buildIndividualLink(Node childNode,
                                Node parentNode)
build link from a child nodes to a parent node

Parameters:
childNode - a child node
parentNode - a parent node

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

getParentStateVector

public java.util.Vector getParentStateVector(NodeList parents)

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

deleteNodes

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

Parameters:
tempNode - the node to delete
Throws:
NeticaException