The monitor package deals with the creation / display and management of
Monitor GUI Components.
Contents
Overview
The MonitorGCInterface
GraphMonitorGC
Updating the monitors

Monitors are used to display the probability distribution, and statistics
values for a given set of nodes. These probability values are extracted
from the core and displayed on the monitor GUI component. The parent class for
all monitors is the MonitorGCInterface
The MonitorGCInterface is the parent class of all would be monitors. It
is an abstract class. It performs a number of functions which all monitor
implementations will need:
- It supports the addition and removal of nodes whose stats are to be
displayed on the monitor.
- It maintains a list of monitor data items that in turn hold reference to
the nodes that the monitor must display information on.
- It constructs series based statistics datasets from all the connected
monitor data items such that for a given stat (E.G. mean) a series of values
(one from each connected monitor data item/node) is constructed, which can
then be used by the monitor implementations.
- It contains coupling / decoupling code, that removes the monitor from its
native frame and adds it to a free floating window, and back again.
The graph monitor GC is currently the only implementation of the
MonitorGCInterface. It renders the node probabilities and statistics using
the Graphing API. The additional functionality that it adds to the
MonitorGCInterface is purely aesthetic. Each monitor data item needs to be
connected to a graph data set (that resides in the graphing API), thus the
GraphMonitorGC holds reference to a set of GraphMonitorDataItems (rather than
monitorDataItems) which extend MonitorDataItem and a add reference to the
GraphDataSet.
The complexity in the monitors resides in how and when the monitors update
(get the marginal's and stats from the underlying nodes). The figure below
provides a flow diagram that outlines the process.

In summary each and every monitor data item listens to the extended BN in
which its connected node resides. It thus receives events from that BN,
which may or may not trigger the monitor data item to go and get the latest
marginal's and statistics for that node. There are a number of flags that
can be configured on a monitor data item that help determine whether the update
should occur, namely:
- Call sign (String), when ever an event is received from the
extended BN it contains a list of call signs (strings) that are relevant to
that event (propagation). most of the time these will be ID's of the
scenarios that were in the core at the time of the propagation. The Monitor
data item also has a single string call sign.
- Only update on matched call sign (Boolean), This flag determines
whether the event should only be acted upon if the call sign in the monitor
data item matches on of the call signs in the extended BN event.
- Update Datasets (Boolean), A Boolean flag that determines whether
the data sets should be updated when a propagated / retracted event is received.
This can be used to effectively turn of listening.
- Update on Evidence retracted (Boolean), flag that determines
whether the monitor data item should update its dataset from the connected
node if a retracted event is received.
- Update stats before propagation (boolean), boolean flag that
determines whether the stats should be extracted from the node before a
propagation rather than after. If this flag is true then the stats are
ONLY extracted before the propagation event, never after.