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

Public Member Functions

 Daemon (boolean useUI)
 The constructor.
 Daemon (boolean useUI, int port)
 The constructor.
 Daemon (boolean useUI, int port, String workDir)
 The constructor.
 Daemon (AgentAddress controllerAddress, boolean useUI)
 A constructor that tells the daemon the controller's address.
 Daemon (AgentAddress controllerAddress, boolean useUI, String workDir)
 A constructor that tells the daemon the controller's address.
 Daemon (AgentAddress controllerAddress, boolean useUI, int port)
 A constructor that tells the daemon the controller's address.
 Daemon (AgentAddress controllerAddress, boolean useUI, int port, String workDir)
 A constructor that tells the daemon the controller's address.
int getPort ()
Collection< String > getAgents ()
 get the list of agents running under this daemon
void addAgent (String ID, AgentInterface<?> agent)
 Add an agent to the list of agents.
void addOutputPipe (String fromID, String toID, QueueOutputPipeInterface pipe)
 Add agent toID's input pipe as an output pipe to agent fromID's queue.
void registerDaemon ()
 Register the daemon to the controller.
QueueIOPipe getInput ()
 Getter for the Daemons internal input pipe.
void clearAgents ()
 Delete the pointers to all agents that are running.
void exit (boolean quit)
 Exit the daemon.

Static Public Member Functions

static void main (String[] args)

Public Attributes

String daemonId
 The daemons local Id.
AgentAddress daemonAddress
 The daemon address.

Static Public Attributes

static final String DAEMON = "frodo2.daemon.Daemon"
 The id of the daemon.

Protected Attributes

Queue daemonQueue
 The daemons queue.
boolean isFinished = false
 When the controller is non-omniscient, keeps track of whether the daemon has run out of problem instances to solve.

Private Member Functions

void init (boolean useUI, String workDir)
 Initialisation.

Private Attributes

QueueIOPipe inputInternal
 The pipe for receiving internal messages.
UserIO ui
 User interface.
LocalWhitePages lwp
 Local white pages.
Constructor constructor
 the constructor
HashMap< String, AgentInterface<?> > agentList
 A list of agents.
int port
 The port number that the daemon listens on.
LocalConfigManager configMan
 The local configuration manager.

Static Private Attributes

static final int DEFAULT_PORT = 25000
 The default port the Daemon is listening to.

Detailed Description

Author
Brammert Ottens, Thomas Leaute This is the client side daemon that spawns new agents for the experiments

Constructor & Destructor Documentation

◆ Daemon() [1/7]

frodo2.daemon.Daemon.Daemon ( boolean useUI)

The constructor.

Parameters
useUIwhether or not to use the User Interface

References DEFAULT_PORT.

Referenced by Daemon(), and main().

◆ Daemon() [2/7]

frodo2.daemon.Daemon.Daemon ( boolean useUI,
int port )

The constructor.

Parameters
useUIwhether or not to use the User Interface
portthe port number the daemon listens on

References port.

◆ Daemon() [3/7]

frodo2.daemon.Daemon.Daemon ( boolean useUI,
int port,
String workDir )

The constructor.

Parameters
useUIwhether or not to use the User Interface
portthe port number the daemon listens on
workDirthe working directory

References init(), and port.

Here is the call graph for this function:

◆ Daemon() [4/7]

frodo2.daemon.Daemon.Daemon ( AgentAddress controllerAddress,
boolean useUI )

A constructor that tells the daemon the controller's address.

Parameters
controllerAddressaddress of the controller
useUIwhether or not to use the User Interface

◆ Daemon() [5/7]

frodo2.daemon.Daemon.Daemon ( AgentAddress controllerAddress,
boolean useUI,
String workDir )

A constructor that tells the daemon the controller's address.

Parameters
controllerAddressaddress of the controller
useUIwhether or not to use the User Interface
workDirthe working directory

References Daemon().

Here is the call graph for this function:

◆ Daemon() [6/7]

frodo2.daemon.Daemon.Daemon ( AgentAddress controllerAddress,
boolean useUI,
int port )

A constructor that tells the daemon the controller's address.

Parameters
controllerAddressaddress of the controller
useUIwhether or not to use the User Interface
portthe port number the daemon listens on

References port.

◆ Daemon() [7/7]

frodo2.daemon.Daemon.Daemon ( AgentAddress controllerAddress,
boolean useUI,
int port,
String workDir )

A constructor that tells the daemon the controller's address.

Parameters
controllerAddressaddress of the controller
useUIwhether or not to use the User Interface
portthe port number the daemon listens on
workDirthe working directory

References init(), port, and ui.

Here is the call graph for this function:

Member Function Documentation

◆ addAgent()

void frodo2.daemon.Daemon.addAgent ( String ID,
AgentInterface<?> agent )

Add an agent to the list of agents.

Parameters
IDID of the agent
agentthe agent itself

References agentList.

◆ addOutputPipe()

void frodo2.daemon.Daemon.addOutputPipe ( String fromID,
String toID,
QueueOutputPipeInterface pipe )

Add agent toID's input pipe as an output pipe to agent fromID's queue.

Parameters
fromIDID of the sender agent
toIDID of the recipient agent
pipethe pipe the sender should use to send messages to the recipient

References agentList.

◆ clearAgents()

void frodo2.daemon.Daemon.clearAgents ( )

Delete the pointers to all agents that are running.

Used to clear up after an experiment.

References agentList.

◆ exit()

void frodo2.daemon.Daemon.exit ( boolean quit)

Exit the daemon.

Parameters
quitwhether the JVM should be terminated
Bug
Before exiting, the Daemon should warn the Controller.

References daemonQueue, and ui.

◆ getAgents()

Collection< String > frodo2.daemon.Daemon.getAgents ( )

get the list of agents running under this daemon

Returns
a collection of agent names

References agentList.

◆ getInput()

QueueIOPipe frodo2.daemon.Daemon.getInput ( )

Getter for the Daemons internal input pipe.

Returns
QueueIOPipe

References inputInternal.

◆ getPort()

int frodo2.daemon.Daemon.getPort ( )
Returns
the port number that the daemon listens on

◆ init()

void frodo2.daemon.Daemon.init ( boolean useUI,
String workDir )
private

Initialisation.

Parameters
useUIwhether or not to use the User Interface
workDirthe working directory

References agentList, constructor, daemonAddress, daemonId, daemonQueue, frodo2.communication.PipeFactory.getSelfAddress(), inputInternal, frodo2.communication.PipeFactory.inputPipe(), lwp, frodo2.controller.Controller.PipeFactoryInstance, port, and ui.

Referenced by Daemon(), and Daemon().

Here is the call graph for this function:

◆ main()

void frodo2.daemon.Daemon.main ( String[] args)
static
Parameters
argsarguments passed to the main method
Todo
The controller's port should be parameterizable

References Daemon(), DEFAULT_PORT, and frodo2.controller.Controller.PORT.

Here is the call graph for this function:

◆ registerDaemon()

void frodo2.daemon.Daemon.registerDaemon ( )

Register the daemon to the controller.

Only to be used for testing purposes!

References frodo2.daemon.LocalWhitePages.CONTROLLER_ID, daemonAddress, daemonId, daemonQueue, and frodo2.controller.messages.MessageAgentReporting.DEAMON_REPORTING.

Member Data Documentation

◆ agentList

HashMap< String, AgentInterface<?> > frodo2.daemon.Daemon.agentList
private

A list of agents.

Referenced by addAgent(), addOutputPipe(), clearAgents(), getAgents(), and init().

◆ configMan

LocalConfigManager frodo2.daemon.Daemon.configMan
private

The local configuration manager.

◆ constructor

Constructor frodo2.daemon.Daemon.constructor
private

the constructor

Referenced by init().

◆ DAEMON

◆ daemonAddress

AgentAddress frodo2.daemon.Daemon.daemonAddress

The daemon address.

Referenced by init(), and registerDaemon().

◆ daemonId

String frodo2.daemon.Daemon.daemonId

The daemons local Id.

Referenced by init(), and registerDaemon().

◆ daemonQueue

Queue frodo2.daemon.Daemon.daemonQueue
protected

The daemons queue.

Referenced by exit(), init(), and registerDaemon().

◆ DEFAULT_PORT

final int frodo2.daemon.Daemon.DEFAULT_PORT = 25000
staticprivate

The default port the Daemon is listening to.

Referenced by Daemon(), and main().

◆ inputInternal

QueueIOPipe frodo2.daemon.Daemon.inputInternal
private

The pipe for receiving internal messages.

Referenced by getInput(), and init().

◆ isFinished

boolean frodo2.daemon.Daemon.isFinished = false
protected

When the controller is non-omniscient, keeps track of whether the daemon has run out of problem instances to solve.

Reimplemented in frodo2.controller.TestController.DaemonExtension.

◆ lwp

LocalWhitePages frodo2.daemon.Daemon.lwp
private

Local white pages.

Referenced by init().

◆ port

int frodo2.daemon.Daemon.port
private

The port number that the daemon listens on.

Referenced by Daemon(), Daemon(), Daemon(), Daemon(), and init().

◆ ui

UserIO frodo2.daemon.Daemon.ui
private

User interface.

Referenced by Daemon(), exit(), and init().


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