|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.co.agena.minerva.model.scenario.Observation
public class Observation
An Observation stores evidence that has been entered on a node in a BN. This evidence can either be a single selected state or a likelihood distribution across multiple states. Observations can be created by answering Questions or by entering numerical values (for nodes that are either absolute or interval).
Field Summary | |
---|---|
static int |
DEFAULT_CERTAINTY
The value representing certainty an ExtendedState that has been observed with certainty. |
static int |
OBSERVATION_TYPE_EXPRESSION_VARIABLE
|
static int |
OBSERVATION_TYPE_LONG_ANSWER
Represents an Observation that has been made using the long name of an Answer. |
static int |
OBSERVATION_TYPE_NUMERIC
Represents an Observation that has been made using a numerical value. |
static int |
OBSERVATION_TYPE_SHORT_ANSWER
Represents an Observation that has been made using the short name of an Answer. |
static double |
version
|
Fields inherited from interface uk.co.agena.minerva.util.model.Writable |
---|
FIELD_SEPARATOR |
Constructor Summary | |
---|---|
Observation()
Default constructor. |
|
Observation(int connExtendedBNId,
int connExtendedNodeId,
int connQuestionnaireId,
DataSet dataset,
int userEnteredAnswerMapping,
java.lang.String userEnteredAnswer)
Creates a fully specified Observation. |
|
Observation(int connExtendedBNId,
int connExtendedNodeId,
int connQuestionnaireId,
DataSet dataset,
int userEnteredAnswerMapping,
java.lang.String userEnteredAnswer,
java.lang.String uniqueExNodeIdWhenCreated,
int numExNodeStatesWhenCreated)
Creates a fully specified Observation including unique ID of connected node and number of states of connected node. |
Method Summary | |
---|---|
java.lang.Object |
clone()
This method will clone the observation, and return the new;y cloned object |
int |
getConnExtendedBNId()
Returns the ID of the ExtendedBN to which the Observation is connected. |
int |
getConnExtendedNodeId()
Returns the ID of the ExtendedNode to which the Observation is connected. |
int |
getConnQuestionnaireId()
Returns the ID of the Questionnaire to which the Observation is connected. |
DataSet |
getDataSet()
Returns the DataSet containing the actual observation data. |
int |
getDirectObservation()
Returns the ID of the selected ExtendedState state associated with this Observation. |
java.lang.String |
getExpressionVariableName()
|
int |
getId()
Returns the unique ID of the Observation. |
int |
getNumExNodeStatesWhenCreated()
|
java.lang.String |
getUniqueExNodeIdWhenCreated()
|
java.lang.String |
getUserEnteredAnswer()
Returns the answer entered by the user if one exists. |
int |
getUserEnteredAnswerMapping()
Returns the mapping that is used to interpret the user-entered answer. |
double |
getVersion()
Returns the version of the class. |
boolean |
isDirectObservation()
Determines whether there is a direct Observation i.e. |
int |
read(java.util.List strings,
int currentLineNumber)
|
void |
setConnExtendedBNId(int id)
Sets the ID of the ExtendedBN to which the Observation is connected. |
void |
setConnExtendedNodeId(int id)
Sets the ID of the ExtendedNode to which the Observation is connected. |
void |
setConnQuestionnaireId(int id)
Sets the ID of the Questionnaire to which the Observation is connected. |
void |
setDataSet(DataSet dataSet)
Sets the DataSet containing the actual observation data. |
void |
setExpressionVariableName(java.lang.String expressionVariableName)
|
void |
setId(int id)
Sets the unique ID of the Observation to the ID specified. |
void |
setNumExNodeStatesWhenCreated(int numExNodeStatesWhenCreated)
|
void |
setUniqueExNodeIdWhenCreated(java.lang.String uniqueExNodeIdWhenCreated)
|
void |
setUserEnteredAnswer(java.lang.String userEnteredAnswer)
Sets the user-entered answer for this Observation. |
void |
setUserEnteredAnswerMapping(int userEnteredAnswerMapping)
Sets the mapping that is used to interpret the user-entered answer. |
void |
setVersion(double version)
Sets the version number of the class. |
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, toString, wait, wait, wait |
Field Detail |
---|
public static double version
public static final int DEFAULT_CERTAINTY
public static int OBSERVATION_TYPE_SHORT_ANSWER
public static int OBSERVATION_TYPE_LONG_ANSWER
public static int OBSERVATION_TYPE_NUMERIC
public static int OBSERVATION_TYPE_EXPRESSION_VARIABLE
Constructor Detail |
---|
public Observation()
public Observation(int connExtendedBNId, int connExtendedNodeId, int connQuestionnaireId, DataSet dataset, int userEnteredAnswerMapping, java.lang.String userEnteredAnswer)
connExtendedBNId
- the ID of the connected ExtendedBNconnExtendedNodeId
- the ID of the connected ExtendedNodeconnQuestionnaireId
- the ID of the connected Questionnairedataset
- the DataSet containing the Observation datauserEnteredAnswerMapping
- indicates how the userEnteredAnswer parameter should be
interpreteduserEnteredAnswer
- the actual answer information entered by the userpublic Observation(int connExtendedBNId, int connExtendedNodeId, int connQuestionnaireId, DataSet dataset, int userEnteredAnswerMapping, java.lang.String userEnteredAnswer, java.lang.String uniqueExNodeIdWhenCreated, int numExNodeStatesWhenCreated)
connExtendedBNId
- the ID of the connected ExtendedBNconnExtendedNodeId
- the ID of the connected ExtendedNodeconnQuestionnaireId
- the ID of the connected Questionnairedataset
- the DataSet containing the Observation datauserEnteredAnswerMapping
- indicates how the userEnteredAnswer parameter should be
interpreteduserEnteredAnswer
- the actual answer information entered by the useruniqueExNodeIdWhenCreated
- the unique ID of the connected node as it stands when the Observation is created.numExNodeStatesWhenCreated
- the number of states in the connected node as it stands when the Observation is created.Method Detail |
---|
public int getNumExNodeStatesWhenCreated()
public void setNumExNodeStatesWhenCreated(int numExNodeStatesWhenCreated)
public java.lang.String getUniqueExNodeIdWhenCreated()
public void setUniqueExNodeIdWhenCreated(java.lang.String uniqueExNodeIdWhenCreated)
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 Observationpublic int getConnExtendedBNId()
public void setConnExtendedBNId(int id)
id
- the associated ExtendedBN IDpublic int getConnExtendedNodeId()
public void setConnExtendedNodeId(int id)
id
- the associated ExtendedNode IDpublic int getConnQuestionnaireId()
public void setConnQuestionnaireId(int id)
id
- the associated Questionnaire IDpublic DataSet getDataSet()
public java.lang.String getExpressionVariableName()
public void setExpressionVariableName(java.lang.String expressionVariableName)
expressionVariableName
- The expressionVariableName to set.public void setDataSet(DataSet dataSet)
dataSet
- the new DataSetpublic java.lang.Object clone()
clone
in class java.lang.Object
public boolean isDirectObservation() throws ObservationNotInitialisedException
ObservationNotInitialisedException
- if the Observation has not been initialisedpublic int getDirectObservation() throws ObservationNotDirectException, ObservationNotInitialisedException
ObservationNotDirectException
- if the Observation is not direct
ObservationNotInitialisedException
- if the Observation has no datapublic java.lang.String getUserEnteredAnswer()
public void setUserEnteredAnswer(java.lang.String userEnteredAnswer)
userEnteredAnswer
- the value of the entered answer or an empty Stringpublic int getUserEnteredAnswerMapping()
public void setUserEnteredAnswerMapping(int userEnteredAnswerMapping)
userEnteredAnswerMapping
- the new mapping typepublic 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 |