|
FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
|
This class implements all the functions that a user interface should deliver. More...

Public Member Functions | |
| UserIO (Controller control) | |
| A basic constructor. | |
| void | start () |
| Collection< MessageType > | getMsgTypes () |
| void | setQueue (Queue queue) |
| void | notifyIn (Message msg) |
| The user interface responds to message of the type USER_NOTIFICATION_MSG, that contain message to be displayed to the user. | |
| void | load (String filename) |
| Used to load a new configuration file. | |
| void | startExperiment () |
| Used to start the experiments. | |
| void | setDebug (boolean b) |
| Used to stop the experiments. | |
| void | setLogging (boolean b) |
| Tell the controller whether we want to log everything or not. | |
| void | getDaemonList () |
| Ask the white pages for a list of all daemons that are registered. | |
| void | getAgentList () |
| Ask the white pages for a list of all agents that are registered. | |
| void | exit () |
| Stop the experiment, clean everything up and exit the program. | |
| abstract void | tellUser (String message) |
| Tell the user something. | |
| abstract boolean | askUserYesNo (String message) |
| Ask the user a yes or no question. | |
| abstract void | stopRunning () |
| stop the console | |
| abstract void | showUserDaemonList (HashMap< String, AgentAddress > daemons) |
| Display the list of daemons. | |
| abstract void | showUserAgentList (HashMap< String, AgentAddress > agents) |
| Display the list of agents. | |
| 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 | CONFIGURATION_MSG = MessageType.SYSTEM.newChild("UserIO", "Configure") |
| The message type used to convey the configuration file. | |
| static final MessageType | USER_NOTIFICATION_MSG = MessageType.SYSTEM.newChild("UserIO", "User-Notification") |
| The message type used to send messages to the user. | |
| static final MessageType | START_MSG = MessageType.SYSTEM.newChild("UserIO", "StartE") |
| The message the user sends to start the experiment. | |
| static final MessageType | DEAMON_LIST_REQUEST = MessageType.SYSTEM.newChild("UserIO", "Daemon list requested") |
| Message send to request a list of daemons from the white pages. | |
| static final MessageType | AGENTS_LIST_REQUEST = MessageType.SYSTEM.newChild("UserIO", "Agent list requested") |
| Message send to request a list of agents from the white pages. | |
Protected Member Functions | |
| UserIO () | |
| Default constructor. | |
Protected Attributes | |
| Queue | controlQueue |
| The queue of the controller. | |
| Controller | control |
| The controller. | |
Private Attributes | |
| Object | queue_lock = new Object() |
| Lock for queue used for synchronization. | |
| ArrayList< MessageType > | msgTypes = new ArrayList <MessageType> () |
| The list of messages types this listener wants to be notified of. | |
This class implements all the functions that a user interface should deliver.
| frodo2.controller.userIO.UserIO.UserIO | ( | Controller | control | ) |
A basic constructor.
| control | a reference to the controller |
References frodo2.controller.WhitePages.AGENTS_LIST, control, frodo2.controller.WhitePages.DEAMONS_LIST, msgTypes, and USER_NOTIFICATION_MSG.
|
protected |
Default constructor.
|
abstract |
Ask the user a yes or no question.
| message | the text of the question |
Reimplemented in frodo2.controller.userIO.Console, and frodo2.controller.userIO.DistributedSolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.
| void frodo2.controller.userIO.UserIO.exit | ( | ) |
Stop the experiment, clean everything up and exit the program.
References control.
Referenced by frodo2.controller.userIO.Console.parseInput().
| void frodo2.controller.userIO.UserIO.getAgentList | ( | ) |
Ask the white pages for a list of all agents that are registered.
References AGENTS_LIST_REQUEST, and controlQueue.
Referenced by frodo2.controller.userIO.Console.parseInput().
| void frodo2.controller.userIO.UserIO.getDaemonList | ( | ) |
Ask the white pages for a list of all daemons that are registered.
References controlQueue, and DEAMON_LIST_REQUEST.
Referenced by frodo2.controller.userIO.Console.parseInput().
| Collection< MessageType > frodo2.controller.userIO.UserIO.getMsgTypes | ( | ) |
Implements frodo2.communication.MessageListener< T >.
References msgTypes.
| void frodo2.controller.userIO.UserIO.load | ( | String | filename | ) |
Used to load a new configuration file.
| filename | the file to be loaded |
References CONFIGURATION_MSG, and controlQueue.
Referenced by frodo2.controller.userIO.Console.parseInput().
| void frodo2.controller.userIO.UserIO.notifyIn | ( | Message | msg | ) |
The user interface responds to message of the type USER_NOTIFICATION_MSG, that contain message to be displayed to the user.
| msg | the message that was just received |
Implements frodo2.communication.IncomingMsgPolicyInterface< T >.
References frodo2.controller.WhitePages.AGENTS_LIST, frodo2.controller.WhitePages.DEAMONS_LIST, notifyIn(), and USER_NOTIFICATION_MSG.
Referenced by notifyIn().

| void frodo2.controller.userIO.UserIO.setDebug | ( | boolean | b | ) |
Used to stop the experiments.
Used to suspend the current experiment Used to continue a suspended experiment A message is send to all daemons to clean everything up. If project is still running or is suspended, ask the user if he really wants to clean everything up! Tell the controller whether we want to do step by step debugging
| b | whether debug mode should be enabled |
References tellUser().

| void frodo2.controller.userIO.UserIO.setLogging | ( | boolean | b | ) |
Tell the controller whether we want to log everything or not.
| b | whether logging should be enabled |
References tellUser().

| void frodo2.controller.userIO.UserIO.setQueue | ( | Queue | queue | ) |
Implements frodo2.communication.MessageListener< T >.
References queue_lock.
|
abstract |
Display the list of agents.
| agents | a list of agents together with their addresses |
Reimplemented in frodo2.controller.userIO.Console, and frodo2.controller.userIO.DistributedSolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.
|
abstract |
Display the list of daemons.
| daemons | a list of daemons together with their addresses |
Reimplemented in frodo2.controller.userIO.Console, and frodo2.controller.userIO.DistributedSolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.
| void frodo2.controller.userIO.UserIO.start | ( | ) |
| void frodo2.controller.userIO.UserIO.startExperiment | ( | ) |
Used to start the experiments.
References controlQueue, and START_MSG.
Referenced by frodo2.controller.userIO.Console.parseInput().
|
abstract |
stop the console
Reimplemented in frodo2.controller.userIO.Console, and frodo2.controller.userIO.DistributedSolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.
|
abstract |
Tell the user something.
| message | the message to be given |
Reimplemented in frodo2.controller.userIO.Console, and frodo2.controller.userIO.DistributedSolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.
Referenced by setDebug(), and setLogging().
|
static |
Message send to request a list of agents from the white pages.
Referenced by getAgentList(), frodo2.controller.WhitePages.notifyIn(), and frodo2.controller.WhitePages.WhitePages().
|
static |
The message type used to convey the configuration file.
Referenced by frodo2.controller.ConfigurationManager.ConfigurationManager(), load(), frodo2.daemon.userIO.UserIO.load(), frodo2.daemon.LocalConfigManager.LocalConfigManager(), frodo2.controller.ConfigurationManager.notifyIn(), frodo2.controller.TestController.ControllerExtension.setUp(), and frodo2.controller.TestController.DaemonExtension.setUp().
|
protected |
The controller.
Referenced by frodo2.controller.userIO.Console.Console(), exit(), and UserIO().
|
protected |
The queue of the controller.
Referenced by getAgentList(), getDaemonList(), load(), and startExperiment().
|
static |
Message send to request a list of daemons from the white pages.
Referenced by getDaemonList(), frodo2.controller.WhitePages.notifyIn(), and frodo2.controller.WhitePages.WhitePages().
|
private |
The list of messages types this listener wants to be notified of.
Referenced by getMsgTypes(), and UserIO().
|
private |
Lock for queue used for synchronization.
We cannot synchronize directly on queue because it can be null.
Referenced by setQueue().
|
static |
The message the user sends to start the experiment.
Referenced by frodo2.controller.ConfigurationManager.ConfigurationManager(), frodo2.controller.TestController.ControllerExtension.start(), startExperiment(), and frodo2.controller.TestConfigurationManager.testStartExperiment().
|
static |
The message type used to send messages to the user.
Referenced by notifyIn(), frodo2.daemon.userIO.UserIO.notifyIn(), frodo2.controller.ConfigurationManager.tellUser(), frodo2.daemon.Constructor.tellUser(), UserIO(), and frodo2.daemon.userIO.UserIO.UserIO().