|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.co.agena.minerva.model.Model
public class Model
This class encapsulates all of the ExtendedBNs, Scenarios and Questionnaires in an application and mediates all interaction between them.
Field Summary | |
---|---|
static int |
APPLY_SCENARIO_EXCLUDE_NODES
Indicates that a Scenario should be applied to all specified ExtendedNodes in a given ExtendedBN except those specified. |
static int |
APPLY_SCENARIO_EXCLUSIVELY
Indicates that before a Scenario is applied to any ExtendedBN which this Scenario affects, all other evidence is removed. |
static int |
APPLY_SCENARIO_INCLUDE_ONLY_NODES
Indicates that a Scenario should only be applied to the specified ExtendedNodes in a given ExtendedBN. |
static int |
APPLY_SCENARIO_INEXCLUSIVELY
Indicates that before a Scenario is applied to any ExtendedBN in this model, all other evidence is left in the ExtendedBN; the new Scenario is applied "on top of" any existing evidence. |
static int |
APPLY_SCENARIO_MODEL_EXCLUSIVELY
Indicates that before a Scenario is applied to any ExtendedBN in this model, all other evidence is removed. |
static int |
APPLY_SCENARIO_NO_SPECIFIC_NODES
Indicates that a Scenario should be applied to all ExtendedNodes in a given ExtendedBN. |
static int |
SCENARIO_IMPORT_NODE_NOT_FOUND
|
static int |
SCENARIO_IMPORT_WRONG_NODE_ID
|
static int |
SCENARIO_IMPORT_WRONG_STATES_UNWORKABLE
|
static int |
SCENARIO_IMPORT_WRONG_STATES_WORKABLE
|
static double |
version
|
Fields inherited from interface uk.co.agena.minerva.model.PropagationListener |
---|
successfulSimulationCompletion |
Fields inherited from interface uk.co.agena.minerva.util.model.Writable |
---|
FIELD_SEPARATOR |
Constructor Summary | |
---|---|
Model()
Default constructor. |
Method Summary | |
---|---|
int |
addExtendedBN(ExtendedBN ebn)
Adds the supplied ExtendedBN to the Model. |
int |
addExtendedBN(ExtendedBN ebn,
boolean compiled)
Adds the supplied ExtendedBN to the Model's ExtendedBNList and compiles it (if required and if it is not already compiled). |
int |
addExtendedBN(ExtendedBN ebn,
boolean compiled,
boolean fireMergeModelEvent)
Adds the supplied ExtendedBN to the Model's ExtendedBNList and compiles it (if required and if if it is not already compiled). |
ExtendedBN |
addExtendedBN(java.lang.String name,
java.lang.String description)
Creates an empty BN with the supplied name and description and adds it to this model's list. |
int[] |
addExtendedBNs(java.util.List extendedBNs,
boolean compiled)
Adds the supplied List of ExtendedBNs to this Model's List of ExtendedBNs and compiles them (if required and if if they are not already compiled). |
int[] |
addExtendedBNs(java.util.List extendedBNs,
boolean compiled,
boolean fireMergeModelEvent)
Adds the supplied List of ExtendedBNs to this Model's List of ExtendedBNs and compiles them (if required and if if they are not already compiled). |
boolean |
addMessageParseLink(ExtendedNode sourceNode,
ExtendedBN targetexBN)
This method will create a new message parse link from the specified source node, and the selected target BN a Clone of the source node will be created and added to the target BN in order to create the link. |
void |
addMessageParseLink(ExtendedNode sourceNode,
ExtendedNode targetNode)
This method will add the specified message parssing link to the model. |
void |
addMessagePassingLinks(java.util.List newMessagePassingLinks,
boolean fireMergeModelEvent)
Adds the supplied MessagePassingLinks objects to the Model's List. |
void |
addModelListener(ModelListener ebnl)
Adds an object interested in ModelEvents to the List of ModelListeners (actually held by an internal ModelEventGenerator). |
void |
addQuestionnaire(uk.co.agena.minerva.model.questionnaire.Questionnaire questionnaire)
Adds the supplied Questionnaire to the Model's QuestionnaireList. |
void |
addQuestionnaire(uk.co.agena.minerva.model.questionnaire.Questionnaire questionnaire,
boolean fireMergeModelEvent)
Adds the supplied Questionnaire to the Model's QuestionnaireList. |
void |
addQuestionnaires(java.util.List questionnaires)
Adds the supplied Questionnaires to the Model's QuestionnaireList. |
void |
addQuestionnaires(java.util.List questionnaires,
boolean fireMergeModelEvent)
Adds the supplied Questionnaires to the Model's QuestionnaireList. |
void |
addScenario(Scenario scenario,
boolean fireScenarioAddedEvent,
java.lang.Object ebnOrMDI)
Adds a scenario to the model |
void |
addScenario(Scenario scenario,
java.lang.Object ebnOrMDI)
Adds the supplied Scenario to the Model's ScenarioList. |
Scenario |
addScenario(java.lang.String name)
|
void |
addScenarios(java.util.List scenarios)
Adds the supplied Scenarios to the Model's ScenarioList. |
void |
addScenarios(java.util.List scenarios,
boolean fireMergeModelEvent)
|
void |
applyScenario(Scenario scenario,
boolean propagate,
int exclusivity,
boolean useClosestMedianIfPossible)
Applies the Scenario to all the relevant ExtendedBNs in this Model. |
void |
applyScenario(Scenario scenario,
boolean propagate,
int exclusivity,
java.util.List extendedBNs2applyOn,
boolean useClosestMedianIfPossible)
Applies the Scenarios only to the ExtendedBNs contained in the supplied List. |
void |
applyScenario(Scenario scenario,
boolean propagate,
int exclusivity,
java.util.List extendedBNs2applyOn,
boolean overrideCallSign,
java.lang.String[] overridingCallSigns,
boolean useClosestMedianIfPossible)
Applies the Scenarios only to the ExtendedBNs contained in the supplied List using the supplied call sign information. |
void |
applyScenario(Scenario scenario,
boolean propagate,
int exclusivity,
java.util.List extendedBNs2applyOn,
int incl_excl,
java.lang.String[] nodes2Incl_Excl,
boolean overrideCallSign,
java.lang.String[] overridingCallSigns,
boolean useClosestMedianIfPossible)
Applies the Scenarios only to the ExtendedBNs contained in the supplied list using the supplied call sign information and information about which nodes to include and exclude. |
void |
autoGenerateMessagePassingLinks(ExtendedBN rootBN,
ExtendedBN targetBN)
Automatically generates MessagePassingLinks objects between the supplied ExtendedBNs depending on their input and output nodes. |
void |
autoLinkBNOs()
This method uses the generic link generator and the link generator property uk.co.agena.minervaapps.basicminerva.linkgenerator in the minerva.properties file to generate the message passing8 links on this model between the BNO's. |
void |
calculate()
|
void |
calculate(java.util.List scenarios)
|
void |
calculate(java.util.List scenarios,
java.util.List exbns)
|
java.lang.String |
checkBasicPropagationRequirements(java.lang.String propagationType)
This method will call the propagation algorithm to do some basic checks. |
void |
checkCreationTimestamps(java.lang.String licenceType)
Check the difference between the creation timestamp, stored in the CoreBN's associated with this model, and the current time does not exceed a certain limit. |
void |
clearAllObservations()
Clears all observations in this model. |
void |
clearAllObservations(ExtendedBN ebn)
Clears all the observations for a given ExtendedBN. |
void |
clearObservations(boolean onlyActiveScenarios)
Removes all the Observations for all the ExtendedBNs in this Model. |
void |
clearObservations(ExtendedBN ebn,
boolean onlyActiveScenarios)
Removes all the observations for a given ExtendedBN. |
void |
clearProblemNodes()
Empties out the list of problem nodes. |
void |
compileAllExtendedBNs()
Compiles all ExtendedBNs in the Model. |
boolean |
containsDDNodes()
|
void |
copyQuestions(java.util.List sourceQuestions,
java.util.List targetQuestions,
java.lang.String counter,
int targetBNID,
int targetNodeID)
Copy the properties of the source Questions to those of the target Questions. |
static Model |
createEmptyModel()
|
static Model |
createModelFromNetFile(java.lang.String loadFromNetFile)
Creates a new model adding the net file in the string |
java.util.List |
createModificationLogsInreleventBNs(java.util.List effectedExBns,
ModelEvent me,
NameDescription nd)
Locates the extended Bns that require a modifcation log, and creates them. |
void |
createMPLinksFromFile(java.lang.String linkMappingfilename)
Message passing links are created using a configuration file. |
static uk.co.agena.minerva.model.questionnaire.Questionnaire |
createQuestionnaireFromExtendedBN(ExtendedBN extendedbn)
Creates a default Questionnaire from the supplied ExtendedBN. |
void |
deleteExtendedBN(ExtendedBN ebn)
Deletes the supplied BN from the model. |
void |
deleteExtendedBNs(java.util.List ebns)
Removes the BNs in the supplied list from the model. |
void |
deleteScenario(Scenario scenario)
Deletes the supplied Scenario from the model. |
void |
deleteScenarios(java.util.List scenarios)
Removes the Scenarios in the supplied list from the model. |
void |
destroy()
Removes this Model as a listener from all Scenarios, Questionnaires and ExtendedBNs. |
void |
extendedBNAboutToBePropagated(ExtendedBNEvent ebne)
Not currently implemented |
void |
extendedBNAllEvidenceRetracted(ExtendedBNEvent ebne)
Not currently implemented. |
void |
extendedBNConnBNNotFound(ExtendedBNEvent ebne)
Loads up the relevant CoreBN when it is required and when its ExtendedBN has informed listeners that it is not present. |
void |
extendedBNIDChanged(ExtendedBNEvent ebne)
Changes the connected IDs on Questions, Observations and MessagePassingLinks objects in response to the ID on an ExtendedBN changing. |
void |
extendedBNInconsistentEvidencePropagated(ExtendedBNEvent ebne)
Responds to inconsistent evidence being propagated on one of this Model's ExtendedBNs. |
void |
extendedBNNameDescriptionChanged(ExtendedBNEvent ebne)
Tells all registered listeners that this Model has changed (in response to the name of one of its ExtendedBNs having changed). |
void |
extendedBNPropagated(ExtendedBNEvent ebne)
Not currently implemented. |
void |
extendedNodeAboutToBeCut(ExtendedBNEvent ebne,
ExtendedBN sourceEXBN,
int targetEXNodeID,
int sourceEXNodeID,
java.lang.String nameCounter)
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)
Extended Node pasted event, fired by the extended BN |
void |
extendedNodeRemoved(ExtendedBNEvent ebne,
ExtendedNode exnode)
Extended Node removed event, fired by 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. |
java.util.List |
findIdentifiables(java.lang.String className,
java.lang.String searchTerm)
Searches for all Identifiable objects of the supplied class using the supplied search term. |
void |
fireModelChangedEvent(Model model,
int eventType,
java.util.List eventAttributes)
Fires a model changed event with the specified parameters |
static uk.co.agena.minerva.model.questionnaire.Question |
generateQuestionFromNode(ExtendedBN extendedbn,
ExtendedNode extendedNode)
|
java.util.Set |
getAncestorExtendedBNs(ExtendedBN ebn)
This method will use the MessagePassingLinks to get all the Ancestors of the argument ExtendedBN This is done recursively using the getParentExtendedBNs method. |
java.util.List |
getChildren()
Returns the children of this Model. |
java.util.List |
getChildrenExtendedBNs(ExtendedBN ebn)
This method uses the message passing links to return a list of the children ExtendedBNs of the argument BN. |
java.util.Map |
getCoreFilenamesToCoreBNs()
|
java.util.Set |
getDecendentExtendedBNs(ExtendedBN ebn)
This method will use the MessagePassingLinks to get all the decendents of the argument ExtendedBN This is done recursively using the getChildrenExtendedBNs method. |
ExtendedBN |
getExtendedBNAtIndex(int index)
Returns the BN at the supplied index in the model's list of BNs. |
ExtendedBN |
getExtendedBNForNode(ExtendedNode node)
|
ExtendedBNList |
getExtendedBNList()
Returns this Model's ExtendedBNList. |
java.util.List |
getExtendedBNs(int[] ebnIds)
Returns all ExtendedBNs corresponding to the supplied IDs. |
ExtendedBN |
getExtendedBNWithName(java.lang.String name)
Returns the BN with the supplied name. |
ExtendedNode |
getExtendedNodeWithName(java.lang.String name)
|
java.lang.String |
getFullyQualifiedPathForNode(ExtendedNode exNode)
Returns a string that contains the full path of the selected node: mdiPath.exbnName |
int |
getId()
Returns the ID of this Model. |
java.util.List |
getListOfOrderedMessagePassingLinksLists()
Returns the MessagePassingLinks objects associated with this Model as a set of Lists, such that each List contains MessagePassingLinks objects that have the same priority level. |
MarginalDataStore |
getMarginalDataStore()
|
MessagePassingLinks |
getMessageParseLinkWithID(int id)
Returns the message parse link with the specified ID |
java.util.List |
getMessagePassingLinks()
Return's this Model's List of MessagePassingLinks objects. |
protected java.util.List |
getMessagePassingLinksForChild(int childId)
Returns the MessagePassingLinks objects that have the ExtendedBN with the supplied ID as a child. |
java.util.List |
getMessagePassingLinksForParent(int parentId)
Returns the MessagePassingLinks objects that have the ExtendedBN with the supplied ID as a parent. |
uk.co.agena.minerva.model.metadata.MetaData |
getMetaData()
|
NameDescription |
getName()
Returns the name of this Model. |
java.util.List |
getNetFileAestheticData()
Returns a List holding the aesthetic data relating to nodes of a .net file such as x and y co-ordinates. |
Notes |
getNotes()
Tne notes set connected to the model |
java.util.List |
getParentExtendedBNs(ExtendedBN ebn)
This method uses the message passing links to return a list of the parent ExtendedBNs of the argument BN. |
int |
getParentId()
Returns the parent ID of this Model |
java.util.List |
getProblemNodes()
|
Propagation |
getPropagationAlgorithm()
This is the propagation algorithm that will be used for this model. |
int |
getPropagationCalculationEstimate()
Returns the estimated number of calculations required by the propagation algorithm. |
uk.co.agena.minerva.model.questionnaire.QuestionnaireList |
getQuestionnaireList()
Returns this Model's QuestionnaireList. |
java.util.List |
getQuestionnaires(int[] qIds)
Returns all Questionnaires corresponding to the supplied IDs. |
int |
getRankedSampleSize()
|
int |
getSampleSize()
|
Scenario |
getScenarioAtIndex(int index)
Returns the Scenario at the supplied index in the model's list of Scenarios. |
ScenarioList |
getScenarioList()
Returns this Model's ScenarioList. |
java.util.List |
getScenarios(int[] sIds)
Returns all Scenarios corresponding to the supplied IDs. |
Scenario |
getScenarioWithName(java.lang.String name)
Returns the Scenario with the supplied name in the list of the model's Scenarios. |
double |
getSimulationEntropyConvergenceTolerance()
|
double |
getSimulationEvidenceTolerancePercent()
|
int |
getSimulationNoOfIterations()
|
java.util.List |
getUnmarkedMessagePassingExtendedBNs()
Gets all the ExtendedBNs that are not flagged to have been visted by the MessagePassing algorithm. |
java.util.List |
getUnmatchedNodeNames()
|
double |
getVersion()
Returns the version of the class. |
void |
importScenarios(ScenarioList sl)
Takes the supplied list of Scenarios and adds them to the Model. |
boolean |
isAllParentExtendedBNsMarkedForMessagePassing(ExtendedBN extendedBN)
|
boolean |
isFireUpExtendedNodeEvent()
|
boolean |
isMetaDataUsed()
|
boolean |
isPropagateUsingModelScenarios()
|
boolean |
isSimulationLogging()
|
void |
link(ExtendedNode source,
ExtendedNode target)
Links the two ExtendedNodes together, thereby linking the two containing ExtendedBNs. |
static Model |
load(java.lang.String filename)
Loads the model from the supplied file. |
void |
loadScenariosFromCSV(java.util.List csvStrings)
Takes the supplied set of CSV strings, creates scenarios from it and loads them into the Model (replacing any existing scenarios). |
java.util.List |
LocateModelObjectsNoConnectedToMetaDataItems(boolean removeUnConnectedScenarios,
boolean removeUnConnectedQuestionnaires,
boolean removeUnconnectedExtendedBNs)
This method will itterate over the model items (Extended BNs, scenarios and questionnaires), and add to a return list all those that are not connected to any of the meta data objects connected to the model. |
void |
merge(Model model,
boolean destroyArgumentModel,
boolean useArgumentModelMetaData,
uk.co.agena.minerva.model.metadata.MetaDataItem mdiToPlaceMergedItemUnder)
Merges the supplied Model into this one, by adding its Questionnaires, ExtendedBNs, Scenarios and MessagePassingLinks objects. |
void |
observationsAdded(ScenarioEvent se,
java.util.List obs,
boolean allowAutoPropagation)
Gets the Observations from the supplied ScenarioEvent and enters them into the relevant ExtendedBN. |
void |
observationsRemoved(ScenarioEvent se,
java.util.List obs,
boolean autopropagate)
Gets the Observations from the supplied ScenarioEvent and removes them from the current relevant ExtendedBNs in the model. |
void |
propagate(java.util.List scenarios,
java.util.List extendedBNsToUse)
This method should be called to propagate the model. |
void |
propagateAllExtendedBNs(boolean fireUpExtendedNodeEvents)
Propagates all ExtendedBNs in this Model's ExtendedBNList. |
void |
propagateDDAlgorithm(java.util.List scenarios)
This method will propagate all extendedBNs as normal. |
void |
propagateDDAlgorithm(java.util.List scenarios,
java.util.List exbns,
boolean local,
boolean withAncestors)
This method will be call the DD propagation after deriving which ExtendedBNs to actually propagate dependent on its arguments. |
void |
propagationIncremented(PropagationEvent ebne,
int timePeriodPropagated)
Fired whenever a cycle of a Propagation has finished. |
void |
questionAdded(uk.co.agena.minerva.model.questionnaire.QuestionnaireEvent qe,
uk.co.agena.minerva.model.questionnaire.Question q)
This event is fired whenever a new question is added to the questionnaire |
void |
questionEventFired(uk.co.agena.minerva.model.questionnaire.QuestionnaireEvent qte,
uk.co.agena.minerva.model.questionnaire.QuestionEvent qe,
int eventType)
This event is fired up to the questionnaire listeners when the questionnaire receives an event from one of its questions. |
void |
questionnaireChanged(uk.co.agena.minerva.model.questionnaire.QuestionnaireEvent ebne)
Event fired by questionnaires |
void |
questionnaireIDChanged(uk.co.agena.minerva.model.questionnaire.QuestionnaireEvent qe)
Informs all Observations within this Model when the ID for a connected Questionnaire changes. |
void |
questionsRemoved(uk.co.agena.minerva.model.questionnaire.QuestionnaireEvent qe,
java.util.List questions)
Fired whenever one or more questions are removed from a questionnaire. |
int |
read(java.util.List strings,
int currentLineNumber)
|
void |
regenerateProblemNPTs()
Checks the list of problem nodes and, if there are any, regenerates their NPTs. |
void |
reinitialiseAllExtendedBNs()
Reinitialises all ExtendedBNs in this Model's ExtendedBNList. |
void |
removeAllMessageParsesBetweenBNs(ExtendedBN source,
ExtendedBN target)
This method removes all MessagePassingLinks objects that exist between the two specified ExtendedBNs. |
void |
removeAllMessagePassesForBN(int extendedBNId)
Given the ID of an ExtendedBN, this method will then remove all the MessagePassingLinks objects that are associated with it. |
void |
removeAllMessagePassLinks()
Removes all message passing links |
void |
removeAllTracesOfExtendedNode(ExtendedBN ebn,
ExtendedNode enode)
Removes the supplied ExtendedNode from its ExtendedBN. |
void |
removeCrossMDIMessagePassingLinks()
This method will remove all Message Passing links that exist between ExtendedBNs of 2 different Metadataitems. |
void |
removeExtendedBNs(ExtendedBN exBN,
boolean invokeDestroy)
Convinence method for the remove extended BNs, takes a single BN, calls the list based remove extended Bns |
void |
removeExtendedBNs(java.util.List extendedBNs,
boolean invokeDestroy)
Removes a specified ExtendedBN from this Model. |
void |
removeMessageParseLinks(ExtendedNode sourceNode,
ExtendedNode targetNode)
Removes all message parsing links between the specified nodes |
void |
removeModelListener(ModelListener ebnl)
Removes an object no longer interested in ModelEvents from the List of ModelListeners (actually held by an internal ModelEventGenerator). |
void |
removeModificationLogsFoeExBNs(java.util.List exBNs)
This method will remove the inconsitency logs for the specified BNs |
void |
removeQuestionnaire(uk.co.agena.minerva.model.questionnaire.Questionnaire q)
This method will remove the selected questionnaire from the model. |
void |
removeScenario(Scenario scenario)
|
void |
resetAllScenarios()
Removes all Observations from all Scenarios. |
void |
retractAllEvidence()
Retracts evidence from all ExtendedBNs in this Model. |
void |
save(java.lang.String filename)
Saves the model to the specified file |
void |
saveCreationTimestamp(java.lang.String licenceType)
Stores a time stamp in the each of the CoreBN's associated with this model. |
void |
scenarioAttributeChanged(ScenarioEvent se,
int attribute)
Fired whenever an attribute of the scenario is modified |
void |
setChildren(java.util.List children)
Sets the children for this Model. |
void |
setCoreFilenamesToCoreBNs(java.util.Map coreFilenamesToCoreBNs)
|
void |
setDefaultScenario()
Creates scenarios for each of the metadataitems extendedbns for those which do not have any connected scenarios. |
void |
setExtendedBnList(java.util.List extendedBns)
Sets the ExtendedBNs for this Model. |
void |
setFireUpExtendedNodeEvent(boolean fireUpExtendedNodeEvent)
|
void |
setId(int id)
Sets the ID of this Model. |
void |
setMarginalDataStore(MarginalDataStore marginalDataStore)
|
void |
setMessagePassingLinks(java.util.List messagePassingLinks)
Sets the MessagePassingLinks objects associated with this Model. |
void |
setMetaData(uk.co.agena.minerva.model.metadata.MetaData metaData)
|
void |
setMetaDataUsed(boolean b)
|
void |
setName(NameDescription name)
Sets the name of this Model. |
void |
setNetFileAestheticData(java.util.List netFileAestheticData)
|
void |
setNotes(Notes notes)
Tne notes set connected to the model |
void |
setParentId(int parentId)
Sets the parent ID of this Model. |
void |
setProblemNodes(java.util.List problemNodeNames)
|
void |
setPropagateUsingModelScenarios(boolean propagateUsingModelScenarios)
|
void |
setPropagationAlgorithm(Propagation p)
This is the propagation algorithm that will be used for this model. |
void |
setQuestionnaireList(java.util.List questionnaires)
Sets the Questionnaires for this Model. |
void |
setRankedSampleSize(int rankedSampleSize)
|
void |
setSampleSize(int sampleSize)
|
void |
setScenarioList(java.util.List scenarios)
Sets this Model's ScenarioList |
void |
setSimulationEntropyConvergenceTolerance(double simulationEntropyConvergenceTolerance)
|
void |
setSimulationEvidenceTolerancePercent(double simulationEvidenceTolerancePercent)
|
void |
setSimulationLogging(boolean simulationLogging)
|
void |
setSimulationNoOfIterations(int simulationNoOfIterations)
|
void |
setUnmatchedNodeNames(java.util.List unmatchedNodeNames)
|
void |
setUpMetaData(uk.co.agena.minerva.model.metadata.MetaData metaData,
java.util.List ids,
java.util.Map typesConnections)
|
void |
setupNonRecursiveParameterPasses(MessagePassingLinks mplinks,
int noOfPassesAllowed,
boolean forceSetNPT,
boolean savePrior,
boolean changeStatesOnInputNodeIfRequired)
Same as setupParameterPasses but only for non recursive links |
void |
setupParameterPasses(MessagePassingLinks mplinks,
int noOfPassesAllowed,
boolean forceSetNPT,
boolean savePrior,
boolean changeStatesOnInputNodeIfRequired)
Connects the two supplied ExtendedBNs together so that information can be passed between them. |
void |
setupRecursiveParameterPasses(MessagePassingLinks mplinks,
int noOfPassesAllowed,
boolean forceSetNPT,
boolean savePrior,
boolean changeStatesOnInputNodeIfRequired)
Same as setupParameterPasses but only for recursive links |
void |
setUpScenarios()
Ensures that Scenarios are set up correctly once a Model has been loaded in. |
void |
setVersion(double version)
Sets the version number of the class. |
void |
shiftQuestionnaireInModelList(uk.co.agena.minerva.model.questionnaire.Questionnaire q,
uk.co.agena.minerva.model.questionnaire.Questionnaire relationQ,
int moveDirection)
This method will reorder the specified questionnaire in the model list of questionnaires and reorder it in the connected meta data layer |
void |
simulationFinished(PropagationEvent ebne,
boolean completedSuccessfully,
java.util.List propagatedExtendedBNs)
Fired whenever an execution of a Propagation has finished. |
void |
simulationStarted(PropagationEvent msmpe)
Fired whenever an execution of a Propagation is about to be Started. |
void |
synchroniseQuestionAnswersToNodeStates(ExtendedBN exBN,
ExtendedNode exNode)
This method will locate all questions connected to the specified node, and ensure that if the question is configured to auto synchronise the answers to the states in the connected node then it there is indeed a 1-1 mapping |
void |
updateNewAndImportedBNsTimestamps(java.util.List bns)
The CoreBN's being added/imported into this model need to have the creation timestamps set to be identical to those CoreBN's currently in the Model. |
java.util.List |
write()
Writes the object in question to a List of Strings. |
java.util.List |
writeMarginalsToCSV()
Writes the marginals in the model to a List of CSV strings that can be saved to a file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static double version
public static final int APPLY_SCENARIO_MODEL_EXCLUSIVELY
public static final int APPLY_SCENARIO_EXCLUSIVELY
public static final int APPLY_SCENARIO_INEXCLUSIVELY
public static int APPLY_SCENARIO_NO_SPECIFIC_NODES
public static int APPLY_SCENARIO_INCLUDE_ONLY_NODES
public static int APPLY_SCENARIO_EXCLUDE_NODES
public static final int SCENARIO_IMPORT_WRONG_NODE_ID
public static final int SCENARIO_IMPORT_WRONG_STATES_WORKABLE
public static final int SCENARIO_IMPORT_WRONG_STATES_UNWORKABLE
public static final int SCENARIO_IMPORT_NODE_NOT_FOUND
Constructor Detail |
---|
public Model()
Method Detail |
---|
public static Model createEmptyModel() throws ModelException
ModelException
public static Model createModelFromNetFile(java.lang.String loadFromNetFile) throws ModelException
netfile
- compile
-
ModelException
public static uk.co.agena.minerva.model.questionnaire.Questionnaire createQuestionnaireFromExtendedBN(ExtendedBN extendedbn)
extendedbn
- the ExtendedBN from which the Questionnaire is to be created
public static uk.co.agena.minerva.model.questionnaire.Question generateQuestionFromNode(ExtendedBN extendedbn, ExtendedNode extendedNode)
public void setDefaultScenario()
public void propagate(java.util.List scenarios, java.util.List extendedBNsToUse) throws PropagationException, InconsistentEvidenceException, PropagationTerminatedException
scenarios
- enter null to use all the scenarios available in the model.
PropagationException
InconsistentEvidenceException
PropagationTerminatedException
public void propagateDDAlgorithm(java.util.List scenarios) throws InconsistentEvidenceException, PropagationException, PropagationTerminatedException
exbns
- This is a list of extendedBns to propagatelocal
- This should be true if the user has requested a local propagationwithAncestors
- If this is a local propagation it may also want to include its ancestors, then this should be true
PropagationTerminatedException
PropagationException
InconsistentEvidenceException
public void calculate() throws InconsistentEvidenceException, PropagationException, PropagationTerminatedException
InconsistentEvidenceException
PropagationException
PropagationTerminatedException
public void calculate(java.util.List scenarios) throws InconsistentEvidenceException, PropagationException, PropagationTerminatedException
InconsistentEvidenceException
PropagationException
PropagationTerminatedException
public void calculate(java.util.List scenarios, java.util.List exbns) throws InconsistentEvidenceException, PropagationException, PropagationTerminatedException
InconsistentEvidenceException
PropagationException
PropagationTerminatedException
public void propagateDDAlgorithm(java.util.List scenarios, java.util.List exbns, boolean local, boolean withAncestors) throws InconsistentEvidenceException, PropagationException, PropagationTerminatedException
exbns
- This is a list of extendedBns to propagatelocal
- This should be true if the user has requested a local propagationwithAncestors
- If this is a local propagation it may also want to include its ancestors, then this should be true
PropagationTerminatedException
PropagationException
InconsistentEvidenceException
public boolean containsDDNodes()
public java.util.Map getCoreFilenamesToCoreBNs()
public void setCoreFilenamesToCoreBNs(java.util.Map coreFilenamesToCoreBNs)
public int getPropagationCalculationEstimate()
public java.lang.String checkBasicPropagationRequirements(java.lang.String propagationType)
propagationType
- The type of propagation we are dealing with.
public java.util.List getNetFileAestheticData()
public void setNetFileAestheticData(java.util.List netFileAestheticData)
public int getId()
getId
in interface Identifiable
public void setId(int id)
id
- the new Model IDpublic double getVersion()
Writable
getVersion
in interface Writable
public void setVersion(double version)
Writable
setVersion
in interface Writable
version
- the version numberpublic java.util.List getProblemNodes()
public void setProblemNodes(java.util.List problemNodeNames)
public int getParentId()
getParentId
in interface FamilyMember
public void setParentId(int parentId)
setParentId
in interface FamilyMember
parentId
- the new parent ID for this Modelpublic NameDescription getName()
getName
in interface Nameable
public void setName(NameDescription name)
setName
in interface Nameable
name
- the new name of this Modelpublic Notes getNotes()
public void setNotes(Notes notes)
public java.util.List getChildren()
getChildren
in interface FamilyMember
public void setChildren(java.util.List children)
setChildren
in interface FamilyMember
children
- the new children for this Modelpublic int getRankedSampleSize()
public void setRankedSampleSize(int rankedSampleSize)
rankedSampleSize
- The rankedSampleSize to set.public int getSampleSize()
public void setSampleSize(int sampleSize)
sampleSize
- The sampleSize to set.public double getSimulationEntropyConvergenceTolerance()
public void setSimulationEntropyConvergenceTolerance(double simulationEntropyConvergenceTolerance)
simulationEntropyConvergenceTolerance
- The simulationEntropyConvergenceTolerance to set.public double getSimulationEvidenceTolerancePercent()
public void setSimulationEvidenceTolerancePercent(double simulationEvidenceTolerancePercent)
simulationEvidenceTolerancePercent
- The simulationEvidenceTolerancePercent to set.public int getSimulationNoOfIterations()
public void setSimulationNoOfIterations(int simulationNoOfIterations)
simulationNoOfIterations
- the number of simulation iterations to setpublic boolean isSimulationLogging()
public void setSimulationLogging(boolean simulationLogging)
simulationLogging
- The simulationLogging to set.public void merge(Model model, boolean destroyArgumentModel, boolean useArgumentModelMetaData, uk.co.agena.minerva.model.metadata.MetaDataItem mdiToPlaceMergedItemUnder) throws ModelException, InconsistentEvidenceException, uk.co.agena.minervaapps.basicminerva.linkgenerator.LinkModelException
model
- the Model to be merged with this onedestroyArgumentModel
- if the imported meta data should be used, (like in Modist), false if it should be destroyed and we create our own (like Obsolesence)mdiToPlaceMergedItemUnder
- The meta data itemk to merge the contents of the selcted model under. If specified as null the root will be assumed
ModelException
- if there is a problem merging the ExtendedBNs
InconsistentEvidenceException
uk.co.agena.minervaapps.basicminerva.linkgenerator.LinkModelException
public void compileAllExtendedBNs() throws ExtendedBNException, InconsistentEvidenceException
ExtendedBNException
- if there is a problem during compilation or retraction
InconsistentEvidenceException
public void propagateAllExtendedBNs(boolean fireUpExtendedNodeEvents) throws ExtendedBNException
ExtendedBNException
- if there is a problem during propagationpublic void reinitialiseAllExtendedBNs() throws ExtendedBNException, InconsistentEvidenceException
ExtendedBNException
- if there is a problem during reinitialisation
InconsistentEvidenceException
public void applyScenario(Scenario scenario, boolean propagate, int exclusivity, boolean useClosestMedianIfPossible) throws ModelException
scenario
- the Scenario to be appliedpropagate
- whether the underlying CoreBN should be propagated immediatelyexclusivity
- whether the evidence should be applied exclusively or notuseClosestMedianIfPossible
- TODO
ModelException
- if there is a problem applying the Scenariopublic void applyScenario(Scenario scenario, boolean propagate, int exclusivity, java.util.List extendedBNs2applyOn, boolean useClosestMedianIfPossible) throws ModelException
scenario
- the Scenario to applypropagate
- whether the underlying BN should be propagated immediatelyexclusivity
- whether the evidence should be applied exclusively or notextendedBNs2applyOn
- the ExtendedBNs to which the Scenario should be applieduseClosestMedianIfPossible
- TODO
ModelException
- if there is a problem applying the Scenariopublic void applyScenario(Scenario scenario, boolean propagate, int exclusivity, java.util.List extendedBNs2applyOn, boolean overrideCallSign, java.lang.String[] overridingCallSigns, boolean useClosestMedianIfPossible) throws ModelException
scenario
- the Scenario to applypropagate
- whether the underlying BN should be propagated immediatelyexclusivity
- whether the evidence should be applied exclusively or notextendedBNs2applyOn
- the ExtendedBNs to which the Scenario should be appliedoverrideCallSign
- whether the call sign should be generated automatically from the Scenario id, or whether the overriding argument array should be used.overridingCallSigns
- an array of Strings containing call signs that can be used for overriding if required.useClosestMedianIfPossible
- TODO
ModelException
- if there is a problem applying the Scenariopublic void applyScenario(Scenario scenario, boolean propagate, int exclusivity, java.util.List extendedBNs2applyOn, int incl_excl, java.lang.String[] nodes2Incl_Excl, boolean overrideCallSign, java.lang.String[] overridingCallSigns, boolean useClosestMedianIfPossible) throws ModelException
scenario
- the Scenario to applypropagate
- whether the underlying BN should be propagated immediatelyexclusivity
- whether the evidence should be applied exclusively or notextendedBNs2applyOn
- the ExtendedBNs to which the Scenario should be appliedincl_excl
- value indicating if the array of Strings nodes2Incl_Excl should be used if 0, then it will not be used (APPLY_SCENARIO_NO_SPECIFICATION) if 1,
then it will include nodes with those names (APPLY_SCENARIO_INCLUDE_NODES) if 2, then it will exclude nodes of those names
(APPLY_SCENARIO_EXCLUDE_NODES)nodes2Incl_Excl
- the String of node names that should be included, excluded or ignoredoverrideCallSign
- whether the call sign should be generated automatically from the Scenario id, or whether the overriding argument array should be used.overridingCallSigns
- an array of Strings containing call signs that can be used for overriding if required.useClosestMedianIfPossible
- TODO
ModelException
- if there is a problem applying the Scenariopublic int addExtendedBN(ExtendedBN ebn)
ebn
- the ExtendedBN to add
public ExtendedBN addExtendedBN(java.lang.String name, java.lang.String description) throws ExtendedBNException
name
- the name of the BNdescription
- the BN's description
ExtendedBNException
- if there is a problem creating the BNpublic int addExtendedBN(ExtendedBN ebn, boolean compiled) throws ExtendedBNException, InconsistentEvidenceException
ebn
- the ExtendedBN to addcompiled
- whether the ExtendedBN should be compiled
ExtendedBNException
- if there is a problem during compilation
InconsistentEvidenceException
public int addExtendedBN(ExtendedBN ebn, boolean compiled, boolean fireMergeModelEvent) throws ExtendedBNException, InconsistentEvidenceException
ebn
- the ExtendedBN to addcompiled
- whether the ExtendedBN should be compiled
ExtendedBNException
- if there is a problem during compilation
InconsistentEvidenceException
public int[] addExtendedBNs(java.util.List extendedBNs, boolean compiled) throws ExtendedBNException, InconsistentEvidenceException
extendedBNs
- the ExtendedBNs to add to this Model's Listcompiled
- whether the ExtendedBNs should be compiled or not
ExtendedBNException
- if there is a problem during compilation
InconsistentEvidenceException
public int[] addExtendedBNs(java.util.List extendedBNs, boolean compiled, boolean fireMergeModelEvent) throws ExtendedBNException, InconsistentEvidenceException
extendedBNs
- the ExtendedBNs to add to this Model's Listcompiled
- whether the ExtendedBNs should be compiled or not
ExtendedBNException
- if there is a problem during compilation
InconsistentEvidenceException
public void addQuestionnaire(uk.co.agena.minerva.model.questionnaire.Questionnaire questionnaire)
questionnaire
- the Questionnaire to be addedpublic void addQuestionnaire(uk.co.agena.minerva.model.questionnaire.Questionnaire questionnaire, boolean fireMergeModelEvent)
questionnaire
- the Questionnaire to be addedpublic void addQuestionnaires(java.util.List questionnaires)
questionnaires
- the Questionnaires to be addedpublic void addQuestionnaires(java.util.List questionnaires, boolean fireMergeModelEvent)
questionnaires
- the Questionnaires to be addedpublic boolean isPropagateUsingModelScenarios()
public void setPropagateUsingModelScenarios(boolean propagateUsingModelScenarios)
public void addMessagePassingLinks(java.util.List newMessagePassingLinks, boolean fireMergeModelEvent)
newMessagePassingLinks
- the new MessagePassingLinks objects to be addedpublic Scenario addScenario(java.lang.String name)
public void addScenario(Scenario scenario, java.lang.Object ebnOrMDI)
scenario
- the Scenario to be addedpublic void addScenario(Scenario scenario, boolean fireScenarioAddedEvent, java.lang.Object ebnOrMDI)
scenario
- fireMergeModelEvent
- ebnOrMDI
- public void addScenarios(java.util.List scenarios)
scenarios
- the Scenarios to be addedpublic void addScenarios(java.util.List scenarios, boolean fireMergeModelEvent)
public void removeScenario(Scenario scenario) throws ScenarioNotFoundException
ScenarioNotFoundException
public uk.co.agena.minerva.model.metadata.MetaData getMetaData()
public java.lang.String getFullyQualifiedPathForNode(ExtendedNode exNode)
exNode
-
public void setMetaData(uk.co.agena.minerva.model.metadata.MetaData metaData)
public void setUpMetaData(uk.co.agena.minerva.model.metadata.MetaData metaData, java.util.List ids, java.util.Map typesConnections) throws ModelException
ModelException
public java.util.List findIdentifiables(java.lang.String className, java.lang.String searchTerm)
className
- searchTerm
-
public MarginalDataStore getMarginalDataStore()
public void setMarginalDataStore(MarginalDataStore marginalDataStore)
public void setExtendedBnList(java.util.List extendedBns)
extendedBns
- the ExtendedBNs used to initialise the Model's ExtendedBNListpublic void setQuestionnaireList(java.util.List questionnaires)
questionnaires
- the Questionnaires used to initialise the Model's QuestionnaireListpublic MessagePassingLinks getMessageParseLinkWithID(int id)
id
-
public java.util.List getMessagePassingLinks()
public java.util.List getListOfOrderedMessagePassingLinksLists() throws ModelException
ModelException
public void removeCrossMDIMessagePassingLinks() throws ExtendedBNNotFoundException
ExtendedBNNotFoundException
public void removeAllMessageParsesBetweenBNs(ExtendedBN source, ExtendedBN target)
source
- the ExtendedBN that is the source of a given MessagePassingLinks objecttarget
- the ExtendedBN that is the target of a given MessagePassingLinks objectpublic void removeAllMessagePassesForBN(int extendedBNId)
extendedBNId
- the ID of the ExtendedBN for which all MessagePassingLinks objects will be removedpublic void removeAllMessagePassLinks()
public void removeExtendedBNs(java.util.List extendedBNs, boolean invokeDestroy) throws ModelException
ebn
- the ExtendedBN to be removedinvokeDestroy
- flag determines whether the destroy method should be invoked on the exBN, this will sever all listener links the exBN has with other model objects
ModelException
- if the ExtendedBN (or any of its associated Questionnaires or Scenarios) cannot be foundpublic void deleteScenario(Scenario scenario) throws ModelException
scenario
- the Scenario to remove
ModelException
- if there is a problem with the deletionpublic void deleteScenarios(java.util.List scenarios) throws ModelException
scenario
- the Scenarios to be removed.
ModelException
- if there is a problem with the deletionpublic void deleteExtendedBN(ExtendedBN ebn) throws ModelException
ebn
- the BN to remove
ModelException
- if there is a problem with the deletionpublic void deleteExtendedBNs(java.util.List ebns) throws ModelException
ebns
- the BNs to be removed.
ModelException
- if there is a problem with the deletionpublic void removeExtendedBNs(ExtendedBN exBN, boolean invokeDestroy) throws ModelException
extendedBNs
- invokeDestroy
-
ModelException
public void removeQuestionnaire(uk.co.agena.minerva.model.questionnaire.Questionnaire q) throws ModelException
q
-
ModelException
public java.util.List getMessagePassingLinksForParent(int parentId)
parentId
- the ID of the parent ExtendedBN
protected java.util.List getMessagePassingLinksForChild(int childId)
childId
- the ID of the parent ExtendedBN
public void setMessagePassingLinks(java.util.List messagePassingLinks)
messagePassingLinks
- the MessagePassingLinks objects associated with this Modelpublic void autoGenerateMessagePassingLinks(ExtendedBN rootBN, ExtendedBN targetBN) throws ModelException
If no MessagePassingLinks object can be configured then no link is generated. A ModelException is thrown if the links cannot be created and the user will then be responsible for defining the links manually.
rootBN
- the ExtendedBN which sits at the root of the linktargetBN
- the ExtendedBN which sits at the head of the link
ModelException
- if the links cannot be created; the user is then responsible for defining the links manuallypublic ExtendedBNList getExtendedBNList()
public uk.co.agena.minerva.model.questionnaire.QuestionnaireList getQuestionnaireList()
public ScenarioList getScenarioList()
public void setScenarioList(java.util.List scenarios)
scenarios
- the new ScenarioListpublic void resetAllScenarios()
public void autoLinkBNOs() throws ModelException
ModelException
public void createMPLinksFromFile(java.lang.String linkMappingfilename) throws ModelException, MessagePassingLinkException
ModelException
MessagePassingLinkException
ExtendedBNNotFoundException
public void link(ExtendedNode source, ExtendedNode target) throws MessagePassingLinkException
source
- the start of the linktarget
- the end of the link
MessagePassingLinkException
- if there is a problem linking the two nodespublic void addMessageParseLink(ExtendedNode sourceNode, ExtendedNode targetNode) throws MessagePassingLinkException
mpl
-
MessagePassingLinkException
- If there was a problem creating the link. The exception message will explain the reason for the failure.public boolean addMessageParseLink(ExtendedNode sourceNode, ExtendedBN targetexBN)
sourceNode
- exBN
-
public void removeMessageParseLinks(ExtendedNode sourceNode, ExtendedNode targetNode)
sourceNode
- targetNode
- public void setupParameterPasses(MessagePassingLinks mplinks, int noOfPassesAllowed, boolean forceSetNPT, boolean savePrior, boolean changeStatesOnInputNodeIfRequired) throws ModelException
mplinks
- the MessagePassingLinks involved in the parameter passingnoOfPassesAllowed
- how many times information should be passed in succession between the ExtendedBNsforceSetNPT
- whether the NPT for the receiving ExtendedNode should be reset with the new values (i.e. true) or if the information should be added as likelihood
evidence (i.e. false)savePrior
- true if the original priors are to be added to the saved priors for the listening node, otherwise falsechangeStatesOnInputNodeIfRequired
- If this flag is true then input node should change its states to be the same as that of the output node it is recieving a message from. This
should primarily done when dynamic discretisation is used. Should be false by default.
ModelException
- if there is a problem setting up parameter passingpublic void setupRecursiveParameterPasses(MessagePassingLinks mplinks, int noOfPassesAllowed, boolean forceSetNPT, boolean savePrior, boolean changeStatesOnInputNodeIfRequired) throws ModelException
mplinks
- noOfPassesAllowed
- forceSetNPT
- savePrior
-
ModelException
public void setupNonRecursiveParameterPasses(MessagePassingLinks mplinks, int noOfPassesAllowed, boolean forceSetNPT, boolean savePrior, boolean changeStatesOnInputNodeIfRequired) throws ModelException
mplinks
- noOfPassesAllowed
- forceSetNPT
- savePrior
-
ModelException
public void destroy()
public void addModelListener(ModelListener ebnl)
ebnl
- the intereseted ModelListenerpublic void removeModelListener(ModelListener ebnl)
ebnl
- the ModelListener no longer interestedpublic void clearObservations(ExtendedBN ebn, boolean onlyActiveScenarios)
ebn
- The ExtendedBN for which all related Observations will be removedonlyActiveScenarios
- If true only Observations from Active/Reportable Scenarios will be removedpublic void clearAllObservations(ExtendedBN ebn)
ebn
- The ExtendedBN for which all related Observations will be removedpublic void clearAllObservations()
public void clearObservations(boolean onlyActiveScenarios)
onlyActiveScenarios
- If true only Observations from Active/Reportable Scenarios will be removedpublic void observationsAdded(ScenarioEvent se, java.util.List obs, boolean allowAutoPropagation)
observationsAdded
in interface ScenarioListener
se
- a ScenarioEvent encapsulating the change that has occurredallowAutoPropagation
- If this flag is set to false Auto Propagation will not occur even if Auto Propagation is ON.public void scenarioAttributeChanged(ScenarioEvent se, int attribute)
scenarioAttributeChanged
in interface ScenarioListener
se
- attribute
- public void observationsRemoved(ScenarioEvent se, java.util.List obs, boolean autopropagate)
observationsRemoved
in interface ScenarioListener
se
- an event encapsulating the change that has occurredpublic void extendedBNNameDescriptionChanged(ExtendedBNEvent ebne)
extendedBNNameDescriptionChanged
in interface ExtendedBNListener
ebne
- the event encapsulating the changepublic void extendedBNPropagated(ExtendedBNEvent ebne)
extendedBNPropagated
in interface ExtendedBNListener
ebne
- the event encapsulating the changepublic void extendedBNAllEvidenceRetracted(ExtendedBNEvent ebne)
extendedBNAllEvidenceRetracted
in interface ExtendedBNListener
ebne
- the event encapsulating the changepublic void extendedNodeEventFired(ExtendedBNEvent ebne, ExtendedNodeEvent ene, java.lang.String eventName)
extendedNodeEventFired
in interface ExtendedBNListener
ebne
- Tne Extended Bn that fired the eventene
- The extended Node that fired the event, caught by the BNeventName
- The name of the extendedBN node event.public void extendedNodePasted(ExtendedBNEvent ebne, ExtendedBN sourceEXBN, ExtendedNode sourceNode, ExtendedNode exNode)
extendedNodePasted
in interface ExtendedBNListener
ebne
- exNode
- sourceNode
- the node that was copiedpublic void extendedNodeAboutToBeCut(ExtendedBNEvent ebne, ExtendedBN sourceEXBN, int targetEXNodeID, int sourceEXNodeID, java.lang.String nameCounter)
extendedNodeAboutToBeCut
in interface ExtendedBNListener
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.nameCounter
- The extra String that was added to the cut/pasted node to make it unique in the destination ExtendedBN.public void copyQuestions(java.util.List sourceQuestions, java.util.List targetQuestions, java.lang.String counter, int targetBNID, int targetNodeID)
sourceQuestions
- The list of Source QuestionstargetQuestions
- The list of Target Questionscounter
- The counter String which should be added to each of the targetQuestion names to make them unique.targetBNID
- The ID of the ExtnededBN the target questions will be associated with.targetNodeID
- The ID of the ExtendedNode the target questions will be associated with.public void extendedNodeRemoved(ExtendedBNEvent ebne, ExtendedNode exnode)
extendedNodeRemoved
in interface ExtendedBNListener
ebne
- public void extendedNodeAdded(ExtendedBNEvent ebne, ExtendedNode exNode)
extendedNodeAdded
in interface ExtendedBNListener
ebne
- The extended BN from which the event was firedexNode
- The extended node which was added to the extended BNpublic void extendedNodeReplaced(ExtendedBNEvent ebne, ExtendedNode oldNode, ExtendedNode newNode, ExtendedBN ebn)
ExtendedBNListener
extendedNodeReplaced
in interface ExtendedBNListener
ebne
- The extended BN from which the event was firedoldNode
- the old nodenewNode
- the new nodeebn
- the BN containing both nodespublic void extendedBNIDChanged(ExtendedBNEvent ebne)
extendedBNIDChanged
in interface ExtendedBNListener
ebne
- the event encapsulating the changepublic void extendedBNAboutToBePropagated(ExtendedBNEvent ebne)
extendedBNAboutToBePropagated
in interface ExtendedBNListener
ebne
- the event encapsulating the changepublic void extendedBNInconsistentEvidencePropagated(ExtendedBNEvent ebne)
extendedBNInconsistentEvidencePropagated
in interface ExtendedBNListener
ebne
- the event encapsulating the changepublic void extendedBNConnBNNotFound(ExtendedBNEvent ebne) throws ExtendedBNException
extendedBNConnBNNotFound
in interface ExtendedBNListener
ebne
- the event encapsulating the change
ExtendedBNException
- if there is any problem in loading or compiling the underlying CoreBNpublic void questionnaireIDChanged(uk.co.agena.minerva.model.questionnaire.QuestionnaireEvent qe)
questionnaireIDChanged
in interface uk.co.agena.minerva.model.questionnaire.QuestionnaireListener
qe
- the event encapsulating the changepublic void questionnaireChanged(uk.co.agena.minerva.model.questionnaire.QuestionnaireEvent ebne)
questionnaireChanged
in interface uk.co.agena.minerva.model.questionnaire.QuestionnaireListener
ebne
- the event encapsulating the changepublic void retractAllEvidence() throws ModelException, InconsistentEvidenceException
ModelException
- if there is a problem retracting evidence from any of the ExtendedBNs.
InconsistentEvidenceException
public java.util.List createModificationLogsInreleventBNs(java.util.List effectedExBns, ModelEvent me, NameDescription nd)
public void removeModificationLogsFoeExBNs(java.util.List exBNs)
exBNs
- public void fireModelChangedEvent(Model model, int eventType, java.util.List eventAttributes)
model
- eventType
- eventAttributes
- public void shiftQuestionnaireInModelList(uk.co.agena.minerva.model.questionnaire.Questionnaire q, uk.co.agena.minerva.model.questionnaire.Questionnaire relationQ, int moveDirection)
q
- The questionnaire that was movedmoveDirection
- The direction of the movement.public boolean isMetaDataUsed()
public void setMetaDataUsed(boolean b)
public java.util.List getUnmarkedMessagePassingExtendedBNs()
public boolean isAllParentExtendedBNsMarkedForMessagePassing(ExtendedBN extendedBN) throws ExtendedBNNotFoundException
ExtendedBNNotFoundException
public java.util.List LocateModelObjectsNoConnectedToMetaDataItems(boolean removeUnConnectedScenarios, boolean removeUnConnectedQuestionnaires, boolean removeUnconnectedExtendedBNs)
removeUnConnectedScenarios
- determines whether unconnected scenarios should be deleted from the modelremoveUnConnectedQuestionnaires
- determines whether unconnected questionnaires should be deleted from the modelremoveUnconnectedExtendedBNs
- determines whether unconnected extended BNs should be deleted from the model
public void synchroniseQuestionAnswersToNodeStates(ExtendedBN exBN, ExtendedNode exNode)
exNode
- public void questionAdded(uk.co.agena.minerva.model.questionnaire.QuestionnaireEvent qe, uk.co.agena.minerva.model.questionnaire.Question q)
questionAdded
in interface uk.co.agena.minerva.model.questionnaire.QuestionnaireListener
qe
- The questionnaire event itselfq
- the question that has been addedpublic void questionEventFired(uk.co.agena.minerva.model.questionnaire.QuestionnaireEvent qte, uk.co.agena.minerva.model.questionnaire.QuestionEvent qe, int eventType)
questionEventFired
in interface uk.co.agena.minerva.model.questionnaire.QuestionnaireListener
qe
- qe
- public void questionsRemoved(uk.co.agena.minerva.model.questionnaire.QuestionnaireEvent qe, java.util.List questions)
uk.co.agena.minerva.model.questionnaire.QuestionnaireListener
questionsRemoved
in interface uk.co.agena.minerva.model.questionnaire.QuestionnaireListener
qe
- the event itselfquestions
- the questions that have been removedpublic void simulationFinished(PropagationEvent ebne, boolean completedSuccessfully, java.util.List propagatedExtendedBNs)
PropagationListener
simulationFinished
in interface PropagationListener
ebne
- an event encapsulating the completion of the Propagation executionpropagatedExtendedBNs
- TODOpublic void propagationIncremented(PropagationEvent ebne, int timePeriodPropagated)
PropagationListener
propagationIncremented
in interface PropagationListener
ebne
- an event encapsulating the completion of the Propagation cyclepublic void simulationStarted(PropagationEvent msmpe)
PropagationListener
simulationStarted
in interface PropagationListener
public void removeAllTracesOfExtendedNode(ExtendedBN ebn, ExtendedNode enode) throws ExtendedBNException
ebn
- the ExtendedBN containing the ExtendedNodeenode
- the ExtendedNode to remove
ExtendedBNException
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
public boolean isFireUpExtendedNodeEvent()
public void setFireUpExtendedNodeEvent(boolean fireUpExtendedNodeEvent)
fireUpExtendedNodeEvent
- The fireUpExtendedNodeEvent to set.public java.util.List getExtendedBNs(int[] ebnIds) throws ExtendedBNNotFoundException
ebnIds
-
ExtendedBNNotFoundException
public java.util.List getQuestionnaires(int[] qIds) throws uk.co.agena.minerva.model.questionnaire.QuestionnaireNotFoundException
qIds
-
uk.co.agena.minerva.model.questionnaire.QuestionnaireNotFoundException
public java.util.List getScenarios(int[] sIds) throws ScenarioNotFoundException
sIds
-
ScenarioNotFoundException
public void setUpScenarios()
public void regenerateProblemNPTs() throws InconsistentEvidenceException, ExtendedBNException, NPTGeneratorException, PropagationException
PropagationException
NPTGeneratorException
ExtendedBNException
InconsistentEvidenceException
public void clearProblemNodes()
public ExtendedBN getExtendedBNForNode(ExtendedNode node)
node
-
public ExtendedNode getExtendedNodeWithName(java.lang.String name)
node
-
public ExtendedBN getExtendedBNAtIndex(int index)
index
- the index of the BN to be returned
public ExtendedBN getExtendedBNWithName(java.lang.String name)
index
- the name of the BN to be returned
public Scenario getScenarioAtIndex(int index)
index
- the index of the Scenario to be returned
public Scenario getScenarioWithName(java.lang.String name)
index
- the name of the Scenario to be returned
public void importScenarios(ScenarioList sl)
The data structure sent out is a Map. In this Map, the key is a Scenario and the value is another Map. In this second Map, the key is an Observation and the value is a List of Integers. If this List is empty, it means that the Observation has been imported OK. If this List is not empty, there have been one or more problems. The Integers in the List detail the problems: SCENARIO_IMPORT_WRONG_NODE_ID = the matching node has been found based on the ID, but the unique ID in the Observation is wrong SCENARIO_IMPORT_WRONG_STATES_WORKABLE = the number of states is different, but the Observation is for a state index that still exists SCENARIO_IMPORT_WRONG_STATES_UNWORKABLE = the number of states is different, but the Observation is for a state index that no longer exists SCENARIO_IMPORT_NODE_NOT_FOUND = a node with the matching ID is not found
sl
- The List of Scenarios that is being importedpublic void saveCreationTimestamp(java.lang.String licenceType)
licenceType
- The type of licence the tool is currently running under will be either 'Evaluation' or 'Professional'public void checkCreationTimestamps(java.lang.String licenceType) throws uk.co.agena.minerva.util.helpers.ProbabilityCalculatorException
licenceType
- The type of licence the tool is currently running under will be either 'Evaluation' or 'Professional'
uk.co.agena.minerva.util.helpers.ProbabilityCalculatorException
- When difference between the creation timestamp and the current date/time exceeds the set limit. This will only occur when under an evaluation
version licence.public void updateNewAndImportedBNsTimestamps(java.util.List bns)
bns
- The BN's being added/imported.public Propagation getPropagationAlgorithm()
public void setPropagationAlgorithm(Propagation p)
public java.util.List getChildrenExtendedBNs(ExtendedBN ebn) throws ExtendedBNNotFoundException
ebn
-
ExtendedBNNotFoundException
public java.util.Set getDecendentExtendedBNs(ExtendedBN ebn) throws ExtendedBNNotFoundException
ebn
-
ExtendedBNNotFoundException
public java.util.List getParentExtendedBNs(ExtendedBN ebn) throws ExtendedBNNotFoundException
ebn
-
ExtendedBNNotFoundException
public java.util.Set getAncestorExtendedBNs(ExtendedBN ebn) throws ExtendedBNNotFoundException
ebn
-
ExtendedBNNotFoundException
public void save(java.lang.String filename) throws uk.co.agena.minerva.util.io.FileHandlingException
filename
- the file to save the model to
uk.co.agena.minerva.util.io.FileHandlingException
- if there is a problem during the savepublic static Model load(java.lang.String filename) throws uk.co.agena.minerva.util.io.FileHandlingException
filename
- the name of the file containing the model
uk.co.agena.minerva.util.io.FileHandlingException
- if there is a problem loading the modelpublic java.util.List writeMarginalsToCSV()
public void loadScenariosFromCSV(java.util.List csvStrings) throws ScenarioException
csvStrings
- the strings containing the scenarios
ScenarioNotFoundException
ScenarioException
public java.util.List getUnmatchedNodeNames()
public void setUnmatchedNodeNames(java.util.List unmatchedNodeNames)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |