|
FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
|
A simple agent for testing purposes. More...

Public Member Functions | |
| SimpleAgent (Queue queue, String Id, int port) | |
| The constructor. | |
| void | agentReportGlobal () |
| Reports the agent to the global white pages. | |
| void | agentReportLocal () |
| Reports the agent to the local white pages. | |
| Collection< MessageType > | getMsgTypes () |
| void | notifyIn (Message msg) |
| void | askAddress (String agentName) |
| Ask the address of agent agentName. | |
| void | sendTestMessage (String agentName) |
| Send a test message to agent agentName. | |
| void | setQueue (Queue queue) |
| Does nothing. | |
| int | getReceived () |
| void | report () |
| Does nothing. | |
| void | connect () |
| Does nothing. | |
| void | kill () |
| Does nothing. | |
| void | start () |
| Does nothing. | |
| String | getID () |
| void | addOutputPipe (String agent, QueueOutputPipeInterface outputPipe) |
| void | setup (QueueOutputPipeInterface toDaemonPipe, QueueOutputPipeInterface toControllerPipe, boolean statsToController, int port) |
| Does nothing. | |
| Map< String, AddableInteger > | getCurrentSolution () |
| 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 Attributes | |
| static final MessageType | TEST = new MessageType ("test") |
| A message used to test the Pipes. | |
| Static Public Attributes inherited from frodo2.algorithms.AgentInterface< V extends Addable< V > > | |
| static final String | STATS_MONITOR = "Statistics Monitor" |
| Recipient ID to which statistics about algorithm execution should be sent. | |
| static final MessageType | AGENT_CONNECTED = MessageType.SYSTEM.newChild("AgentInterface", "Agent-Connected") |
| Message to be sent if an agent has a connection with all its neighbours. | |
| static final MessageType | AGENT_FINISHED = MessageType.SYSTEM.newChild("AgentInterface", "Agent-Ready") |
| The message sent when an agent has terminated. | |
| static final MessageType | ALL_AGENTS_IDLE = MessageType.SYSTEM.newChild("AgentInterface", "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 = MessageType.SYSTEM.newChild("AgentInterface", "local-address-request") |
| The message an agent uses to ask the white pages for an address. | |
| static final MessageType | LOCAL_AGENT_REPORTING = MessageType.SYSTEM.newChild("AgentInterface", "local-agent-reporting") |
| an agent reports to its local white pages | |
| static final MessageType | START_AGENT = MessageType.SYSTEM.newChild("AgentInterface", "Start-Agent") |
| Message used to tell an agent to start its algorithm. | |
| static final MessageType | STOP_AGENT = MessageType.SYSTEM.newChild("AgentInterface", "Stop-Agent") |
| Message used to tell an agent to stop. | |
Private Attributes | |
| ArrayList< MessageType > | msgTypes = new ArrayList <MessageType> () |
| The list of messages types this listener wants to be notified of. | |
| Queue | queue |
| The queue. | |
| QueueIOPipe | inputPipe |
| Its non-TCP input pipe. | |
| int | received |
| A counter to count the number of received messages. | |
| String | Id |
| The agents ID. | |
| int | port |
| The agent's port number. | |
A simple agent for testing purposes.
| frodo2.daemon.TestLocalWhitePages.SimpleAgent.SimpleAgent | ( | Queue | queue, |
| String | Id, | ||
| int | port ) |
| void frodo2.daemon.TestLocalWhitePages.SimpleAgent.addOutputPipe | ( | String | agent, |
| QueueOutputPipeInterface | outputPipe ) |
Implements frodo2.algorithms.AgentInterface< V extends Addable< V > >.
References queue.
| void frodo2.daemon.TestLocalWhitePages.SimpleAgent.agentReportGlobal | ( | ) |
Reports the agent to the global white pages.
References frodo2.controller.messages.MessageAgentReporting.AGENT_REPORTING, frodo2.daemon.LocalWhitePages.CONTROLLER_ID, frodo2.communication.PipeFactory.getSelfAddress(), Id, frodo2.controller.Controller.PipeFactoryInstance, port, and queue.
Referenced by frodo2.daemon.TestLocalWhitePages.testLocalAgentAddressRequestUnknown().

| void frodo2.daemon.TestLocalWhitePages.SimpleAgent.agentReportLocal | ( | ) |
Reports the agent to the local white pages.
References Id, inputPipe, port, and queue.
Referenced by frodo2.daemon.TestLocalWhitePages.testLocalAgentAddressRequestKnown(), frodo2.daemon.TestLocalWhitePages.testLocalAgentAddressRequestUnknown(), and frodo2.daemon.TestLocalWhitePages.testLocalAgentReporting().
| void frodo2.daemon.TestLocalWhitePages.SimpleAgent.askAddress | ( | String | agentName | ) |
Ask the address of agent agentName.
| agentName | name of the agent |
References Id, frodo2.algorithms.AgentInterface< V extends Addable< V > >.LOCAL_AGENT_ADDRESS_REQUEST, and queue.
Referenced by frodo2.daemon.TestLocalWhitePages.testLocalAgentAddressRequestKnown(), and frodo2.daemon.TestLocalWhitePages.testLocalAgentAddressRequestUnknown().
| void frodo2.daemon.TestLocalWhitePages.SimpleAgent.connect | ( | ) |
Does nothing.
Implements frodo2.algorithms.AgentInterface< V extends Addable< V > >.
| Map< String, AddableInteger > frodo2.daemon.TestLocalWhitePages.SimpleAgent.getCurrentSolution | ( | ) |
Implements frodo2.algorithms.AgentInterface< V extends Addable< V > >.
| String frodo2.daemon.TestLocalWhitePages.SimpleAgent.getID | ( | ) |
Implements frodo2.algorithms.AgentInterface< V extends Addable< V > >.
References Id.
| Collection< MessageType > frodo2.daemon.TestLocalWhitePages.SimpleAgent.getMsgTypes | ( | ) |
Implements frodo2.communication.MessageListener< T >.
References msgTypes.
| int frodo2.daemon.TestLocalWhitePages.SimpleAgent.getReceived | ( | ) |
References received.
Referenced by frodo2.daemon.TestLocalWhitePages.testLocalAgentAddressRequestKnown(), frodo2.daemon.TestLocalWhitePages.testLocalAgentAddressRequestUnknown(), and frodo2.daemon.TestLocalWhitePages.testLocalAgentReporting().
| void frodo2.daemon.TestLocalWhitePages.SimpleAgent.kill | ( | ) |
Does nothing.
Implements frodo2.algorithms.AgentInterface< V extends Addable< V > >.
| void frodo2.daemon.TestLocalWhitePages.SimpleAgent.notifyIn | ( | Message | msg | ) |
Implements frodo2.communication.IncomingMsgPolicyInterface< T >.
References frodo2.communication.MessageType.equals(), frodo2.communication.Message.getType(), received, and TEST.

| void frodo2.daemon.TestLocalWhitePages.SimpleAgent.report | ( | ) |
Does nothing.
Implements frodo2.algorithms.AgentInterface< V extends Addable< V > >.
| void frodo2.daemon.TestLocalWhitePages.SimpleAgent.sendTestMessage | ( | String | agentName | ) |
Send a test message to agent agentName.
| agentName | name of the recipient |
Referenced by frodo2.daemon.TestLocalWhitePages.testLocalAgentAddressRequestKnown(), and frodo2.daemon.TestLocalWhitePages.testLocalAgentAddressRequestUnknown().
| void frodo2.daemon.TestLocalWhitePages.SimpleAgent.setQueue | ( | Queue | queue | ) |
| void frodo2.daemon.TestLocalWhitePages.SimpleAgent.setup | ( | QueueOutputPipeInterface | toDaemonPipe, |
| QueueOutputPipeInterface | toControllerPipe, | ||
| boolean | statsToController, | ||
| int | port ) |
Does nothing.
Implements frodo2.algorithms.AgentInterface< V extends Addable< V > >.
References port.
| void frodo2.daemon.TestLocalWhitePages.SimpleAgent.start | ( | ) |
Does nothing.
Implements frodo2.algorithms.AgentInterface< V extends Addable< V > >.
|
private |
The agents ID.
Referenced by agentReportGlobal(), agentReportLocal(), askAddress(), getID(), and SimpleAgent().
|
private |
Its non-TCP input pipe.
Referenced by agentReportLocal(), and SimpleAgent().
|
private |
The list of messages types this listener wants to be notified of.
Referenced by getMsgTypes(), and SimpleAgent().
|
private |
The agent's port number.
Referenced by agentReportGlobal(), agentReportLocal(), setup(), and SimpleAgent().
|
private |
The queue.
Referenced by addOutputPipe(), agentReportGlobal(), agentReportLocal(), askAddress(), sendTestMessage(), setQueue(), and SimpleAgent().
|
private |
A counter to count the number of received messages.
Referenced by getReceived(), notifyIn(), and SimpleAgent().
|
static |
A message used to test the Pipes.
Referenced by notifyIn(), sendTestMessage(), SimpleAgent(), and frodo2.daemon.TestLocalWhitePages.testLocalAgentReporting().