FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
Loading...
Searching...
No Matches
frodo2.controller.userIO.Console Class Reference

A simple console based user interface. More...

Inheritance diagram for frodo2.controller.userIO.Console:

Public Member Functions

 Console (Controller control)
 The constructor.
boolean askUserYesNo (String message)
void tellUser (String message)
void showUserDaemonList (HashMap< String, AgentAddress > daemons)
void showUserAgentList (HashMap< String, AgentAddress > agents)
void stopRunning ()
void run ()
 The main loop that waits for user input is situated here.
void parseInput (String input)
 A simple function that looks at the input and determines what to.
Public Member Functions inherited from frodo2.controller.userIO.UserIO
 UserIO (Controller control)
 A basic constructor.
void start ()
Collection< MessageTypegetMsgTypes ()
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.
Public Member Functions inherited from frodo2.communication.IncomingMsgPolicyInterface< T >
default void notifyIn (Message msg, Object toAgent)
 Notifies the listener of an incoming message.

Package Attributes

boolean done = false
 This variable is used to determine whether the program should exit or not.

Private Attributes

final String prefix
 The command line prefix.

Additional Inherited Members

Static Public Attributes inherited from frodo2.controller.userIO.UserIO
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 inherited from frodo2.controller.userIO.UserIO
 UserIO ()
 Default constructor.
Protected Attributes inherited from frodo2.controller.userIO.UserIO
Queue controlQueue
 The queue of the controller.
Controller control
 The controller.

Detailed Description

A simple console based user interface.

It responds to the following commands:

  • to load a configuration file, type open [filename]
  • to start the experiments, type start
  • to exit, type exit
    Author
    Brammert Ottens, Thomas Leaute

Constructor & Destructor Documentation

◆ Console()

frodo2.controller.userIO.Console.Console ( Controller control)

The constructor.

Parameters
controlthe controller

References frodo2.controller.userIO.UserIO.control.

Member Function Documentation

◆ askUserYesNo()

boolean frodo2.controller.userIO.Console.askUserYesNo ( String message)
See also
frodo2.controller.userIO.UserIO.askUserYesNo(java.lang.String)
Todo
Auto-generated method stub

Reimplemented from frodo2.controller.userIO.UserIO.

◆ parseInput()

void frodo2.controller.userIO.Console.parseInput ( String input)

A simple function that looks at the input and determines what to.

Parameters
inputinput String

References frodo2.controller.userIO.UserIO.exit(), frodo2.controller.userIO.UserIO.getAgentList(), frodo2.controller.userIO.UserIO.getDaemonList(), frodo2.controller.userIO.UserIO.load(), frodo2.controller.userIO.UserIO.startExperiment(), and tellUser().

Referenced by run().

Here is the call graph for this function:

◆ run()

void frodo2.controller.userIO.Console.run ( )

The main loop that waits for user input is situated here.

See also
java.lang.Thread#run()

References done, and parseInput().

Here is the call graph for this function:

◆ showUserAgentList()

void frodo2.controller.userIO.Console.showUserAgentList ( HashMap< String, AgentAddress > agents)

◆ showUserDaemonList()

void frodo2.controller.userIO.Console.showUserDaemonList ( HashMap< String, AgentAddress > daemons)

◆ stopRunning()

void frodo2.controller.userIO.Console.stopRunning ( )

◆ tellUser()

void frodo2.controller.userIO.Console.tellUser ( String message)
See also
frodo2.controller.userIO.UserIO.tellUser(java.lang.String)

Reimplemented from frodo2.controller.userIO.UserIO.

Referenced by parseInput().

Member Data Documentation

◆ done

boolean frodo2.controller.userIO.Console.done = false
package

This variable is used to determine whether the program should exit or not.

Referenced by run(), and stopRunning().

◆ prefix

final String frodo2.controller.userIO.Console.prefix
private

The command line prefix.


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