|
FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
|
A simple GUI to configure and start FRODO. More...

Public Member Functions | |
| SimpleGUI (String problemFilePath, String agentFilePath, String timeout) | |
| Constructor defining and building the GUI. | |
| SimpleGUI (String problemFilePath, String agentFilePath, String timeout, String outputFilePath) | |
| Constructor defining and building the GUI. | |
| void | actionPerformed (ActionEvent e) |
| This method is called whenever a button associated with this ActionListener is pressed. | |
| void | itemStateChanged (ItemEvent e) |
| This method is called when another item is selected from the list of available agent configuration files. | |
Static Public Member Functions | |
| static void | main (String[] args) |
Private Member Functions | |
| String | readLicense () |
| This method reads the license from the file LICENSE.txt and displays it if the file exists and can be read. | |
| String[] | createAgentsList () |
| This method creates the mapping from all currently implemented DCOP solving agents to their paths, and returns an array containing only the file names of the configuration files, in order to display them in the drop down list. | |
| void | solveProblem () |
| This method first checks if all the necessary parameters (problem file, agent description file, timeout value) are valid. | |
| void | enableProblemDef (boolean enabled) |
| Enables or disables input fields used to define the problem (problem instance, agent...). | |
| void | editProblemFile () |
| This method creates a dialog containing a text editor to edit the chosen problem file. | |
| void | editAgentFile (boolean isCustomFile, String filePath) |
| This method creates a dialog containing a text editor to edit the chosen agent configuration file. | |
| void | saveFile (String filePath) |
| This method saves the current editor content to a file with the given path. | |
Private Attributes | |
| Map< String, String > | agentNamesToPath |
| Mapping from agent configuration file names to their absolute path. | |
| JTextField | problemField |
| Text field containing path of problem file. | |
| JTextField | outputField |
| Text field containing path to the output file. | |
| JComboBox< String > | agentList |
| List of DCOP solving agents. | |
| JTextField | timeoutField |
| Specified timeout value. | |
| JLabel | problemError |
| Label indicating an error in chosen problem file. | |
| JLabel | agentError |
| Label indicating an error in chosen agent configuration file. | |
| JLabel | timeoutError |
| Label indicating an erroneous timeout value. | |
| JDialog | editorDialog |
| Dialog window containing a text editor to change problem and agent configuration files. | |
| JTextPane | editorPane |
| Pane containing a text editor to change problem and agent configuration files. | |
| String | tempAgentFile = null |
| String indicating the path of a temporary agent configuration file, if used. | |
| JButton | problemBrowseBtn |
| The button to select an input problem file. | |
| JButton | outputBrowseBtn |
| The button to select an output file. | |
| JButton | problemEditBtn |
| The button to edit the problem file. | |
| JButton | agentEditBtn |
| The button to edit the agent file. | |
| JButton | solveBtn |
| The button to start solving. | |
Static Private Attributes | |
| static final long | serialVersionUID = 4194657988533551087L |
| Serial version ID of JFrame. | |
| static final String | dotRendererClass = DOTrenderer.class.getName() |
| Class name of DOT renderer used to display graphs. | |
A simple GUI to configure and start FRODO.
Add the possibility to interrupt an algorithm.
Replace GraphViz by JUNG? http://jung.sourceforge.net/
Display the console messages in a dedicated window?
| frodo2.gui.SimpleGUI.SimpleGUI | ( | String | problemFilePath, |
| String | agentFilePath, | ||
| String | timeout ) |
Constructor defining and building the GUI.
| problemFilePath | Path to problem file to use |
| agentFilePath | Path to agent configuration file to use |
| timeout | Timeout value |
References frodo2.timeout.
Referenced by editAgentFile(), main(), and solveProblem().
| frodo2.gui.SimpleGUI.SimpleGUI | ( | String | problemFilePath, |
| String | agentFilePath, | ||
| String | timeout, | ||
| String | outputFilePath ) |
Constructor defining and building the GUI.
| problemFilePath | Path to problem file to use |
| agentFilePath | Path to agent configuration file to use |
| timeout | Timeout value |
| outputFilePath | Path to the output file. If null, no output file is created. |
References agentEditBtn, agentError, agentList, agentNamesToPath, createAgentsList(), outputBrowseBtn, outputField, problemBrowseBtn, problemEditBtn, problemError, problemField, solveBtn, frodo2.timeout, timeoutError, and timeoutField.

| void frodo2.gui.SimpleGUI.actionPerformed | ( | ActionEvent | e | ) |
This method is called whenever a button associated with this ActionListener is pressed.
| e | Action event |
References agentList, agentNamesToPath, editAgentFile(), editorDialog, editProblemFile(), frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.parse(), problemError, problemField, readLicense(), saveFile(), solveProblem(), tempAgentFile, and frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.toDOT().

|
private |
This method creates the mapping from all currently implemented DCOP solving agents to their paths, and returns an array containing only the file names of the configuration files, in order to display them in the drop down list.
References agentNamesToPath.
Referenced by SimpleGUI().
|
private |
This method creates a dialog containing a text editor to edit the chosen agent configuration file.
Depending on whether the file is custom or built-in, it allows overwriting the existing file, saving the editor content in a specified location or in a temporary file.
| isCustomFile | true if chosen agent configuration file is a custom file, false if it is a built-in file |
| filePath | Path to the chosen agent configuration file |
References agentError, editorDialog, editorPane, and SimpleGUI().
Referenced by actionPerformed().

|
private |
This method creates a dialog containing a text editor to edit the chosen problem file.
It allows saving the changes by overwriting the existing file.
References editorDialog, editorPane, problemError, and problemField.
Referenced by actionPerformed().
|
private |
Enables or disables input fields used to define the problem (problem instance, agent...).
| enabled | whether the input fields should be enabled |
Referenced by solveProblem().
| void frodo2.gui.SimpleGUI.itemStateChanged | ( | ItemEvent | e | ) |
This method is called when another item is selected from the list of available agent configuration files.
This is mainly used to add custom files.
| e | Item event |
References agentError, agentList, agentNamesToPath, and tempAgentFile.
|
static |
| args | Array of parameters containing 3 optional arguments:
|
References SimpleGUI(), and frodo2.timeout.

|
private |
This method reads the license from the file LICENSE.txt and displays it if the file exists and can be read.
Referenced by actionPerformed().
|
private |
This method saves the current editor content to a file with the given path.
Existing files are overwritten.
| filePath | Path and name of file where editor content should be saved |
References editorDialog, and editorPane.
Referenced by actionPerformed().
|
private |
This method first checks if all the necessary parameters (problem file, agent description file, timeout value) are valid.
If so, it slightly changes the agent configuration file in order to use a DOT renderer to display graphs, and then starts the solver.
References agentError, agentList, agentNamesToPath, dotRendererClass, enableProblemDef(), frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.end(), frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.parse(), problemError, problemField, SimpleGUI(), tempAgentFile, timeoutError, and timeoutField.
Referenced by actionPerformed().

|
private |
The button to edit the agent file.
Referenced by SimpleGUI().
|
private |
Label indicating an error in chosen agent configuration file.
Referenced by editAgentFile(), itemStateChanged(), SimpleGUI(), and solveProblem().
|
private |
List of DCOP solving agents.
Referenced by actionPerformed(), itemStateChanged(), SimpleGUI(), and solveProblem().
|
private |
Mapping from agent configuration file names to their absolute path.
Referenced by actionPerformed(), createAgentsList(), itemStateChanged(), SimpleGUI(), and solveProblem().
|
staticprivate |
Class name of DOT renderer used to display graphs.
Referenced by solveProblem().
|
private |
Dialog window containing a text editor to change problem and agent configuration files.
Referenced by actionPerformed(), editAgentFile(), editProblemFile(), and saveFile().
|
private |
Pane containing a text editor to change problem and agent configuration files.
Referenced by editAgentFile(), editProblemFile(), and saveFile().
|
private |
The button to select an output file.
Referenced by SimpleGUI().
|
private |
Text field containing path to the output file.
Referenced by SimpleGUI().
|
private |
The button to select an input problem file.
Referenced by SimpleGUI().
|
private |
The button to edit the problem file.
Referenced by SimpleGUI().
|
private |
Label indicating an error in chosen problem file.
Referenced by actionPerformed(), editProblemFile(), SimpleGUI(), and solveProblem().
|
private |
Text field containing path of problem file.
Referenced by actionPerformed(), editProblemFile(), SimpleGUI(), and solveProblem().
|
staticprivate |
Serial version ID of JFrame.
|
private |
The button to start solving.
Referenced by SimpleGUI().
|
private |
String indicating the path of a temporary agent configuration file, if used.
Referenced by actionPerformed(), itemStateChanged(), and solveProblem().
|
private |
Label indicating an erroneous timeout value.
Referenced by SimpleGUI(), and solveProblem().
|
private |
Specified timeout value.
Referenced by SimpleGUI(), and solveProblem().