|
FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
|
A queue. More...

Public Member Functions | |
| 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 (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 | 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 | sendMessage (Object to, Message msg) |
| Sends a message to a specified recipient. | |
| void | sendMessage (Object to, MessageWrapper msgWrap) |
| Send a message that has already been wrapped. | |
| void | sendMessageToSelf (Message msg) |
| Sends a message to itself. | |
| 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. | |
Static Public Member Functions | |
| static String | networkToDOT (Queue[] queues) |
| Generates a String representation in DOT format of a network of queues. | |
Protected Member Functions | |
| Queue () | |
| Empty constructor that does absolutely nothing. | |
| void | notifyInListeners (Message msg, Object toAgent) |
| Notifies the incoming message listeners of a message. | |
| 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 | |
| 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) |
| Sends a message to all specified recipients. | |
Private Member Functions | |
| void | init () |
| Helper function called by the constructors to avoid code redundancy. | |
| void | toDOT (StringBuilder out, int ID) |
| Creates a fragment of DOT representation for this queue and its pipes. | |
Private Attributes | |
| BlockingQueue< MessageWrapper > | inbox |
| The list of incoming messages waiting to be processed. | |
| final ReentrantLock | outPolicies_lock = new ReentrantLock() |
| Lock for outPolicies field. | |
| boolean | keepGoing = true |
| Used to tell the thread to stop. | |
| Thread | myThread |
| The queue's thread. | |
| HashMap< Object, Integer > | msgNbrsSent |
| The number of messages sent to each other agent. | |
| HashMap< Object, Long > | msgSizesSent |
| The amount of information sent to each other agent, in bytes. | |
| final ReentrantLock | input_lock = new ReentrantLock() |
| lock for input field | |
| final ReentrantLock | output_lock = new ReentrantLock() |
| lock for output field | |
| final ReentrantLock | inPolicies_lock = new ReentrantLock() |
| lock for inPolicies field | |
A queue.
|
protected |
Empty constructor that does absolutely nothing.
Referenced by addOutputQueue(), networkToDOT(), and frodo2.algorithms.varOrdering.election.VariableElection< S extends Comparable< S > &Serializable >.setQueue().
| frodo2.communication.Queue.Queue | ( | boolean | measureMsgs | ) |
Constructor.
| measureMsgs | whether to measure the number of messages and the total amount of information sent |
References measureMsgs.
| frodo2.communication.Queue.Queue | ( | boolean | measureMsgs, |
| boolean | init ) |
Constructor.
| measureMsgs | whether to measure the number of messages and the total amount of information sent |
| init | whether the init() method should be called |
References init(), and measureMsgs.

| void frodo2.communication.Queue.addIncomingMessagePolicy | ( | Collection< MessageType > | msgTypes, |
| IncomingMsgPolicyInterface< MessageType > | policy ) |
Adds a listener to be notified of new incoming messages.
| msgTypes | the message types the policy should be registered for |
| policy | Incoming object policy to be added |
References addIncomingMessagePolicy().

| void frodo2.communication.Queue.addIncomingMessagePolicy | ( | IncomingMsgPolicyInterface< MessageType > | policy | ) |
Adds a listener to be notified of new incoming messages.
It prompts the listener for the types of messages it wants to listen to.
| policy | Incoming object policy to be added |
Reimplemented in frodo2.algorithms.varOrdering.dfs.DFSgenerationParallel< S extends Comparable< S > &Serializable >.FakeQueue.
References addIncomingMessagePolicy(), and frodo2.communication.MessageListener< T >.getMsgTypes().
Referenced by addIncomingMessagePolicy(), addIncomingMessagePolicy(), frodo2.algorithms.dpop.param.test.ParamVALUEtest< U extends Addable< U > >.Listener.getStatsFromQueue(), frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.Listener.getStatsFromQueue(), frodo2.algorithms.varOrdering.election.tests.SecureVarElectionTest.initiateParamAndListener(), frodo2.algorithms.varOrdering.election.tests.VariableElectionTest< S extends Comparable< S > &Serializable >.initiateParamAndListener(), frodo2.algorithms.varOrdering.election.tests.LeaderElectionMaxIDTest< S extends Comparable< S > >.initiatingIDandListener(), frodo2.algorithms.varOrdering.election.tests.VarElectionMessengerTest.initiatingIDandListener(), frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.Listener.Listener(), frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.Listener.Listener(), frodo2.algorithms.dpop.privacy.test.SecureRerootingTest.randomTest(), frodo2.algorithms.dpop.privacy.test.VariableObfuscationTest< V extends Addable< V > >.randomTest(), frodo2.algorithms.dpop.stochastic.test.LowestCommonAncestorsTest.setModules(), frodo2.algorithms.dpop.stochastic.test.SamplingPhaseTest.setModules(), frodo2.algorithms.dpop.privacy.test.SecureCircularRoutingTest.setUp(), frodo2.algorithms.dpop.stochastic.test.ExpectedUTILtest.Listener.setUpPrelimModules(), frodo2.algorithms.adopt.test.testADOPT.test(), frodo2.algorithms.asodpop.tests.ASODPOPBinaryTest< V extends Addable< V >, U extends Addable< U > >.test(), frodo2.algorithms.asodpop.tests.ASODPOPTest< V extends Addable< V >, U extends Addable< U > >.test(), frodo2.algorithms.duct.tests.NormalizeInfTest.test(), frodo2.algorithms.duct.tests.NormalizeTest.test(), frodo2.algorithms.odpop.tests.UTILpropagationTest< V extends Addable< V >, U extends Addable< U > >.test(), frodo2.algorithms.odpop.tests.VALUEpropagationTest< V extends Addable< V >, U extends Addable< U > >.test(), frodo2.algorithms.varOrdering.linear.tests.CentralLinearOrderingTest.test(), frodo2.daemon.TestLocalWhitePages.testLocalAgentAddressRequestUnknown(), frodo2.communication.mailer.tests.testCentralMailer.testNext(), frodo2.algorithms.adopt.test.testPreprocessing.testRandom(), frodo2.algorithms.varOrdering.dfs.tests.DFSgenerationTest.testRandom(), and frodo2.algorithms.varOrdering.election.tests.VariableElectionTest< S extends Comparable< S > &Serializable >.testRandom().

| void frodo2.communication.Queue.addIncomingMessagePolicy | ( | MessageType | type, |
| IncomingMsgPolicyInterface< MessageType > | policy ) |
Adds a listener to be notified of new incoming messages of type type.
| type | the type of messages |
| policy | incoming object policy to be used |
Reimplemented in frodo2.communication.mailer.CentralMailer.FakeQueue.
References inPolicies, inPolicies_lock, and frodo2.communication.MessageListener< T >.setQueue().

| void frodo2.communication.Queue.addOutgoingMessagePolicy | ( | Collection< MessageType > | msgTypes, |
| OutgoingMsgPolicyInterface< MessageType > | policy ) |
Adds a listener to be notified of new outgoing messages.
| msgTypes | the message types the policy should be registered for |
| policy | outgoing message policy to be added |
References addOutgoingMessagePolicy().

| void frodo2.communication.Queue.addOutgoingMessagePolicy | ( | MessageType | type, |
| OutgoingMsgPolicyInterface< MessageType > | policy ) |
Adds a listener to be notified of new outgoing messages of type type.
| type | the type of messages |
| policy | outgoing object policy to be used |
Reimplemented in frodo2.communication.mailer.CentralMailer.FakeQueue.
References outPolicies, outPolicies_lock, and frodo2.communication.MessageListener< T >.setQueue().

| void frodo2.communication.Queue.addOutgoingMessagePolicy | ( | OutgoingMsgPolicyInterface< MessageType > | policy | ) |
Adds a listener to be notified of new outgoing messages.
It prompts the listener for the types of messages it wants to listen to.
| policy | outgoing message policy to be added |
References addOutgoingMessagePolicy(), and frodo2.communication.MessageListener< T >.getMsgTypes().
Referenced by addOutgoingMessagePolicy(), addOutgoingMessagePolicy(), frodo2.algorithms.dpop.privacy.test.SecureRerootingTest.randomTest(), and frodo2.algorithms.dpop.privacy.test.VariableObfuscationTest< V extends Addable< V > >.randomTest().

| void frodo2.communication.Queue.addOutputPipe | ( | Object | recipient, |
| QueueOutputPipeInterface | output ) |
Adds an output pipe to this queue.
| recipient | ID of the recipient |
| output | output pipe corresponding to the recipient |
Reimplemented in frodo2.communication.mailer.CentralMailer.FakeQueue.
References frodo2.output, output_lock, and outputs.
Referenced by addOutputQueue(), frodo2.algorithms.test.AllTests.createQueueNetwork(), frodo2.algorithms.SingleQueueAgent< Val extends Addable< Val > >.setup(), frodo2.daemon.TestLocalWhitePages.testLocalAgentAddressRequestKnown(), frodo2.daemon.TestLocalWhitePages.testLocalAgentAddressRequestUnknown(), and frodo2.daemon.TestLocalWhitePages.testLocalAgentReporting().
| QueueIOPipe frodo2.communication.Queue.addOutputQueue | ( | Object | recipient, |
| Queue | queue ) |
Adds a new output pipe to the provided queue.
| recipient | ID of the recipient |
| queue | recipient |
References addOutputPipe(), and Queue().

| void frodo2.communication.Queue.addToInbox | ( | MessageWrapper | msg | ) |
Adds the input message to this queue's inbox.
| msg | the message |
Reimplemented in frodo2.communication.mailer.CentralMailer.FakeQueue.
References inbox.
Referenced by sendMessageToSelf().
| void frodo2.communication.Queue.cleanQueue | ( | ) |
Removes all messages from the inbox.
Reimplemented in frodo2.communication.mailer.CentralMailer.FakeQueue.
References inbox.
| void frodo2.communication.Queue.deleteIncomingMessagePolicy | ( | IncomingMsgPolicyInterface< MessageType > | policy | ) |
Completely removes the input policy from all lists of listeners.
| policy | the policy to be removed |
References inPolicies, and inPolicies_lock.
| void frodo2.communication.Queue.deleteOutgoingMessagePolicy | ( | OutgoingMsgPolicyInterface< MessageType > | policy | ) |
Completely removes the outgoing message policy from all lists of listeners.
| policy | the policy to be removed |
References outPolicies, and outPolicies_lock.
| void frodo2.communication.Queue.deleteStatsReporters | ( | ) |
Delete all StatsReporters.
References inPolicies.
Referenced by frodo2.controller.ConfigurationManager.cleanProblem().
| void frodo2.communication.Queue.end | ( | ) |
Kills the queue, making it unusable.
Reimplemented in frodo2.communication.mailer.CentralMailer.FakeQueue.
References input_lock, inputs, keepGoing, monitor, myThread, and output_lock.
Referenced by frodo2.algorithms.dpop.privacy.test.VariableObfuscationTest< V extends Addable< V > >.randomTest(), frodo2.algorithms.dpop.privacy.test.SecureCircularRoutingTest.tearDown(), frodo2.algorithms.asodpop.tests.ASODPOPBinaryTest< V extends Addable< V >, U extends Addable< U > >.test(), frodo2.algorithms.asodpop.tests.ASODPOPTest< V extends Addable< V >, U extends Addable< U > >.test(), frodo2.algorithms.dpop.stochastic.test.LowestCommonAncestorsTest.test(), frodo2.algorithms.varOrdering.linear.tests.CentralLinearOrderingTest.test(), frodo2.daemon.TestLocalWhitePages.testLocalAgentAddressRequestKnown(), frodo2.daemon.TestLocalWhitePages.testLocalAgentAddressRequestUnknown(), frodo2.daemon.TestLocalWhitePages.testLocalAgentReporting(), frodo2.algorithms.adopt.test.testPreprocessing.testRandom(), and frodo2.algorithms.varOrdering.dfs.tests.DFSgenerationTest.testRandom().
| MessageWrapper frodo2.communication.Queue.getCurrentMessageWrapper | ( | ) |
| long frodo2.communication.Queue.getCurrentTime | ( | ) |
Reimplemented in frodo2.communication.mailer.CentralMailer.FakeQueue.
Referenced by frodo2.algorithms.afb.AFB< V extends Addable< V >, U extends Addable< U > >.assign_CPA(), and frodo2.algorithms.synchbb.SynchBB< V extends Addable< V >, U extends Addable< U > >.send_token().
| int frodo2.communication.Queue.getInboxSize | ( | ) |
Reimplemented in frodo2.communication.mailer.CentralMailer.FakeQueue.
| HashMap< MessageType, Long > frodo2.communication.Queue.getMaxMsgSizes | ( | ) |
References maxMsgSizes.
| HashMap< MessageType, Integer > frodo2.communication.Queue.getMsgNbrs | ( | ) |
References msgNbrs.
| HashMap< Object, Integer > frodo2.communication.Queue.getMsgNbrsSent | ( | ) |
References msgNbrsSent.
| HashMap< MessageType, Long > frodo2.communication.Queue.getMsgSizes | ( | ) |
References msgSizes.
| HashMap< Object, Long > frodo2.communication.Queue.getMsgSizesSent | ( | ) |
References msgSizesSent.
| QueueOutputPipeInterface frodo2.communication.Queue.getOutputPipe | ( | Object | recipient | ) |
Returns the output pipe corresponding to the given recipient.
| recipient | the recipient |
null if none References output_lock, and outputs.
Referenced by frodo2.algorithms.SingleQueueAgent< Val extends Addable< Val > >.connect(), and frodo2.algorithms.test.AllTests.createQueueNetwork().
|
private |
Helper function called by the constructors to avoid code redundancy.
Reimplemented in frodo2.algorithms.varOrdering.election.VariableElection< S extends Comparable< S > &Serializable >.
References inbox, inPolicies, inputs, myThread, outPolicies, outputs, and frodo2.communication.MessageType.ROOT.
Referenced by Queue().
|
static |
|
protected |
Notifies the incoming message listeners of a message.
| msg | the message |
| toAgent | ID of the destination agent |
Reimplemented in frodo2.algorithms.varOrdering.dfs.DFSgenerationParallel< S extends Comparable< S > &Serializable >.FakeQueue, and frodo2.communication.mailer.CentralMailer.FakeQueue.
References frodo2.communication.MessageType.getParent(), frodo2.communication.Message.getType(), inPolicies, and inPolicies_lock.
Referenced by run().

|
protected |
Notifies the outgoing message listeners of a message.
| fromAgent | the sender agent |
| msg | the message |
| toAgents | the destination agents |
true if the message should be discarded Reimplemented in frodo2.communication.mailer.CentralMailer.FakeQueue.
References frodo2.communication.OutgoingMsgPolicyInterface< T >.Decision.DISCARD, frodo2.communication.MessageType.getParent(), frodo2.communication.Message.getType(), and frodo2.java.
Referenced by sendMessage(), sendMessageToMulti(), and sendMessageToSelf().

|
protected |
Records statistics about the input message.
| to | recipient |
| msg | message |
Reimplemented in frodo2.communication.mailer.CentralMailer.FakeQueue.
References frodo2.controller.Controller.CONTROLLER, frodo2.daemon.Daemon.DAEMON, frodo2.communication.MsgSizeMonitor.getMsgSize(), frodo2.communication.Message.getType(), and frodo2.algorithms.AgentInterface< V extends Addable< V > >.STATS_MONITOR.
Referenced by sendMessage().

| void frodo2.communication.Queue.removeInputPipe | ( | QueueInputPipeInterface | input | ) |
Removes the given input pipe from the list of input pipes.
| input | the input pipe to be removed |
References input_lock, and inputs.
| void frodo2.communication.Queue.removeOutputPipe | ( | Object | recipient | ) |
Removes the output pipe corresponding to the given recipient.
| recipient | the recipient |
References output_lock, and outputs.
| void frodo2.communication.Queue.resetMsgSizeMonitor | ( | ) |
Closes the MsgSizeMonitor and creates a new one.
Makes the queue forget all previously sent data, hereby resetting the one-time serialization overheads.
References frodo2.communication.MsgSizeMonitor.close().

| void frodo2.communication.Queue.resetStats | ( | ) |
Resets the metrics statistics.
Reimplemented in frodo2.communication.mailer.CentralMailer.FakeQueue.
References msgWrap.
| void frodo2.communication.Queue.run | ( | ) |
Continuously processes all messages in the inbox.
References frodo2.solutionSpaces.ProblemInterface< V extends Addable< V >, U extends Addable< U > >.getAgent(), frodo2.communication.MessageWrapper.getNCCCs(), keepGoing, msgWrap, notifyInListeners(), and updateNCCCs().

| void frodo2.communication.Queue.sendMessage | ( | Object | to, |
| Message | msg ) |
Sends a message to a specified recipient.
| to | recipient of the message |
| msg | message to be sent |
Reimplemented in frodo2.algorithms.varOrdering.dfs.DFSgenerationParallel< S extends Comparable< S > &Serializable >.FakeQueue, frodo2.algorithms.varOrdering.dfs.DFSgenerationParallel< S extends Comparable< S > &Serializable >.SinkQueue, and frodo2.communication.mailer.CentralMailer.FakeQueue.
References frodo2.solutionSpaces.ProblemInterface< V extends Addable< V >, U extends Addable< U > >.getAgent(), frodo2.solutionSpaces.ProblemInterface< V extends Addable< V >, U extends Addable< U > >.getNCCCs(), msgWrap, notifyOutListeners(), and sendMessage().
Referenced by frodo2.algorithms.afb.AFB< V extends Addable< V >, U extends Addable< U > >.assign_CPA(), frodo2.algorithms.afb.AFB< V extends Addable< V >, U extends Addable< U > >.backtrack(), frodo2.algorithms.dpop.count.CountSolutionsVALUE< Val extends Addable< Val >, U extends Addable< U > >.computeOptValAndSendVALUEmsgs(), frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.init(), frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.nextMultiplication(), frodo2.algorithms.dpop.memory.LabelingPhase< V extends Addable< V > >.notifyIn(), frodo2.algorithms.maxsum.MaxSum< V extends Addable< V >, U extends Addable< U > >.notifyIn(), frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.notifyIn(), frodo2.algorithms.varOrdering.linear.LinearOrdering< V extends Addable< V >, U extends Addable< U > >.notifyIn(), frodo2.algorithms.afb.AFB< V extends Addable< V >, U extends Addable< U > >.processFbCpa(), frodo2.algorithms.SingleQueueAgent< Val extends Addable< Val > >.report(), frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.revealSol(), frodo2.algorithms.synchbb.SynchBB< V extends Addable< V >, U extends Addable< U > >.send_token(), frodo2.controller.ConfigurationManager.sendEmptyConfigs(), sendMessage(), sendMessage(), sendMessageToMulti(), frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.share(), frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.share0(), frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.shareVector(), frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.shareVectorOfZeros(), frodo2.algorithms.maxsum.MaxSum< V extends Addable< V >, U extends Addable< U > >.start(), frodo2.algorithms.afb.AFB< V extends Addable< V >, U extends Addable< U > >.terminate(), frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.terminate(), and frodo2.algorithms.synchbb.SynchBB< V extends Addable< V >, U extends Addable< U > >.terminate().

| void frodo2.communication.Queue.sendMessage | ( | Object | to, |
| MessageWrapper | msgWrap ) |
Send a message that has already been wrapped.
| to | The destination of the message |
| msgWrap | The wrapped message |
Reimplemented in frodo2.algorithms.varOrdering.dfs.DFSgenerationParallel< S extends Comparable< S > &Serializable >.FakeQueue, and frodo2.communication.mailer.CentralMailer.FakeQueue.
References msgWrap, output_lock, outputs, frodo2.communication.QueueOutputPipeInterface.pushMessage(), recordStats(), and sendMessage().

|
package |
Sends a message to all specified recipients.
| <T> | the type used for recipient IDs |
| recipients | the recipients |
| msg | the message to be sent |
Reimplemented in frodo2.algorithms.varOrdering.dfs.DFSgenerationParallel< S extends Comparable< S > &Serializable >.FakeQueue, and frodo2.communication.mailer.CentralMailer.FakeQueue.
References frodo2.solutionSpaces.ProblemInterface< V extends Addable< V >, U extends Addable< U > >.getAgent(), frodo2.solutionSpaces.ProblemInterface< V extends Addable< V >, U extends Addable< U > >.getNCCCs(), msgWrap, notifyOutListeners(), and sendMessage().
Referenced by frodo2.algorithms.afb.AFB< V extends Addable< V >, U extends Addable< U > >.assign_CPA(), frodo2.algorithms.varOrdering.linear.LinearOrdering< V extends Addable< V >, U extends Addable< U > >.notifyIn(), frodo2.algorithms.synchbb.SynchBB< V extends Addable< V >, U extends Addable< U > >.send_token(), frodo2.algorithms.afb.AFB< V extends Addable< V >, U extends Addable< U > >.terminate(), and frodo2.algorithms.synchbb.SynchBB< V extends Addable< V >, U extends Addable< U > >.terminate().

| void frodo2.communication.Queue.sendMessageToSelf | ( | Message | msg | ) |
Sends a message to itself.
| msg | message to be sent |
Reimplemented in frodo2.algorithms.varOrdering.dfs.DFSgenerationParallel< S extends Comparable< S > &Serializable >.FakeQueue, frodo2.algorithms.varOrdering.election.VariableElection< S extends Comparable< S > &Serializable >, and frodo2.communication.mailer.CentralMailer.FakeQueue.
References addToInbox(), frodo2.solutionSpaces.ProblemInterface< V extends Addable< V >, U extends Addable< U > >.getAgent(), frodo2.solutionSpaces.ProblemInterface< V extends Addable< V >, U extends Addable< U > >.getNCCCs(), msgWrap, and notifyOutListeners().
Referenced by frodo2.algorithms.dpop.privacy.EncryptedUTIL< V extends Addable< V >, U extends Addable< U >, E extends AddableLimited< U, E >.askDecrypt(), frodo2.algorithms.maxsum.MaxSum< V extends Addable< V >, U extends Addable< U > >.checkForTermination(), frodo2.algorithms.dpop.count.CountSolutionsVALUE< Val extends Addable< Val >, U extends Addable< U > >.computeOptValAndSendVALUEmsgs(), frodo2.algorithms.dpop.VALUEpropagation< Val extends Addable< Val > >.computeOptValAndSendVALUEmsgs(), frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.init(), frodo2.algorithms.localSearch.mgm.mgm2.MGM2< V extends Addable< V >, U extends Addable< U > >.init(), frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.init(), frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.init(), frodo2.algorithms.varOrdering.dfs.DFSgenerationParallel< S extends Comparable< S > &Serializable >.init(), frodo2.algorithms.varOrdering.linear.CentralLinearOrdering< V extends Addable< V >, U extends Addable< U > >.init(), frodo2.daemon.userIO.UserIO.load(), frodo2.algorithms.dpop.memory.LabelingPhase< V extends Addable< V > >.notifyIn(), frodo2.algorithms.maxsum.MaxSum< V extends Addable< V >, U extends Addable< U > >.notifyIn(), frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.notifyIn(), frodo2.algorithms.reformulation.ProblemRescaler< U extends Addable< U > >.notifyIn(), frodo2.algorithms.varOrdering.factorgraph.FactorGraphGen< V extends Addable< V >, U extends Addable< U > >.notifyIn(), frodo2.algorithms.varOrdering.linear.LinearOrdering< V extends Addable< V >, U extends Addable< U > >.notifyIn(), frodo2.algorithms.dpop.privacy.SecureRerooting< C extends Addable< C >, E extends AddableLimited< C, E >.passOn(), frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.processPending(), frodo2.algorithms.dpop.privacy.test.SecureRerootingTest.randomTest(), frodo2.algorithms.dpop.privacy.EncryptedUTIL< V extends Addable< V >, U extends Addable< U >, E extends AddableLimited< U, E >.sendOutput(), frodo2.algorithms.adopt.test.testADOPT.startADOPT(), frodo2.algorithms.duct.tests.NormalizeInfTest.startNormalization(), frodo2.algorithms.duct.tests.NormalizeTest.startNormalization(), frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.startUTIL(), frodo2.algorithms.asodpop.tests.ASODPOPBinaryTest< V extends Addable< V >, U extends Addable< U > >.startUTILpropagation(), frodo2.algorithms.asodpop.tests.ASODPOPTest< V extends Addable< V >, U extends Addable< U > >.startUTILpropagation(), frodo2.algorithms.odpop.tests.UTILpropagationTest< V extends Addable< V >, U extends Addable< U > >.startUTILpropagation(), frodo2.algorithms.odpop.tests.VALUEpropagationTest< V extends Addable< V >, U extends Addable< U > >.startUTILpropagation(), frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.terminate(), frodo2.algorithms.dpop.stochastic.test.LowestCommonAncestorsTest.test(), and frodo2.algorithms.adopt.test.testPreprocessing.testRandom().

| void frodo2.communication.Queue.setProblem | ( | ProblemInterface<?, ?> | problem | ) |
Sets the problem that is queried for NCCCs.
| problem | the problem |
References problem.
Referenced by frodo2.algorithms.varOrdering.election.tests.SecureVarElectionTest.initiateParamAndListener(), frodo2.algorithms.varOrdering.election.tests.VariableElectionTest< S extends Comparable< S > &Serializable >.initiateParamAndListener(), frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.Listener.Listener(), frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.Listener.Listener(), frodo2.algorithms.dpop.privacy.test.SecureRerootingTest.randomTest(), frodo2.algorithms.dpop.privacy.test.VariableObfuscationTest< V extends Addable< V > >.randomTest(), frodo2.algorithms.dpop.stochastic.test.SamplingPhaseTest.setModules(), frodo2.algorithms.dpop.privacy.test.SecureCircularRoutingTest.setUp(), frodo2.algorithms.adopt.test.testADOPT.test(), frodo2.algorithms.asodpop.tests.ASODPOPBinaryTest< V extends Addable< V >, U extends Addable< U > >.test(), frodo2.algorithms.asodpop.tests.ASODPOPTest< V extends Addable< V >, U extends Addable< U > >.test(), frodo2.algorithms.duct.tests.NormalizeInfTest.test(), frodo2.algorithms.duct.tests.NormalizeTest.test(), frodo2.algorithms.odpop.tests.UTILpropagationTest< V extends Addable< V >, U extends Addable< U > >.test(), frodo2.algorithms.odpop.tests.VALUEpropagationTest< V extends Addable< V >, U extends Addable< U > >.test(), frodo2.algorithms.varOrdering.linear.tests.CentralLinearOrderingTest.test(), frodo2.algorithms.adopt.test.testPreprocessing.testRandom(), frodo2.algorithms.varOrdering.dfs.tests.DFSgenerationTest.testRandom(), and frodo2.algorithms.varOrdering.election.tests.VariableElectionTest< S extends Comparable< S > &Serializable >.testRandom().
| void frodo2.communication.Queue.toBeClosedUponKill | ( | QueueInputPipeInterface | input | ) |
Reminds the queue to close the given pipe when it is killed.
| input | pipe to be closed |
References input_lock, and inputs.
|
private |
Creates a fragment of DOT representation for this queue and its pipes.
| out | StringBuilder |
| ID | ID to be used to represent this queue |
References inputs, frodo2.output, and outputs.
Referenced by networkToDOT().
| void frodo2.communication.Queue.updateNCCCs | ( | long | msgNCCCs | ) |
Updates the queue's NCCC counter to the input count if the input is greater.
| msgNCCCs | input NCCC count |
References frodo2.solutionSpaces.ProblemInterface< V extends Addable< V >, U extends Addable< U > >.getNCCCs(), and frodo2.solutionSpaces.ProblemInterface< V extends Addable< V >, U extends Addable< U > >.setNCCCs().
Referenced by frodo2.communication.mailer.CentralMailer.run(), and run().

|
private |
The list of incoming messages waiting to be processed.
Referenced by addToInbox(), cleanQueue(), and init().
|
protected |
A list of listeners notified of incoming objects.
These listeners are called whenever there is a new incoming object, in order to decide what to do with it. There is a list of listeners for each message type.
Referenced by frodo2.communication.mailer.CentralMailer.FakeQueue.addIncomingMessagePolicy(), addIncomingMessagePolicy(), deleteIncomingMessagePolicy(), deleteStatsReporters(), frodo2.algorithms.varOrdering.dfs.DFSgenerationParallel< S extends Comparable< S > &Serializable >.FakeQueue.FakeQueue(), frodo2.communication.mailer.CentralMailer.FakeQueue.FakeQueue(), init(), frodo2.algorithms.varOrdering.dfs.DFSgenerationParallel< S extends Comparable< S > &Serializable >.FakeQueue.notifyInListeners(), frodo2.communication.mailer.CentralMailer.FakeQueue.notifyInListeners(), and notifyInListeners().
|
private |
lock for inPolicies field
Referenced by addIncomingMessagePolicy(), deleteIncomingMessagePolicy(), and notifyInListeners().
|
private |
lock for input field
Referenced by end(), removeInputPipe(), and toBeClosedUponKill().
|
protected |
List of input pipes.
Referenced by frodo2.communication.mailer.CentralMailer.FakeQueue.end(), end(), frodo2.communication.mailer.CentralMailer.FakeQueue.FakeQueue(), init(), removeInputPipe(), toBeClosedUponKill(), and toDOT().
|
private |
|
protected |
For each message type, the size (in bytes) of the largest message of that type.
Referenced by getMaxMsgSizes().
|
protected |
Whether to measure the number of messages and the total amount of information sent.
Referenced by frodo2.communication.mailer.CentralMailer.FakeQueue.end(), Queue(), and Queue().
|
protected |
A monitor used to measure the sizes of the messages.
Referenced by frodo2.communication.mailer.CentralMailer.FakeQueue.end(), and end().
|
protected |
For each message type, the number of messages sent of that type.
Referenced by getMsgNbrs().
|
private |
The number of messages sent to each other agent.
Referenced by getMsgNbrsSent().
|
protected |
For each message type, the total amount of information sent in messages of that type, in bytes.
Referenced by getMsgSizes().
|
private |
The amount of information sent to each other agent, in bytes.
Referenced by getMsgSizesSent().
|
protected |
The last wrapped message to have been received.
Referenced by resetStats(), run(), frodo2.algorithms.varOrdering.dfs.DFSgenerationParallel< S extends Comparable< S > &Serializable >.FakeQueue.sendMessage(), frodo2.communication.mailer.CentralMailer.FakeQueue.sendMessage(), frodo2.communication.mailer.CentralMailer.FakeQueue.sendMessage(), sendMessage(), sendMessage(), frodo2.communication.mailer.CentralMailer.FakeQueue.sendMessageToMulti(), sendMessageToMulti(), and sendMessageToSelf().
|
private |
|
protected |
A list of listeners notified of outgoing messages.
These listeners are called whenever there is a new outgoing message, in order to decide what to do with it. There is a list of listeners for each message type.
Referenced by frodo2.communication.mailer.CentralMailer.FakeQueue.addOutgoingMessagePolicy(), addOutgoingMessagePolicy(), deleteOutgoingMessagePolicy(), frodo2.algorithms.varOrdering.dfs.DFSgenerationParallel< S extends Comparable< S > &Serializable >.FakeQueue.FakeQueue(), frodo2.communication.mailer.CentralMailer.FakeQueue.FakeQueue(), init(), and frodo2.communication.mailer.CentralMailer.FakeQueue.notifyOutListeners().
|
private |
Lock for outPolicies field.
Referenced by addOutgoingMessagePolicy(), and deleteOutgoingMessagePolicy().
|
private |
lock for output field
Referenced by addOutputPipe(), end(), getOutputPipe(), removeOutputPipe(), and sendMessage().
|
protected |
Map associating an output pipe to each destination ID.
Referenced by addOutputPipe(), frodo2.communication.mailer.CentralMailer.FakeQueue.FakeQueue(), getOutputPipe(), init(), removeOutputPipe(), sendMessage(), and toDOT().
|
protected |
The problem used to obtain the current NCCC count.
Referenced by frodo2.communication.mailer.CentralMailer.FakeQueue.sendMessage(), frodo2.communication.mailer.CentralMailer.FakeQueue.sendMessageToMulti(), and setProblem().