FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
Loading...
Searching...
No Matches
frodo2.controller.testFiles.TestAgent< V extends Addable< V > > Class Template Reference

Does the following: More...

Inheritance diagram for frodo2.controller.testFiles.TestAgent< V extends Addable< V > >:

Public Member Functions

 TestAgent (ProblemInterface< V, ?> probDesc, Document agentDesc, CentralMailer mailman) throws Exception
 Constructor.
void start ()
void notifyIn (Message msg)
Public Member Functions inherited from frodo2.algorithms.SingleQueueAgent< Val extends Addable< Val > >
 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 setup (QueueOutputPipeInterface toDaemonPipe, QueueOutputPipeInterface toControllerPipe, boolean statsToController, int port)
void report ()
Collection< MessageTypegetMsgTypes ()
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 Attributes

static final MessageType TEST_MESSAGE = MessageType.SYSTEM.newChild("TestAgent", "Can you hear me?")
 A test message the agent send to a neighbour to test the connection.
static final MessageType RESPONSE = MessageType.SYSTEM.newChild("TestAgent", "I received your message!")
 The response to TEST_MESSAGE.
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.

Private Attributes

int neighboursResponded
 The number of neighbours that have responded.

Additional Inherited Members

Static Public Member Functions inherited from frodo2.algorithms.SingleQueueAgent< Val extends Addable< Val > >
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 inherited from frodo2.algorithms.SingleQueueAgent< Val extends Addable< Val > >
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 inherited from frodo2.algorithms.SingleQueueAgent< Val extends Addable< Val > >
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.

Detailed Description

Does the following:

  • connects to its neighbours
  • sends a test message to its neighbours when prompted by the start method
  • sends a "finished" message to the controller when all its neighbours have responded to the test message
    Author
    Brammert Ottens
    Thomas Leaute
    Parameters
    <V>type used for domain elements

Constructor & Destructor Documentation

◆ TestAgent()

frodo2.controller.testFiles.TestAgent< V extends Addable< V > >.TestAgent ( ProblemInterface< V, ?> probDesc,
Document agentDesc,
CentralMailer mailman ) throws Exception

Constructor.

Parameters
probDescthe description of the problem
agentDescJDOM document containing the description of the problem
mailmanpointer to the central mailer (not used)
Exceptions
Exceptionif an error occurs

References frodo2.algorithms.SingleQueueAgent< Val extends Addable< Val > >.queue, RESPONSE, and TEST_MESSAGE.

Member Function Documentation

◆ notifyIn()

void frodo2.controller.testFiles.TestAgent< V extends Addable< V > >.notifyIn ( Message msg)
See also
SingleQueueAgent.notifyIn(Message)

Reimplemented from frodo2.algorithms.SingleQueueAgent< Val extends Addable< Val > >.

References notifyIn(), and RESPONSE.

Referenced by notifyIn().

Here is the call graph for this function:

◆ start()

Member Data Documentation

◆ neighboursResponded

int frodo2.controller.testFiles.TestAgent< V extends Addable< V > >.neighboursResponded
private

The number of neighbours that have responded.

◆ RESPONSE

final MessageType frodo2.controller.testFiles.TestAgent< V extends Addable< V > >.RESPONSE = MessageType.SYSTEM.newChild("TestAgent", "I received your message!")
static

The response to TEST_MESSAGE.

Referenced by notifyIn(), and TestAgent().

◆ TEST_MESSAGE

final MessageType frodo2.controller.testFiles.TestAgent< V extends Addable< V > >.TEST_MESSAGE = MessageType.SYSTEM.newChild("TestAgent", "Can you hear me?")
static

A test message the agent send to a neighbour to test the connection.

Referenced by start(), and TestAgent().


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