uk.co.agena.minerva.model
Class MarginalDataItem

java.lang.Object
  extended by uk.co.agena.minerva.model.MarginalDataItem
All Implemented Interfaces:
Writable

public class MarginalDataItem
extends java.lang.Object
implements Writable

A MarginalDataItem captures all the marginal information for an ExtendedNode for a given scenario. It holds the raw probability data as a DataSet. It also stores various summary statistics.


Field Summary
static double version
           
 
Fields inherited from interface uk.co.agena.minerva.util.model.Writable
FIELD_SEPARATOR
 
Constructor Summary
MarginalDataItem()
           
MarginalDataItem(java.lang.String scenarioName)
          Empty constructor
 
Method Summary
 void extendedBNAboutToBePropagated(ExtendedNode enode, java.lang.String[] callSigns)
          Event invoked by the connected extended Bn if it is about to propagate.
 void extendedBNAllEvidenceRetracted(ExtendedNode enode, java.lang.String[] callSigns)
          Invoked by any extended BN's that this class is listening to, event prompts the listener that the extended BN has had all its eveidence retracted
 void extendedBNInconsistentEvidencePropagated()
          Event fired by the extended BN if the last propagation caused inconsistant evidence to be propagated.
 void extendedBNPropagated(ExtendedNode enode, java.lang.String[] callSigns)
          Invoked by any extended BN's that this class is listening to, event prompts the listener that the extended BN has been propagated
 java.lang.String getCallSignToUpdateOn()
          This attribute is matched against the call sign passed during a propagation event invoked by the connected extended BN.
 double getConfidenceInterval()
           
 DataSet getDataset()
           
 double getLowerPercentile()
           
 double getMeanValue()
           
 double getMedianValue()
           
 double getPercentileValue()
           
 java.lang.String getScenarioName()
           
 double getStandardDeviationValue()
           
 double getUpperPercentile()
           
 double getVarianceValue()
           
 double getVersion()
          Returns the version of the class.
 boolean isOnlyUpdateOnMatchedCallSign()
          Attribute determines whether an update is only called when the call sign in the propagate event is matched to the call sign in the MDI, or if the uodate occurs on every occassion
 boolean isUpdateOnAllEvidenceRetracted()
          this attribute determines whether the monitors should update when it recieves a all evidence retracted event from the connected extended BN.
 boolean isVisible()
          This attribute defines whether the results of the marginal data item should be made visible to the user (currently restricted to the visibility of the marginal plot on the monitors)
 int read(java.util.List strings, int currentLineNumber)
           
 void setCallSignToUpdateOn(java.lang.String callSignToUpdateOn)
          This attribute is matched against the call sign passed during a propagation event invoked by the connected extended BN.
 void setConfidenceInterval(double confidnceInterval)
           
 void setDataset(DataSet dataset)
           
 void setOnlyUpdateOnMatchedCallSign(boolean onlyUpdateOnMatchedCallSign)
          Attribute determines whether an update is only called when the call sign in the propagate event is matched to the call sign in the MDI, or if the uodate occurs on every occassion
 void setScenarioName(java.lang.String scenarioName)
           
 void setUpdateOnAllEvidenceRetracted(boolean updateOnAllEvidenceRetracted)
          this attribute determines whether the monitors should update when it recieves a all evidence retracted event from the connected extended BN.
 void setVersion(double version)
          Sets the version number of the class.
 void setVisible(boolean visible)
          This attribute defines whether the results of the marginal data item should be made visible to the user (currently restricted to the visibility of the marginal plot on the monitors)
 void updateDataSet(ExtendedNode exNode)
          invoked when a propagation or retraction event (depending on how the data item is set up).
 void updateStats(ExtendedNode exNode)
          extracts the stats from the connected node if they are available
 java.util.List write()
          Writes the object in question to a List of Strings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

version

public static double version
Constructor Detail

MarginalDataItem

public MarginalDataItem()

MarginalDataItem

public MarginalDataItem(java.lang.String scenarioName)
Empty constructor

Method Detail

getVersion

public double getVersion()
Description copied from interface: Writable
Returns the version of the class. Used to ensure backward compatibility.

Specified by:
getVersion in interface Writable
Returns:
the version number

setVersion

public void setVersion(double version)
Description copied from interface: Writable
Sets the version number of the class. Used to ensure backward compatibility.

Specified by:
setVersion in interface Writable
Parameters:
version - the version number

updateDataSet

public void updateDataSet(ExtendedNode exNode)
invoked when a propagation or retraction event (depending on how the data item is set up). It extracts the marginals from the connected node and stores them locally. It will also exstract the stats if required


updateStats

public void updateStats(ExtendedNode exNode)
extracts the stats from the connected node if they are available


getDataset

public DataSet getDataset()

setDataset

public void setDataset(DataSet dataset)

getMeanValue

public double getMeanValue()

getPercentileValue

public double getPercentileValue()

getLowerPercentile

public double getLowerPercentile()

getUpperPercentile

public double getUpperPercentile()

getConfidenceInterval

public double getConfidenceInterval()

setConfidenceInterval

public void setConfidenceInterval(double confidnceInterval)

getMedianValue

public double getMedianValue()

isVisible

public boolean isVisible()
This attribute defines whether the results of the marginal data item should be made visible to the user (currently restricted to the visibility of the marginal plot on the monitors)


setVisible

public void setVisible(boolean visible)
This attribute defines whether the results of the marginal data item should be made visible to the user (currently restricted to the visibility of the marginal plot on the monitors)


isUpdateOnAllEvidenceRetracted

public boolean isUpdateOnAllEvidenceRetracted()
this attribute determines whether the monitors should update when it recieves a all evidence retracted event from the connected extended BN. As default this is set to true


setUpdateOnAllEvidenceRetracted

public void setUpdateOnAllEvidenceRetracted(boolean updateOnAllEvidenceRetracted)
this attribute determines whether the monitors should update when it recieves a all evidence retracted event from the connected extended BN. As default this is set to true


getCallSignToUpdateOn

public java.lang.String getCallSignToUpdateOn()
This attribute is matched against the call sign passed during a propagation event invoked by the connected extended BN. The MDI will only update if the call sign in the propagation event matches the call sign in the MDI.


setCallSignToUpdateOn

public void setCallSignToUpdateOn(java.lang.String callSignToUpdateOn)
This attribute is matched against the call sign passed during a propagation event invoked by the connected extended BN. The MDI will only update if the call sign in the propagation event matches the call sign in the MDI.


isOnlyUpdateOnMatchedCallSign

public boolean isOnlyUpdateOnMatchedCallSign()
Attribute determines whether an update is only called when the call sign in the propagate event is matched to the call sign in the MDI, or if the uodate occurs on every occassion


setOnlyUpdateOnMatchedCallSign

public void setOnlyUpdateOnMatchedCallSign(boolean onlyUpdateOnMatchedCallSign)
Attribute determines whether an update is only called when the call sign in the propagate event is matched to the call sign in the MDI, or if the uodate occurs on every occassion


extendedBNPropagated

public void extendedBNPropagated(ExtendedNode enode,
                                 java.lang.String[] callSigns)
Invoked by any extended BN's that this class is listening to, event prompts the listener that the extended BN has been propagated


extendedBNAllEvidenceRetracted

public void extendedBNAllEvidenceRetracted(ExtendedNode enode,
                                           java.lang.String[] callSigns)
Invoked by any extended BN's that this class is listening to, event prompts the listener that the extended BN has had all its eveidence retracted


extendedBNAboutToBePropagated

public void extendedBNAboutToBePropagated(ExtendedNode enode,
                                          java.lang.String[] callSigns)
Event invoked by the connected extended Bn if it is about to propagate.


extendedBNInconsistentEvidencePropagated

public void extendedBNInconsistentEvidencePropagated()
Event fired by the extended BN if the last propagation caused inconsistant evidence to be propagated.


getStandardDeviationValue

public double getStandardDeviationValue()
Returns:
Returns the standardDeviationValue.

getVarianceValue

public double getVarianceValue()
Returns:
Returns the varianceValue.

getScenarioName

public java.lang.String getScenarioName()
Returns:
Returns the scenarioName.

setScenarioName

public void setScenarioName(java.lang.String scenarioName)
Parameters:
scenarioName - The scenarioName to set.

write

public java.util.List write()
                     throws MinervaReadWriteException
Description copied from interface: Writable
Writes the object in question to a List of Strings.

Specified by:
write in interface Writable
Returns:
the List to which the Strings have been written
Throws:
MinervaReadWriteException - if there

read

public int read(java.util.List strings,
                int currentLineNumber)
         throws MinervaReadWriteException
Specified by:
read in interface Writable
Throws:
MinervaReadWriteException


Copyright © 2006 Agena Ltd. All Rights Reserved.