|
FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
|
An agent that uses a single queue. More...

Public Member Functions | |
| SingleQueueAgent (ProblemInterface< Val, ?> probDesc, Document agentDesc, CentralMailer mailman) throws JDOMException, ClassNotFoundException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException | |
| Constructor. | |
| void | addOutputPipe (String agent, QueueOutputPipeInterface outputPipe) |
| void | connect () |
| String | getID () |
| void | kill () |
| void | start () |
| Does nothing. | |
| void | setup (QueueOutputPipeInterface toDaemonPipe, QueueOutputPipeInterface toControllerPipe, boolean statsToController, int port) |
| void | report () |
| Collection< MessageType > | getMsgTypes () |
| void | notifyIn (Message msg) |
| void | setQueue (Queue queue) |
| Does nothing. | |
| Map< String, Val > | getCurrentSolution () |
| Public Member Functions inherited from frodo2.algorithms.AgentInterface< Val > | |
| void | report () |
| Tells the agent to report to the local white pages. | |
| void | connect () |
| Tells the agent to start requesting connections to other agents from the white pages. | |
| void | start () |
| Starts the algorithm. | |
| void | kill () |
| Stops the algorithm. | |
| String | getID () |
| Map< String, V > | getCurrentSolution () |
| Returns the solution found by the algorithm upon termination. | |
| void | addOutputPipe (String agent, QueueOutputPipeInterface outputPipe) |
| Adds an output pipe to the agent. | |
| void | setup (QueueOutputPipeInterface toDaemonPipe, QueueOutputPipeInterface toControllerPipe, boolean statsToController, int port) |
| Sets up the agent to communicate with a daemon, a controller, and its neighbors. | |
| 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 Member Functions | |
| static void | setMsgType (Class< ? extends MessageListener< MessageType > > moduleClass, String msgType, MessageType newType) throws NoSuchFieldException |
| Changes the type of a message in a module. | |
Protected Member Functions | |
| void | oneMoreNeighbor () |
| Increments the number of neighbors connected, and notifies the controller when they are all connected. | |
| void | finished () |
| Sends a message to the controller saying that the agent has finished. | |
Protected Attributes | |
| String | agentID |
| The agent's ID. | |
| final Queue | queue |
| The agent's queue. | |
| Set< String > | neighbours |
| This agent's neighbor IDs. | |
| QueueIOPipe | localInputPipe |
| Pipe used to send messages to this agent. | |
Private Attributes | |
| Collection< MessageType > | msgTypes = new ArrayList<MessageType> () |
| The message types this agent listens to. | |
| int | neighboursConnected |
| The number of neighbours connected to the agent. | |
| int | port |
| The incoming port number. | |
| final boolean | measureMsgs |
| Whether to measure the number of messages and the total amount of information sent. | |
| ProblemInterface< Val, ?> | problem |
| The problem to solve. | |
| StatsReporterWithConvergence< Val > | solutionMonitor |
| The module that monitors on the values of the variables this agent owns. | |
Static Private Attributes | |
| static QueueOutputPipeInterface | blackHole |
| Output pipe that ignores anything sent to it. | |
Additional Inherited Members | |
| Static Public Attributes inherited from frodo2.algorithms.AgentInterface< Val > | |
| static final String | STATS_MONITOR |
| Recipient ID to which statistics about algorithm execution should be sent. | |
| static final MessageType | AGENT_CONNECTED |
| Message to be sent if an agent has a connection with all its neighbours. | |
| static final MessageType | AGENT_FINISHED |
| The message sent when an agent has terminated. | |
| static final MessageType | ALL_AGENTS_IDLE |
| The message sent when it has been detected that all agents are waiting for messages, but there are no more messages on the way. | |
| static final MessageType | LOCAL_AGENT_ADDRESS_REQUEST |
| The message an agent uses to ask the white pages for an address. | |
| static final MessageType | LOCAL_AGENT_REPORTING |
| an agent reports to its local white pages | |
| static final MessageType | START_AGENT |
| Message used to tell an agent to start its algorithm. | |
| static final MessageType | STOP_AGENT |
| Message used to tell an agent to stop. | |
An agent that uses a single queue.
| <Val> | the type used for domain values |
| frodo2.algorithms.SingleQueueAgent< Val extends Addable< Val > >.SingleQueueAgent | ( | ProblemInterface< Val, ?> | probDesc, |
| Document | agentDesc, | ||
| CentralMailer | mailman ) throws JDOMException, ClassNotFoundException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException |
Constructor.
| probDesc | the description of the problem |
| agentDesc | JDOM document containing the description of the problem |
| mailman | the CentralMailer; ignored if not measuring Simulated Time |
| JDOMException | thrown if reading a description document failed |
| ClassNotFoundException | if a module class mentioned in the description is unknown |
| NoSuchMethodException | if a module class used does not contain a constructor that takes in a ProblemInterface and a JDOM Element |
| InvocationTargetException | if a module constructor throws an exception |
| IllegalAccessException | if the constructor for an IncomingMsgPolicyInterface is not accessible |
| InstantiationException | if a module class provided in the description is an abstract class |
| IllegalArgumentException | if the constructor of an IncomingMsgPolicyInterface does not take the proper arguments |
References measureMsgs, problem, and SingleQueueAgent().
Referenced by SingleQueueAgent().

| void frodo2.algorithms.SingleQueueAgent< Val extends Addable< Val > >.addOutputPipe | ( | String | agent, |
| QueueOutputPipeInterface | outputPipe ) |
| void frodo2.algorithms.SingleQueueAgent< Val extends Addable< Val > >.connect | ( | ) |
References frodo2.algorithms.AgentInterface< V extends Addable< V > >.AGENT_CONNECTED, agentID, frodo2.controller.Controller.CONTROLLER, frodo2.daemon.Daemon.DAEMON, frodo2.solutionSpaces.ProblemInterface< V extends Addable< V >, U extends Addable< U > >.getAgents(), frodo2.communication.Queue.getOutputPipe(), frodo2.algorithms.AgentInterface< V extends Addable< V > >.LOCAL_AGENT_ADDRESS_REQUEST, neighbours, oneMoreNeighbor(), and queue.
Referenced by notifyIn().

|
protected |
Sends a message to the controller saying that the agent has finished.
References frodo2.algorithms.AgentInterface< Val >.AGENT_FINISHED, queue, and frodo2.algorithms.AgentInterface< Val >.STATS_MONITOR.
Referenced by notifyIn(), and frodo2.controller.testFiles.TestAgent< V extends Addable< V > >.start().
| Map< String, Val > frodo2.algorithms.SingleQueueAgent< Val extends Addable< Val > >.getCurrentSolution | ( | ) |
References solutionMonitor.
| String frodo2.algorithms.SingleQueueAgent< Val extends Addable< Val > >.getID | ( | ) |
References agentID.
| Collection< MessageType > frodo2.algorithms.SingleQueueAgent< Val extends Addable< Val > >.getMsgTypes | ( | ) |
Implements frodo2.communication.MessageListener< T >.
References msgTypes.
| void frodo2.algorithms.SingleQueueAgent< Val extends Addable< Val > >.kill | ( | ) |
| void frodo2.algorithms.SingleQueueAgent< Val extends Addable< Val > >.notifyIn | ( | Message | msg | ) |
Implements frodo2.communication.IncomingMsgPolicyInterface< T >.
Reimplemented in frodo2.controller.testFiles.TestAgent< V extends Addable< V > >.
References frodo2.algorithms.AgentInterface< Val >.AGENT_FINISHED, connect(), frodo2.controller.WhitePages.CONNECT_AGENT, frodo2.daemon.LocalWhitePages.DIE, frodo2.communication.MessageType.equals(), finished(), frodo2.communication.Message.getType(), kill(), start(), and frodo2.algorithms.AgentInterface< V extends Addable< V > >.START_AGENT.

|
protected |
Increments the number of neighbors connected, and notifies the controller when they are all connected.
References frodo2.algorithms.AgentInterface< V extends Addable< V > >.AGENT_CONNECTED, frodo2.controller.Controller.CONTROLLER, neighbours, neighboursConnected, and queue.
Referenced by addOutputPipe(), and connect().
| void frodo2.algorithms.SingleQueueAgent< Val extends Addable< Val > >.report | ( | ) |
References agentID, frodo2.daemon.Daemon.DAEMON, localInputPipe, port, and frodo2.communication.Queue.sendMessage().
Referenced by setup().

|
static |
Changes the type of a message in a module.
| moduleClass | the class of the module |
| msgType | the message type whose value is to be changed |
| newType | new value for the message type |
| NoSuchFieldException | if msgType is not a field of module |
Referenced by frodo2.algorithms.varOrdering.dfs.DFSgenerationParallel< S extends Comparable< S > &Serializable >.DFSgenerationParallel(), frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.overrideMsgTypes(), and frodo2.algorithms.afb.test.AFBagentTest< V extends Addable< V >, U extends Addable< U > >.setUp().
| void frodo2.algorithms.SingleQueueAgent< Val extends Addable< Val > >.setQueue | ( | Queue | queue | ) |
| void frodo2.algorithms.SingleQueueAgent< Val extends Addable< Val > >.setup | ( | QueueOutputPipeInterface | toDaemonPipe, |
| QueueOutputPipeInterface | toControllerPipe, | ||
| boolean | statsToController, | ||
| int | port ) |
References frodo2.communication.Queue.addOutputPipe(), frodo2.controller.Controller.CONTROLLER, frodo2.daemon.Daemon.DAEMON, frodo2.communication.PipeFactory.getSelfAddress(), frodo2.communication.PipeFactory.inputPipe(), frodo2.controller.Controller.PipeFactoryInstance, port, queue, report(), and frodo2.algorithms.AgentInterface< V extends Addable< V > >.STATS_MONITOR.

| void frodo2.algorithms.SingleQueueAgent< Val extends Addable< Val > >.start | ( | ) |
Does nothing.
Reimplemented in frodo2.controller.testFiles.TestAgent< V extends Addable< V > >.
Referenced by notifyIn().
|
protected |
The agent's ID.
Referenced by connect(), getID(), report(), and frodo2.controller.testFiles.TestAgent< V extends Addable< V > >.start().
|
staticprivate |
Output pipe that ignores anything sent to it.
|
protected |
Pipe used to send messages to this agent.
Referenced by report().
|
private |
Whether to measure the number of messages and the total amount of information sent.
Referenced by SingleQueueAgent().
|
private |
The message types this agent listens to.
Referenced by getMsgTypes().
|
protected |
This agent's neighbor IDs.
Referenced by connect(), oneMoreNeighbor(), and frodo2.controller.testFiles.TestAgent< V extends Addable< V > >.start().
|
private |
The number of neighbours connected to the agent.
Referenced by oneMoreNeighbor().
|
private |
|
private |
The problem to solve.
Referenced by SingleQueueAgent().
|
protected |
|
private |
The module that monitors on the values of the variables this agent owns.
Referenced by getCurrentSolution().