|
FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
|
An algorithm to compute multiple Lowest Common Ancestors. More...

Classes | |
| class | NodeInfo |
| Information about a node in the DFS. More... | |
Public Member Functions | |
| LowestCommonAncestors (Map< String, Set< String > > flags, Map< String, String > owners) | |
| Constructor. | |
| Collection< MessageType > | getMsgTypes () |
| void | notifyIn (Message msg) |
| void | setQueue (Queue queue) |
| Public Member Functions inherited from frodo2.communication.IncomingMsgPolicyInterface< T > | |
| default void | notifyIn (Message msg, Object toAgent) |
| Notifies the listener of an incoming message. | |
Static Public Attributes | |
| static MessageType | DFS_MSG_TYPE = DFSgeneration.OUTPUT_MSG_TYPE |
| The type of the message containing information about the DFS. | |
| static final MessageType | PHASE1_MSG_TYPE = new MessageType ("E[DPOP]", "LowestCommonAncestors", "LCAmsg1") |
| The type of a phase 1 message. | |
| static final MessageType | PHASE2_MSG_TYPE = new MessageType ("E[DPOP]", "LowestCommonAncestors", "LCAmsg2") |
| The type of a phase 2 message. | |
| static final MessageType | OUTPUT_MSG_TYPE = new MessageType ("E[DPOP]", "LowestCommonAncestors", "LCAoutput") |
| The type of the output messages. | |
Protected Member Functions | |
| LowestCommonAncestors () | |
| Empty constructor with no specified flags. | |
| void | setFlags (Map< String, ? extends Set< String > > flags) |
| Adds flags. | |
| LCAmsg1 | newPhase1msg (String node, NodeInfo nodeInfo) |
| Creates a new Phase 1 message. | |
| void | terminatePhase2 (String node, NodeInfo nodeInfo, Set< String > pendingFlags) |
| Sends messages to children and the output message. | |
| void | sendOutput (String node, NodeInfo nodeInfo) |
| Sends the output message. | |
Protected Attributes | |
| Queue | queue |
| The queue. | |
| HashMap< String, NodeInfo > | infos |
| The known information about each node. | |
| Map< String, String > | owners = new HashMap<String, String> () |
| For each known node, the name of the agent that owns it. | |
An algorithm to compute multiple Lowest Common Ancestors.
Nodes in the DFS can have flags of various types. The algorithm computes, for each flag type, the lca of all nodes with that flag.
| frodo2.algorithms.dpop.stochastic.LowestCommonAncestors.LowestCommonAncestors | ( | Map< String, Set< String > > | flags, |
| Map< String, String > | owners ) |
Constructor.
| flags | for each node, a set of flags |
| owners | for each node, the ID of the owner agent |
References owners.
|
protected |
Empty constructor with no specified flags.
| Collection< MessageType > frodo2.algorithms.dpop.stochastic.LowestCommonAncestors.getMsgTypes | ( | ) |
Implements frodo2.communication.MessageListener< T >.
Reimplemented in frodo2.algorithms.dpop.stochastic.SamplingPhase< V extends Addable< V >, U extends Addable< U > >.
References DFS_MSG_TYPE, PHASE1_MSG_TYPE, and PHASE2_MSG_TYPE.
|
protected |
Creates a new Phase 1 message.
| node | sender variable |
| nodeInfo | information concerning the sender variable |
References frodo2.algorithms.dpop.stochastic.LowestCommonAncestors.NodeInfo.allFlags, and frodo2.algorithms.dpop.stochastic.LowestCommonAncestors.NodeInfo.parent.
| void frodo2.algorithms.dpop.stochastic.LowestCommonAncestors.notifyIn | ( | Message | msg | ) |
Implements frodo2.communication.IncomingMsgPolicyInterface< T >.
Reimplemented in frodo2.algorithms.dpop.stochastic.SamplingPhase< V extends Addable< V >, U extends Addable< U > >.
References frodo2.algorithms.dpop.stochastic.LowestCommonAncestors.NodeInfo.allFlags, frodo2.algorithms.dpop.stochastic.LowestCommonAncestors.NodeInfo.childFlags, DFS_MSG_TYPE, frodo2.communication.MessageType.equals(), frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.DFSview< V extends Addable< V >, U extends Addable< U > >.getChildren(), frodo2.algorithms.dpop.stochastic.LCAmsg1.getDest(), frodo2.algorithms.dpop.stochastic.LCAmsg1.getFlags(), frodo2.algorithms.dpop.stochastic.LCAmsg2.getFlags(), frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.MessageDFSoutput< V extends Addable< V >, U extends Addable< U > >.getNeighbors(), frodo2.algorithms.dpop.stochastic.LCAmsg2.getNode(), frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.DFSview< V extends Addable< V >, U extends Addable< U > >.getParent(), frodo2.algorithms.dpop.stochastic.LCAmsg1.getSender(), frodo2.communication.Message.getType(), frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.MessageDFSoutput< V extends Addable< V >, U extends Addable< U > >.getVar(), frodo2.algorithms.dpop.stochastic.LowestCommonAncestors.NodeInfo.lcas, frodo2.algorithms.dpop.stochastic.LowestCommonAncestors.NodeInfo.myFlags, frodo2.algorithms.dpop.stochastic.LowestCommonAncestors.NodeInfo.nbrMsgsRemaining, notifyIn(), owners, frodo2.algorithms.dpop.stochastic.LowestCommonAncestors.NodeInfo.parent, PHASE1_MSG_TYPE, frodo2.algorithms.dpop.stochastic.LowestCommonAncestors.NodeInfo.phase1msgs, PHASE2_MSG_TYPE, queue, sendOutput(), and terminatePhase2().
Referenced by notifyIn().

|
protected |
Sends the output message.
| node | the corresponding node in the DFS |
| nodeInfo | the info about the node |
References frodo2.algorithms.dpop.stochastic.LowestCommonAncestors.NodeInfo.lcas, OUTPUT_MSG_TYPE, and queue.
Referenced by notifyIn(), and terminatePhase2().
|
protected |
Adds flags.
| flags | for each node, a set of flags |
| void frodo2.algorithms.dpop.stochastic.LowestCommonAncestors.setQueue | ( | Queue | queue | ) |
Implements frodo2.communication.MessageListener< T >.
References queue.
|
protected |
Sends messages to children and the output message.
| node | the current node |
| nodeInfo | information about the current node |
| pendingFlags | a set of flags whose lca has not yet been computed |
References frodo2.algorithms.dpop.stochastic.LowestCommonAncestors.NodeInfo.childFlags, frodo2.algorithms.dpop.stochastic.LowestCommonAncestors.NodeInfo.lcas, owners, PHASE2_MSG_TYPE, queue, and sendOutput().
Referenced by notifyIn().

|
static |
The type of the message containing information about the DFS.
Referenced by getMsgTypes(), notifyIn(), and frodo2.algorithms.dpop.stochastic.SamplingPhase< V extends Addable< V >, U extends Addable< U > >.AtLeaves< V extends Addable< V >, U extends Addable< U > >.notifyIn().
|
protected |
The known information about each node.
|
static |
The type of the output messages.
Referenced by frodo2.algorithms.dpop.stochastic.test.LowestCommonAncestorsTest.getMsgTypes(), frodo2.algorithms.dpop.stochastic.test.LowestCommonAncestorsTest.notifyIn(), and sendOutput().
|
protected |
For each known node, the name of the agent that owns it.
Referenced by LowestCommonAncestors(), notifyIn(), terminatePhase2(), and frodo2.algorithms.dpop.stochastic.SamplingPhase< V extends Addable< V >, U extends Addable< U > >.AtLCAs< V extends Addable< V >, U extends Addable< U > >.terminatePhase2().
|
static |
The type of a phase 1 message.
Referenced by getMsgTypes(), frodo2.algorithms.dpop.stochastic.LCAmsg1.LCAmsg1(), notifyIn(), frodo2.algorithms.dpop.stochastic.SamplingPhase< V extends Addable< V >, U extends Addable< U > >.AtLCAs< V extends Addable< V >, U extends Addable< U > >.notifyIn(), and frodo2.algorithms.dpop.stochastic.SamplingPhase< V extends Addable< V >, U extends Addable< U > >.AtRoots< V extends Addable< V >, U extends Addable< U > >.notifyIn().
|
static |
The type of a phase 2 message.
Referenced by getMsgTypes(), frodo2.algorithms.dpop.stochastic.test.SamplingPhaseTest.getMsgTypes(), notifyIn(), frodo2.algorithms.dpop.stochastic.test.SamplingPhaseTest.notifyIn(), and terminatePhase2().
|
protected |
The queue.
Referenced by frodo2.algorithms.dpop.stochastic.SamplingPhase< V extends Addable< V >, U extends Addable< U > >.getStatsFromQueue(), frodo2.algorithms.dpop.stochastic.SamplingPhase< V extends Addable< V >, U extends Addable< U > >.AtLeaves< V extends Addable< V >, U extends Addable< U > >.init(), notifyIn(), sendOutput(), frodo2.algorithms.dpop.stochastic.SamplingPhase< V extends Addable< V >, U extends Addable< U > >.AtLCAs< V extends Addable< V >, U extends Addable< U > >.sendOutput(), setQueue(), terminatePhase2(), and frodo2.algorithms.dpop.stochastic.SamplingPhase< V extends Addable< V >, U extends Addable< U > >.AtLCAs< V extends Addable< V >, U extends Addable< U > >.terminatePhase2().