|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.co.agena.minerva.model.scenario.Scenario
public class Scenario
A Scenario contains a collection of Observations that have been made by a user on an ExtendedBN. Each Observation in a Scenario corresponds to one or more ExtendedStates being selected on an ExtendedNode. Where more than one ExtendedState has been selected (i.e. a likelihood has been entered), the Observation will also contain a probability distribution across the selected ExtendedStates. A Scenario can be saved and reloaded at a later date. Once reloaded, it can be applied to the ExtendedBN to which its Observations are connected.
Field Summary | |
---|---|
static double |
version
|
Fields inherited from interface uk.co.agena.minerva.util.model.Writable |
---|
FIELD_SEPARATOR |
Constructor Summary | |
---|---|
Scenario()
Default constructor. |
|
Scenario(NameDescription name)
Creates a Scenario with the specified name. |
Method Summary | |
---|---|
void |
addHardEvidenceObservation(int extendedBNId,
int extendedNodeId,
int stateId)
|
void |
addIntegerObservation(int extendedBNId,
int extendedNodeId,
int value)
|
void |
addObservation(Observation observation,
boolean allowAutoPropagation)
Adds the supplied Observation to the end of the List of Observations. |
void |
addRealObservation(int extendedBNId,
int extendedNodeId,
double value)
|
void |
addScenarioListenerPrimary(ScenarioListener sl)
Adds an object interested in ScenarioEvents to the List of ScenarioListeners (actually held by an internal ScenarioEventGenerator). |
void |
addScenarioListenerSecondary(ScenarioListener sl)
Adds an object interested in ScenarioEvents to the List of ScenarioListeners (actually held by an internal ScenarioEventGenerator). |
void |
addSoftEvidenceObservation(int extendedBNId,
int extendedNodeId,
int[] stateIds,
double[] probabilities)
|
void |
addUserDefinedRevantExtendedBNIds(int[] additionalUserDefinedRelevantExtendedBNIds)
|
void |
clearAllObservations()
Removes all Observations from the Scenario. |
void |
clearObservationsForNode(int extendedBNId,
int extendedNodeId)
Removes all observations for the supplied BN and Node. |
java.lang.Object |
clone()
This method will clone the scenario, and return the copy |
int |
getDirectObservation(int connExtendedBNId,
int connExtendedNodeId)
Returns the ID of the selected ExtendedState in the ExtendedNode. |
int |
getId()
Returns the unique ID of the Scenario. |
NameDescription |
getName()
Returns the name of the Scenario. |
Observation |
getObservation(int connExtendedBNId,
int connExtendedNodeId)
Returns the Observation associated with the supplied ExtendedBN and ExtendedNode IDs. |
java.util.List |
getObservations()
Returns a List of all the Observations contained in this Scenario. |
java.util.List |
getObservations(int connExtendedBNId,
int connExtendedNodeId)
This method will return all observations connected to the specified node in the connected extended BN |
int[] |
getRelevantExtendedBNIds()
Returns a list of IDs of all the ExtendedBNs that are related to this Scenario. |
int[] |
getUserDefinedRelevantExtendedBNIds()
Returns the user-defined ExtendedBN IDs that are deemed relevant to this Scenario. |
double |
getVersion()
Returns the version of the class. |
boolean |
isDisplayOnRiskGraphs()
|
boolean |
isReportable()
Flag can be toggled by external objects to determine whether the scenario is reportable (the user is interested in seeing its results). |
int |
read(java.util.List strings,
int currentLineNumber)
|
void |
removeObservation(Observation ob,
boolean allowAutoPropagation)
This method will remove the specified Observations from the Scenario. |
void |
removeObservationsForExtendedBN(int exBNId)
This method will remove all the observations from the scenario that are contaiend within the specified extended BN |
void |
removeObservationsForNode(int connExtendedBNID,
int connExtendedNodeID,
int[] DoNotRemoveObservationsOfTheseTypes,
boolean allowAutoPropagation)
This method will remove all Observations in the Scenario that are related to the specified ExtendedNode (determined by its ID, and the ID of the ExtendedBN in which it resides). |
void |
removeObservationsForNodeExpression(int connExtendedBNID,
int connExtendedNodeID,
java.lang.String parameterName)
This method will remove all observations for the specified node that have the same parameter name as the one specified in the third argument |
void |
removeScenarioListener(ScenarioListener sl)
Removes an object no longer interested in ScenarioEvents from the List of ScenarioListeners (actually held by an internal ScenarioEventGenerator). |
void |
setDisplayOnRiskGraphs(boolean displayOnRiskGraphs)
|
void |
setId(int id)
Sets the unique ID of the Scenario to the ID specified. |
void |
setName(NameDescription name)
Sets the name of the Scenario to the name specified. |
void |
setReportable(boolean reportable)
Flag can be toggled by external objects to determine whether the scenario is reportable (the user is interested in seeing its results). |
void |
setUserDefinedRelevantExtendedBNIds(int[] userDefinedRelevantExtendedBNIds)
Sets the user-defined ExtendedBN IDs that are deemed relevant to this Scenario. |
void |
setVersion(double version)
Sets the version number of the class. |
java.lang.String |
toString()
Returns a String representation of this Scenario. |
void |
updateExpressionParameterName(int extendedBNID,
int extendedNodeID,
java.lang.String oldname,
java.lang.String newName)
This method updates all observatins connected to the specified node with the specified parameter expression name, with the new name of the parameter |
void |
updateUserDefinedRelevantExtendedBNIds(int[] oldExtendedBNIds,
int[] newExtendedBNIds)
Updated the User defined relevant extended BN ids with the two argument arrays. |
void |
updateUserDefinedRelevantExtendedBNIds(int oldId,
int newId)
Updates an ExtendedBN ID in the array of relevant ones with the new value. |
java.util.List |
write()
Writes the object in question to a List of Strings. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static double version
Constructor Detail |
---|
public Scenario()
public Scenario(NameDescription name)
Method Detail |
---|
public double getVersion()
Writable
getVersion
in interface Writable
public void setVersion(double version)
Writable
setVersion
in interface Writable
version
- the version numberpublic int getId()
getId
in interface Identifiable
public void setId(int id)
id
- the new ID for the Scenariopublic NameDescription getName()
getName
in interface Nameable
public void setName(NameDescription name)
setName
in interface Nameable
name
- the new name for the Scenariopublic boolean isReportable()
public void setReportable(boolean reportable)
public int[] getUserDefinedRelevantExtendedBNIds()
public void setUserDefinedRelevantExtendedBNIds(int[] userDefinedRelevantExtendedBNIds)
userDefinedRelevantExtendedBNIds
- the user-defined ExtendedBN IDs that are deemed relevant to this Scenariopublic void addUserDefinedRevantExtendedBNIds(int[] additionalUserDefinedRelevantExtendedBNIds)
public java.util.List getObservations()
public boolean isDisplayOnRiskGraphs()
public void setDisplayOnRiskGraphs(boolean displayOnRiskGraphs)
displayOnRiskGraphs
- The displayOnRiskGraphs to set.public void addRealObservation(int extendedBNId, int extendedNodeId, double value)
public void addIntegerObservation(int extendedBNId, int extendedNodeId, int value)
public void addHardEvidenceObservation(int extendedBNId, int extendedNodeId, int stateId)
public void addSoftEvidenceObservation(int extendedBNId, int extendedNodeId, int[] stateIds, double[] probabilities) throws ScenarioException
ScenarioException
public void addObservation(Observation observation, boolean allowAutoPropagation)
observation
- the Observation to be addedallowAutoPropagation
- If this flag is set to false Auto Propagation will not occur even if Auto Propagation is ON.public void clearObservationsForNode(int extendedBNId, int extendedNodeId)
extendedBNId
- the relevant BNextendedNodeId
- the relevant Nodepublic void removeObservationsForNode(int connExtendedBNID, int connExtendedNodeID, int[] DoNotRemoveObservationsOfTheseTypes, boolean allowAutoPropagation)
connExtendedBNID
- The ID of the ExtendedBN in which the ExtendedNode sitsconnExtendedNodeID
- the ID of the ExtendedNode.public void removeObservationsForNodeExpression(int connExtendedBNID, int connExtendedNodeID, java.lang.String parameterName)
connExtendedBNID
- connExtendedNodeID
- parameterName
- public void removeObservationsForExtendedBN(int exBNId)
exBNId
- public void removeObservation(Observation ob, boolean allowAutoPropagation)
ob
- The Observation to remove.public void clearAllObservations()
public Observation getObservation(int connExtendedBNId, int connExtendedNodeId) throws ObservationNotFoundException
connExtendedBNId
- the ID of the ExtendedBN with which the Observation is associatedconnExtendedNodeId
- the ID of the ExtendedNode with which the Observation is associated
ObservationNotFoundException
- if there is noObservation associated with the ExtendedNode IDpublic int getDirectObservation(int connExtendedBNId, int connExtendedNodeId) throws ObservationNotDirectException, ObservationNotFoundException, ObservationNotInitialisedException
connExtendedBNId
- the ID of the ExtendedBN with which the Observation is associatedconnExtendedNodeId
- the ID of the ExtendedNode with which the Observation is associated
ObservationNotDirectException
- if there is no direct observation on the specified ExtendedNode
ObservationNotFoundException
- if an Observation for the specified ExtendedNode does not exist
ObservationNotInitialisedException
- if the Observation has no datapublic java.util.List getObservations(int connExtendedBNId, int connExtendedNodeId)
connExtendedBNId
- connExtendedNodeId
-
public java.lang.Object clone()
clone
in class java.lang.Object
public int[] getRelevantExtendedBNIds()
public void addScenarioListenerPrimary(ScenarioListener sl)
sl
- the interested ScenarioListenerpublic void addScenarioListenerSecondary(ScenarioListener sl)
sl
- the interested ScenarioListenerpublic void removeScenarioListener(ScenarioListener sl)
sl
- the ScenarioListener no longer interestedpublic java.lang.String toString()
toString
in class java.lang.Object
public void updateUserDefinedRelevantExtendedBNIds(int oldId, int newId)
oldId
- the old ExtendedBN IDnewId
- the new ExtendedBN IDpublic void updateExpressionParameterName(int extendedBNID, int extendedNodeID, java.lang.String oldname, java.lang.String newName)
extendedBNID
- extendedNodeID
- oldname
- newName
- public void updateUserDefinedRelevantExtendedBNIds(int[] oldExtendedBNIds, int[] newExtendedBNIds)
oldExtendedBNIds
- newExtendedBNIds
- public java.util.List write() throws MinervaReadWriteException
Writable
write
in interface Writable
MinervaReadWriteException
- if therepublic int read(java.util.List strings, int currentLineNumber) throws MinervaReadWriteException
read
in interface Writable
MinervaReadWriteException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |