|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.co.agena.minerva.model.Propagation
public abstract class Propagation
This class encapsulates propagation algorithms in which multiple Scenarios may be applied in different ways to a set of ExtendedBNs over a sequence of time periods. The Propagation class cannot be directly instantiated; instead, a sub-class must be created that defines the actual propagation properties and behaviour. Major changes to the structure and order of propagation made on 30/9/04
Nested Class Summary | |
---|---|
class |
Propagation.PropagationEventGenerator
The PropagationEventGenerator is used to inform listeners of events relating to propagation. |
Field Summary | |
---|---|
static java.lang.String |
BASIC_PROPAGATION
|
static java.lang.String |
DD_PROPAGATION
|
protected boolean |
inconsistentEvidencePropagated
We need to monitor if there has been any inconsistent evidence propagated. |
protected int |
lengthOfProgressableTask
Represnts the length of the operation which is currently being monitored in this class. |
protected Model |
model
This is the Model on which to do the propagation. |
static boolean |
ONLY_PROPAGATE_MODIFIED_EXTENDEDBNS
Propagation will only deal with ExtendedBN's which have been modified if this flag is true. |
protected int |
progress
Represnts the current progress of any operation which is currently being monitored in this class. |
protected boolean |
progressableTaskDone
When set to true the current task being monitored will have been completed. |
protected Propagation.PropagationEventGenerator |
propagationEventGenerator
Event generator used for firing events relating to propagation. |
protected boolean |
terminateProgressableTask
When set to true the current propagation will be terminated/cancelled. |
Constructor Summary | |
---|---|
Propagation(Model model)
Contructs a Propagation object that relates to the specified Model. |
Method Summary | |
---|---|
void |
addCoreBNListeners()
Adds this as a Listener to each of the CoreBN's associated with the ExtendedBN's in the current models ExtendedBNList. |
void |
addPropagationListener(PropagationListener pl)
Adds an object interested in PropagationEvents to the List of PropagationListeners (actually held by an internal PropagationEventGenerator). |
protected void |
calculateLengthOfProgressableTask(java.util.List extendedBNsToCalculate)
Calculates the length of a propagation task based upon the Scenario's and ExtendedBN's being propagated. |
void |
coreBNPropagationStageComplete(uk.co.agena.minerva.model.corebn.CoreBNEvent cbne)
A stage of the Propagation has completed for the CoreBN in the specified event. |
void |
destroy()
|
java.lang.String |
doesBasicChecksPass()
This method should run some basic check that need to pass before the propagation can continue. |
int |
getCurrentProgress()
Represents the current progress of any operation which is currently being monitored in this class. |
int |
getEstimatedNumberOfCalculations()
This method is used to intomathe user of the number |
int |
getLengthOfProgressableTask()
The length of the propagation task. |
boolean |
isProgressableTaskDone()
When set to true the current task being monitored will have been completed. |
void |
modelInconsistentEvidencePropagated(ModelEvent ebne)
|
protected abstract void |
propagateScenario(java.util.List extendedbns,
Scenario scenario,
boolean propagate,
int propagationExclusivity)
|
void |
removeCoreBNListeners()
Removes this as a Listener to each of the CoreBN's associated with the ExtendedBN's in the current models ExtendedBNList. |
void |
removePropagationListener(PropagationListener pl)
Removes an object no longer interested in PropagationEvents from the List of PropagationListeners (actually held by an internal PropagationEventGenerator). |
void |
resetProgressableTask()
Reset the variables used in the monitoring of the current propagation. |
java.util.List |
restartDataCollectionStore(boolean onlyModifiedBns,
java.util.List specifiedExtendedBNs)
This method should be called always at the start of the simulate method to restart the data collection store. |
int |
revertAllExtendedBNsToSavedMarginals(int revertToSavedMarginals)
Returns all ExtendedBNs to a state stored during propagation if there is one. |
void |
rollBackCores()
|
java.util.Map |
setupExpressionVariableNodesFromScenario(Scenario scenario,
ExtendedBNList extendedBNList)
|
void |
setupMessagePasses(MessagePassingLinks mplink,
int noOfPassesToReactTo,
boolean touchTable)
Sets up parameter passes among ExtendedNodes as defined in the supplied MessagePassingLinks object. |
void |
simulate(java.util.List extendedBNsToUse)
|
void |
simulate(java.util.List scenarios,
java.util.List extendedBNsToUse)
Propagates using a given list of scenarios if the model allows this. |
void |
simulateCheckPoint()
This method should be used to check if the marginals have changed from the last propagation, and if it should continue to Dynamically Discretise Nodes before it starts doing so. |
void |
terminateProgressableTask()
Stop the current propagation. |
void |
unmarkExpressionVariableNodes(java.util.Map extendedNodesToRecalculateVarExpressionToBNMap)
|
void |
updateCurrentProgress(int inc)
Increment the currentProgress by the specified value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Model model
protected int lengthOfProgressableTask
protected int progress
protected boolean progressableTaskDone
protected boolean terminateProgressableTask
protected Propagation.PropagationEventGenerator propagationEventGenerator
protected boolean inconsistentEvidencePropagated
public static java.lang.String DD_PROPAGATION
public static java.lang.String BASIC_PROPAGATION
public static final boolean ONLY_PROPAGATE_MODIFIED_EXTENDEDBNS
Constructor Detail |
---|
public Propagation(Model model)
model
- the Model to which the Propagation relatesMethod Detail |
---|
public void destroy()
public java.util.List restartDataCollectionStore(boolean onlyModifiedBns, java.util.List specifiedExtendedBNs)
public int getEstimatedNumberOfCalculations()
public java.lang.String doesBasicChecksPass()
updateStringInformation
- This string should be updated by this method, to provide information
to the user about why the checks may not have passed.
public void simulate(java.util.List scenarios, java.util.List extendedBNsToUse) throws PropagationException, InconsistentEvidenceException, PropagationTerminatedException
scenarios
-
PropagationException
InconsistentEvidenceException
PropagationTerminatedException
public void addPropagationListener(PropagationListener pl)
pl
- the intereseted PropagationListenerspublic void removePropagationListener(PropagationListener pl)
pl
- the PropagationListeners no longer interestedpublic void modelInconsistentEvidencePropagated(ModelEvent ebne)
public void setupMessagePasses(MessagePassingLinks mplink, int noOfPassesToReactTo, boolean touchTable) throws PropagationException
mplink
- the MessagePassingLinks object that defines the parameter passingnoOfPassesToReactTo
- defines how many times the listening ExtendedNode should react to
a change in the sending ExtendedNode's marginalstouchTable
- defines whether the change in the marginals of the sending node
should be treated by the listening node as soft evidence (false)
or as a setting of the NPT (true)
PropagationException
- if there is a problem setting up the parameter passingpublic int revertAllExtendedBNsToSavedMarginals(int revertToSavedMarginals) throws PropagationException, InconsistentEvidenceException
revertToSavedMarginals
- the index of the saved marginals that should be restoredw
PropagationException
- if there is a problem with reverting
InconsistentEvidenceException
public void rollBackCores() throws ExtendedBNException, InconsistentEvidenceException
ExtendedBNException
InconsistentEvidenceException
public void simulateCheckPoint()
public void simulate(java.util.List extendedBNsToUse) throws PropagationException, InconsistentEvidenceException, PropagationTerminatedException
PropagationException
InconsistentEvidenceException
PropagationTerminatedException
protected abstract void propagateScenario(java.util.List extendedbns, Scenario scenario, boolean propagate, int propagationExclusivity) throws ModelException, PropagationException, InconsistentEvidenceException, PropagationTerminatedException
ModelException
PropagationException
InconsistentEvidenceException
PropagationTerminatedException
public java.util.Map setupExpressionVariableNodesFromScenario(Scenario scenario, ExtendedBNList extendedBNList) throws MinervaVariableException, InconsistentEvidenceException, ExtendedBNException, MinervaRangeException, NPTGeneratorInsufficientStateRangeException, NPTGeneratorException
MinervaVariableException
InconsistentEvidenceException
ExtendedBNException
MinervaRangeException
NPTGeneratorInsufficientStateRangeException
NPTGeneratorException
public void unmarkExpressionVariableNodes(java.util.Map extendedNodesToRecalculateVarExpressionToBNMap) throws InconsistentEvidenceException, ExtendedBNException, MinervaRangeException, NPTGeneratorInsufficientStateRangeException, NPTGeneratorException
InconsistentEvidenceException
ExtendedBNException
MinervaRangeException
NPTGeneratorInsufficientStateRangeException
NPTGeneratorException
public int getCurrentProgress()
getCurrentProgress
in interface Progressable
public int getLengthOfProgressableTask()
getLengthOfProgressableTask
in interface Progressable
public void terminateProgressableTask()
terminateProgressableTask
in interface Progressable
public boolean isProgressableTaskDone()
isProgressableTaskDone
in interface Progressable
public void resetProgressableTask()
resetProgressableTask
in interface Progressable
protected void calculateLengthOfProgressableTask(java.util.List extendedBNsToCalculate)
extendedBNsToCalculate
- The ExtendedBN's being propagated.public void updateCurrentProgress(int inc)
inc
- The amount by which we are updating the Current Progress.public void removeCoreBNListeners()
public void addCoreBNListeners()
public void coreBNPropagationStageComplete(uk.co.agena.minerva.model.corebn.CoreBNEvent cbne)
coreBNPropagationStageComplete
in interface uk.co.agena.minerva.model.corebn.CoreBNListener
The
- CoreBNEvent holding a reference to the source CoreBN.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |