uk.co.agena.minerva.model
Class MarginalDataItemList

java.lang.Object
  extended by uk.co.agena.minerva.model.MarginalDataItemList
All Implemented Interfaces:
java.util.EventListener, ExtendedBNListener, Writable

public class MarginalDataItemList
extends java.lang.Object
implements ExtendedBNListener, Writable

Stores a List of MarginalDataItems which are cleared & created before a propagation is started. Each MarginalDataItem in the list corresponds to a different Scenario.


Field Summary
static double version
           
 
Fields inherited from interface uk.co.agena.minerva.util.model.Writable
FIELD_SEPARATOR
 
Constructor Summary
MarginalDataItemList()
          Empty constructor
MarginalDataItemList(ExtendedBN exBN, ExtendedNode exNode)
          Empty constructor
 
Method Summary
 void destroy()
          Cleans up objects.
 void extendedBNAboutToBePropagated(ExtendedBNEvent ebne)
          Event invoked by the connected extended Bn if it is about to propagate.
 void extendedBNAllEvidenceRetracted(ExtendedBNEvent ebne)
          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 extendedBNConnBNNotFound(ExtendedBNEvent ebne)
          Currently empty.
 void extendedBNIDChanged(ExtendedBNEvent ebne)
          Invoked whenever the ID for the ExtendedBN is changed.
 void extendedBNInconsistentEvidencePropagated(ExtendedBNEvent ebne)
          Event fired by the extended BN if the last propagation caused inconsistant evidence to be propagated.
 void extendedBNNameDescriptionChanged(ExtendedBNEvent ebne)
          Currently empty.
 void extendedBNPropagated(ExtendedBNEvent ebne)
          Invoked by any extended BN's that this class is listening to, event prompts the listener that the extended BN has been propagated
 void extendedNodeAboutToBeCut(ExtendedBNEvent ebne, ExtendedBN sourceEXBN, int targetEXNodeID, int sourceEXNodeID, java.lang.String oldSourceName)
          This event is fired when an ExtendedNode has been pasted to the destination ExtendedBN and is about to be cut from the specified source ExtendedBN.
 void extendedNodeAdded(ExtendedBNEvent ebne, ExtendedNode exNode)
          This event is fired when ever a new node has been added to the extendedBN
 void extendedNodeEventFired(ExtendedBNEvent ebne, ExtendedNodeEvent ene, java.lang.String eventName)
          Event received from the extended BN Invoked whenever the extended BN recieves a BN Node event, this event throws the event up to any listeners on the extended BN.
 void extendedNodePasted(ExtendedBNEvent ebne, ExtendedBN sourceEXBN, ExtendedNode sourceNode, ExtendedNode exNode)
          This event is fired when an extended node is pasted into the extended BN
 void extendedNodeRemoved(ExtendedBNEvent ebne, ExtendedNode exNode)
          This event is fired when an extended node is removed from the extended BN
 void extendedNodeReplaced(ExtendedBNEvent ebne, ExtendedNode oldNode, ExtendedNode newNode, ExtendedBN ebn)
          This event is fired whenever a node is replaced with another one.
 ExtendedBN getExBN()
           
 ExtendedNode getExNode()
           
 int getExtendedBNID()
           
 int getExtendedNodeID()
           
 java.lang.String getLabel()
           
 MarginalDataItem getMarginalDataItemAtIndex(int index)
          Returns the MarginalDataItem at the specified index in the list.
 java.util.List getMarginalDataItems()
           
 double getVersion()
          Returns the version of the class.
 int read(java.util.List strings, int currentLineNumber)
           
 void rollbackToLastMarginalDataItems()
          This method will replace the current marginal data item with the previous one.
 void setExBN(ExtendedBN exBN)
           
 void setExNode(ExtendedNode exNode)
           
 void setExtendedBNID(int extendedBNID)
           
 void setExtendedNodeID(int extendedNodeID)
           
 void setLabel(java.lang.String label)
           
 void setVersion(double version)
          Sets the version number of the class.
 void startDataCollection(java.util.List scenarios)
          for each of the scenarios it creates a MarginalDataItem
 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

MarginalDataItemList

public MarginalDataItemList()
Empty constructor


MarginalDataItemList

public MarginalDataItemList(ExtendedBN exBN,
                            ExtendedNode exNode)
Empty constructor

Method Detail

getExBN

public ExtendedBN getExBN()

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

setExBN

public void setExBN(ExtendedBN exBN)

getMarginalDataItemAtIndex

public MarginalDataItem getMarginalDataItemAtIndex(int index)
Returns the MarginalDataItem at the specified index in the list.

Parameters:
index - the index of the required MarginalDataItem
Returns:

getMarginalDataItems

public java.util.List getMarginalDataItems()

getExtendedBNID

public int getExtendedBNID()

setExtendedBNID

public void setExtendedBNID(int extendedBNID)

getExtendedNodeID

public int getExtendedNodeID()

setExtendedNodeID

public void setExtendedNodeID(int extendedNodeID)

destroy

public void destroy()
Cleans up objects.


getExNode

public ExtendedNode getExNode()

setExNode

public void setExNode(ExtendedNode exNode)

getLabel

public java.lang.String getLabel()

setLabel

public void setLabel(java.lang.String label)

extendedBNNameDescriptionChanged

public void extendedBNNameDescriptionChanged(ExtendedBNEvent ebne)
Currently empty. The MonitorGUIComponent is not interested in the ExtendedBN's name.

Specified by:
extendedBNNameDescriptionChanged in interface ExtendedBNListener
Parameters:
ebne - the event encapsulating information about the change

extendedBNConnBNNotFound

public void extendedBNConnBNNotFound(ExtendedBNEvent ebne)
Currently empty. This component is not interested in this event from the ExtendedBN

Specified by:
extendedBNConnBNNotFound in interface ExtendedBNListener
Parameters:
ebne - the event encapsulating information about the change

extendedBNIDChanged

public void extendedBNIDChanged(ExtendedBNEvent ebne)
Description copied from interface: ExtendedBNListener
Invoked whenever the ID for the ExtendedBN is changed.

Specified by:
extendedBNIDChanged in interface ExtendedBNListener
Parameters:
ebne - the event encapsulating information about the change

extendedBNPropagated

public void extendedBNPropagated(ExtendedBNEvent ebne)
Invoked by any extended BN's that this class is listening to, event prompts the listener that the extended BN has been propagated

Specified by:
extendedBNPropagated in interface ExtendedBNListener
Parameters:
ebne - The Extended BN event

extendedBNAllEvidenceRetracted

public void extendedBNAllEvidenceRetracted(ExtendedBNEvent ebne)
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

Specified by:
extendedBNAllEvidenceRetracted in interface ExtendedBNListener
Parameters:
ebne - The Extended BN event

extendedBNInconsistentEvidencePropagated

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

Specified by:
extendedBNInconsistentEvidencePropagated in interface ExtendedBNListener
Parameters:
ebne -

extendedBNAboutToBePropagated

public void extendedBNAboutToBePropagated(ExtendedBNEvent ebne)
Event invoked by the connected extended Bn if it is about to propagate.

Specified by:
extendedBNAboutToBePropagated in interface ExtendedBNListener
Parameters:
ebne -

startDataCollection

public void startDataCollection(java.util.List scenarios)
for each of the scenarios it creates a MarginalDataItem

Parameters:
scenarios -

rollbackToLastMarginalDataItems

public void rollbackToLastMarginalDataItems()
This method will replace the current marginal data item with the previous one.


extendedNodeEventFired

public void extendedNodeEventFired(ExtendedBNEvent ebne,
                                   ExtendedNodeEvent ene,
                                   java.lang.String eventName)
Event received from the extended BN Invoked whenever the extended BN recieves a BN Node event, this event throws the event up to any listeners on the extended BN. As well as the node event it provides a string which is the name of the event that BN node fired.

Specified by:
extendedNodeEventFired in interface ExtendedBNListener
Parameters:
ebne - Tne Extended Bn that fired the event
ene - The extended Node that fired the event, caught by the BN
eventName - The name of the extendedBN node event.

extendedNodeRemoved

public void extendedNodeRemoved(ExtendedBNEvent ebne,
                                ExtendedNode exNode)
Description copied from interface: ExtendedBNListener
This event is fired when an extended node is removed from the extended BN

Specified by:
extendedNodeRemoved in interface ExtendedBNListener

extendedNodeAdded

public void extendedNodeAdded(ExtendedBNEvent ebne,
                              ExtendedNode exNode)
This event is fired when ever a new node has been added to the extendedBN

Specified by:
extendedNodeAdded in interface ExtendedBNListener
Parameters:
ebne - The extended BN from which the event was fired
exNode - The extended node which was added to the extended BN

extendedNodeReplaced

public void extendedNodeReplaced(ExtendedBNEvent ebne,
                                 ExtendedNode oldNode,
                                 ExtendedNode newNode,
                                 ExtendedBN ebn)
Description copied from interface: ExtendedBNListener
This event is fired whenever a node is replaced with another one.

Specified by:
extendedNodeReplaced in interface ExtendedBNListener
Parameters:
ebne - The extended BN from which the event was fired
oldNode - the old node
newNode - the new node
ebn - the BN containing both nodes

extendedNodePasted

public void extendedNodePasted(ExtendedBNEvent ebne,
                               ExtendedBN sourceEXBN,
                               ExtendedNode sourceNode,
                               ExtendedNode exNode)
Description copied from interface: ExtendedBNListener
This event is fired when an extended node is pasted into the extended BN

Specified by:
extendedNodePasted in interface ExtendedBNListener
sourceNode - the node that was copied
exNode - the newly cloned node

extendedNodeAboutToBeCut

public void extendedNodeAboutToBeCut(ExtendedBNEvent ebne,
                                     ExtendedBN sourceEXBN,
                                     int targetEXNodeID,
                                     int sourceEXNodeID,
                                     java.lang.String oldSourceName)
This event is fired when an ExtendedNode has been pasted to the destination ExtendedBN and is about to be cut from the specified source ExtendedBN. This is the last point at which the ExtendedNode (which has the sourceEXNodeID in the source and the targetEXNodeID in the destination) will exist on both the source and destination ExtendedBN's. Note: Although the ID's of the source and target ExtendedNode are different they are the same object.

Specified by:
extendedNodeAboutToBeCut in interface ExtendedBNListener
Parameters:
ebne - Holds the destination/target ExtendedBN.
sourceEXBN - The ExtendedBN the ExtendedNode is about to be cut from.
targetEXNodeID - The ID of the ExtendedNode which has been pasted to the ExtendedBN in the specified event.
sourceEXNodeID - The ID of the ExtendedNode which is about to be cut from the specified ExtendedBN.
oldSourceName - The short name description of the soruce node before any updated were made to allow the node to be added to the destination ExtendedBN.

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.