FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
Loading...
Searching...
No Matches
frodo2.algorithms.varOrdering.dfs.DFSgenerationParallel< S extends Comparable< S > &Serializable >.FakeQueue Class Reference

There is one such FakeQueue for each candidate root. More...

Inheritance diagram for frodo2.algorithms.varOrdering.dfs.DFSgenerationParallel< S extends Comparable< S > &Serializable >.FakeQueue:

Public Member Functions

 FakeQueue (S root)
 Constructor.
void sendMessage (Object to, Message msg)
void sendMessage (Object to, MessageWrapper msgWrap)
void sendMessageToSelf (Message msg)
void notifyInListeners (Message msg, Object toAgent)
 Does the same as the superclass, but without the need to synchronize on a lock.
void addIncomingMessagePolicyForReal (DFSgeneration<?, ?> dfsModule)
 Adds the input DFS module to the queue's listeners.
void addIncomingMessagePolicy (IncomingMsgPolicyInterface< MessageType > policy)
 The module's queue is set to a SinkQueue so that all messages sent are discarded.
Public Member Functions inherited from frodo2.communication.Queue
 Queue (boolean measureMsgs)
 Constructor.
 Queue (boolean measureMsgs, boolean init)
 Constructor.
void toBeClosedUponKill (QueueInputPipeInterface input)
 Reminds the queue to close the given pipe when it is killed.
void removeInputPipe (QueueInputPipeInterface input)
 Removes the given input pipe from the list of input pipes.
void addOutputPipe (Object recipient, QueueOutputPipeInterface output)
 Adds an output pipe to this queue.
QueueOutputPipeInterface getOutputPipe (Object recipient)
 Returns the output pipe corresponding to the given recipient.
void removeOutputPipe (Object recipient)
 Removes the output pipe corresponding to the given recipient.
QueueIOPipe addOutputQueue (Object recipient, Queue queue)
 Adds a new output pipe to the provided queue.
void addIncomingMessagePolicy (Collection< MessageType > msgTypes, IncomingMsgPolicyInterface< MessageType > policy)
 Adds a listener to be notified of new incoming messages.
void addIncomingMessagePolicy (MessageType type, IncomingMsgPolicyInterface< MessageType > policy)
 Adds a listener to be notified of new incoming messages of type type.
void addOutgoingMessagePolicy (OutgoingMsgPolicyInterface< MessageType > policy)
 Adds a listener to be notified of new outgoing messages.
void addOutgoingMessagePolicy (Collection< MessageType > msgTypes, OutgoingMsgPolicyInterface< MessageType > policy)
 Adds a listener to be notified of new outgoing messages.
void addOutgoingMessagePolicy (MessageType type, OutgoingMsgPolicyInterface< MessageType > policy)
 Adds a listener to be notified of new outgoing messages of type type.
void addToInbox (MessageWrapper msg)
 Adds the input message to this queue's inbox.
void end ()
 Kills the queue, making it unusable.
void run ()
 Continuously processes all messages in the inbox.
void deleteIncomingMessagePolicy (IncomingMsgPolicyInterface< MessageType > policy)
 Completely removes the input policy from all lists of listeners.
void deleteStatsReporters ()
 Delete all StatsReporters.
void deleteOutgoingMessagePolicy (OutgoingMsgPolicyInterface< MessageType > policy)
 Completely removes the outgoing message policy from all lists of listeners.
void cleanQueue ()
 Removes all messages from the inbox.
void setProblem (ProblemInterface<?, ?> problem)
 Sets the problem that is queried for NCCCs.
void updateNCCCs (long msgNCCCs)
 Updates the queue's NCCC counter to the input count if the input is greater.
long getCurrentTime ()
int getInboxSize ()
MessageWrapper getCurrentMessageWrapper ()
HashMap< MessageType, Integer > getMsgNbrs ()
HashMap< Object, Integer > getMsgNbrsSent ()
HashMap< MessageType, Long > getMsgSizes ()
HashMap< Object, Long > getMsgSizesSent ()
HashMap< MessageType, Long > getMaxMsgSizes ()
void resetStats ()
 Resets the metrics statistics.
void resetMsgSizeMonitor ()
 Closes the MsgSizeMonitor and creates a new one.

Package Functions

public< T extends Object > void sendMessageToMulti (Collection< T > recipients, Message msg)

Private Member Functions

void releaseOutput (String var, boolean isRoot)
 Releases the DFSoutput message for the input variable, and tell its children to do the same.

Private Attributes

final S root
 The candidate root.
HashMap< String, MessageDFSoutput<?, ?> > dfsOutputMsgs = new HashMap< String, MessageDFSoutput<?, ?> > ()
 For each internal variable, the DFSoutput message that is being held until it becomes clear that the candidate root is indeed a root.
HashMap< String, DFSorderOutputMessagedfsOrderMsgs = new HashMap<String, DFSorderOutputMessage> ()
 For each internal variable, the DFSorder message that is being held until it becomes clear that the candidate root is indeed a root.
HashMap< String, MessageDFSoutput<?, ?> > dfsStatsMsgs = new HashMap< String, MessageDFSoutput<?, ?> > ()
 For each internal variable, the DFSstats message that is being held until it becomes clear that the candidate root is indeed a root.
HashMap< String, VarNbrMsgvarNbrMsgs = new HashMap<String, VarNbrMsg> ()
 For each internal variable, the VarNbrMsg message that is being held until it becomes clear that the candidate root is indeed a root.
HashMap< String, List< String > > children = new HashMap< String, List<String> > ()
 For each variable I own, its list of children.

Additional Inherited Members

Static Public Member Functions inherited from frodo2.communication.Queue
static String networkToDOT (Queue[] queues)
 Generates a String representation in DOT format of a network of queues.
Protected Member Functions inherited from frodo2.communication.Queue
 Queue ()
 Empty constructor that does absolutely nothing.
boolean notifyOutListeners (Object fromAgent, Message msg, Collection<? extends Object > toAgents)
 Notifies the outgoing message listeners of a message.
void recordStats (Object to, Message msg)
 Records statistics about the input message.
Protected Attributes inherited from frodo2.communication.Queue
Set< QueueInputPipeInterfaceinputs
 List of input pipes.
HashMap< Object, QueueOutputPipeInterfaceoutputs
 Map associating an output pipe to each destination ID.
MsgSizeMonitor monitor
 A monitor used to measure the sizes of the messages.
HashMap< MessageType, ArrayList< IncomingMsgPolicyInterface< MessageType > > > inPolicies
 A list of listeners notified of incoming objects.
HashMap< MessageType, ArrayList< OutgoingMsgPolicyInterface< MessageType > > > outPolicies
 A list of listeners notified of outgoing messages.
ProblemInterface<?, ?> problem
 The problem used to obtain the current NCCC count.
final boolean measureMsgs
 Whether to measure the number of messages and the total amount of information sent.
HashMap< MessageType, Integer > msgNbrs
 For each message type, the number of messages sent of that type.
HashMap< MessageType, Long > msgSizes
 For each message type, the total amount of information sent in messages of that type, in bytes.
HashMap< MessageType, Long > maxMsgSizes
 For each message type, the size (in bytes) of the largest message of that type.
MessageWrapper msgWrap
 The last wrapped message to have been received.

Detailed Description

There is one such FakeQueue for each candidate root.

Constructor & Destructor Documentation

◆ FakeQueue()

frodo2.algorithms.varOrdering.dfs.DFSgenerationParallel< S extends Comparable< S > &Serializable >.FakeQueue.FakeQueue ( S root)

Member Function Documentation

◆ addIncomingMessagePolicy()

void frodo2.algorithms.varOrdering.dfs.DFSgenerationParallel< S extends Comparable< S > &Serializable >.FakeQueue.addIncomingMessagePolicy ( IncomingMsgPolicyInterface< MessageType > policy)

The module's queue is set to a SinkQueue so that all messages sent are discarded.

See also
Queue#addIncomingMessagePolicy(IncomingMsgPolicyInterface)

Reimplemented from frodo2.communication.Queue.

References frodo2.communication.MessageListener< T >.setQueue().

Here is the call graph for this function:

◆ addIncomingMessagePolicyForReal()

void frodo2.algorithms.varOrdering.dfs.DFSgenerationParallel< S extends Comparable< S > &Serializable >.FakeQueue.addIncomingMessagePolicyForReal ( DFSgeneration<?, ?> dfsModule)

Adds the input DFS module to the queue's listeners.

Parameters
dfsModuleDFS module

Referenced by frodo2.algorithms.varOrdering.dfs.DFSgenerationParallel< S extends Comparable< S > &Serializable >.newFakeQueue().

◆ notifyInListeners()

void frodo2.algorithms.varOrdering.dfs.DFSgenerationParallel< S extends Comparable< S > &Serializable >.FakeQueue.notifyInListeners ( Message msg,
Object toAgent )

Does the same as the superclass, but without the need to synchronize on a lock.

See also
Queue.notifyInListeners(Message, Object)

Reimplemented from frodo2.communication.Queue.

References frodo2.communication.MessageType.equals(), frodo2.algorithms.varOrdering.dfs.VarNbrMsg.getDest(), frodo2.communication.MessageType.getParent(), 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.communication.Queue.inPolicies, frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.OUTPUT_MSG_TYPE, frodo2.algorithms.varOrdering.dfs.DFSgenerationParallel< S extends Comparable< S > &Serializable >.queue, frodo2.algorithms.varOrdering.dfs.DFSgenerationParallel< S extends Comparable< S > &Serializable >.RELEASE_OUTPUT_MSG_TYPE, releaseOutput(), frodo2.algorithms.varOrdering.dfs.DFSgenerationParallel< S extends Comparable< S > &Serializable >.rootElectionScores, and frodo2.algorithms.varOrdering.dfs.DFSgenerationWithOrder< V extends Addable< V >, U extends Addable< U > >.VARIABLE_COUNT_TYPE.

Referenced by frodo2.algorithms.varOrdering.dfs.DFSgenerationParallel< S extends Comparable< S > &Serializable >.init(), frodo2.algorithms.varOrdering.dfs.DFSgenerationParallel< S extends Comparable< S > &Serializable >.newFakeQueue(), and frodo2.algorithms.varOrdering.dfs.DFSgenerationParallel< S extends Comparable< S > &Serializable >.notifyIn().

Here is the call graph for this function:

◆ releaseOutput()

void frodo2.algorithms.varOrdering.dfs.DFSgenerationParallel< S extends Comparable< S > &Serializable >.FakeQueue.releaseOutput ( String var,
boolean isRoot )
private

Releases the DFSoutput message for the input variable, and tell its children to do the same.

Parameters
varthe variable whose DFSoutput message must be released
isRootwhether the variable is the root

References frodo2.algorithms.varOrdering.dfs.DFSgenerationParallel< S extends Comparable< S > &Serializable >.owners, frodo2.algorithms.varOrdering.dfs.DFSgenerationParallel< S extends Comparable< S > &Serializable >.queue, sendMessage(), and frodo2.algorithms.AgentInterface< V extends Addable< V > >.STATS_MONITOR.

Referenced by notifyInListeners().

Here is the call graph for this function:

◆ sendMessage() [1/2]

◆ sendMessage() [2/2]

◆ sendMessageToMulti()

public< T extends Object > void frodo2.algorithms.varOrdering.dfs.DFSgenerationParallel< S extends Comparable< S > &Serializable >.FakeQueue.sendMessageToMulti ( Collection< T > recipients,
Message msg )
package

◆ sendMessageToSelf()

Member Data Documentation

◆ children

HashMap< String, List<String> > frodo2.algorithms.varOrdering.dfs.DFSgenerationParallel< S extends Comparable< S > &Serializable >.FakeQueue.children = new HashMap< String, List<String> > ()
private

For each variable I own, its list of children.

◆ dfsOrderMsgs

HashMap<String, DFSorderOutputMessage> frodo2.algorithms.varOrdering.dfs.DFSgenerationParallel< S extends Comparable< S > &Serializable >.FakeQueue.dfsOrderMsgs = new HashMap<String, DFSorderOutputMessage> ()
private

For each internal variable, the DFSorder message that is being held until it becomes clear that the candidate root is indeed a root.

◆ dfsOutputMsgs

HashMap< String, MessageDFSoutput<?, ?> > frodo2.algorithms.varOrdering.dfs.DFSgenerationParallel< S extends Comparable< S > &Serializable >.FakeQueue.dfsOutputMsgs = new HashMap< String, MessageDFSoutput<?, ?> > ()
private

For each internal variable, the DFSoutput message that is being held until it becomes clear that the candidate root is indeed a root.

◆ dfsStatsMsgs

HashMap< String, MessageDFSoutput<?, ?> > frodo2.algorithms.varOrdering.dfs.DFSgenerationParallel< S extends Comparable< S > &Serializable >.FakeQueue.dfsStatsMsgs = new HashMap< String, MessageDFSoutput<?, ?> > ()
private

For each internal variable, the DFSstats message that is being held until it becomes clear that the candidate root is indeed a root.

◆ root

final S frodo2.algorithms.varOrdering.dfs.DFSgenerationParallel< S extends Comparable< S > &Serializable >.FakeQueue.root
private

The candidate root.

Referenced by FakeQueue().

◆ varNbrMsgs

HashMap<String, VarNbrMsg> frodo2.algorithms.varOrdering.dfs.DFSgenerationParallel< S extends Comparable< S > &Serializable >.FakeQueue.varNbrMsgs = new HashMap<String, VarNbrMsg> ()
private

For each internal variable, the VarNbrMsg message that is being held until it becomes clear that the candidate root is indeed a root.


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