FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
Loading...
Searching...
No Matches
frodo2.daemon.TestLocalWhitePages.SimpleAgent Class Reference

A simple agent for testing purposes. More...

Inheritance diagram for frodo2.daemon.TestLocalWhitePages.SimpleAgent:

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< MessageTypegetMsgTypes ()
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, AddableIntegergetCurrentSolution ()
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< MessageTypemsgTypes = 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.

Detailed Description

A simple agent for testing purposes.

Constructor & Destructor Documentation

◆ SimpleAgent()

frodo2.daemon.TestLocalWhitePages.SimpleAgent.SimpleAgent ( Queue queue,
String Id,
int port )

The constructor.

Parameters
queuethe queue whose incoming messages this simple agent listens to
Idthe name of the agent
portthe port of the agent

References frodo2.daemon.LocalWhitePages.AGENT_OUTPUT_PIPE, Id, inputPipe, msgTypes, port, queue, received, and TEST.

Member Function Documentation

◆ addOutputPipe()

void frodo2.daemon.TestLocalWhitePages.SimpleAgent.addOutputPipe ( String agent,
QueueOutputPipeInterface outputPipe )

◆ agentReportGlobal()

void frodo2.daemon.TestLocalWhitePages.SimpleAgent.agentReportGlobal ( )

◆ agentReportLocal()

void frodo2.daemon.TestLocalWhitePages.SimpleAgent.agentReportLocal ( )

◆ askAddress()

void frodo2.daemon.TestLocalWhitePages.SimpleAgent.askAddress ( String agentName)

◆ connect()

void frodo2.daemon.TestLocalWhitePages.SimpleAgent.connect ( )

◆ getCurrentSolution()

Map< String, AddableInteger > frodo2.daemon.TestLocalWhitePages.SimpleAgent.getCurrentSolution ( )

◆ getID()

String frodo2.daemon.TestLocalWhitePages.SimpleAgent.getID ( )

◆ getMsgTypes()

Collection< MessageType > frodo2.daemon.TestLocalWhitePages.SimpleAgent.getMsgTypes ( )

◆ getReceived()

int frodo2.daemon.TestLocalWhitePages.SimpleAgent.getReceived ( )

◆ kill()

void frodo2.daemon.TestLocalWhitePages.SimpleAgent.kill ( )

◆ notifyIn()

void frodo2.daemon.TestLocalWhitePages.SimpleAgent.notifyIn ( Message msg)

◆ report()

void frodo2.daemon.TestLocalWhitePages.SimpleAgent.report ( )

◆ sendTestMessage()

void frodo2.daemon.TestLocalWhitePages.SimpleAgent.sendTestMessage ( String agentName)

Send a test message to agent agentName.

Parameters
agentNamename of the recipient

References queue, and TEST.

Referenced by frodo2.daemon.TestLocalWhitePages.testLocalAgentAddressRequestKnown(), and frodo2.daemon.TestLocalWhitePages.testLocalAgentAddressRequestUnknown().

◆ setQueue()

void frodo2.daemon.TestLocalWhitePages.SimpleAgent.setQueue ( Queue queue)

◆ setup()

void frodo2.daemon.TestLocalWhitePages.SimpleAgent.setup ( QueueOutputPipeInterface toDaemonPipe,
QueueOutputPipeInterface toControllerPipe,
boolean statsToController,
int port )

◆ start()

void frodo2.daemon.TestLocalWhitePages.SimpleAgent.start ( )

Member Data Documentation

◆ Id

String frodo2.daemon.TestLocalWhitePages.SimpleAgent.Id
private

◆ inputPipe

QueueIOPipe frodo2.daemon.TestLocalWhitePages.SimpleAgent.inputPipe
private

Its non-TCP input pipe.

Referenced by agentReportLocal(), and SimpleAgent().

◆ msgTypes

ArrayList<MessageType> frodo2.daemon.TestLocalWhitePages.SimpleAgent.msgTypes = new ArrayList <MessageType> ()
private

The list of messages types this listener wants to be notified of.

Referenced by getMsgTypes(), and SimpleAgent().

◆ port

int frodo2.daemon.TestLocalWhitePages.SimpleAgent.port
private

The agent's port number.

Referenced by agentReportGlobal(), agentReportLocal(), setup(), and SimpleAgent().

◆ queue

Queue frodo2.daemon.TestLocalWhitePages.SimpleAgent.queue
private

◆ received

int frodo2.daemon.TestLocalWhitePages.SimpleAgent.received
private

A counter to count the number of received messages.

Referenced by getReceived(), notifyIn(), and SimpleAgent().

◆ TEST

final MessageType frodo2.daemon.TestLocalWhitePages.SimpleAgent.TEST = new MessageType ("test")
static

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