unbbayes.prs.hybridbn
Class GaussianMixture

java.lang.Object
  extended by unbbayes.prs.hybridbn.GaussianMixture
All Implemented Interfaces:
IInferenceAlgorithm

public class GaussianMixture
extends Object
implements IInferenceAlgorithm

Gaussian Mixture inference algorithm. It calculates the prior (compilation) for the discrete nodes and the mean and variance for the continuous nodes. The propagation is not yet implemented.

Author:
Rommel Carvalho

Field Summary
protected  ProbabilisticNetwork clonedPN
           
protected  List<Node> nodeOrderQueue
           
protected  ProbabilisticNetwork pn
           
 
Constructor Summary
GaussianMixture()
          Default constructor - created for plugin support
GaussianMixture(ProbabilisticNetwork pn)
           
 
Method Summary
protected  void addAdjacentNodes(Node node, List<Node> nodeInNetwork)
           
protected  void addToOrderQueue(ArrayList<Node> children, boolean[] nodeAddedList)
          Take the children of a node that have already been added to the queue.
protected  ProbabilisticNetwork clonePN(ProbabilisticNetwork network)
          As I am not sure if the clone methods are corrected.
protected  void createOrderQueue()
          Creates the queue of the nodes that are going to be analyzed.
 String getDescription()
          Obtains the description of this algorithm.
protected  Integer getIndexInQueue(Node node)
          Retrieves the node's index in the queue.
 String getName()
          Obtains the name of this algorithm
 Graph getNetwork()
           
 List<Node> getNodeOrderQueue()
          Return the order the nodes are in the sampled matrix.
protected  List<Integer> getParentsIndexesInQueue(ProbabilisticNode node)
          Return the indexes (sampling order) in the queue for the parents of a given node.
protected  void init()
           
protected  void initOrderQueue(boolean[] nodeAddedList)
          Initializes the queue with the nodes that are root.
 void propagate()
          Propagate evidences.
 void reset()
          Resets the algorithm and optionally the network state.
 void run()
          Runs the algorithm given the current state of the attributes.
 void setNetwork(Graph g)
          Sets the network (graph) treated by this algorithm.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pn

protected ProbabilisticNetwork pn

clonedPN

protected ProbabilisticNetwork clonedPN

nodeOrderQueue

protected List<Node> nodeOrderQueue
Constructor Detail

GaussianMixture

public GaussianMixture()
Default constructor - created for plugin support


GaussianMixture

public GaussianMixture(ProbabilisticNetwork pn)
Method Detail

getNodeOrderQueue

public List<Node> getNodeOrderQueue()
Return the order the nodes are in the sampled matrix.

Returns:
The order the nodes are in the sampled matrix.

init

protected void init()

createOrderQueue

protected void createOrderQueue()
Creates the queue of the nodes that are going to be analyzed.


initOrderQueue

protected void initOrderQueue(boolean[] nodeAddedList)
Initializes the queue with the nodes that are root. In other words. It will put in the queue the nodes that do not have parents.

Parameters:
nodeAddedList - Keeps track of the nodes that have already been added to the queue (nodeAddedList[nodeIndex]=true).

addToOrderQueue

protected void addToOrderQueue(ArrayList<Node> children,
                               boolean[] nodeAddedList)
Take the children of a node that have already been added to the queue. Analyze them one by one and add the child that is not in the queue yet.

Parameters:
children - Children of a node that is already in the queue.
nodeAddedList - Nodes that have already been added to the queue.

run

public void run()
         throws IllegalStateException
Description copied from interface: IInferenceAlgorithm
Runs the algorithm given the current state of the attributes.

Specified by:
run in interface IInferenceAlgorithm
Throws:
IllegalStateException - : this exception may also be used for general purpose.

addAdjacentNodes

protected void addAdjacentNodes(Node node,
                                List<Node> nodeInNetwork)

getParentsIndexesInQueue

protected List<Integer> getParentsIndexesInQueue(ProbabilisticNode node)
Return the indexes (sampling order) in the queue for the parents of a given node.

Parameters:
node - The node to retrieve the parents for finding the indexes.
Returns:
List of indexes (sampling order) of a node's parents in the queue.

getIndexInQueue

protected Integer getIndexInQueue(Node node)
Retrieves the node's index in the queue.

Parameters:
node -
Returns:

clonePN

protected ProbabilisticNetwork clonePN(ProbabilisticNetwork network)
As I am not sure if the clone methods are corrected. I decided to clone the network by saving it in a file and loading again as another network.

Parameters:
network -
Returns:

setNetwork

public void setNetwork(Graph g)
                throws IllegalArgumentException
Description copied from interface: IInferenceAlgorithm
Sets the network (graph) treated by this algorithm.

Specified by:
setNetwork in interface IInferenceAlgorithm
Parameters:
g - : the network (graph) to set.
Throws:
IllegalArgumentException - : if the given graph is not appropriate for this algorithm.

getNetwork

public Graph getNetwork()
Specified by:
getNetwork in interface IInferenceAlgorithm
Returns:
Gets the network (graph) treated by this algorithm.

getDescription

public String getDescription()
Description copied from interface: IInferenceAlgorithm
Obtains the description of this algorithm. This information is generally used as a tool tip text.

Specified by:
getDescription in interface IInferenceAlgorithm
Returns:
: name of this algorithm.

getName

public String getName()
Description copied from interface: IInferenceAlgorithm
Obtains the name of this algorithm

Specified by:
getName in interface IInferenceAlgorithm
Returns:
: name of this algorithm.

reset

public void reset()
Description copied from interface: IInferenceAlgorithm
Resets the algorithm and optionally the network state.

Specified by:
reset in interface IInferenceAlgorithm

propagate

public void propagate()
Description copied from interface: IInferenceAlgorithm
Propagate evidences.

Specified by:
propagate in interface IInferenceAlgorithm


Copyright © 2001-2010 University of Brasilia - UnB. All Rights Reserved.