|
FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
|
The controller class, a container for the listeners that do the actual work. More...

Public Member Functions | |
| Controller (boolean local, boolean ui, String workDir) | |
| Constructor for the controller. | |
| Controller (DistributedSolver<?, ?, ?> solver) | |
| Constructor to use a solver in distributed mode. | |
| Controller (boolean local, boolean ui) | |
| Constructor for the controller. | |
| Controller (boolean local, boolean ui, String testDir, int size) | |
| void | addAgent (String agentId, AgentInterface<?> agent) |
| Function to add agents to the repository. | |
| void | addOutputPipe (String fromID, String toID, QueueOutputPipeInterface pipe) |
| Add agent toID's input pipe as an output pipe to agent fromID's queue. | |
| Collection< String > | getAgents () |
| void | exit (boolean quit) |
| This function must be called to stop the controller. | |
| void | setFinished () |
| This functions sets a boolean value to true when finished. | |
| void | endQueue () |
| This function is there mainly for test purposes and can be removed in the end. | |
| void | clearAgents () |
| Delete all the agents from the repository. | |
Static Public Member Functions | |
| static void | main (String[] args) |
Public Attributes | |
| boolean | isSuspended = false |
| is true when the experiment is suspended and false otherwise | |
| boolean | isStopped = true |
| Is true when the experiment has stopped and false when it is running. | |
| boolean | isFinished = false |
| Is true when the experiments are finished. | |
| Object | isFinishedSync |
| Used to synchronized access to isFinished. | |
Static Public Attributes | |
| static final String | CONTROLLER = "frodo2.controller.Controller" |
| The destination ID of messages that are meant for the Controller. | |
| static PipeFactory | PipeFactoryInstance = new TCPPipeFactory() |
| The instance of the PipeFactory Visitor. | |
| static final int | PORT = 3000 |
| The port the controller is listening to. | |
| static Integer | daemonNb = null |
| counts the number of instantiated daemon in order to launch the controller when everybody is ready. | |
Protected Attributes | |
| Queue | controlQueue |
| The queue that is used to send and receive messages. | |
Private Member Functions | |
| void | init (String workDir, DistributedSolver<?, ?, ?> solver) |
| Initializes the controller. | |
| void | initLocal (boolean ui, String workDir) |
| Initializes the controller for running the experiments itself. | |
| void | run () |
| Start the controller. | |
Private Attributes | |
| UserIO | userIO |
| userIO takes care of all the user input and output | |
| ConfigurationManager | confManager |
| the configuration manager sets up the experiments | |
| WhitePages | wp |
| The global white pages. | |
| LocalWhitePages | lwp |
| The local white pages, used when the experiments are run locally. | |
| Constructor | constructor |
| The agent constructor, used when the experiments are run locally. | |
| HashMap< String, AgentInterface<?> > | agents |
| Agent repository, used when experiments are run locally. | |
| QueueInputPipeInterface | input |
| The input pipe for external messages. | |
The controller class, a container for the listeners that do the actual work.
| frodo2.controller.Controller.Controller | ( | boolean | local, |
| boolean | ui, | ||
| String | workDir ) |
Constructor for the controller.
Experiments can either be run on the same machine the controller is running on, or on (a) separate machine(s).
| local | true if the experiments are run locally |
| ui | true if the user interface should be used |
| workDir | folder containing the files mentioned in the configuration document. Must end with a slash. |
References init(), and initLocal().
Referenced by init(), and main().

| frodo2.controller.Controller.Controller | ( | DistributedSolver<?, ?, ?> | solver | ) |
Constructor to use a solver in distributed mode.
| solver | the distributed solver |
References init().

| frodo2.controller.Controller.Controller | ( | boolean | local, |
| boolean | ui ) |
Constructor for the controller.
Experiments can either be run on the same machine the controller is running on, or on (a) separate machine(s).
| local | true if the experiments are run locally |
| ui | true if the user interface should be used |
| frodo2.controller.Controller.Controller | ( | boolean | local, |
| boolean | ui, | ||
| String | testDir, | ||
| int | size ) |
| local | true if the experiments are run locally |
| ui | true if the user interface should be used |
| testDir | the working directory |
| size | the number of daemon to be instantiated |
References daemonNb.
| void frodo2.controller.Controller.addAgent | ( | String | agentId, |
| AgentInterface<?> | agent ) |
| void frodo2.controller.Controller.addOutputPipe | ( | String | fromID, |
| String | toID, | ||
| QueueOutputPipeInterface | pipe ) |
Add agent toID's input pipe as an output pipe to agent fromID's queue.
| fromID | the ID of the sender agent |
| toID | the ID of the recipient agent |
| pipe | the pipe |
References agents.
| void frodo2.controller.Controller.clearAgents | ( | ) |
Delete all the agents from the repository.
References agents.
| void frodo2.controller.Controller.endQueue | ( | ) |
This function is there mainly for test purposes and can be removed in the end.
References controlQueue.
| void frodo2.controller.Controller.exit | ( | boolean | quit | ) |
This function must be called to stop the controller.
| quit | whether the JVM should be terminated |
References controlQueue.
| Collection< String > frodo2.controller.Controller.getAgents | ( | ) |
References agents.
|
private |
Initializes the controller.
| workDir | folder containing the files mentioned in the configuration document. Must end with a slash. |
| solver | the distributed solver, if any |
References confManager, Controller(), controlQueue, isFinishedSync, PORT, userIO, and wp.
Referenced by Controller(), and Controller().

|
private |
Initializes the controller for running the experiments itself.
| ui | currently unused parameter |
| workDir | folder containing the files mentioned in the configuration document. Must end with a slash. |
References agents, confManager, constructor, controlQueue, input, isFinishedSync, lwp, and userIO.
Referenced by Controller().
|
static |
| args | if -local then the experiments are run on the local machine (default is distributed) if -license is passed as an argument, displays the license and returns |
References Controller().

|
private |
Start the controller.
References userIO.
| void frodo2.controller.Controller.setFinished | ( | ) |
This functions sets a boolean value to true when finished.
References isFinished, and isFinishedSync.
|
private |
Agent repository, used when experiments are run locally.
Referenced by addAgent(), addOutputPipe(), clearAgents(), getAgents(), and initLocal().
|
private |
the configuration manager sets up the experiments
Referenced by init(), and initLocal().
|
private |
The agent constructor, used when the experiments are run locally.
Referenced by initLocal().
|
static |
The destination ID of messages that are meant for the Controller.
Referenced by frodo2.algorithms.SingleQueueAgent< Val extends Addable< Val > >.connect(), frodo2.communication.mailer.CentralMailer.execute(), frodo2.communication.mailer.CentralMailer.newQueue(), frodo2.algorithms.test.MessageDebugger.notifyOut(), frodo2.algorithms.SingleQueueAgent< Val extends Addable< Val > >.oneMoreNeighbor(), frodo2.communication.Queue.recordStats(), and frodo2.algorithms.SingleQueueAgent< Val extends Addable< Val > >.setup().
|
protected |
The queue that is used to send and receive messages.
Referenced by endQueue(), exit(), init(), initLocal(), frodo2.controller.TestController.ControllerExtension.setUp(), and frodo2.controller.TestController.ControllerExtension.start().
|
static |
counts the number of instantiated daemon in order to launch the controller when everybody is ready.
Referenced by Controller().
|
private |
The input pipe for external messages.
Referenced by initLocal().
| boolean frodo2.controller.Controller.isFinished = false |
Is true when the experiments are finished.
Referenced by setFinished().
| Object frodo2.controller.Controller.isFinishedSync |
Used to synchronized access to isFinished.
Referenced by init(), initLocal(), and setFinished().
| boolean frodo2.controller.Controller.isStopped = true |
Is true when the experiment has stopped and false when it is running.
| boolean frodo2.controller.Controller.isSuspended = false |
is true when the experiment is suspended and false otherwise
|
private |
The local white pages, used when the experiments are run locally.
Referenced by initLocal().
|
static |
The instance of the PipeFactory Visitor.
Referenced by frodo2.daemon.TestLocalWhitePages.SimpleAgent.agentReportGlobal(), frodo2.algorithms.test.AllTests.createQueueNetwork(), frodo2.controller.TestController.DaemonExtension.DaemonExtension(), frodo2.daemon.Daemon.init(), frodo2.daemon.userIO.UserIO.registerController(), frodo2.controller.TestConfigurationManager.setUp(), frodo2.controller.TestWhitePages.setUp(), frodo2.algorithms.SingleQueueAgent< Val extends Addable< Val > >.setup(), frodo2.daemon.TestLocalWhitePages.testAgentAddress(), frodo2.controller.TestWhitePages.testAgentReporting(), frodo2.controller.TestWhitePages.testDaemonReporting(), frodo2.controller.TestWhitePages.testKillAllAgents(), and frodo2.daemon.TestLocalWhitePages.testLocalAgentAddressRequestUnknown().
|
static |
The port the controller is listening to.
Referenced by frodo2.daemon.Constructor.Constructor(), frodo2.controller.TestController.DaemonExtension.DaemonExtension(), init(), frodo2.daemon.Daemon.main(), and frodo2.daemon.userIO.Console.parseInput().
|
private |
userIO takes care of all the user input and output
Referenced by addAgent(), init(), initLocal(), and run().
|
private |
The global white pages.
Referenced by init().