FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
Loading...
Searching...
No Matches
frodo2.algorithms.dpop.stochastic.LowestCommonAncestors Class Reference

An algorithm to compute multiple Lowest Common Ancestors. More...

Inheritance diagram for frodo2.algorithms.dpop.stochastic.LowestCommonAncestors:

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< MessageTypegetMsgTypes ()
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, NodeInfoinfos
 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.

Detailed Description

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.

Author
Thomas Leaute

Constructor & Destructor Documentation

◆ LowestCommonAncestors() [1/2]

frodo2.algorithms.dpop.stochastic.LowestCommonAncestors.LowestCommonAncestors ( Map< String, Set< String > > flags,
Map< String, String > owners )

Constructor.

Parameters
flagsfor each node, a set of flags
ownersfor each node, the ID of the owner agent

References owners.

◆ LowestCommonAncestors() [2/2]

frodo2.algorithms.dpop.stochastic.LowestCommonAncestors.LowestCommonAncestors ( )
protected

Empty constructor with no specified flags.

Member Function Documentation

◆ getMsgTypes()

◆ newPhase1msg()

LCAmsg1 frodo2.algorithms.dpop.stochastic.LowestCommonAncestors.newPhase1msg ( String node,
NodeInfo nodeInfo )
protected

Creates a new Phase 1 message.

Parameters
nodesender variable
nodeInfoinformation concerning the sender variable
Returns
a new Phase1 message

References frodo2.algorithms.dpop.stochastic.LowestCommonAncestors.NodeInfo.allFlags, and frodo2.algorithms.dpop.stochastic.LowestCommonAncestors.NodeInfo.parent.

◆ notifyIn()

void frodo2.algorithms.dpop.stochastic.LowestCommonAncestors.notifyIn ( Message msg)
See also
IncomingMsgPolicyInterface.notifyIn(Message)

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().

Here is the call graph for this function:

◆ sendOutput()

void frodo2.algorithms.dpop.stochastic.LowestCommonAncestors.sendOutput ( String node,
NodeInfo nodeInfo )
protected

Sends the output message.

Parameters
nodethe corresponding node in the DFS
nodeInfothe info about the node

References frodo2.algorithms.dpop.stochastic.LowestCommonAncestors.NodeInfo.lcas, OUTPUT_MSG_TYPE, and queue.

Referenced by notifyIn(), and terminatePhase2().

◆ setFlags()

void frodo2.algorithms.dpop.stochastic.LowestCommonAncestors.setFlags ( Map< String, ? extends Set< String > > flags)
protected

Adds flags.

Parameters
flagsfor each node, a set of flags

◆ setQueue()

void frodo2.algorithms.dpop.stochastic.LowestCommonAncestors.setQueue ( Queue queue)

◆ terminatePhase2()

void frodo2.algorithms.dpop.stochastic.LowestCommonAncestors.terminatePhase2 ( String node,
NodeInfo nodeInfo,
Set< String > pendingFlags )
protected

Sends messages to children and the output message.

Parameters
nodethe current node
nodeInfoinformation about the current node
pendingFlagsa 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().

Here is the call graph for this function:

Member Data Documentation

◆ DFS_MSG_TYPE

MessageType frodo2.algorithms.dpop.stochastic.LowestCommonAncestors.DFS_MSG_TYPE = DFSgeneration.OUTPUT_MSG_TYPE
static

◆ infos

HashMap<String, NodeInfo> frodo2.algorithms.dpop.stochastic.LowestCommonAncestors.infos
protected

◆ OUTPUT_MSG_TYPE

final MessageType frodo2.algorithms.dpop.stochastic.LowestCommonAncestors.OUTPUT_MSG_TYPE = new MessageType ("E[DPOP]", "LowestCommonAncestors", "LCAoutput")
static

◆ owners

Map<String, String> frodo2.algorithms.dpop.stochastic.LowestCommonAncestors.owners = new HashMap<String, String> ()
protected

◆ PHASE1_MSG_TYPE

◆ PHASE2_MSG_TYPE

final MessageType frodo2.algorithms.dpop.stochastic.LowestCommonAncestors.PHASE2_MSG_TYPE = new MessageType ("E[DPOP]", "LowestCommonAncestors", "LCAmsg2")
static

◆ queue


The documentation for this class was generated from the following file: