|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.co.agena.minerva.model.extendedbn.ExtendedBN
public class ExtendedBN
An ExtendedBN is an encapsulation of a Bayesian Network. It contains a reference to a single BN. Any client wishing to use a BN does so via the ExtendedBN.
An ExtendedBN only has reference to a list of ExtendedNodes; it currently has no reference to any edges. Those methods that involve manipulating or querying the BN are delegated to the ExtendedBN's internal BN object.
Field Summary | |
---|---|
protected int |
lengthOfProgressableTask
Represnts the current progress of any operation which is currently being monitored in this class. |
protected int |
progress
Represnts the length of the operation which is currently being monitored in this class. |
static int |
PROGRESSABLE_PASTE
To indicate we are monitoring the Paste operation. |
protected boolean |
progressableTaskDone
When set to true the current task being monitored will have been completed. |
protected boolean |
terminateProgressableTask
When set to true the current operation can be cancelled / terminated. |
static double |
version
|
Fields inherited from interface uk.co.agena.minerva.util.model.Writable |
---|
FIELD_SEPARATOR |
Constructor Summary | |
---|---|
ExtendedBN()
Default constructor. |
Method Summary | |
---|---|
BooleanEN |
addBooleanNode(java.lang.String id,
java.lang.String name)
Creates a new Boolean node with the specified name and with the default states "False" and "True". |
ContinuousIntervalEN |
addContinuousIntervalNode(java.lang.String id,
java.lang.String name)
Creates a new Continuous Interval node with the specified name and with default states 0.0 - 10.0, 10.0 - 20.0, 20.0 - 30.0, 30.0 - 40.0 and 40.0 - 50.0. |
DiscreteRealEN |
addDiscreteRealNode(java.lang.String id,
java.lang.String name)
Creates a new Discrete Real node with the specified name and with default states 1.0, 2.0, 3.0, 4.0 and 5.0. |
Variable |
addExpressionVariable(ExtendedNode exn,
java.lang.String name,
double defaultValue)
Adds a new Variable with the specified name and default value to the VariableList for the specified ExtendedNode. |
void |
addExtendedBNListener(ExtendedBNListener ebnl)
Adds an object interested in ExtendedBNEvents to the List of ExtendedBNListeners (actually held by an internal ExtendedBNEventGenerator). |
void |
addExtendedNode(ExtendedNode extendedNode)
Adds the supplied node the Extended BN. |
void |
addExtendedNode(ExtendedNode extendedNode,
boolean autoAssignId)
Adds the specified ExtendedNode to the ExtendedBN's List. |
IntegerIntervalEN |
addIntegerIntervalNode(java.lang.String id,
java.lang.String name)
Creates a new Integer Interval node with the specified name and with default states 0 - 10, 10 - 20, 20 - 30, 30 - 40 and 40 - 50. |
LabelledEN |
addLabelledNode(java.lang.String id,
java.lang.String name)
Creates a new Labelled node with the specified name and with the default states "State_1", "State_2" and "State_3". |
ModificationLog.ModificationLogItem |
addModificationLogItem(NameDescription description)
Convience method adds a new modification log top the extended BN |
RankedEN |
addRankedNode(java.lang.String id,
java.lang.String name)
Creates a new Ranked node with the specified name and with default states Very Low, Low, Medium, High and Very High. |
boolean |
allParentsPresent(ExtendedNode exn,
ExtendedBN fromBN,
java.util.Collection allNodes)
Returns true if all the parents of the specified node in the specified ExtendedBN are present in the Collection or in this ExtendedBN. |
boolean |
allParentsPresent(java.lang.String altId,
ExtendedBN fromBN,
java.util.Collection allNodes)
Returns true if all the parents of the node with the connected CoreBNNode AltID in the specified ExtendedBN are present in the Collection or in this ExtendedBN. |
void |
changeNodeStates(ExtendedNode en,
DataSet data)
Takes the supplied node and removes its current States replacing them with the ones represented in the specified DataSet. |
ExtendedNode |
changeNodeType(ExtendedNode en,
java.lang.Class type)
Takes the supplied node, creates a new instance of the supplied type and then copies the data from the old node into the new one. |
ExtendedNode |
changeNodeType(ExtendedNode en,
java.lang.Class type,
DataSet data)
Takes the supplied node, creates a new instance of the supplied type and then copies the data from the old node into the new one. |
void |
clearUnpropagatedEvidence()
This method should be called if anything fails after some evidence has been entered. |
void |
cloneNodeFunctions(java.util.Map oldToNewNodes,
ExtendedBN fromBN)
Given a Map of the Original ExtendedNodes to their Cloned versions this method clones all the Function information from the original ExtendedNode to the Clone. |
void |
cloneNodeNPTs(java.util.Map oldToNewNodes,
ExtendedBN fromBN)
Given a Map of the Original ExtendedNodes to their Cloned versions this method clones all the CoreNPT data from the original Node to its Clone. |
void |
compile()
Compiles the underlying BN. |
void |
createClonedNodes(java.util.List nodes,
ExtendedBN sourceBN,
java.util.Map clonedNodes)
Creates a clone of each of the ExtendedNodes if the specified List. |
static ExtendedBN |
createEmptyExtendedBN()
|
static ExtendedBN |
createExtendedBN()
Creates and returns a new extended BN, a new core is also created and connected to the newly created BN |
static ExtendedBN |
createExtendedBNFromCoreBN(uk.co.agena.minerva.model.corebn.CoreBN connBN)
Creates an ExtendedBN from the supplied CoreBN. |
static ExtendedBN |
createExtendedBNFromNetFile(java.lang.String netFile,
java.util.List aestheticProperties)
Creates an ExtendedBN from the supplied .net file. |
ExtendedNode |
createNewExtendedNode(java.lang.String type,
NameDescription name)
Creates a new ExtendedNode of the supplied type, adds it to this ExtendedBN and returns it. |
void |
deleteExtendedNode(ExtendedNode enode)
Deletes the supplied ExtendedNode from this BN. |
void |
destroy()
Removes itself as a listener from all of its ExtendedNodes. |
void |
extendedNodeAttributeChanged(ExtendedNodeEvent ene,
int attribute)
Event caught by the extend BN from a node it was listening to. |
void |
extendedNodeConnBNNotFound(ExtendedNodeEvent ene)
Called by an ExtendedNode when it cannot find the connected CoreBN in memory. |
void |
extendedNodeConnNodeIdChanged(ExtendedNodeEvent ene)
When the connNodeId of a node is changed then we need to ensure that all the children of this node are told that the name has changed to that they can change their functions (if they have any) to reflect this change. |
void |
extendedNodeInconsistentEvidenceEntered(ExtendedNodeEvent ene)
Called when an ExtendedNode has had inconsistent evidence entered on it. |
void |
extendedNodeMarginalsChanged(ExtendedNodeEvent ene,
boolean useMarginalDataSetForStateReplication)
Not implemented - the ExtendedBN is not interested when this happens. |
void |
extendedNodeNameDescriptionChanged(ExtendedNodeEvent ene)
Not implemented - the ExtendedBN is not interested when this happens. |
void |
extendedNodeRemoved(ExtendedNode exNode)
Informs all listeners (via the event generator) that this ExtendedBN has had a NodeRemoved. |
void |
extendedNodeStateNameChanged(ExtendedNodeEvent ene,
ExtendedState es)
Invoked when an ExtendedState name is changed. |
void |
extendedNodeStatesReplaced(ExtendedNodeEvent ene)
Called when the node's states are replaced. |
void |
extendedNodeVariableAdded(ExtendedNodeEvent ene,
Variable addedVarible)
Invoked when a Variable is added to the ExtendedNodes VariableList. |
void |
extendedNodeVariableRemoved(ExtendedNodeEvent ene,
Variable removedVarible)
Invoked when a Variable is removed from the ExtendedNodes VariableList. |
void |
extendedNodeVisibleAttributeChanged(ExtendedNodeEvent ene,
boolean visible)
ExtendedNode visible attribute has been changed. |
void |
extendedStateAdded(ExtendedNodeEvent ene)
New ExtendedState created and added to this node and added all the way to the core. |
void |
extendedStateRemoved(ExtendedNodeEvent ene,
int indexOfStateRemoved)
ExtendedNode removed from this node and all the way to the core. |
void |
fireExtendedBNAboutToBePropagated(ExtendedBN ebn)
Informs all listeners (via the event generator) that this ExtendedBN is about to be propagated. |
void |
fireExtendedBNConnBNNotFound(boolean compile)
Informs all listeners (via the event generator) that the CoreBN for this ExtendedBN is is not in memory. |
void |
forceCoreNPTsSizeUpdates(boolean autoselectNodes)
This should be called if the states on nodes have been update, but the core NPT sizes havent been updated. |
java.util.List |
getChildNodes(ExtendedNode enode)
Returns the child ExtendedNodes of the supplied ExtendedNode. |
java.util.List |
getChildren()
Returns the children of this FamilyMember. |
uk.co.agena.minerva.model.corebn.CoreBN |
getConnBN()
Returns the BN to which the ExtendedBN is connected. |
java.lang.String |
getConnCoreFileName()
Returns the name of the file in which the connected CoreBN is stored. |
java.util.List |
getConnections()
Returns a list of the connections that this BN has with other connectable objects (which) will be other exBNs |
java.util.List |
getConnNodeIds(java.util.List nodes)
|
int |
getCurrentProgress()
|
ExtendedNode |
getExtendedNode(int id)
Returns an ExtendedNode with the specified ID. |
ExtendedNode |
getExtendedNode(java.lang.String altId)
|
java.util.List |
getExtendedNodes()
Returns a List of all the ExtendedNodes contained in the ExtendedBN. |
java.util.List |
getExtendedNodes(java.lang.String name)
Retruns a list of ExtendedNodes that have a short name equal to that specified. |
ExtendedNode |
getExtendedNodeWithName(java.lang.String name)
Returns the first ExtendedNode that has a short name equal to that specified. |
ExtendedNode |
getExtendedNodeWithUniqueIdentifier(java.lang.String uniqueIdentifier)
Returns the ExtendedNode that has a unique string identifier the same as that specified. |
int |
getId()
Returns the unique ID of the ExtendedBN. |
java.util.List |
getInputNodes()
Returns a List of all ExtendedNodes that can be input nodes for message passing. |
int |
getLengthOfProgressableTask()
|
ModificationLog |
getModificationLog()
The modification log holds information about what has made this exBN inconsistent with the last known good propagation. |
NameDescription |
getName()
Returns the name of the ExtendedBN. |
int |
getNumberOfCellsForNPT(ExtendedNode node)
Used to know how many calculations it will take to fill the NPT from this node. |
java.util.List |
getOutputNodes()
Returns a List of all ExtendedNodes that can be output nodes for message passing. |
java.util.List |
getParentConnectedNodeIds(ExtendedNode child)
Returns a List of the connected IDs for the supplied child node. |
int |
getParentId()
Returns the ID of this FamilyMember's parent. |
java.util.List |
getParentNodes(ExtendedNode enode)
Returns the parent ExtendedNodes of the supplied ExtendedNode. |
java.util.List |
getParentNodes(java.lang.String connNodeID)
Returns the parent ExtendedNodes of the ExtendedNode with the supplied connected CoreBNNode AltID. |
java.util.List |
getPasteErrorLog()
When a paste operation is performed if any errors occur they will be stored as Strings in this List. |
java.lang.String[] |
getPropagationCallSigns()
Returns the array containing the propagation call signs. |
java.lang.String |
getType()
Returns the type of the ExtendedBN. |
java.util.List |
getUnmarkedTemporaryNodeOrderFlagNodes()
Gets all the ExtendedNodes that are not flagged to have been visted by ordering algorithm. |
double |
getVersion()
Returns the version of the class. |
boolean |
hasDDNodes()
Returns a boolean value that determines whether the exBN has DD nodes |
boolean |
hasRankedNodes()
Returns a boolean value that determines whether the exBN has Ranked nodes |
boolean |
hasStatisticalNodes()
Returns a boolean value that determines whether the exBN has statistical nodes |
boolean |
isAllParentExtendedNodesMarkedForOrdering(ExtendedNode enode)
|
boolean |
isCompiled()
Checks whether the underlying BN has been compiled or not. |
boolean |
isMessagepassingMarkedFlag()
|
boolean |
isPasteErrorCritical()
If an error occured in the paste operation and it was of critical nature this flag will be set. |
boolean |
isProgressableTaskDone()
|
void |
nodeChanged(ExtendedNodeEvent ene)
Called whenever a node changes (for selected events) |
void |
paste(java.util.List exNodes,
java.util.List connections,
ExtendedBN copiedFromBN,
java.lang.String type,
java.util.Map clonedNodes)
Based on the specified List of ExtendedNodes and List of connections between these nodes this method creates clones of the ExtendedNodes and adds them to the ExtendedBN with the required connections between the cloned nodes. |
void |
printJunctionTreeReport()
|
void |
propagate(boolean fireUpExtendedNodeEvents)
Propagates the underlying BN. |
int |
read(java.util.List strings,
int currentLineNumber)
|
void |
regenerateNPT(ExtendedNode enode)
Regenerates the NPT for the supplied node if it has an expression or partitioned expressions defined on it. |
void |
regenerateNPT(ExtendedNode node,
boolean autoExtendStateRanges,
boolean autoRestrictStateRanges,
boolean imitateNewEvidence)
This method will take the function properties of this node (i.e. |
void |
reinitialise(boolean fireUpExtendedNodeEvents)
They will multiply back in all NPTs to build new cliques and sepsets and then message pass to make the BN consistent. |
void |
removeAllExtendedNodes()
Removes all ExtendedNodes from the ExtendedBN's List. |
void |
removeExpressionVariable(ExtendedNode exn,
Variable v)
Removes the specified Variable from the VariableList of the specified ExtendedNode if it is actually a member that ExtendedNodes VariableList. |
void |
removeExtendedBNListener(ExtendedBNListener ebnl)
Removes an object no longer interested in ExtendedBNEvents from the List of ExtendedBNListeners (actually held by an internal ExtendedBNEventGenerator). |
void |
removeExtendedNode(ExtendedNode enode)
Removes the ExtendedNode from the this ExtendedBN. |
void |
removeRelationship(ExtendedNode parentNode,
ExtendedNode childNode)
Removes the CoreBN relationship between the two specified nodes. |
void |
resetModificationLog()
Clears the modification log on the exBN. |
void |
resetProgressableTask()
Should be invoked at the end of the task to reset all required attributes used in the monitoring of the task. |
void |
restartSavedPriors()
|
void |
retractAllEvidence(boolean fireUpExtendedNodeEvent)
Retracts all evidence from the underlying BN. |
int |
revertToSavedPriors(int priorIndex)
Makes all the relevant nodes revert their priors back to the saved priors at the given index. |
void |
rollBackCores()
This will roll back the cores to their original states and not inform anybosy about it. |
void |
setChildren(java.util.List children)
Sets the children of this FamilyMember to those in the supplied list of FamilyMembers. |
void |
setConnBN(uk.co.agena.minerva.model.corebn.CoreBN connBN)
Sets the connected BN of the ExtendedBN to that specified. |
void |
setConnCoreFileName(java.lang.String connCoreFileName)
Sets the name of file in which the connected CoreBN is stored. |
void |
setExtendedNodes(java.util.List extendedNodes,
boolean autoAssignIds)
Reinitialises the ExtendedBN's List of ExtendedNodes with those in the supplied List. |
void |
setId(int id)
Sets the unique ID of the ExtendedBN to the ID specified. |
void |
setMessagepassingMarkedFlag(boolean messagepassingMarkedFlag)
|
void |
setName(NameDescription name)
Sets the name of the ExtendedBN to the name specified. |
void |
setParentId(int parentId)
Sets the ID of this FamilyMember's parent. |
void |
setPropagationCallSigns(java.lang.String[] propagationCallSigns)
Sets the array containing the propagation call signs. |
void |
setType(java.lang.String type)
Sets the type of the ExtendedBN to the value specified. |
void |
setVersion(double version)
Sets the version number of the class. |
void |
terminateProgressableTask()
Invoked when the user has requested the task to be terminated. |
java.lang.String |
toString()
Returns a String representation of the ExtendedNode. |
void |
updateConnNodeId(ExtendedNode exn,
java.lang.String newConnNodeId)
Updates the ID of the underlying Core Node for the specified ExtendedNode. |
void |
updateCurrentProgress(int inc)
Increment the currentProgress by the specified value. |
void |
updateExpressionVariable(ExtendedNode exn,
Variable v,
java.lang.String newName,
double newDefaultValue)
For the ExtendedNodes VariableList the specified Variable is updated to have the new Name and Default Value. |
void |
updateExtendedNodesDuringPasteFollowingCut(java.util.List exNodes,
ExtendedBN copiedFromBN,
java.util.List connections)
When ExtendedNodes which have been 'Cut' from another ExtendedBN are being pasted we must remove any references to the ExtendedNodes in the source ExtendedBN and CoreBN. |
java.util.List |
write()
Writes the object in question to a List of Strings. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static double version
public static final int PROGRESSABLE_PASTE
protected int lengthOfProgressableTask
protected int progress
protected boolean progressableTaskDone
protected boolean terminateProgressableTask
Constructor Detail |
---|
public ExtendedBN()
Method Detail |
---|
public static ExtendedBN createEmptyExtendedBN() throws ExtendedBNException
ExtendedBNException
public static ExtendedBN createExtendedBNFromCoreBN(uk.co.agena.minerva.model.corebn.CoreBN connBN) throws ExtendedBNException
connBN
- the CoreBN used to create the ExtendedBN
ExtendedBNException
- if there is a problem creating the ExtendedBNpublic static ExtendedBN createExtendedBN() throws ExtendedBNException
ExtendedBNException
public static ExtendedBN createExtendedBNFromNetFile(java.lang.String netFile, java.util.List aestheticProperties) throws ExtendedBNException
netFile
- the .net file used to create the ExtendedBN
ExtendedBNException
- if there is a problem creating the ExtendedBNpublic int getId()
getId
in interface Identifiable
public void setId(int id)
id
- the new ID for the ExtendedBNpublic double getVersion()
Writable
getVersion
in interface Writable
public void setVersion(double version)
Writable
setVersion
in interface Writable
version
- the version numberpublic java.util.List getExtendedNodes()
public ExtendedNode getExtendedNodeWithName(java.lang.String name)
name
- the name to be matched
public ExtendedNode getExtendedNodeWithUniqueIdentifier(java.lang.String uniqueIdentifier)
uniqueIdentifier
- the unique identifier to be matched
public java.util.List getExtendedNodes(java.lang.String name)
name
- the name to be matched
public ExtendedNode getExtendedNode(int id) throws ExtendedNodeNotFoundException
id
- The ID to be matched
ExtendedNodeNotFoundException
- if an ExtendedNode with the supplied ID was not foundpublic uk.co.agena.minerva.model.corebn.CoreBN getConnBN()
public java.util.List getConnNodeIds(java.util.List nodes)
public void setConnBN(uk.co.agena.minerva.model.corebn.CoreBN connBN)
connBN
- the new connected BN for the ExtendedBNpublic NameDescription getName()
getName
in interface Nameable
public void setName(NameDescription name)
setName
in interface Nameable
name
- the new name for the ExtendedBNpublic java.lang.String getType()
public void setType(java.lang.String type)
type
- the new type of the ExtendedBNpublic boolean isMessagepassingMarkedFlag()
public void setMessagepassingMarkedFlag(boolean messagepassingMarkedFlag)
public boolean hasDDNodes()
public boolean hasRankedNodes()
public boolean hasStatisticalNodes()
public void retractAllEvidence(boolean fireUpExtendedNodeEvent) throws ExtendedBNException, InconsistentEvidenceException
ExtendedBNException
- if there is a problem with the retraction
InconsistentEvidenceException
public void propagate(boolean fireUpExtendedNodeEvents) throws ExtendedBNException
ExtendedBNException
- if there is a problem with the propagationpublic void printJunctionTreeReport()
public void compile() throws ExtendedBNException, InconsistentEvidenceException
ExtendedBNException
- if there is a problem during compilation
InconsistentEvidenceException
public void reinitialise(boolean fireUpExtendedNodeEvents) throws ExtendedBNException, InconsistentEvidenceException
ExtendedBNException
- if there is any problem reinitialising
InconsistentEvidenceException
public int revertToSavedPriors(int priorIndex) throws ExtendedBNException, InconsistentEvidenceException
priorIndex
- the index of saved priors that the nodes will revert to
ExtendedBNException
InconsistentEvidenceException
public void restartSavedPriors() throws ExtendedBNException
ExtendedBNException
public void addExtendedNode(ExtendedNode extendedNode, boolean autoAssignId)
extendedNode
- the ExtendedNode to be addedautoAssignId
- whether to modify the ExtendedNode's ID before addingpublic void addExtendedNode(ExtendedNode extendedNode)
extendedNode
- the node to be addedpublic ExtendedNode createNewExtendedNode(java.lang.String type, NameDescription name) throws ExtendedNodeCreationException
type
- the fully qualified class name of the node that is to be createdname
- the name of the newly created node
ExtendedNodeCreationException
public LabelledEN addLabelledNode(java.lang.String id, java.lang.String name) throws uk.co.agena.minerva.model.corebn.CoreBNNodeNotFoundException, ExtendedBNException
id
- The unique identifier of the nodename
- The name of the node
ExtendedBNException
- if there is a problem creating the node
uk.co.agena.minerva.model.corebn.CoreBNNodeNotFoundException
public BooleanEN addBooleanNode(java.lang.String id, java.lang.String name) throws uk.co.agena.minerva.model.corebn.CoreBNNodeNotFoundException, ExtendedBNException
id
- The unique identifier of the nodename
- The name of the node
ExtendedBNException
- if there is a problem creating the node
uk.co.agena.minerva.model.corebn.CoreBNNodeNotFoundException
public ContinuousIntervalEN addContinuousIntervalNode(java.lang.String id, java.lang.String name) throws uk.co.agena.minerva.model.corebn.CoreBNNodeNotFoundException, ExtendedBNException
id
- The unique identifier of the nodename
- The name of the node
ExtendedBNException
- if there is a problem creating the node
uk.co.agena.minerva.model.corebn.CoreBNNodeNotFoundException
public IntegerIntervalEN addIntegerIntervalNode(java.lang.String id, java.lang.String name) throws uk.co.agena.minerva.model.corebn.CoreBNNodeNotFoundException, ExtendedBNException
id
- The unique identifier of the nodename
- The name of the node
ExtendedBNException
- if there is a problem creating the node
uk.co.agena.minerva.model.corebn.CoreBNNodeNotFoundException
public DiscreteRealEN addDiscreteRealNode(java.lang.String id, java.lang.String name) throws uk.co.agena.minerva.model.corebn.CoreBNNodeNotFoundException, ExtendedBNException
id
- The unique identifier of the nodename
- The name of the node
ExtendedBNException
- if there is a problem creating the node
uk.co.agena.minerva.model.corebn.CoreBNNodeNotFoundException
public RankedEN addRankedNode(java.lang.String id, java.lang.String name) throws uk.co.agena.minerva.model.corebn.CoreBNNodeNotFoundException, ExtendedBNException
id
- The unique identifier of the nodename
- The name of the node
ExtendedBNException
- if there is a problem creating the node
uk.co.agena.minerva.model.corebn.CoreBNNodeNotFoundException
public void deleteExtendedNode(ExtendedNode enode) throws ExtendedBNException
enode
- the node to be deleted
ExtendedBNException
- if there is a problem with the deletionpublic void removeExtendedNode(ExtendedNode enode) throws ExtendedBNException
enode
-
ExtendedBNException
public void removeRelationship(ExtendedNode parentNode, ExtendedNode childNode) throws ExtendedBNException
parentNode
- The parent ExtendedNode of the relationship.childNode
- The child ExtendedNode of the relationship.
ExtendedBNException
- If the Connected CoreBN or the CoreNodes can't be found.public void setExtendedNodes(java.util.List extendedNodes, boolean autoAssignIds)
extendedNodes
- the new List of ExtendedNodesautoAssignIds
- whether to modify the ExtendedNodes' IDs before adding thempublic void removeAllExtendedNodes()
public Variable addExpressionVariable(ExtendedNode exn, java.lang.String name, double defaultValue) throws ExtendedBNException
exn
- The ExtenededNode we are adding the new Variable too.name
- The String Name for the new VariabledefaultValue
- The double default value for the new Variable
ExtendedBNException
public void removeExpressionVariable(ExtendedNode exn, Variable v) throws ExtendedBNException
exn
- The ExtendedNode whos VariableList we are removing the Variable from.v
- The Variable to be removed
ExtendedBNException
public void updateExpressionVariable(ExtendedNode exn, Variable v, java.lang.String newName, double newDefaultValue) throws ExtendedBNException
exn
- The ExtendedNode to which the Variable which needs updating belongs.v
- The Variable that is to be updatednewName
- The New Name for the VariablenewDefaultValue
- The New Default Value for the Variable
ExtendedBNException
public boolean isCompiled() throws ExtendedBNException
ExtendedBNException
- if there is a problem checking whether the BN is compiledpublic int getNumberOfCellsForNPT(ExtendedNode node) throws InconsistentEvidenceException, ExtendedBNException
node
-
InconsistentEvidenceException
ExtendedBNException
public ModificationLog getModificationLog()
public ModificationLog.ModificationLogItem addModificationLogItem(NameDescription description)
description
- public void resetModificationLog()
public java.util.List getParentNodes(ExtendedNode enode) throws ExtendedBNException
enode
- the ExtendedNode whose parents are being sought
ExtendedBNException
- if there is a problem accessing the parent ExtendedNodespublic java.util.List getParentNodes(java.lang.String connNodeID) throws ExtendedBNException
coreNodeID
- the connected CoreBNNode AltID of the ExtendedNode whose parents are being sought
ExtendedBNException
- if there is a problem accessing the parent ExtendedNodespublic java.util.List getParentConnectedNodeIds(ExtendedNode child)
child
- the node whose parents will be queried
public java.util.List getChildNodes(ExtendedNode enode) throws ExtendedBNException
enode
- the ExtendedNode whose children are being sought
ExtendedBNException
- if there is a problem accessing the children ExtendedNodespublic java.lang.String getConnCoreFileName()
public void setConnCoreFileName(java.lang.String connCoreFileName)
connCoreFileName
- the new file name for the connected CoreBNpublic java.lang.String[] getPropagationCallSigns()
public void setPropagationCallSigns(java.lang.String[] propagationCallSigns)
propagationCallSigns
- the new array of propagation call signspublic void addExtendedBNListener(ExtendedBNListener ebnl)
ebnl
- the intereseted ExtendedBNListenerpublic void removeExtendedBNListener(ExtendedBNListener ebnl)
ebnl
- the ExtendedBNListener no longer interestedpublic void destroy()
public void extendedNodeInconsistentEvidenceEntered(ExtendedNodeEvent ene)
extendedNodeInconsistentEvidenceEntered
in interface ExtendedNodeListener
ene
- the event signalling the inconsistent evidencepublic void extendedNodeNameDescriptionChanged(ExtendedNodeEvent ene)
ene
- the name change eventpublic void extendedNodeMarginalsChanged(ExtendedNodeEvent ene, boolean useMarginalDataSetForStateReplication)
extendedNodeMarginalsChanged
in interface ExtendedNodeListener
ene
- the marginal change eventuseMarginalDataSetForStateReplication
- TODOpublic void nodeChanged(ExtendedNodeEvent ene)
nodeChanged
in interface ExtendedNodeListener
ebne
- the event encapsulating the changepublic void extendedNodeConnNodeIdChanged(ExtendedNodeEvent ene)
extendedNodeConnNodeIdChanged
in interface ExtendedNodeListener
ExtendedNodeListener.extendedNodeConnNodeIdChanged(uk.co.agena.minerva.model.extendedbn.ExtendedNodeEvent)
public void extendedStateAdded(ExtendedNodeEvent ene)
extendedStateAdded
in interface ExtendedNodeListener
ene
- public void extendedStateRemoved(ExtendedNodeEvent ene, int indexOfStateRemoved)
extendedStateRemoved
in interface ExtendedNodeListener
ene
- public void extendedNodeStateNameChanged(ExtendedNodeEvent ene, ExtendedState es)
ExtendedNodeListener
extendedNodeStateNameChanged
in interface ExtendedNodeListener
public void extendedNodeVariableAdded(ExtendedNodeEvent ene, Variable addedVarible)
extendedNodeVariableAdded
in interface ExtendedNodeListener
ene
- The ExtendedNode event.addedVarible
- The Variable that was added.public void extendedNodeVariableRemoved(ExtendedNodeEvent ene, Variable removedVarible)
extendedNodeVariableRemoved
in interface ExtendedNodeListener
ene
- The ExtendedNode event.removedVarible
- The Variable that was removed.public void extendedNodeRemoved(ExtendedNode exNode)
extendedNodeID
- The id of the ExtendedNode which has been removed.public void extendedNodeVisibleAttributeChanged(ExtendedNodeEvent ene, boolean visible)
extendedNodeVisibleAttributeChanged
in interface ExtendedNodeListener
ene
- visible
- The visibility of the node in questionpublic void fireExtendedBNAboutToBePropagated(ExtendedBN ebn)
ebn
- the ExtendedBN that is about to be propagated i.e. this onepublic void fireExtendedBNConnBNNotFound(boolean compile) throws ExtendedBNException
compile
- whether listeners should compiled the CoreBN when loading it
ExtendedBNException
public void extendedNodeConnBNNotFound(ExtendedNodeEvent ene) throws ExtendedBNException
extendedNodeConnBNNotFound
in interface ExtendedNodeListener
ene
- the event indicating that the CoreBN has not been found
ExtendedBNException
public void regenerateNPT(ExtendedNode enode) throws InconsistentEvidenceException, ExtendedBNException, MinervaRangeException, NPTGeneratorInsufficientStateRangeException, NPTGeneratorException
enode
- the node for which the NPT is to be regenerated.
InconsistentEvidenceException
ExtendedBNException
MinervaRangeException
NPTGeneratorInsufficientStateRangeException
NPTGeneratorException
public void regenerateNPT(ExtendedNode node, boolean autoExtendStateRanges, boolean autoRestrictStateRanges, boolean imitateNewEvidence) throws ExtendedBNException, MinervaRangeException, InconsistentEvidenceException, NPTGeneratorInsufficientStateRangeException, NPTGeneratorException
autoRestrictStateRanges
- TODOimitateNewEvidence
- TODO
ExtendedBNException
MinervaRangeException
InconsistentEvidenceException
NPTGeneratorInsufficientStateRangeException
NPTGeneratorException
public java.util.List getInputNodes()
public java.util.List getOutputNodes()
public void paste(java.util.List exNodes, java.util.List connections, ExtendedBN copiedFromBN, java.lang.String type, java.util.Map clonedNodes) throws ExtendedBNException
connection
- A List containing x number of single item 2D arrays where the first dimension is the start ExtendedNode of the connection and the second dimension
is the end ExtendedNodeexNodes
- A list of the ExtendedNodes to be cloned and added (pasted) to the ExtendedBN.copiedFromBN
- A reference to the ExtendedBN the ExtendedNodes were copied from.type
- String to store the type of operation the paste is being performed for, this is either "cut" or "copy."clonedNodes
- A Mapping of the specified ExtendedNodes to their Clones. When passed in this Map should be empty and populated by the method. This was if an
exception is thrown we will still have a handel on the Map.
ExtendedBNException
public void updateExtendedNodesDuringPasteFollowingCut(java.util.List exNodes, ExtendedBN copiedFromBN, java.util.List connections) throws ExtendedBNException
exNodes
- A List of the ExtendedNodes that are being pasted.copiedFromBN
- The source ExtendedBNconnection
- A List containing x number of single item 2D arrays where the first dimension is the start ExtendedNode of the connection and the second dimension
is the end ExtendedNode
ExtendedBNException
public boolean allParentsPresent(ExtendedNode exn, ExtendedBN fromBN, java.util.Collection allNodes)
exn
- The ExtendedNode to be checked.fromBN
- The ExtendedBN which the ExtendedNode exn resides. It is there the appropiate parent information will be found.allNodes
- The List we are checking to see if all the parents are present.
public boolean allParentsPresent(java.lang.String altId, ExtendedBN fromBN, java.util.Collection allNodes)
altId
- The connAltID of the node whose parents we want to know are in the collection or EXBN.fromBN
- The ExtendedBN from which the ExtendedNode with the specified connAltID resides. It is there the appropiate parent information will be found.allNodes
- The List we are checking to see if all the parents are present.
public void cloneNodeFunctions(java.util.Map oldToNewNodes, ExtendedBN fromBN) throws ExtendedBNException
oldToNewNodes
- A Map obejct of the Original ExtendedNode (key) to the Clone (value)fromBN
- The ExtendedBN the ExtendedNodes were copied from.
ExtendedBNException
public void cloneNodeNPTs(java.util.Map oldToNewNodes, ExtendedBN fromBN) throws ExtendedBNException
oldToNewNodes
- A Map obejct of the Original ExtendedNode (key) to the Clone (value)fromBN
- The ExtendedBN the ExtendedNodes were copied from.
ExtendedBNException
public void createClonedNodes(java.util.List nodes, ExtendedBN sourceBN, java.util.Map clonedNodes)
nodes
- The nodes to be cloned.sourceBN
- The ExtendedBN the ExtendedNodes were copied from.clonedNodes
- A HashMap which can be populated with a Map of the Original (key) ExtendedNodes to their Clones (value)public void updateConnNodeId(ExtendedNode exn, java.lang.String newConnNodeId) throws uk.co.agena.minerva.model.corebn.CoreBNNodeNotFoundException, ExtendedBNException
connNodeId
- The ID the Core Node should be changed to.exn
- The ExtendedNode who's CoreNode needs to be updated.
uk.co.agena.minerva.model.corebn.CoreBNNodeNotFoundException
ExtendedBNException
public java.lang.String toString()
toString
in class java.lang.Object
public void rollBackCores() throws ExtendedBNException, InconsistentEvidenceException
ExtendedBNException
InconsistentEvidenceException
public ExtendedNode getExtendedNode(java.lang.String altId)
public void clearUnpropagatedEvidence() throws ExtendedBNException
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 void changeNodeStates(ExtendedNode en, DataSet data) throws ExtendedBNException
en
- The node who's States are being replaceddata
- The new set of states
ExtendedBNException
public ExtendedNode changeNodeType(ExtendedNode en, java.lang.Class type, DataSet data) throws ExtendedNodeCreationException
en
- the old nodetype
- the type of the new nodedata
- information for initialising a new set of states
ExtendedNodeCreationException
public ExtendedNode changeNodeType(ExtendedNode en, java.lang.Class type) throws ExtendedNodeCreationException
en
- the old nodetype
- the type of the new node
ExtendedNodeCreationException
public java.util.List getPasteErrorLog()
public boolean isPasteErrorCritical()
public void extendedNodeStatesReplaced(ExtendedNodeEvent ene)
ExtendedNodeListener
extendedNodeStatesReplaced
in interface ExtendedNodeListener
public void extendedNodeAttributeChanged(ExtendedNodeEvent ene, int attribute)
extendedNodeAttributeChanged
in interface ExtendedNodeListener
ene
- attribute
- public java.util.List getUnmarkedTemporaryNodeOrderFlagNodes()
public boolean isAllParentExtendedNodesMarkedForOrdering(ExtendedNode enode) throws ExtendedBNException
ExtendedBNException
public java.util.List getConnections()
getConnections
in interface Connectable
public void setChildren(java.util.List children)
FamilyMember
setChildren
in interface FamilyMember
children
- the new children of the FamilyMemberpublic java.util.List getChildren()
FamilyMember
getChildren
in interface FamilyMember
public int getParentId()
FamilyMember
getParentId
in interface FamilyMember
public void setParentId(int parentId)
FamilyMember
setParentId
in interface FamilyMember
parentId
- the ID of this FamilyMember's new parentpublic 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
public void updateCurrentProgress(int inc)
inc
- The amount by which we are updating the Current Progress.public void forceCoreNPTsSizeUpdates(boolean autoselectNodes) throws ExtendedBNException
ExtendedBNException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |