|
FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
|
The queue associated with a specific agent. More...

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< QueueInputPipeInterface > | inputs |
| List of input pipes. | |
| HashMap< Object, QueueOutputPipeInterface > | outputs |
| 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. | |
The queue associated with a specific agent.
|
protected |
|
protected |
Constructor.
| agent | the agent name |
| updateTime | If false, this queue's time will always remain frozen at its initial value |
References agent, frodo2.communication.Queue.inPolicies, frodo2.communication.Queue.inputs, frodo2.communication.mailer.CentralMailer.measuringMsgs, frodo2.communication.Queue.outPolicies, frodo2.communication.Queue.outputs, frodo2.communication.MessageType.ROOT, and updateTime.
| 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.
Reimplemented from frodo2.communication.Queue.
References frodo2.communication.Queue.inPolicies, and frodo2.communication.MessageListener< T >.setQueue().

| 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.
Reimplemented from frodo2.communication.Queue.
References frodo2.communication.Queue.outPolicies, and frodo2.communication.MessageListener< T >.setQueue().

| void frodo2.communication.mailer.CentralMailer.FakeQueue.addOutputPipe | ( | Object | recipient, |
| QueueOutputPipeInterface | output ) |
Reimplemented from frodo2.communication.Queue.
References frodo2.output.
| 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.
Reimplemented from frodo2.communication.Queue.
References frodo2.communication.mailer.CentralMailer.outbox.
| 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.

| void frodo2.communication.mailer.CentralMailer.FakeQueue.end | ( | ) |
Reimplemented from frodo2.communication.Queue.
References frodo2.communication.Queue.inputs, frodo2.communication.Queue.measureMsgs, and frodo2.communication.Queue.monitor.
|
protected |
Sets the queue's timestamp to the current time.
References startTime.
Referenced by frodo2.communication.mailer.CentralMailer.run().
| long frodo2.communication.mailer.CentralMailer.FakeQueue.getCurrentTime | ( | ) |
Reimplemented from frodo2.communication.Queue.
References startTime, and time.
Referenced by frodo2.communication.mailer.CentralMailer.execute(), getInboxSize(), sendMessage(), and sendMessageToMulti().
| int frodo2.communication.mailer.CentralMailer.FakeQueue.getInboxSize | ( | ) |
Reimplemented from frodo2.communication.Queue.
References getCurrentTime(), and frodo2.communication.mailer.CentralMailer.orderedQueue.

|
protected |
Does the same as the superclass, but without the need to synchronize on a lock.
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().

|
protected |
Does the same as the superclass, but without the need to synchronize on a lock.
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().

|
protected |
Reimplemented from frodo2.communication.Queue.
References frodo2.algorithms.AgentInterface< V extends Addable< V > >.STATS_MONITOR.
Referenced by frodo2.communication.mailer.CentralMailer.execute().
| void frodo2.communication.mailer.CentralMailer.FakeQueue.resetStats | ( | ) |
Reimplemented from frodo2.communication.Queue.
| void frodo2.communication.mailer.CentralMailer.FakeQueue.sendMessage | ( | Object | to, |
| Message | msg ) |
Reimplemented from frodo2.communication.Queue.
References getCurrentTime(), messageCounter, frodo2.communication.Queue.msgWrap, notifyOutListeners(), frodo2.communication.Queue.problem, sendMessage(), and frodo2.communication.MessageWrapper.setDestination().
Referenced by sendMessage(), and sendMessageToSelf().

| void frodo2.communication.mailer.CentralMailer.FakeQueue.sendMessage | ( | Object | to, |
| MessageWrapper | msgWrap ) |
Reimplemented from frodo2.communication.Queue.
References frodo2.communication.Queue.msgWrap, and frodo2.communication.mailer.CentralMailer.queues.
|
package |
Reimplemented from frodo2.communication.Queue.
References frodo2.communication.Message.fakeSerialize(), getCurrentTime(), frodo2.communication.Message.getType(), messageCounter, frodo2.communication.Queue.msgWrap, frodo2.communication.mailer.CentralMailer.outbox, frodo2.communication.Queue.problem, frodo2.communication.MessageWrapper.setTime(), and frodo2.algorithms.AgentInterface< V extends Addable< V > >.START_AGENT.

| void frodo2.communication.mailer.CentralMailer.FakeQueue.sendMessageToSelf | ( | Message | msg | ) |
Reimplemented from frodo2.communication.Queue.
References sendMessage().

|
protected |
Sets the current message wrapper.
| wrap | current message wrapper |
Referenced by frodo2.communication.mailer.CentralMailer.execute().
|
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.
| msgTime | input time |
References startTime, and updateTime.
|
protected |
The agent name.
Referenced by cleanQueue(), frodo2.communication.mailer.CentralMailer.execute(), FakeQueue(), FakeQueue(), and frodo2.communication.mailer.CentralMailer.run().
|
protected |
Counts the total number of messages having been sent by this queue.
Referenced by sendMessage(), and sendMessageToMulti().
|
private |
The last time we started measuring time again after interrupting the measurement.
Referenced by freezeTime(), getCurrentTime(), and updateTime().
|
protected |
Functions as a timer for the agent that owns this queue.
Referenced by getCurrentTime().
|
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().