Package dsc_suite :: Package gui :: Module config
[hide private]
[frames] | no frames]

Module config

source code


Created on 08.06.2010

@author: Robert Fischbach
@author: Tobias Heimpold

This module contains several parameters for the GUI. They are provided in a "crypted" form using dictionaries and lists.
That seems complicated at the first time. But: Lists and dictionaries can be easily iterated. So the code in the GUI module need not to be programmed
with several controls like if elif else.
For example a algorithm has different parameters, which should all stand together in one group box. The parameters have different values, step sizes etc.
Without a list the GUI must handle every single parameter on its own. With a list, the GUI just reads the correct entry from the list where it is told what to do.

- list of supported data structures
- list of working benchmarks
- list of optimization approaches
- list of parameters of optimization approaches
- list of data type of these parameters (linked with PyQt)
- list of functions to edit parameters (linked with PyQt)
- list of functions to read parameters (linked with PyQt)
- list of evaluation options

Hint: Linking to PyQt without import ! --> string must be run with eval(string) in main program

Variables [hide private]
  DATA_STRUCTURE_LIST = {'3D Slicing Tree': [<class 'dsc_suite.d...
  BENCHMARK_LIST = {'M198.yal': [<class 'dsc_suite.tools.benchma...
  OPTIMIZATION_LIST = {'Monte Carlo': [generate_monte_carlo_data...
this dictionary contains the different parameters of the algorithms PARAMETER_LIST[name_of_algorithm] returns a dictionary: keys : parameter name used in algorithm value : list with detailed information about parameter
  PARAMETER_LIST = {'Evolutionary Algorithm': {'children': ['int...
this dictionary contains the different data types which are used in the algorithms and combines them with the Qt-Framework keys : used data type value : used Qt Widget
  DATATYPE_LIST = {'float': 'QtGui.QDoubleSpinBox()', 'int': 'Qt...
this dictionary contains the different functions to set the limits of the parameters keys : used data type value : list of functions for setting the limits
  LIMITFUNCTION_LIST = {'float': ['setDecimals', 'setMinimum', '...
this dictionary contains the different functions to read the parameters keys : used data type --> used as cast operator value : list of functions to read the parameter
  READFUNCTION_LIST = {'float': 'value', 'int': 'value', 'str': ...
this list contains the names of parameters which are used from every algorithm cost_criteria is replaced by the cost criteria key list in datastructure module
  HEADER_LIST = ['#', 'trial name', 'datastructure', 'benchmark'...
  EVALUATION_PLOT_LIST = {'Cost Distribution': [plot_cost_distri...
dictionary of diagram options which can be adjusted keys ...
  DIAGRAM_PARAMETER_LIST = {'axes': {'x-axe': {'xmax': ['str', '...
  __package__ = 'dsc_suite.gui'
  key = 'MPMWE'
Variables Details [hide private]

DATA_STRUCTURE_LIST

Value:
{'3D Slicing Tree': [<class 'dsc_suite.ds.slicing_tree.SlicingTree'>,
                     'bla bla slicing tree'],
 'O-Sequence': [<class 'dsc_suite.ds.o_sequence.OSequence'>,
                'bla bla o sequence'],
 'Sequence Quintuple': [<class 'dsc_suite.ds.sequence_quintuple.Sequen\
ceQuintuple'>,
                        'bla bla sequence quintuple'],
 'Sequence Triple': [<class 'dsc_suite.ds.sequence_triple.SequenceTrip\
...

BENCHMARK_LIST

Value:
{'M198.yal': [<class 'dsc_suite.tools.benchmarks.YAL'>,
              33,
              '''M198

 number of blocks:\t 33
 benchmarkclass:\t YAL'''],
 'ami33.yal': [<class 'dsc_suite.tools.benchmarks.YAL'>,
               33,
...

OPTIMIZATION_LIST

this dictionary contains the different parameters of the algorithms PARAMETER_LIST[name_of_algorithm] returns a dictionary: keys : parameter name used in algorithm value : list with detailed information about parameter

index and refered information: 0 : data type -> see DATATYPE_LIST 1 : description for tool tip 2 : list with limits --> MUST be correlated with functions in LIMITFUNCTION_LIST !

that means: the first object in the list is used as a parameter for the first function for that datatype

Value:
{'Monte Carlo': [generate_monte_carlo_data, 'Evenly distributed sampli\
ng of the given solution space.'], 'Simulated Annealing': [generate_si\
mulated_annealing_data, 'add nice text'], 'Evolutionary Algorithm': [g\
enerate_evolution_data, 'add nice text'], 'Great Deluge Algorithm': [g\
enerate_great_deluge_data, 'add nice text']}

PARAMETER_LIST

this dictionary contains the different data types which are used in the algorithms and combines them with the Qt-Framework keys : used data type value : used Qt Widget

for example: to set a integer based parameter a QtSpinBox is used

Value:
{'Evolutionary Algorithm': {'children': ['int',
                                         'number of created children p\
er recombination',
                                         [1, 20, 1, 4]],
                            'generations': ['int',
                                            'number of created generat\
ions',
                                            [5, 100, 5, 50]],
...

DATATYPE_LIST

this dictionary contains the different functions to set the limits of the parameters keys : used data type value : list of functions for setting the limits

MUST be correlated to the limits in PARAMETER_LIST

for example: to set a integer based parameter a QtSpinBox is used

Value:
{'float': 'QtGui.QDoubleSpinBox()',
 'int': 'QtGui.QSpinBox()',
 'str': 'QtGui.QLineEdit()'}

LIMITFUNCTION_LIST

this dictionary contains the different functions to read the parameters keys : used data type --> used as cast operator value : list of functions to read the parameter

for example: to read a integer based parameter from a QSpinBox is used function value

Value:
{'float': ['setDecimals',
           'setMinimum',
           'setMaximum',
           'setSingleStep',
           'setValue'],
 'int': ['setMinimum', 'setMaximum', 'setSingleStep', 'setValue'],
 'str': ['setText']}

READFUNCTION_LIST

this list contains the names of parameters which are used from every algorithm cost_criteria is replaced by the cost criteria key list in datastructure module

Value:
{'float': 'value', 'int': 'value', 'str': 'text'}

HEADER_LIST

Value:
['#',
 'trial name',
 'datastructure',
 'benchmark',
 'algorithm',
 'z-Dimension',
 'HESA',
 'weight factor HESA',
...

EVALUATION_PLOT_LIST

dictionary of diagram options which can be adjusted keys ... will create tabs (as first level) and group boxes all sub-levels value ... dictionary --> next level of group box, list --> information about parameter usage: similar to parameter list The DSC construts a dialog with a special layout. The first level keys create tabs. If the value referenced by the key is a dictionary, all sub-level keys will create a group box and include all next sub-level keys. If the value referenced by the key is a list, the key is a parameter and the DSC will create a PyQt item for adjustment (see DATATYPE_LIST). The other items in the list are tooltip and limits (if needed) --> see limit function list).

Value:
{'Cost Distribution': [plot_cost_distribution, 'Plot distribution of c\
osts given by data entries.'], '2D Cost Distribution': [plot_2d_cost_d\
istribution, 'Contrast two cost distributions in a single diagram'], '\
Cost development': [plot_costdata_development, 'Plot cost data over th\
eir index in data file'], 'Scatter plot': [plot_2D_scatter_plot, 'Cont\
rast two cost distributions in a single diagram'], 'Histogram': [plot_\
histogramm, 'Plots histogramm']}

DIAGRAM_PARAMETER_LIST

Value:
{'axes': {'x-axe': {'xmax': ['str',
                             'The maximum x-value. Auto = searches max\
imum',
                             'auto'],
                    'xmin': ['str',
                             'The minimum x-value. Auto = 0',
                             'auto']},
          'y-axe': {'ymax': ['str', 'The maximum y-value. Auto = searc\
...