|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.co.agena.minerva.model.MessagePassingLinks
public class MessagePassingLinks
This class should be used to setup a link between ExtendedNodes of possibly different ExtendedBNs so that message-passing can occur between them. A single MessagePassingLinks object contains multiple links of this kind.
Field Summary | |
---|---|
static java.lang.String |
MESSAGE_LINK_NAME
Constant used when storing MessagePassingLinks to file. |
static int |
PRIORITY_HIGH
Constant used to indicate high priority. |
static int |
PRIORITY_LOW
Constant used to indicate low priority. |
static int |
PRIORITY_MEDIUM
Constant used to indicate medium priority. |
static int |
PRIORITY_VERY_HIGH
Constant used to indicate very high priority. |
static int |
PRIORITY_VERY_LOW
Constant used to indicate very low priority. |
static double |
version
|
Fields inherited from interface uk.co.agena.minerva.util.model.Writable |
---|
FIELD_SEPARATOR |
Constructor Summary | |
---|---|
MessagePassingLinks()
Default constructor. |
|
MessagePassingLinks(int childExtBNID,
int childExtNodeID,
int parentExtBNID,
int parentExtNodeID)
Creates a MessagePassingLinks object with one initial link. |
Method Summary | |
---|---|
void |
add(int parentExtBNID,
int childExtBNID,
int parentExtNodeID,
int childExtNodeID)
Adds a new link with the specified child/parent ExtendedBN/ExtendedNode IDs to this MessagePassingLinks object. |
void |
changeExtendedBNId(int oldExtendedBNId,
int newExtendedBNId)
Changes all occurences of the specified old ExtendedBN ID to the specified new ExtendedBN ID, wherever it occurs in any of the links. |
java.lang.Object |
clone()
|
void |
decreasePriorityLevel()
Decrements the current priority level by one (unless the priority level is already PRIORITY_VERY_LOW i.e. |
int[] |
getChildrenExtendedBNIds(int parentExtendedBNID)
Returns all child ExtendedBN IDs that are connected to the supplied parent ExtendedBN ID in the links contained in this MessagePassingLinks object. |
int |
getId()
Returns the unique integer ID of the object. |
int |
getIterationChildExtendedBNId()
Gets the child ExtendedBN ID at the index specified by the current value of the iterator counter. |
int |
getIterationChildExtendedNodeId()
Gets the child ExtendedNode ID at the index specified by the current value of the iterator counter. |
int |
getIterationParentExtendedBNId()
Gets the parent ExtendedBN ID at the index specified by the current value of the iterator counter. |
int |
getIterationParentExtendedNodeId()
Gets the parent ExtendedNode ID at the index specified by the current value of the iterator counter. |
int[] |
getParentExtendedBNIds(int childExtendedBNID)
Returns all parent ExtendedBN IDs that are connected to the supplied child ExtendedBN ID in the links contained in this MessagePassingLinks object. |
int |
getPriorityLevel()
Returns the current priority level of this MessagePassingLinks object with respect to any other MessagePassingLinks objects that are being navigated. |
double |
getVersion()
Returns the version of the class. |
void |
increasePriority()
Increments the current priority level by one (unless the priority level is already PRIORITY_VERY_HIGH i.e. |
int |
isAllParentsSame()
Goes through and checks whether all the IDs for the parent ExtendedBNs in this MessagePassingLinks object are the same. |
boolean |
isChildExtendedBN(int childExtendedBNID)
Checks whether there are any links in this MessagePassingLinks object whose children have the supplied ExtendedBN ID. |
boolean |
isParentExtendedBN(int parentExtendedBNID)
Checks whether there are any links in this MessagePassingLinks object whose parents have the supplied ExtendedBN ID. |
boolean |
isRecursive()
Checks if this link is recursive |
boolean |
isValidForModel(Model m)
This method will itterate over the message pass links in the message pass link object, and remove those that are connected to exBNs and exNodes that are in the connected model. |
static boolean |
isValidLink(ExtendedNode sourceNode,
ExtendedBN targetBN,
ExtendedNode targetNode)
This method takes two nodes, and informs the user whether they are a valid source and target for a message parse link. |
static MessagePassingLinks |
joinLinks(java.util.List mpLinksList)
Joins the Links in the List of MessagePassingLinks. |
boolean |
messageParseExistsFor(int childExtBNID,
int childExtNodeID,
int parentExtBNID,
int parentExtNodeID)
Indicates whether a message-passing link exists between the two specified ExtendedNodes (that reside in the two specified ExtendedBNs). |
boolean |
next()
Increments the iterator counter. |
int |
read(java.util.List strings,
int currentLineNumber)
|
boolean |
removeAllRelatedMessagePassLinks(int extBNID,
int extNodeID)
Removes all message passing links where the supplied BN/Node ID combination features as child or parent. |
boolean |
removeMessagePassingLinkByIndex(int indexToRemove)
This will remove the message passing links that are located in the argument index. |
boolean |
removeMessagePassLink(int extBNID)
Removes all links involving the specified Extended BN. |
boolean |
removeMessagePassLink(int childExtBNID,
int parentExtBNID)
Removes all links between the specified ExtendedBNs. |
boolean |
removeMessagePassLink(int childExtBNID,
int childExtNodeID,
int parentExtBNID,
int parentExtNodeID)
Removes the first link in this MessagePassingLinks object that has the specified child/parent ExtendedBN/ExtendedNode IDs. |
static java.util.List |
reorderByPriority(java.util.List messagePassingLinksList)
Takes the supplied list of MessagePassingLinks objects, orders them by priority level and then returns them. |
void |
setId(int id)
|
void |
setIterationChildExtendedBNId(int newChildExtendedBNId)
Sets the child ExtendedBN ID at the index specified by the current value of the iterator counter. |
void |
setIterationChildExtendedNodeId(int newChildExtendedNodeId)
Sets the child ExtendedNode ID at the index specified by the current value of the iterator counter. |
void |
setIterationParentExtendedBNId(int newParentExtendedBNId)
Sets the parent ExtendedBN ID at the index specified by the current value of the iterator counter. |
void |
setIterationParentExtendedNodeId(int newParentExtendedNodeId)
Sets the parent ExtendedNode ID at the index specified by the current value of the iterator counter. |
void |
setPriorityLevel(int priorityLevel)
Sets the current priority level of this MessagePassingLinks object with respect to any other MessagePassingLinks objects that are being navigated. |
void |
setVersion(double version)
Sets the version number of the class. |
int |
size()
Returns the number of links stored in this MessagePassingLinks object. |
void |
startIterator()
Starts an iterator for the links in this MessagePassingLinks object. |
java.util.List |
write()
Writes the object in question to a List of Strings. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static double version
public static final java.lang.String MESSAGE_LINK_NAME
public static final int PRIORITY_VERY_LOW
public static final int PRIORITY_LOW
public static final int PRIORITY_MEDIUM
public static final int PRIORITY_HIGH
public static final int PRIORITY_VERY_HIGH
Constructor Detail |
---|
public MessagePassingLinks()
public MessagePassingLinks(int childExtBNID, int childExtNodeID, int parentExtBNID, int parentExtNodeID)
childExtBNID
- the ExtendedBN ID of the child end of the linkchildExtNodeID
- the ExtendedNode ID of the child end of the linkparentExtBNID
- the ExtendedBN ID of the parent end of the linkparentExtNodeID
- the ExtendedNode ID of the parent end of the linkMethod Detail |
---|
public void changeExtendedBNId(int oldExtendedBNId, int newExtendedBNId)
oldExtendedBNId
- the ID to be changednewExtendedBNId
- the new value of the IDpublic static boolean isValidLink(ExtendedNode sourceNode, ExtendedBN targetBN, ExtendedNode targetNode) throws MessagePassingLinkException
sourceNode
- targetNode
-
MessagePassingLinkException
public boolean isValidForModel(Model m)
m
-
public boolean removeAllRelatedMessagePassLinks(int extBNID, int extNodeID)
extBNID
- the BN under considerationextNodeID
- the node under consideration
public boolean removeMessagePassLink(int childExtBNID, int childExtNodeID, int parentExtBNID, int parentExtNodeID)
childExtBNID
- the ExtendedBN ID of the child end of the linkchildExtNodeID
- the ExtendedNode ID of the child end of the linkparentExtBNID
- the ExtendedBN ID of the parent end of the linkparentExtNodeID
- the ExtendedNode ID of the parent end of the link
public boolean removeMessagePassingLinkByIndex(int indexToRemove)
indexToRemove
-
public boolean removeMessagePassLink(int childExtBNID, int parentExtBNID)
childExtBNID
- the ExtendedBN ID of the child end of the linkparentExtBNID
- the ExtendedBN ID of the parent end of the link
public boolean removeMessagePassLink(int extBNID)
extBNID
- the ExtendedBN for which to remove all links
public boolean messageParseExistsFor(int childExtBNID, int childExtNodeID, int parentExtBNID, int parentExtNodeID)
childExtBNID
- the target child ExtendedBN IDchildExtNodeID
- the target child ExtendedNode IDparentExtBNID
- the target parent ExtendedBN IDparentExtNodeID
- the target child ExtendedNode ID
public int getPriorityLevel()
public void setPriorityLevel(int priorityLevel)
priorityLevel
- the new priority levelpublic void increasePriority()
public void decreasePriorityLevel()
public int size()
public void add(int parentExtBNID, int childExtBNID, int parentExtNodeID, int childExtNodeID)
parentExtBNID
- the ExtendedBN ID of the parent end of the linkchildExtBNID
- the ExtendedBN ID of the child end of the linkparentExtNodeID
- the ExtendedNode ID of the parent end of the linkchildExtNodeID
- the ExtendedNode ID of the child end of the linkpublic boolean isParentExtendedBN(int parentExtendedBNID)
parentExtendedBNID
- the parent ExtendedBN ID of the link being sought
public boolean isChildExtendedBN(int childExtendedBNID)
childExtendedBNID
- the child ExtendedBN ID of the link being sought
public int[] getChildrenExtendedBNIds(int parentExtendedBNID)
parentExtendedBNID
- the parent ExtendedBN ID being sought
public int[] getParentExtendedBNIds(int childExtendedBNID)
childExtendedBNID
- the child ExtendedBN ID being sought
public static java.util.List reorderByPriority(java.util.List messagePassingLinksList)
messagePassingLinksList
- the unordered List of MessagePassingLinks objects
public void startIterator()
public boolean next()
public int getIterationParentExtendedBNId()
public int getIterationChildExtendedBNId()
public int getIterationParentExtendedNodeId()
public int getIterationChildExtendedNodeId()
public void setIterationParentExtendedBNId(int newParentExtendedBNId)
newParentExtendedBNId
- the new parent ExtendedBN ID at the index specified by the current
value of the iterator counterpublic void setIterationChildExtendedBNId(int newChildExtendedBNId)
newChildExtendedBNId
- the new child ExtendedBN ID at the index specified by the current
value of the iterator counterpublic void setIterationParentExtendedNodeId(int newParentExtendedNodeId)
newParentExtendedNodeId
- the new parent ExtendedNode ID at the index specified by the
current value of the iterator counterpublic void setIterationChildExtendedNodeId(int newChildExtendedNodeId)
newChildExtendedNodeId
- the new child ExtendedNode ID at the index specified by the
current value of the iterator counterpublic int isAllParentsSame()
public boolean isRecursive()
public static MessagePassingLinks joinLinks(java.util.List mpLinksList)
mpLinksList
-
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 java.lang.Object clone()
clone
in class java.lang.Object
public int getId()
Identifiable
getId
in interface Identifiable
public void setId(int id)
id
- The id to set.public double getVersion()
Writable
getVersion
in interface Writable
public void setVersion(double version)
Writable
setVersion
in interface Writable
version
- the version number
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |