edu.duke.cs.banjo.utility
Class PostProcessor

java.lang.Object
  extended byedu.duke.cs.banjo.utility.PostProcessor

public class PostProcessor
extends java.lang.Object

Contains the (optional) post-processing actions.

Computation of a dot-compliant file for generating a graphical representation.
Computation of the consensus graph from a set of high-scoring networks.

Details:

Change History:
Created on Mar 29, 2005

10/10/2005 (v2.0) hjs Add method for computing a consensus graph from a set of high-scoring networks.

2008 (v2.1) hjs Changes to update the use of FileUtil

4/14/2009 hjs (v2.2.1) Modify the handling of return values from externally executed apps.

Author:
hjs
For the latest info, please visit www.cs.duke.edu.

Field Summary
protected  int maxMarkovLag
           
protected  int minMarkovLag
           
protected  Settings settings
           
protected  int varCount
           
protected  java.lang.String[] variableNames
           
 
Constructor Summary
PostProcessor(Settings _processData)
           
 
Method Summary
 java.lang.StringBuffer composeDotGraph(EdgesI _bayesNetStructure, java.lang.String _networkLabel, double _networkScore)
           
 EdgesI computeConsensusGraph(java.util.TreeSet nBestStructures)
           
(package private)  void createDotGraphic(java.lang.String _fullPathToDotExecutable, java.lang.String _dotFile, java.lang.String _graphicsFile, java.lang.String _graphicsFormat)
           
 java.lang.String createLabel(EdgesI _bayesNetStructure, java.lang.String _networkLabel, double _networkScore)
           
 boolean execute()
           
private  java.lang.StringBuffer executeExternalProgram(java.lang.String cmdline)
           
 void updateVariableNames()
           
private  boolean validateRequiredData()
          Validates the settings values required for the post-processing.
 java.lang.Object validChoices()
          Provides the valid choices for this class, here: the available searchers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

settings

protected Settings settings

varCount

protected final int varCount

minMarkovLag

protected final int minMarkovLag

maxMarkovLag

protected final int maxMarkovLag

variableNames

protected java.lang.String[] variableNames
Constructor Detail

PostProcessor

public PostProcessor(Settings _processData)
              throws java.lang.Exception
Method Detail

validateRequiredData

private boolean validateRequiredData()
                              throws java.lang.Exception
Validates the settings values required for the post-processing.

Returns:
Returns the boolean flag that indicates whether a crucial setting could not be validated.
Throws:
java.lang.Exception

updateVariableNames

public void updateVariableNames()

composeDotGraph

public java.lang.StringBuffer composeDotGraph(EdgesI _bayesNetStructure,
                                              java.lang.String _networkLabel,
                                              double _networkScore)
                                       throws java.lang.Exception
Parameters:
_bayesNetStructure - The bayesNet for which to compute the dot graph
Returns:
The string representing the dot graph.
Throws:
java.lang.Exception

computeConsensusGraph

public EdgesI computeConsensusGraph(java.util.TreeSet nBestStructures)
                             throws java.lang.Exception
Parameters:
nBestStructures - The set of bayesnets (usually a set of n-best networks) for which to compute the consensus graph.
Returns:
The adjacency matrix (as EdgesI) representing the consensus graph.
Throws:
java.lang.Exception

createDotGraphic

void createDotGraphic(java.lang.String _fullPathToDotExecutable,
                      java.lang.String _dotFile,
                      java.lang.String _graphicsFile,
                      java.lang.String _graphicsFormat)
                throws java.lang.Exception
Throws:
java.lang.Exception

executeExternalProgram

private java.lang.StringBuffer executeExternalProgram(java.lang.String cmdline)
                                               throws java.lang.Exception
Throws:
java.lang.Exception

createLabel

public java.lang.String createLabel(EdgesI _bayesNetStructure,
                                    java.lang.String _networkLabel,
                                    double _networkScore)

validChoices

public java.lang.Object validChoices()
Provides the valid choices for this class, here: the available searchers.


execute

public boolean execute()
                throws java.lang.Exception
Throws:
java.lang.Exception