edu.duke.cs.banjo.bayesnet
Class BayesNetStructure

java.lang.Object
  extended byedu.duke.cs.banjo.bayesnet.BayesNetStructure
All Implemented Interfaces:
BayesNetStructureI, java.lang.Comparable

public class BayesNetStructure
extends java.lang.Object
implements java.lang.Comparable, BayesNetStructureI

Stores a basic BayesNet structure (where the use of a BayesNetManager is redundant).

Details:
- Used for storing the N-best network structures.
- Similar to the BayesNetManager, but without the overhead of tracking multiple subsets of nodes (parents).
- Uses internal knowledge about the EdgesAsMatrix class for performance reasons.

Change History:
Created on Apr 13, 2004

Author:
Jurgen Sladeczek (hjs)
For the latest info, please visit www.cs.duke.edu.

Field Summary
protected  int[] arrayOfParentCounts
           
protected  int[] arrayOfParentCountsToCompareTo
           
protected  int combinedParentCount
           
protected  int combinedParentCountToCompareTo
           
protected  double networkScore
           
protected  EdgesWithCachedStatisticsI networkStructure
           
protected  BayesNetStructure otherBayesNetStructure
           
protected  long searchLoopIndex
           
protected  int varCount
           
 
Constructor Summary
BayesNetStructure(BayesNetStructureI _bayesNetStructure, double _networkScore, long _searchLoopIndex)
           
BayesNetStructure(EdgesWithCachedStatisticsI _networkStructure, double _networkScore, long _searchLoopIndex)
           
 
Method Summary
 void assignBayesNetStructure(EdgesI _networkStructure, double _networkScore, long _searchLoopIndex)
           
 void assignBayesNetStructure(EdgesWithCachedStatisticsI _networkStructure, double _networkScore, long _searchLoopIndex)
           
 int compareTo(java.lang.Object otherStructure)
           
 double getNetworkScore()
           
 EdgesI getNetworkStructure()
           
 long getSearchLoopIndex()
           
 void setNetworkScore(double networkScore)
           
 void setNetworkStructure(EdgesI networkStructure)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

networkStructure

protected EdgesWithCachedStatisticsI networkStructure

networkScore

protected double networkScore

searchLoopIndex

protected long searchLoopIndex

otherBayesNetStructure

protected BayesNetStructure otherBayesNetStructure

varCount

protected final int varCount

combinedParentCount

protected int combinedParentCount

combinedParentCountToCompareTo

protected int combinedParentCountToCompareTo

arrayOfParentCounts

protected int[] arrayOfParentCounts

arrayOfParentCountsToCompareTo

protected int[] arrayOfParentCountsToCompareTo
Constructor Detail

BayesNetStructure

public BayesNetStructure(BayesNetStructureI _bayesNetStructure,
                         double _networkScore,
                         long _searchLoopIndex)
                  throws java.lang.Exception

BayesNetStructure

public BayesNetStructure(EdgesWithCachedStatisticsI _networkStructure,
                         double _networkScore,
                         long _searchLoopIndex)
                  throws java.lang.Exception
Method Detail

assignBayesNetStructure

public void assignBayesNetStructure(EdgesI _networkStructure,
                                    double _networkScore,
                                    long _searchLoopIndex)
                             throws java.lang.Exception
Specified by:
assignBayesNetStructure in interface BayesNetStructureI
Parameters:
_networkStructure - The networkStructure (as set of edges) to assign.
_networkScore - The score of the network.
_searchLoopIndex - The search loop where the network was discovered.
Throws:
java.lang.Exception

assignBayesNetStructure

public void assignBayesNetStructure(EdgesWithCachedStatisticsI _networkStructure,
                                    double _networkScore,
                                    long _searchLoopIndex)
                             throws java.lang.Exception
Specified by:
assignBayesNetStructure in interface BayesNetStructureI
Throws:
java.lang.Exception

getNetworkStructure

public EdgesI getNetworkStructure()
Specified by:
getNetworkStructure in interface BayesNetStructureI
Returns:
Returns the networkStructure.

compareTo

public int compareTo(java.lang.Object otherStructure)
Specified by:
compareTo in interface java.lang.Comparable

toString

public java.lang.String toString()
Specified by:
toString in interface BayesNetStructureI

setNetworkStructure

public void setNetworkStructure(EdgesI networkStructure)
                         throws java.lang.Exception
Specified by:
setNetworkStructure in interface BayesNetStructureI
Parameters:
networkStructure - The networkStructure to set.
Throws:
java.lang.Exception

getNetworkScore

public double getNetworkScore()
Specified by:
getNetworkScore in interface BayesNetStructureI
Returns:
Returns the networkScore.

setNetworkScore

public void setNetworkScore(double networkScore)
Specified by:
setNetworkScore in interface BayesNetStructureI
Parameters:
networkScore - The score (of the stored network) to set.

getSearchLoopIndex

public long getSearchLoopIndex()
Specified by:
getSearchLoopIndex in interface BayesNetStructureI
Returns:
Returns the searchLoopIndex.