FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
Loading...
Searching...
No Matches
frodo2.communication.mailer.CentralMailer.FakeQueue Class Reference

The queue associated with a specific agent. More...

Inheritance diagram for frodo2.communication.mailer.CentralMailer.FakeQueue:

Public Member Functions

void addIncomingMessagePolicy (MessageType type, IncomingMsgPolicyInterface< MessageType > policy)
 Does exactly the same as the superclass, except that synchronizing over a lock is not necessary.
void addOutgoingMessagePolicy (MessageType type, OutgoingMsgPolicyInterface< MessageType > policy)
 Does exactly the same as the superclass, except that synchronizing over a lock is not necessary.
void addOutputPipe (Object recipient, QueueOutputPipeInterface output)
void addToInbox (MessageWrapper msg)
 Adds the input message wrapper to the buffer of messages waiting to be put into the central priority queue.
void cleanQueue ()
 Removes this agent from the lists of destinations of all messages in the central priority queue.
void end ()
long getCurrentTime ()
int getInboxSize ()
void resetStats ()
void sendMessage (Object to, Message msg)
void sendMessage (Object to, MessageWrapper msgWrap)
void sendMessageToSelf (Message msg)
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.
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 (IncomingMsgPolicyInterface< MessageType > policy)
 Adds a listener to be notified of new incoming messages.
void addIncomingMessagePolicy (Collection< MessageType > msgTypes, IncomingMsgPolicyInterface< MessageType > policy)
 Adds a listener to be notified of new incoming messages.
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 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 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.
MessageWrapper getCurrentMessageWrapper ()
HashMap< MessageType, Integer > getMsgNbrs ()
HashMap< Object, Integer > getMsgNbrsSent ()
HashMap< MessageType, Long > getMsgSizes ()
HashMap< Object, Long > getMsgSizesSent ()
HashMap< MessageType, Long > getMaxMsgSizes ()
void resetMsgSizeMonitor ()
 Closes the MsgSizeMonitor and creates a new one.

Protected Member Functions

 FakeQueue (String agent)
 Constructor.
 FakeQueue (String agent, boolean updateTime)
 Constructor.
void notifyInListeners (Message msg, Object toAgent)
 Does the same as the superclass, but without the need to synchronize on a lock.
boolean notifyOutListeners (Object fromAgent, Message msg, Collection<? extends Object > toAgents)
 Does the same as the superclass, but without the need to synchronize on a lock.
void recordStats (Object to, Message msg)
void setCurrentMsgWrapper (MessageWrapper wrap)
 Sets the current message wrapper.
void freezeTime ()
 Sets the queue's timestamp to the current time.
void updateTime (long msgTime)
 Updates this queue's timer to the input time if the input is greater, and resets the start time to the current system time.
Protected Member Functions inherited from frodo2.communication.Queue
 Queue ()
 Empty constructor that does absolutely nothing.

Protected Attributes

String agent
 The agent name.
int messageCounter
 Counts the total number of messages having been sent by this queue.
long time = Long.MIN_VALUE
 Functions as a timer for the agent that owns this queue.
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.

Package Functions

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

Private Attributes

long startTime = 0
 The last time we started measuring time again after interrupting the measurement.
final boolean updateTime
 If false, this queue's time will always remain frozen at its initial value.

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.

Detailed Description

The queue associated with a specific agent.

Constructor & Destructor Documentation

◆ FakeQueue() [1/2]

frodo2.communication.mailer.CentralMailer.FakeQueue.FakeQueue ( String agent)
protected

Constructor.

Parameters
agentthe agent name

References agent.

◆ FakeQueue() [2/2]

frodo2.communication.mailer.CentralMailer.FakeQueue.FakeQueue ( String agent,
boolean updateTime )
protected

Member Function Documentation

◆ addIncomingMessagePolicy()

void frodo2.communication.mailer.CentralMailer.FakeQueue.addIncomingMessagePolicy ( MessageType type,
IncomingMsgPolicyInterface< MessageType > policy )

Does exactly the same as the superclass, except that synchronizing over a lock is not necessary.

See also
Queue#addIncomingMessagePolicy(MessageType, IncomingMsgPolicyInterface)

Reimplemented from frodo2.communication.Queue.

References frodo2.communication.Queue.inPolicies, and frodo2.communication.MessageListener< T >.setQueue().

Here is the call graph for this function:

◆ addOutgoingMessagePolicy()

void frodo2.communication.mailer.CentralMailer.FakeQueue.addOutgoingMessagePolicy ( MessageType type,
OutgoingMsgPolicyInterface< MessageType > policy )

Does exactly the same as the superclass, except that synchronizing over a lock is not necessary.

See also
Queue#addOutgoingMessagePolicy(MessageType, OutgoingMsgPolicyInterface)

Reimplemented from frodo2.communication.Queue.

References frodo2.communication.Queue.outPolicies, and frodo2.communication.MessageListener< T >.setQueue().

Here is the call graph for this function:

◆ addOutputPipe()

void frodo2.communication.mailer.CentralMailer.FakeQueue.addOutputPipe ( Object recipient,
QueueOutputPipeInterface output )

◆ addToInbox()

void frodo2.communication.mailer.CentralMailer.FakeQueue.addToInbox ( MessageWrapper msg)

Adds the input message wrapper to the buffer of messages waiting to be put into the central priority queue.

See also
Queue.addToInbox(MessageWrapper)

Reimplemented from frodo2.communication.Queue.

References frodo2.communication.mailer.CentralMailer.outbox.

◆ cleanQueue()

void frodo2.communication.mailer.CentralMailer.FakeQueue.cleanQueue ( )

Removes this agent from the lists of destinations of all messages in the central priority queue.

Reimplemented from frodo2.communication.Queue.

References agent, frodo2.communication.MessageWrapper.getDestinations(), and frodo2.communication.mailer.CentralMailer.orderedQueue.

Here is the call graph for this function:

◆ end()

void frodo2.communication.mailer.CentralMailer.FakeQueue.end ( )

◆ freezeTime()

void frodo2.communication.mailer.CentralMailer.FakeQueue.freezeTime ( )
protected

Sets the queue's timestamp to the current time.

References startTime.

Referenced by frodo2.communication.mailer.CentralMailer.run().

◆ getCurrentTime()

long frodo2.communication.mailer.CentralMailer.FakeQueue.getCurrentTime ( )

◆ getInboxSize()

int frodo2.communication.mailer.CentralMailer.FakeQueue.getInboxSize ( )
See also
Queue.getInboxSize()

Reimplemented from frodo2.communication.Queue.

References getCurrentTime(), and frodo2.communication.mailer.CentralMailer.orderedQueue.

Here is the call graph for this function:

◆ notifyInListeners()

void frodo2.communication.mailer.CentralMailer.FakeQueue.notifyInListeners ( Message msg,
Object toAgent )
protected

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.getParent(), frodo2.communication.Message.getType(), and frodo2.communication.Queue.inPolicies.

Referenced by frodo2.communication.mailer.CentralMailer.execute(), and frodo2.communication.mailer.CentralMailer.run().

Here is the call graph for this function:

◆ notifyOutListeners()

boolean frodo2.communication.mailer.CentralMailer.FakeQueue.notifyOutListeners ( Object fromAgent,
Message msg,
Collection<? extends Object > toAgents )
protected

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

See also
Queue#notifyOutListeners(Object, Message, Collection)

Reimplemented from frodo2.communication.Queue.

References frodo2.communication.OutgoingMsgPolicyInterface< T >.Decision.DISCARD, frodo2.communication.MessageType.getParent(), frodo2.communication.Message.getType(), and frodo2.communication.Queue.outPolicies.

Referenced by sendMessage().

Here is the call graph for this function:

◆ recordStats()

void frodo2.communication.mailer.CentralMailer.FakeQueue.recordStats ( Object to,
Message msg )
protected

◆ resetStats()

void frodo2.communication.mailer.CentralMailer.FakeQueue.resetStats ( )
See also
Queue.resetStats()

Reimplemented from frodo2.communication.Queue.

◆ sendMessage() [1/2]

void frodo2.communication.mailer.CentralMailer.FakeQueue.sendMessage ( Object to,
Message msg )

◆ sendMessage() [2/2]

void frodo2.communication.mailer.CentralMailer.FakeQueue.sendMessage ( Object to,
MessageWrapper msgWrap )

◆ sendMessageToMulti()

public< T extends Object > void frodo2.communication.mailer.CentralMailer.FakeQueue.sendMessageToMulti ( Collection< T > recipients,
Message msg )
package

◆ sendMessageToSelf()

void frodo2.communication.mailer.CentralMailer.FakeQueue.sendMessageToSelf ( Message msg)
See also
Queue.sendMessageToSelf(Message)

Reimplemented from frodo2.communication.Queue.

References sendMessage().

Here is the call graph for this function:

◆ setCurrentMsgWrapper()

void frodo2.communication.mailer.CentralMailer.FakeQueue.setCurrentMsgWrapper ( MessageWrapper wrap)
protected

Sets the current message wrapper.

Parameters
wrapcurrent message wrapper

Referenced by frodo2.communication.mailer.CentralMailer.execute().

◆ updateTime()

void frodo2.communication.mailer.CentralMailer.FakeQueue.updateTime ( long msgTime)
protected

Updates this queue's timer to the input time if the input is greater, and resets the start time to the current system time.

Parameters
msgTimeinput time

References startTime, and updateTime.

Member Data Documentation

◆ agent

String frodo2.communication.mailer.CentralMailer.FakeQueue.agent
protected

◆ messageCounter

int frodo2.communication.mailer.CentralMailer.FakeQueue.messageCounter
protected

Counts the total number of messages having been sent by this queue.

Referenced by sendMessage(), and sendMessageToMulti().

◆ startTime

long frodo2.communication.mailer.CentralMailer.FakeQueue.startTime = 0
private

The last time we started measuring time again after interrupting the measurement.

Referenced by freezeTime(), getCurrentTime(), and updateTime().

◆ time

long frodo2.communication.mailer.CentralMailer.FakeQueue.time = Long.MIN_VALUE
protected

Functions as a timer for the agent that owns this queue.

Referenced by getCurrentTime().

◆ updateTime

final boolean frodo2.communication.mailer.CentralMailer.FakeQueue.updateTime
private

If false, this queue's time will always remain frozen at its initial value.

Referenced by FakeQueue(), frodo2.communication.mailer.CentralMailer.run(), and updateTime().


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