92
EVOCOM GUI User’s Manual Eva Besada Portas José Antonio López Orozco Bonifacio de Andrés Toro

EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

EVOCOM GUI User’s Manual

Eva Besada Portas

José Antonio López Orozco

Bonifacio de Andrés Toro

Page 2: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 2 Ingeniería de Sistemas y Automática

Page 3: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 3 EVOCOM Toolbox

INDEX

EVOCOM OVERVIEW...............................................................................................................................6 EVOCOM GRAPHIC USER INTERFACE OVERVIEW ..........................................................................8 EVOCOM GUI DESCRIPTION................................................................................................................11

GENERAL CHARACTERISTICS OF EVOCOM GUIs ......................................................................12 Calling the GUIs.................................................................................................................................12 Providing information to the Editable/Writable Elements..................................................................13 Providing the information of a method...............................................................................................14 Ø Method Names........................................................................................................................15 Ø Extra-parameters.....................................................................................................................16

Erroneous information........................................................................................................................17 Editable Area and Color Bars .............................................................................................................18 Ø Useful tip for identifying the cause of errors when running the specified EA........................19

Menu Bar ............................................................................................................................................19 Ø Options Menu .........................................................................................................................19 Ø Help Menu ..............................................................................................................................20

Closing a GUI.....................................................................................................................................21 INDIVIDUAL STRUCTURE GUI: GUI_IS .........................................................................................22

Creating/Destroying/Selecting Chromosome Area.............................................................................23 Ø New chrom .............................................................................................................................23 Ø Copy chrom ............................................................................................................................23 Ø Delete chrom...........................................................................................................................24 Ø Delete all.................................................................................................................................24 Ø Total Num Chrom...................................................................................................................24 Ø Selected Chrom.......................................................................................................................24 Ø Moving Pushbuttons (<<,<,>,>>) ...........................................................................................24

Providing Information for each Chromosome Area ...........................................................................24 Ø Specifying the methods of the individual structure ................................................................25 Ø Specifying the number of genes..............................................................................................25 Ø Updating pushbuttons .............................................................................................................25

Displaying (Error Status) Area ...........................................................................................................26 Ø Erroneous information considerations ....................................................................................26 Ø Editable Area (Status of the current chromosome) .................................................................26 Ø Color Bar (Status of the all the chromosomes) .......................................................................27

Differences in gui_is when calling it from Matlab or gui_evocom.....................................................27 OBJECTIVE STRUCTURE GUI: GUI_OS ..........................................................................................28

Creating/Destroying/Selecting Objective Function Area ...................................................................29 Ø New Obj..................................................................................................................................29 Ø Del Obj ...................................................................................................................................29 Ø Del all .....................................................................................................................................30 Ø Number of objective functions ...............................................................................................30 Ø Selected Objective ..................................................................................................................30 Ø Moving Pushbuttons (<<,<,>,>>) ...........................................................................................30

Providing Information for each Objective Function Area ..................................................................30 Ø Specifying the function of the objective structure ..................................................................30 Ø Specifying the number of objectives returned for the objective function ...............................31 Ø Updating pushbuttons .............................................................................................................31

Displaying (Error Status) Area ...........................................................................................................31 Ø Erroneous information considerations ....................................................................................32 Ø Individual Structure Area .......................................................................................................32 Ø Editable Area (Status of the current Objective Function) .......................................................33 Ø Color Bar (Status of the all the objective functions)...............................................................34

Differences in the gui_os when calling it from Matlab or gui_evocom ..............................................34 EVOLUTIONARY STRUCTURE GUI: GUI_GAS .............................................................................35

Modify Menu......................................................................................................................................36 Initialization Area ...............................................................................................................................37 Ø Incrementing pushbuttons (+).................................................................................................37

Page 4: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 4 Ingeniería de Sistemas y Automática

Ø Decrementing pushbuttons (+)................................................................................................37 Ø Chrom .....................................................................................................................................37 Ø Obj ..........................................................................................................................................38 Ø Show.......................................................................................................................................38

Selecting the EA field area .................................................................................................................38 Providing Information for each field Area..........................................................................................40 Ø Area for specifying a unique parameter..................................................................................40 Ø Area for selecting a unique parameter ....................................................................................40 Ø Area for selecting several parameters .....................................................................................41 Ø Area for providing information for a unique method..............................................................42 Ø Area for providing information for several methods ..............................................................43

Ways of identifying each type of method ...........................................................................................45 Erroneous information considerations ................................................................................................45 Differences in the gui_gas when calling it from Matlab or gui_evocom ............................................45

EVOCOM MAIN GUI: GUI_EVOCOM...............................................................................................47 Defining/Loading Structure Area .......................................................................................................47 Ø List box...................................................................................................................................48 Ø Load........................................................................................................................................48 Ø Define .....................................................................................................................................48

Displaying Area..................................................................................................................................49 Running Area......................................................................................................................................49 Ø Run .........................................................................................................................................49 Ø Eval Structures before running ...............................................................................................50 Ø Ask if results should be saved.................................................................................................50

Erroneous information considerations ................................................................................................51 Gui_evocom can only be called from the Matlab prompt ..................................................................51

INITIAL INFORMATION GUI: GUI_INIT .........................................................................................52 Error checking ....................................................................................................................................52 Differences in gui_init when calling it from Matlab or from gui_evocom .........................................53

EXTRA-PARAMETER VARIABLE GUI: GUI_PARAM...................................................................54 Creating/Destroying/Selecting Extra-Parameter Area ........................................................................54 Ø New Param .............................................................................................................................55 Ø Del Param ...............................................................................................................................55 Ø Del all .....................................................................................................................................55 Ø Number of Parameters ............................................................................................................55 Ø Parameter Selected..................................................................................................................55 Ø Moving Pushbuttons (<<,<,>,>>) ...........................................................................................55

Providing Information for each Extra-parameter Area .......................................................................56 Ø Specifying the information of the extra-parameter .................................................................56 Ø Updating pushbuttons .............................................................................................................56

Displaying (Error Status) Area ...........................................................................................................56 Ø Erroneous information considerations ....................................................................................56 Ø Editable Area (Status of the current parameter)......................................................................57 Ø Color Bar (Status of the all the extra-parameters) ..................................................................57

Differences in gui_param when calling it from Matlab or from a Parameter Pushbutton..................57 EVOCOM HELP GUI: GUI_GAHELP.................................................................................................59

Selecting Area ....................................................................................................................................59 Displaying Area..................................................................................................................................59 Differences in gui_gahelp when calling it from Matlab or from another GUI ...................................60

EXAMPLES OF USE ................................................................................................................................61

Stuckman’s Problem...............................................................................................................................62 Problem Description ...........................................................................................................................62 Ø Problem Codification..............................................................................................................62 Ø Objectives Description............................................................................................................62 Ø EA Specification.....................................................................................................................62

Using EVOCOM GUI for solving the problem..................................................................................62 Multiobjective Schaffer Problem............................................................................................................78

Problem Description ...........................................................................................................................78 Ø Problem Codification..............................................................................................................78

Page 5: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 5 EVOCOM Toolbox

Ø Objectives Description............................................................................................................78 Ø EA Specification.....................................................................................................................78

Using EVOCOM GUI for solving the problem..................................................................................79 Results ................................................................................................................................................87

Finding a path in a maze.........................................................................................................................88 Problem Description ...........................................................................................................................88 Ø Problem Codification..............................................................................................................88 Ø Objectives Description............................................................................................................88 Ø EA Specification.....................................................................................................................88

Using EVOCOM GUI for solving the problem..................................................................................89 References ..................................................................................................................................................92

Page 6: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 6 Ingeniería de Sistemas y Automática

EVOCOM OVERVIEW Evolutionary computation (EC) is based on the idea of using/implementing/applying the principles that rule the biological evolution (genetic inheritance and natural selection) for solving optimization problems with computers (Darwin, 1859; Holland, 1975; Goldberg, 1989; Michalewicz, 1999).

The Matlab (for version 5.3 or posterior) Toolbox EVOCOM (EVOlutionary COMputation) ver 2.0 (developed by the System Engineering Group of the Dpto. de Arquitectura de Computadores y Automática, UCM) is an optimization toolbox which provides the framework for developing different kind of EA. It can be used as a traditional GA, or for solving genetic programming and/or multiobjective problems, and in combination with other AI techniques. It can handle different kinds of constrains, codifications (numeric and/or symbolic) and work with different domains. Its implementation highlights the common origin of the different evolutionary approaches, because it makes use of the same schema and basic steps for all of them.

EVOCOM versatility is based on a functionality approach implementation with two levels of functions. Each high level function performs one of the main steps of the EA, grouping the functionality of any possible implementations for that step. The low level functions (methods) are in charge of implementing the functionality desired for the high level function (i.e., the are input parameters of the high level functions and are called inside them). Figure 1 shows a schema of this process.

Low-level functions are responsible of specifying the solution’s properties (by generating solutions with the desired properties), implementing the objective functions and of specifying the properties of the high level functions (by implementing the tunable part of the high level function). So, the specification of the problem and the EA depends in the end on the methods selected.

The low level methods are Matlab functions which can be implemented by the user, who are only restricted to maintain the appropriate header (input output parameter) for the type of method that are implementing. A correct header is needed because each high level method provides always the same parameters to the type of methods it calls. In order to relax this restriction, the user can always provide as many extra parameters as desired at the end of a method. For this reason, both the name of the method (a Matlab string) and the extra-parameters needed for the method (usually in a cell array) are always provided to the high level functions.

EVOCOM two function levels

Low level method: Provided with the toolbox Implemented by the user

pop=ga_highlevel(t,pop,lowlevel_method,[param_lowlevel])

begin do_things pop=low_level_method(t,pop,[param_lowlevel]) do_things end

High-level: Group Main EA

Figure 1. EVOCOM versatility based on two function levels (example)

EVOCOM provides a group of structures (and functions to create/modify/get information from them) to store the information needed for specifying the properties of the solutions (individuals of the populations), the objective functions to optimize (which are strongly related with the problem to optimize), and the specification of properties of all the steps of the evolutionary algorithm. These are the individual structure, the objective structure and the EA structure (also called GA structure) respectively.

By specifying all these properties properly and filling the three structures where this information is stored, the user can call a general evolutionary algorithm provided with the toolbox and solve the problem. Considering the functional approach followed in the toolbox, what the user actually specifies in the structures to store the specifications of the problem and EA are the selected low-level method. Figure 2 shows a schema of this process.

Page 7: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 7 EVOCOM Toolbox

EVOCOM TOOLBOX

• Struture to specify the solutions (ind_str) • Structure to specify the objective functions

(objs_str)

• Structure to specify the evolutionary algorithm (gas_str)

EA SOLUTION OF THE PROBLEM

ind_str=Specify(Problem) obj_str=Specify(Objectives)

gas_str=Specify(EV-algorithm)

USER IMPLEMENTS ITS PROBLEM

USER SPECIFIES THE EA

basic_evolutionary_algorithm( ind_str, objs_str, gas_str)

Figure 2. Specifying and solving a problem with EVOCOM

The individual, objective and GA structure can be filled either with a group of Matlab function or with the EVOCOM graphic interface. The Matlab functions are already explained in the DACYA 01/01 technical report EVOCOM ver 2.0: A Multipurpose Evolutionary Algorithm Toolbox. User Manual. The GUI, which can also be used for running the general EA provided with the toolbox, is explained in this technical report. EVOCOM GUI has been designed and implemented for easy the labors of newcomers to Matlab and toolbox users, because a graphic interface seems usually friendlier when having to learn any new tool.

This report is focused on describing EVOCOM user interface and so many of the aspects of the toolbox are not explained in detail. References will be made to the sections of EVOCOM ver 2.0. User’s manual where users can get more information. Users are supposed to have some knowledge about EA in this report. A short introduction can be found in EVOCOM ver 2.0. User’s manual

Page 8: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 8 Ingeniería de Sistemas y Automática

EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM:

• GUI_IS, the individual structure graphic interface which has been designed for specifying the properties of all the methods that determine the characteristics of the chromosomes of the individuals.

• GUI_OS, the objective structure graphic interface which has been designed for specifying the properties of all the objective functions that will be used in the EA

• GUI_GAS, the EA (or GA) structure graphic interface which has been designed for specifying the properties of all the methods of the general evolutionary algorithm provided with EVOCOM.

• GUI_PARAM, the extra-parameters graphic interface, which has been designed to help users when having to provide several extra-parameters for any of the methods. This GUI can be expanded from the pushbuttons incorporated in the three previous GUIs for defining graphically extra-parameters for the different methods.

• GUI_INIT, for defining some initial information for the EA if desired. This information is a random seed and individuals of the initial population.

• GUI_EVOCOM, the main EVOCOM graphic interface, used for specifying completely the individuals, optimization problem and EA; and for then running the algorithm. This GUI can make use of GUI_IS, GUI_OS and GUI_GAS for specifying the information stored in the individual, objective and EA structure respectively

• GUI_GAHELP, the help graphic interface where all the GUIs are explained in detail. This GUI can be called from any of the previous GUIs when the user needs some guidance about what to do in each case.

Each of the five first GUIs is used to provide information to four different kind of variables related with EVOCOM: the individual structure, the objective structure, the EA structure, extra-parameter variables and initial information. All these variables are explained in detail in Evocom ver 2.0 User Manual.

All these GUIs can either be called independently directly from the Matlab prompt (by typing its name) or can be expanded from another GUI with a more general functionality. The initialization of the variables stored in the GUI and the information that can be modified in each case, depends on the way it was called:

• When calling them directly from the Matlab prompt no input parameters should be supplied to the GUIs. The variables are initialized with default values, which can be later modified by the user. All the information specified in the GUI can be saved before closing it, in order to be able to reuse it (by loading it) when theGUI is used again.

• When expanding a GUI from another, the input variables to the GUIs are used to initialize the variables with the information provided so far. This is directly done when the GUI is expanded, so user should no do anything special. When closing one of the expanded GUIs, users are asked if the new information should be returned to the calling GUI or not. In the last case, the returned variable will have the values provided when expanding the GUIs. In some cases, there are fewer options in the GUIs expanded from other GUIs than in the same GUI called directly from the Matlab prompt.

In the second case, the main GUI is gui_evocom, which can call gui_is, gui_os, gui_gas and gui_init for specifying or seeing the information stored in the individual, objective and EA structures, and the initialization information. The three first GUIs (gui_is, gui_os and gui_init) can call gui_param for helping users to specify the extra-parameters needed for the methods defined in each of the structures. Gui_gahelp can be called from any of the other five GUIs when users need some help about the information that should be supplied for each of the structures and about how to provide correctly to EVOCOM graphic interface. Gui_gahelp will be opened in the point related with the calling GUI.

Figure 3 shows the different GUIs and the relationships between them when calling one from another. The main GUI gui_evocom (top left) can be used to define the individual, objective and EA structure (the top three on the right) and the initialization information. This relationship is represented with read lines. The three structure GUIs (gui_is, gui_os and gui_gas) can make use of the parameter GUI gui_param

Page 9: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 9 EVOCOM Toolbox

(button right). This relationship is represented with pink lines. All the GUIs can call the help GUI gui_gahelp (button left) when necessary. This relation is represented with green lines.

Figure 3. EVOCOM GUIs and their relationships

Page 10: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 10 Ingeniería de Sistemas y Automática

When expanding a GUI from another, the expanding GUI is disable until the expanded GUI is closed, except in the case that the called GUI is gui_gahelp that does not need to be closed. Moreover, when gui_gahelp is already open (called from the Matlab prompt or by another GUI) and any GUI tries to expand it again, the already open gui_gahelp will be used for obtaining the information users want to obtain. In other words, only a help GUI can be opened in a Matlab session.

This report is organized in the following way. In the first section the different GUIs are explained in detail. Before proceeding with a full description of each GUI, some common aspects to all of them are presented. Then the GUIs are explained one by one, starting with gui_is and continuing with gui_os, gui_gas, gui_evocom, gui_init and gui_param and ending with gui_gahelp. Once all the GUIs have been presented, the examples included with the toolbox are explained.

Page 11: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 11 EVOCOM Toolbox

EVOCOM GUI DESCRIPTION EVOCOM is a Multipurpose Evolutionary Computation Matlab Toolbox that can be used for solving a wide range of optimization problems. The properties of the solutions of the problem, the objective functions and the properties of the EA to be used should be supplied to the toolbox in a group of well-structured variables. These variables can be filled by using a group of Matlab functions or by using EVOCOM graphic user interface. Once the variables are properly filled the general evolutionary algorithm can be run, either from the Matlab prompt or from the EVOCOM main GUI. The same functionality can be achieved in both ways.

However, when using the GUI users are restricted to run only the general evolutionary algorithm provided with the toolbox. As EVOCOM provides also all the high level functions implemented for building the general evolutionary algorithm, users are able to build their own algorithms (with the steps they want) and user’s implemented evolutionary algorithm cannot be run from EVOCOM GUIs. In spite of this fact, due to the functionality approach used in the toolbox and the kinds of populations allowed the general evolutionary algorithm lets user test a wide range of EAs such as GAs, MOEAs, GPAs, … We have been using the general algorithm for solving many different types of problems with success. Additionally, no all the steps will be necessary performed. Some of them can be skipped by no providing the necessary information for performing then. For instance if a method for the crossover is no provided, the crossover step will be skipped because the general evolutionary algorithm will not know how to perform it.

EVOCOM GUI has been designed and implemented for easy the labors of newcomers to Matlab and toolbox users, because a graphic interface seems usually friendlier when having to learn any new tool. For users than prefer to interact with Matlab directly through the command line EVOCOM GUIs can also be useful to learn about the characteristics of the toolbox. To shorten the path between both ways of interacting with the toolbox EVOCOM GUIs allow users to save the information stored in them in Matlab Script files that users are able to edit, read and run directly from the Matlab prompt. This possibility is extremely useful when once a EA and problem has been defined from the EVOCOM GUIs need to be run several times. As it is quicker to run the algorithm directly from the Matlab prompt than from the GUI, users can save it in a Matlab Script file one and then run it directly.

In this section we will describe the different GUIs presented in EVOCOM. Before proceeding with a full description of each GUI, some common aspects to all of them are presented. Then the GUIs are explained one by one, starting with gui_is and continuing with gui_os, gui_gas, gui_evocom, gui_init and gui_param and ending with gui_gahelp.

Page 12: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 12 Ingeniería de Sistemas y Automática

GENERAL CHARACTERISTICS OF EVOCOM GUIs Although each of the GUIs provided in EVOCOM are designed for a different purpose, when possible the same approach for similar type of variables or functions have been followed in all the GUIs. In this section we will explain these common characteristics implemented in all the GUIs.

Knowing the characteristics described in this section is necessary for dealing properly with EVOCOM GUI. However it can be skimmed in the first approach to this manual, and read it again later when actually interacting with EVOCOM GUI. The different aspects are presented under different headings so the information will be easily found when needed.

Calling the GUIs The GUIs can be called in two different ways:

1) Independently directly from the Matlab prompt (by typing its name). In this case no input parameters should be supplied to the GUIs. The variables are initialized with default values, which can be later modified by the user. All the information specified in the GUI can be saved before closing it, in order to be able to reuse it (by loading it) when theGUI is used again.

2) Expanded from another GUI with a more general functionality. The input variables to the GUIs are used to initialize the variables with the information provided so far. This is directly done when the GUI is expanded, so user should no do anything special. When closing one of the expanded GUIs, users are asked if the new information should be returned to the calling GUI or not. In the last case, the returned variable will have the values provided when expanding the GUIs.

The main GUI gui_evocom can call gui_is, gui_os and gui_gas for specifying or seeing the information stored in the individual, objective and EA structures; and gui_init for specifying some initial information. The three structure GUIs can call gui_param for helping users to specify the extra-parameters needed for the methods defined in each of the structures. Gui_gahelp can be called from any of the other six GUIs when users need some help about the information that should be supplied for each of the structures and about how to provide correctly to EVOCOM graphic interface.

When expanding a GUI from another, the expanding GUI is disable until the expanded GUI is closed, except in the case that the called GUI is gui_gahelp that does not need to be closed. Moreover, when gui_gahelp is already open (called from the Matlab prompt or by another GUI) and any GUI tries to expand it again, the already open gui_gahelp will be used for obtaining the information users want to obtain. In other words, only a help GUI can be opened in a Matlab session.

In gui_os and gui_gas there are fewer options if the GUIs are expanded from gui_evocom than when calling the GUIs directly from the Matlab prompt. Next figure shows the differences that appear when gui_os is called in the two ways.

a) Called directly

b) Called from gui_evocom

Figure 4. Differences in the GUI when calling it from the Matlab prompt and from another GUI

Page 13: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 13 EVOCOM Toolbox

Providing information to the Editable/Writable Elements EVOCOM GUIs have Editable/Writable Objects where information can be written. Users can write directly the information selected for that object or a name of a variable that exists in the Matlab base workspace that stores the information. The Editable/Writable Objects are easily identified because are white square boxes where the user can write (when they are enable). Figure 5 shows the Editable/Writable Objects of gui_is (under the red lines).

Figure 5 Editable/Writable objects of one of the GUIs

Some rules apply when writing in the Editable/Writable Objects:

1) The content of the Editable/Writable Object is a string that is evaluated in the Matlab base workspace and their value saved for using it when running the algorithm. Both the string and the result of evaluating the string are stored in the Editable/Writable Object: the former is used for displaying it and the last for running the algorithm. If the string cannot be evaluated the Object will be filled with a default erroneous value (usually an empty matrix []). As the Editable/Writable Object contents a string itself users do not need to surrounded by ‘’ usually. Some examples are next presented:

a. If it is written 1 the Editable/Writable object stores ‘1’ that when evaluated in the Matlab base workspace is the variable 1

b. If it is written a the Editable/Writable object stores ‘a’ that when evaluated in the Matlab base workspace is the content of the base workspace variable a. If the variable does not exist it is considered to be an erroneous variable whose contents are in almost all the Editable/Writable objects empty (that is, []).

c. If it is written [a,b] the Editable/Writable object stores ‘[a,b]’, that when evaluated in the Matlab base workspace will be a matrix with the contents of a and b variables. It is important that a and b will exist and that they are variables that can joined for building a matrix, because if it is no possible, the GUI will find the combination erroneous and fill the variable with its erroneous default content.

d. If it is written {a,b,1,[c,d]} the Editable/Writable object stores ‘{a,b,1,[c,d]}’, that when evaluated in the Matlab base workspace will be a cell array with four elements: the first the contents of the variable a, the second the contents of the variable b, the third 1, and the four a matrix build with the contents of the variables c and d. If any of the variables (a, b, c and

Page 14: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 14 Ingeniería de Sistemas y Automática

d) does not exist or the matrix [c,d] cannot be filled, the variable related with the Editable/Writable object stores its default erroneous value.

2) When using ‘’ for surrounding any part of the contents of the Editable/Writable Object, it will be understood that the user is providing an actual string. This is useful when users need to provide variables which store strings such us names of functions or string input variables. Some examples are next presented:

a. If it is written ‘1’ the Editable/Writable objects stores ‘‘1’’, than when evaluated in the Matlab base workspace will be ‘1’, which is a string variable with the tag ‘1’

b. If it is written ‘Goldberg’ the Editable/Writable objects stores ‘‘Goldberg’’, than when evaluated in the Matlab base workspace will be ‘Goldberg’, which is a string variable with the tag ‘Goldberg’. If users write only ‘Goldberg’ the GUI will try to evaluate that string and see its contents.

3) When the contents of a Editable/Writable objects is considered erroneous at evaluating it in the base working space, the string is not changed although the variable related to that Editable/Writable object is filled with its erroneous default value.

All the previous rules apply to any of the Editable/Writable objects except the ones used for providing names of methods. In that case either:

1) The name of the function that implements the method, without ‘’. For example, if the name of the method is proce_maze write in the Editable/Writable object proce_maze

2) The name of the variable that stores the name of the method, without ‘’. The contents of the variable needs to be a string and so when assigning the string to the variable do not forget to surround it with ‘’. For example, if the name of the variable that stores the name of the method (proce_maze) is method_name write in the Editable/Writable object method_name. For assigning the name of the method to the variable write in the Matlab prompt method_name=’proce_maze’.

3) Leaving the Editable/Writable object empty (without any content) to avoid providing any method. This approach can be used for not supplying any method for the cases where it is possible no specifying any method.

The names of the methods and the extra-parameters of the methods, which can be provided in Editable/Writable Objects is explained with more detail in the following section.

In some of the GUIs some extra error checking is performed. In those cases an Editable/Writable object can be considered erroneous although the previous rules have been followed. For instance if a parameter needs be a single numeric value and you provide an array, the parameter will be erroneous although the array will be correct. So, when there is an error users should first check if the information is correctly provided according with the previous rules and then if the information itself is correct. Error checking is explained with more detail in one of the following sections.

IMPORTANT

After modifying the information of any Editable/Writable object the information use the corresponding updating pushbuttons so the change really takes place. The GUIs will show warning messages if users want to see the contents of other elements of the variables before having updated the last information provided.

Providing the information of a method Methods are the low level functions used in the toolbox for specifying the properties of the population, the objective functions and the characteristics of the EA steps. Many methods are already provided in the toolbox although users can implement their own ones if desired. They are the end responsible of the behavior of the EA that will be run when calling the general evolutionary algorithm provided with the toolbox. More information about methods and the functionality approach followed in EVOCOM can be seen in the Implementation Overview section of EVOCOM ver 2.0. User’s Manual.

Each type of method implements part of the functionality of a high-level function which calls it when needed. All the methods implemented for the same high-level function must maintain a common header with the same group of input and output parameters. After the common input parameters it is possible to

Page 15: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 15 EVOCOM Toolbox

provide more parameters to the method so the behavior of a method can depend in a group of variables that users should select. For instance, when generating binary numbers randomly no extra information need be provided but for generating integer number randomly in a range the range can be defined.

All the methods are specified by the name of the Matlab function where they are implemented and by the extra-parameters needed for it. The variables used for defining the problem, the objective functions and the EA store this information. In the three GUIs used for the same definition tasks (gui_is, gui_os and gui_gas) this information should also be provided. For each of type of method that should be defined in each of the GUIs four objects are always present, two for the name of the method, and the others for the extra-parameters. The name of the method can be specified by writing it in an editable object or selected by pushing a pushbutton. The extra-parameters can be specified by writing then in an editable object or by expanding the extra-parameter GUI gui_param by pushing a pushbutton. The four objects used for providing the objective function (which are also methods) in gui_os are presented in the next figure as an example.

Method Name

Extra Parameters

Parameter Pushbutton

Parameter Edit Object

Name Edit Object

Name Pushbutton

Figure 6. Objects for specifying a method

It is important that all the folders where the methods specified with EVOCOM GUIs will be in the Matlab path before running the algorithm, because as they will be actually called by the general evolutionary algorithm, if they are not in the path there will be an error.

Ø Method Names When using EVOCOM GUIs the name of the methods can be specified in two ways:

1) Writing the name of the Matlab function where the method is implemented or the name of a variable where a string with the name of the method is stored in the Edit Name Object. When writing the name of the method, no ‘’ should surround it. When assigning the name of the method to a variable that will be written in the Edit Name Object, remember that the variable should contain a string and so the name should be surrounded by ‘’

2) Pushing the Name Pushbutton object. In this case a browser window is opened so the user can select the Matlab function where the method is implemented. When closing the browser window the name of the selected function (without ‘’) will be written in the Edit Name Object. The browser window will let users move from a folder to another. The folder from which the method is selected will become the current path-working directory for EVOCOM GUIs. Remember that before running the specified algorithm all the selected methods should be in the Matlab path. So, it is advisable to have all the methods in the same path. The methods provided with EVOCOM will be already in the path, so there is no need to be worried about them.

Figure 7 shows the browser window expanded when pushing the Name Pushbutton object of the objective structure GUI gui_os for defining the objective function.

Page 16: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 16 Ingeniería de Sistemas y Automática

Figure 7. Specifying the name of a method by using a name pushbutton object

IMPORTANT

The browser will no display usually all the Matlab function files in the current folder. It will show the files whose name starts with the group of letters that have been used in the toolbox for identifying each group of methods. For instance if the method should be a generating law method, it will display the functions in the current folder whose name starts with gen_. Users can implement a method with a different group of starting letters; they have been only used for identifying easier the functionality of the method.

If displaying objective function methods, all the files in the current folder will de displayed, because the toolbox does not have a starting group of letters for this kind of functions.

Ø Extra-parameters When using EVOCOM GUIs the extra-parameters can be provided in one of the following forms:

1) Writing in the Parameter Edit Object the contents of the extra-parameter variable or the name of a variable that contains the extra parameters. In this manual we will only explain how to write the contents of an extra-parameter variable directly in the Parameter Edit Object because how to fill an extra-parameter variable is explained in the Handling Extra-parameters section of the EVOCOM ver 2.0. User’s manual.

When writing directly the contents of the extra-parameter variable in the Parameter Edit Object the following cases can be considered:

a) When no extra-parameters are needed write in the Parameter Edit Object

• [] • {} • (that is, leave it empty)

b) When only one extra-parameter is needed (say for instance a) write in the Parameter Edit

Object: • a • {a}

c) When several extra parameters are needed (say for instance a, b and c) write in the

Parameter Edit Object • {a,b,c}

Page 17: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 17 EVOCOM Toolbox

IMPORTANT

If there is a unique extra-parameter and it happens to be a cell array with several elements (for instance {m,n}, and you are writing in the Parameter Edit Object the contents of the variable directly write {{m,n}} to avoid that the toolbox will consider it as several extra-parameters (in the example 2).

2) Pushing the Parameter Pushbutton object. In this case the parameter GUI gui_param will be called to let users specify the extra-parameters by using that GUI. When finishing the returned information will be written in the Edit Parameter Object with one of the formats explained before.

Figure 8 shows the gui_param expanded when pushing the Parameter Pushbutton object of the objective structure GUI gui_os for defining the objective function. In this example no extra-parameters are needed and so the Parameter Edit Object has nothing and the expanded gui_param has not any parameter defined.

Figure 8. Specifying the extra parameters of a method by using a parameter pushbutton object

Erroneous information The information of the Editable/Writable objects (explained in the section providing information to the Editable/Writable objects and in the section providing information of a method) is checked to see if it is erroneous or not. In all the cases, the information is evaluated according with the rules explained in the section providing information to the Editable/Writable objects.

In gui_is and gui_os a deeper error checking is performed to consider the information completely free of error. The name provided for the methods selected should be in the Matlab path and the extra-parameters provided should be correct for that method. This checking is performed by actually calling the selected methods with its habitual input and output parameters and with the extra parameters provided. If the method succeeds, the information is considered free of error.

This type of checking has no been performed with gui_gas because it contains a lot of information and checking all of it is no that straightforward. When running the algorithm from gui_evocom if the information provided is no correct, the general evolutionary algorithm will be interrupted and a warning message about the cause of the error will be displayed.

Page 18: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 18 Ingeniería de Sistemas y Automática

Editable Area and Color Bars In gui_is, gui_os and gui_param the information obtained after evaluating the Editable/Writable Objects is displayed in an Editable area (big white square button left) and the error status of each of the elements of these array variables (the individual structure and the objective structure in the cases of gui_is and gui_os, and the cell array in the case of gui_param) is shown in a color bar. The elements of the arrays with correct information are represented in green and the elements of the arrays with erroneous information represented in red. Additionally, the Editable/Writable objects with information considered erroneous will be displayed with red letters (if no erroneous in black).

Figure 9 shows gui_is when two chromosomes have been defined, the first filled with correct information and the second filled with some erroneous information.

a)First chromosome

b) Second chromosome

Figure 9. GUI with identified erroneous information

The color bar will show the status error of the two chromosomes (green –free of error- for the first chromosome- and red –with some error- for the second one). In this GUI the displayable area can only show the information of a chromosome at any time. By using the top right moving buttons (<<,<,>,>>)

Page 19: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 19 EVOCOM Toolbox

the current chromosome will be selected. We will show in the figure the state of the GUI in two different moments, so the information of the two chromosomes can be seen. Note that in the first case (first chromosome) all the Editable/Writable objects have black letters (because the information is all correct) while in the second some of them have red letters. The reason they are considered wrong can be seen in the displayable area.

Ø Useful tip for identifying the cause of errors when running the specified EA When using gui_evocom for running the general evolutionary algorithm, if the information provided in the individual, objective or GAS structure is not correct, the algorithm will end with an error message. The cause of the error can be seen in the Matlab prompt. If the provided information does not help you to identify the real cause of error you can save all the information stored in the GUI is a Matlab script (with one of the menu options) that called from the Matlab prompt will run the same algorithm that the GUI is trying to run. If there is an error while running the algorithm the same error will occur when running the Script from Matlab. The advantage of the second way of running the algorithm when having errors is that more information is displayed in the Matlab prompt and the cause of error more easily identified.

Menu Bar In all the GUIs there is a menu bar which contains several menus. In this section we will only explain the menus presented- and organized in the following way- in several GUIs. These menus are the OPTION and HELP. They are next presented.

Ø Options Menu This menu present in gui_is, gui_os, gui_gas, gui_evocom, gui_init and gui_param is used for loading and saving information and for resetting the GUI. The options presented in this menu can be seen in the following figure (which shows the options menu for gui_evocom).

Figure 10 Options menu

Each of the options is used by the following purposes: LOAD: The variables that can be specified in the GUI can be load from an EVOCOM data file

(where were saved before). The file should be a Matlab data file generated with an EVOCOM GUI. Selecting this option opens a window path browser for selecting the name of the file.

SAVE: The variable specified in the GUI can be saved in files. This option displays another menu with the following four different options:

• Data File: The information will be saved in an EVOCOM data file that can be later used for loading. If the name of the saving file has already been supplied it saves it in that file directly

• Data File As: The information will be saved in an EVOCOM data file that can be later used for loading. The name of the file is asked to the users by opening a window path browser for selecting the name of the file.

• M-File: The information is saved in a Matlab Script that can be run for obtaining variables with the same values as the ones stored in the GUI. If the name of the Matlab script has already been provided, it saves it in the same file directly without asking

Page 20: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 20 Ingeniería de Sistemas y Automática

• M-File: The information is saved in a Matlab Script that can be run for obtaining variables with the same values as the ones stored in the GUI. The name of the file is asked by opening a window path browser for selecting the name of the file.

RESET: The variables stored in the GUI are reset to its initial value. As the initial value depends on how the GUI was called (directly from the Matlab prompt or expanded from another GUI) the initial value used for reset depends also on the way of calling the GUI:

• If called from the Matlab prompt resetting will fill the variables with the default initial value

• If called from another GUI resetting will fill the variables with the value provided when calling the GUI

IMPORTANT

The names of the saving files are maintained in internal variables while user does not close the current GUI. Once closed, the names are forgotten and so when opening them again users should always supply the name for the first case. The Reset option also deletes the names of the files.

Ø Help Menu This menu present in all the GUIs is used for helping purposes. The options presented in this menu can be seen in the following figure (which shows the help menu for gui_evocom).

Figure 11 Help menu

Each of the options of this menu is used for the following purposes: HELP MENU: When selecting this option gui_gahelp is called and expanded. If there is a help menu

already expanded a new one will no be created to avoid creating too many windows.

ABOUT: Shows information about EVOCOM, displaying the following window.

Figure 12. About EVOCOM window

Page 21: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 21 EVOCOM Toolbox

Closing a GUI Once you have finished using any of the GUIs close them by pressing the X button (top right). The closing behavior depends on the way the menu was called:

1) If the GUI is called from the Matlab prompt and the information about the variables stored in the GUI have been changed and updated users will be warned of the possibility of loosing the information stored if proceeding. Figure 13a) shows this warning message.

2) If the GUI is called from another GUI and the information about the variables stored in the GUI have been changed and updated users are asked if they want to return the new information to the calling GUI, maintain the old information or stay in the called GUI. Figure 13b) shows the window displayed.

a) Exiting when direclty called

b) Exiting when linked

Figure 13. Exiting messages

Page 22: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 22 Ingeniería de Sistemas y Automática

INDIVIDUAL STRUCTURE GUI: GUI_IS The individual structure is used for specifying the characteristic of the solutions (individuals) of the problem. Each individual can be composed by several chromosomes (parameters to be optimized) and each chromosome codified with several genes. The population can then be implemented in its genetic and chromosome representation level. The individual structure stores all the information used for generating new genes for new individuals when needed, translating the genes into the chromosomes and in case it is necessary repairing the genes of the individuals that are not in the correct range. The characteristics of the populations and of the individual structure are explaining in detail in the Codification of the solutions of the problem section of GUI ver 2.0. User’s Manual

For each of the chromosomes the following information is specified:

1) Number of genes of the chromosome, which can be fixed or variable (because EVOCOM allows the implementation of chromosomes with constant or variable number of genes). This parameter always needs to be specified.

2) Genes coding and domain, specified by the function (law-generating method) which implements the law for generating “randomly” new genes, that is the function which returns genes with the coding and domain necessary for the problem. It is used in the initialization operator. It is always necessary to specify this function.

3) Chromosomes coding and domain, specified by the function (mapping method) that maps the set of genes that constitute a chromosome into the chromosome itself. It is used in the mapping operator. It is always necessary to specify this function

4) A function (repair method) for checking and restoring genes out of domain, if needed (when the EA is using genetic operators that do not ensure that the domain is maintained). It is used in the crossover and mutation operators. This function does not need to be specified (in that case, no checking will be performed).

All this information can be provided to the individual structure with gui_is. In this section we will explain in detail how to provide all this information to this GUI. In the following figure the GUI is presented (as it is when just created by calling it from the Matlab prompt) and their three main areas highlighted with different colors. The different areas are explained in the following sections.

Displaying (Error Status) area

Creating/Destroying/Selecting chromosome area

Providing information for each chromosome area

Figure 14. Main areas of the Individual Structure Graphic User Interface

Page 23: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 23 EVOCOM Toolbox

Creating/Destroying/Selecting Chromosome Area This area is used for creating an individual structure for storing the information of as many chromosomes as the solution of the problem will need. The space for storing each chromosome is created by using the New chrom and Copy chrom pushbuttons. It is also possible to delete the space (and so the information) of any existing chromosome or delete the whole individual structure. For these purpose the Delete chrom and Delete all pushbuttons have been created.

The number of total chromosomes is also displayed and the number of the chromosome whose information is displayed in the other two areas is also presented. Using the moving pushbuttons (<<,<,>,>>) the user can select other chromosome.

When the individual structure is empty, only the New chrom pushbutton is enable. When the individual structure stores the information of only one chromosome the moving pushbuttons are disable. When more than a chromosome exists and the first one is the selected one the < and << pushbuttons are disable while if the last chromosome is the selected one the > and >> pushbuttons are disable.

This area is displayed in the following figure. In the example a total of 4 chromosomes have been created and in the other areas the information of the 2nd chromosome will be displayed.

Figure 15. Creating/Destroying/Selecting Chromosome Area

All the elements of this area are explained with more detail in the following sections. Ø New chrom This pushbutton should be used for creating the space for the information for a new chromosome. The information of the new chromosome is placed in the last position of the individual structure. The number of chromosomes is incremented and the selected chromosome becomes the new created one (the last). The area created for the new chromosome is filled with default values:

Number of genes: 10 Fungen: gen_bin Paramgen: [0 1] Funeval: gev_bin Parameval: [0 10] Funrepair: Paramrepair:

Ø Copy chrom This pushbutton should be used for creating the space for the information for a new chromosome filling it with the same information as the one in the currently selected chromosome. The information of the new chromosome is placed in the last position of the individual structure. The number of chromosomes is incremented and the selected chromosome becomes the new created one (the last).

Page 24: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 24 Ingeniería de Sistemas y Automática

Ø Delete chrom This pushbutton should be used for deleting the information (and the space) of the currently selected chromosome. The number of chromosomes is decremented and the selected chromosome becomes the last one, except in the case where no chromosomes are left (because only one existed before deleting it).

Ø Delete all This pushbutton should be used for deleting all the information of all the chromosomes and so start from an empty individual structure.

Ø Total Num Chrom It displays the total number of chromosomes defined in the individual structure so far. When the individual structure is empty nothing is displayed beside this tag.

Ø Selected Chrom It displays the number of the currently selected chromosome, whose information is displayed in the providing information of each chromosome and displaying areas. For changing the currently selected chromosome use the moving pushbuttons.

Ø Moving Pushbuttons (<<,<,>,>>) These pushbuttons should be used for selecting the currently selected chromosome. By pressing:

< the selected chromosome will be the previous of the current one << the selected chromosome will be the first one

> the selected chromosome will be the next of the current one >> the selected chromosome will be the last one

Providing Information for each Chromosome Area This area is used for changing all the information (number of genes, generating-law method, mapping method and repair method) for the currently selected chromosome (whose number is shown by the Selected Chrom tag of the Creating/Deleting/Selecting chromosome area). In the following figure this area is presented and the different parts highlighted with different colors. Inside the red square the objects used for specifying the generating-law method are present, inside the green the ones for the mapping method, inside the yellow the ones for the repair methods, and in the light blue the ones for the number of genes. The information is updated (put in the individual structure) after pushing the update buttons.

Method names

Extra- parameters

Generating-law method

Mapping method

Repair method

Number of genes

Updating the individual structure

Figure 16. Providing information for each chromosome area

Page 25: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 25 EVOCOM Toolbox

Ø Specifying the methods of the individual structure For specifying each of the methods it is necessary to provide both the name of the method and its extra-parameters. The names of the three methods related with the individual structure are provided with the objects in the first two rows and the extra-parameters with the elements in the two following rows. Section Providing the information of a method of this manual explains how to provide the names and extra-parameters of the methods using EVOCOMOM GUIs by using the Name Pushbuttons (first row of this GUI), Name Edit Objects (second row), Parameter Pushbuttons (third row) and Parameter Edit Objects (fourth row).

The law-generating method should be specified with the four elements in the first column, the mapping method with the four elements in the second column, and the repair method with the four element of the third column. When using the Name Pushbuttons for selecting the method name, the browser window will show the functions whose name starts with gen_ for the generating-law method, gev_ for the mapping method and repair_ for the repair method.

It is necessary to specify always the law-generating method and the mapping method (and so their names). Specifying repair methods is up to the users (if the other operators of the toolbox maintain the genes in their correct domain these methods are not needed and no supplying them will make the toolbox go faster). Users can select any of the methods already provided with the toolbox or implement new ones. For implementing new methods, users should maintain the proper header. See the Individual Structure Methods section of EVOCOM ver 2.0. User’s manual.

The Editable/Writable objects of this section are written in black when the information is considered correct after updating it, red if it is considered erroneous and green if it has been modified and no update it. When the information is considered erroneous is explained in the Displaying (Error Status) Area section of this GUI.

Ø Specifying the number of genes The Editable/Writable object placed by the Genes tag is used for providing the number of genes for the current chromosome. The number of genes variable can be:

1) A single integer value, for specifying chromosomes with a fixed number of genes.

2) An array with two integer values, for specifying chromosomes with variable number of genes, where the number of genes is in the gen_number=[a,b] range

3) An empty variable, for specifying chromosomes with variable number of genes, where the number of genes is determined by the generating-law method

The Editable/Writable object of this section is written in black when the information is considered correct after updating it, red if it is considered erroneous and green if it has been modified and not updated it. When the information is considered erroneous is explained in the Displaying (Error Status) Area section of this GUI.

Ø Updating pushbuttons The information provided in this area is not updated in the individual structure variable until any of the updating buttons is pushed. We decided not to update the values after modifying them in case users want to return to the ones defined before. After modifying the information use the pushbuttons for updating the information provided. There are two pushbuttons in this area:

Update chrom should be used for updating the information of the currently selected chromosome

Update all can be used for updating the information of all the chromosomes of the individual structure with the information shown in the Editable/Writable objects presented in this area.

If the information of the Writable/Editable elements of this area is changed and no updated, and any of the pushbuttons of the Creating/Deleting/Selecting chromosomes area are pushed the GUI will displayed a warning message to ask if users want to update the information before proceeding or not. The information of the changed Writable/Editable objects is displayed in green to help users remember what elements they have changed.

Page 26: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 26 Ingeniería de Sistemas y Automática

Displaying (Error Status) Area This area is used for showing if the information about the currently selected chromosome and of the whole individual structure is valid or not. It consists of a text displaying area where the status of the current individuals structure is displayed and of a color bar where the status of all the elements of the individual structure are present. In the following figure this area is presented.

Editable Area (Status Current Chromosome)Color Bar (Status of all the Chromosomes)

Figure 17. Displaying (Error Status) area

Ø Erroneous information considerations Information is considered to be correct according with the rules for providing method names, extra-parameters and any kind of parameters (see Providing information to the Editable/Writable Elements and Providing the information of a Method sections). Additionally this GUI performs extra-error checking calling the selected methods with its habitual input and output parameters and the extra-parameters provided. So, the function should be in the Matlab path or in the current directory. If the method succeeds, the information is considered free of error. When there is an error in the method check first if the extra-parameters provided are correct and if that happens, consider the possibility of being working with a method no correctly implemented.

IMPORTANT

As the mapping and repair methods have a genetic population as one of its input parameters and the generating-law can be used for generating the genes of a population, if the generating-law method does not succeed it is no possible to check if the other two methods are working properly. By default they are considered erroneous, so it is necessary to provide the information of the generating method correctly before knowing if the information of the other two methods is correct or not.

The number of genes needs to be in one of the correct formats to decide if the other information is or no erroneous. So, if this information is no correct the methods will be considered all wrong (because it is necessary to provide the number of genes to use the generating-law method).

Additionally if the function is not in the path or does not exist, its parameters are considered erroneous by default.

Ø Editable Area (Status of the current chromosome) In this area the error status of the information of the currently selected chromosomes is displayed. The information is arranged in several lines:

1) Number of the currently selected chromosome 2) Gen_number: Number of genes information or an error message related with this field 3) Fungen: name of the generating-law method or an error message related with this field 4) Paramgen: extra-parameters of the generating-law method or an error message related with this field 5) Funeval: name of the mapping method or an error message related with this field 6) Parameval: extra-parameters of the mapping method or an error message related with this field

Page 27: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 27 EVOCOM Toolbox

7) Funrepair: name of the repair method or an error message related with this field 8) Paramrepair: extra-parameters of the repair method or an error message related with this field

When the individual structure is empty instead of showing the information previously explained the message The individual structure is empty is displayed.

Ø Color Bar (Status of the all the chromosomes) A color bar is used to represent the error status of the information of all the chromosomes stored in the individual structure variable.

The bar is divided in as many elements (rectangles) as chromosomes are specified in the individual structure. The first rectangle represents the first chromosome, the second rectangle to the second chromosome and so on. The width of each rectangle is related with the number of genes of each chromosome, so chromosomes with many genes will have a wider rectangle than chromosomes with less genes. For chromosomes whose number of genes is variable or whose number of genes will be determined by the generating-law method the presented rectangle will have the width corresponding with a chromosome with 10 genes.

The color of each rectangle identifies the error status of each chromosome:

1) Green: all the information for that chromosome is considered free of error.

2) Light Grey: the information provided for the number of genes is not in one of the three defined formats (single integer, a two element numeric array or an empty matrix)

3) Red: the information is erroneous for any other case. Read the information of the Editable area and see which Editable/Writable objects of the Providing Information for each Chromosome area are written in red to identify the causes of error.

The currently selected chromosome has one of the previous error status colors but in a lighter version. So, the color bar can also be used to identify the currently selected chromosome: it is the one that highlights over the remaining ones. So it will be in light-green, white, or light red. Use the moving buttons (<<,<,>,>>) to see how the lighter element moves.

When the individual structure is empty, the color bar disappears.

Differences in gui_is when calling it from Matlab or gui_evocom There are no important differences when calling this GUI directly from the Matlab prompt (typing gui_is) and when calling it from gui_evocom (pressing the define pushbutton of gui_evocom when the individual structure is selected in the list menu of gui_evocom). The same objects will be present in both cases.

When calling the GUI from the Matlab prompt is always initialized with an empty individual structure. So, resetting the individual structure (using the reset entry of the options menu) will have the same effect as deleting the individual structure. When closing this GUI if there is a no empty individual structure, users will be asked if they want to save the information because if there has not been yet saved it will be lost.

When calling the GUI from gui_evocom the individual structure stored in gui_evocom is provided to gui_is and use it to initialize its individual structure. So, resetting the individual structure (using the reset entry of the options menu) will initialize it to the input provided value. If you want to delete all the information of the individual structure, use the Delete all pushbutton. When closing this GUI if the information is different to the initialization one, users will be asked if they want to return the new information, return the original information or stay working with gui_is.

Page 28: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 28 Ingeniería de Sistemas y Automática

OBJECTIVE STRUCTURE GUI: GUI_OS The objective structure is used for specifying objective functions used for optimizing the problem. EVOCOM can be used for solving mono or multi objective problems. The objective values assigned to each of the individuals are used to decide which individuals are the best and so to guide the search performed by the EA. When solving a mono-objective problem, the objective value is obtained by a unique function. In multi-objective problems, the user can implement a unique function that returns all the objectives; a different function for each objective; or several functions, each returning several of the objectives. The objective functions need to be implemented as Matlab functions (but inside the Matlab functions, it is possible to call external processes, C functions, …, so this requirement is not restrictive).

The objective values are obtained from the chromosome population level by means of the objective functions. That is, the objective values are obtained from the chromosomes, which have been obtained from the genes using the mapping functions. The codification selected for the chromosomes (that can be either a numeric of cell matrix) determines how to implement the objective functions, because different access symbols should be used to access the elements of a numeric or cell matrix.

The implementation of objective functions and the codifications of chromosome populations are explained in the Objective Specification and Population implementation sections of GUI ver 2.0. User’s Manual.

The objective structure (an array of structures) stores all the information necessary for each of the objective functions implemented for the problem. For each objective function, the objective structure stores in each of its elements:

1) Name of the objective function, which is a string containing the name of the objective function.

2) Extra parameters needed for the objective function (so the function can depend on more parameters than on the chromosomes, although the values of this additional parameters should be selected by the user and are not optimized by EVOCOM)

3) The number of objectives returned by the objective function for an individual. It is necessary that this number and the number of objectives actually returned by the toolbox will be the same.

All this information can be provided to the objective structure with gui_os. In this section we will explain in detail how to provide all this information to this GUI. In the following figure the GUI is presented (as it is when just created by calling it from the Matlab prompt) and their three main areas highlighted with different colors. The different areas are explained in the following sections.

Providing the information for each Objective Function area

Creating/Destroying/ Selecting Objective Function area

Displaying (Error Status) area

Figure 18. Main areas of the Objective Structure Graphic User Interface

Page 29: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 29 EVOCOM Toolbox

Creating/Destroying/Selecting Objective Function Area This area is used for creating the objective structure for storing the information of as many objective functions as the problem will need. The space for storing each objective function is created by using the New Obj pushbutton. It is also possible to delete the space (and so the information) of any existing objective function or delete the whole objective structure. For these purpose the Del Obj and Del All pushbuttons have been created.

The number of total objective functions is also displayed and the number of the objective function whose information is displayed in the other two areas is also presented. Using the moving pushbuttons (<<,<,>,>>) the user can select other objective function.

When the objective structure is empty, only the New Obj pushbutton is enable. When the objective structure stores the information of only one objective function the moving pushbuttons are disable. When more than a objective function exists and the first one is the selected one the < and << pushbuttons are disable while if the last objective function is the selected one the > and >> pushbuttons are disable.

This area is displayed in the following figure. In the example a total of 2 objective functions will be used and in the other areas the information of the 1st objective function will be displayed.

Figure 19. Creating/Destroying/Selecting Objective Function Area

All the elements of this area are explained with more detail in the following sections. Ø New Obj This pushbutton should be used for creating the space for the information for a new objective function. The information of the new objective function is placed in the last position of the objective structure. The number of objective functions is incremented and the selected objective function becomes the new created one (the last). The area created for the new objective function is filled with default values:

Function: (that is empty string) Parameter: (that is empty string) Number of objectives: 1

Ø Del Obj This pushbutton should be used for deleting the information (and the space) of the currently selected objective function. The number of objective functions is decremented and the selected objective function becomes the last one, except in the case where no objective functions are left (because only one existed before deleting it).

Page 30: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 30 Ingeniería de Sistemas y Automática

Ø Del all This pushbutton should be used for deleting all the information of all the objective functions and so start from an empty objective structure.

Ø Number of objective functions It displays the total number of objective functions defined in the objective structure so far. When the objective structure is empty nothing is displayed beside this tag.

Ø Selected Objective It displays the number of the currently selected objective function, whose information is displayed in the providing information of each objective function and displaying areas. For changing the currently selected objective functions use the moving pushbuttons.

Ø Moving Pushbuttons (<<,<,>,>>) These pushbuttons should be used for selecting the currently selected objective function. By pressing:

< the selected objective function will be the previous of the current one << the selected objective function will be the first one

> the selected objective function will be the next of the current one >> the selected objective function will be the last one

Providing Information for each Objective Function Area This area is used for changing all the information (name of the function, extra-parameters and number of objectives returned by the function) for the currently selected objective function (whose number is shown by the Selected Objective tag of the Creating/Deleting/Selecting objective function area). In the following figure this area is presented and the different parts highlighted with different colors. Inside the red square the objects used for specifying the name of the objective functions are present, inside the green the ones for the extra-parameters, and in the yellow the ones for the number of objectives returned for the objective function. The information is updated (put in the objective structure) after pushing the update buttons.

Function name

Updating the Objective Structure

Extra-parameter

Number of Obj

Figure 20. Providing information for each objective function area

Ø Specifying the function of the objective structure For specifying the objective function it is necessary to provide both the name of the method and its extra-parameters. The names of the function are provided with the objects in the first row and the extra-parameters with the elements in the following row. Section Providing the information of a method of this manual explains how to provide the names and extra-parameters of the methods using EVOCOMOM

Page 31: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 31 EVOCOM Toolbox

GUIs by using the Name Pushbutton (first row left of this GUI), the Name Edit Object (first row left), the Parameter Pushbutton (second row left) and the Parameter Edit Object (second row left).

It is necessary to specify always the objective functions (and so their names). For implementing the objective functions, users should maintain the proper header. See the Objective Functions section of EVOCOM ver 2.0. User’s manual.

The Editable/Writable objects of this section are written in black when the information is considered correct after updating it, red if it is considered erroneous and green if it has been modified and no update it. When the information is considered erroneous is explained in the Displaying (Error Status) Area section of this GUI.

Ø Specifying the number of objectives returned for the objective function The Editable/Writable object placed by the Number of objectives tag is used for providing the number of objectives that the currently selected objective function will return. It must be a single integer value bigger than 0.

The Editable/Writable object of this section is written in black when the information is considered correct after updating it, red if it is considered erroneous and green if it has been modified and not updated. When the information is considered erroneous is explained in the Displaying (Error Status) Area section of this GUI.

Ø Updating pushbuttons The information provided in this area is not updated in the objective structure variable until any of the updating buttons is pushed. We decided not to update the values after modifying them in case users want to return to the ones defined before. After modifying the information use the pushbuttons for updating the information provided. There are two pushbuttons in this area:

Update objective should be used for updating the information of the currently selected objective function

Update all can be used for updating the information of all the objective functions of the objective structure with the information shown in the Editable/Writable objects presented in this area.

If the information of the Writable/Editable elements of this area is changed and no updated, and any of the pushbuttons of the Creating/Deleting/Selecting objective function area are pushed the GUI will displayed a warning message to ask if users want to update the information before proceeding or not. The information of the changed Writable/Editable objects is displayed in green to help users remember what elements they have changed.

Displaying (Error Status) Area This area is used for showing if the information about the currently selected objective function and of the whole objective structure is valid or not. It consists of a text displaying area where the status of the current individuals structure is displayed and of a color bar where the status of all the elements of the objective structure are present. There is an additional area related with the individual structure, whose contents depends on the way gui_os has been called. The individual structure area is used when calling gui_os from the Matlab prompt for obtaining the information of an individual structure that will be used for error checking purposes. The individual structure area is used when calling gui_os from gui_evocom only from displaying a message about the existence or no of the individual structure. In the following figure the displaying area is displayed for the case of having called gui_os directly from Matlab when the individual structure has been already loaded.

Page 32: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 32 Ingeniería de Sistemas y Automática

Color Bar (Status of all the Objective Functions)

Editable Area (Status of the current Objective Function)

Individual Structure Area

Figure 21. Displaying (Error Status) area

Ø Erroneous information considerations Information is considered to be correct according with the rules for providing method names, extra-parameters and any kind of parameters (see Providing information to the Editable/Writable Elements and Providing the information of a Method sections).

Additionally this GUI can perform extra-error checking when it can create a chromosome population for testing the objective functions stored in its individual structure variable. For this reason, when calling gui_os from the Matlab prompt users are allowed to load an individual structure (using the objects in the individual structure area) and when calling gui_os from gui_evocom the individual structure is provided if it has already been defined/load in gui_evocom. When the extra-checking can be performed, all the objective functions and methods defined in the individual structure should be in the Matlab path or in the current directory. If the objective function succeeds and returns the same number of objectives as the user has specified in Objective Number, the information is considered free of error. When there is an error in the objective functions, check first if the extra-parameters provided are correct and if that happens, consider the possibility of being working with a objective function no correctly implemented or that does not return the specified number of objectives. When the objective functions are not in the path or do not exist, its parameters are considered erroneous by default.

Ø Individual Structure Area The individual structure Area contents depend on the way gui_os is called. The following figure shows the individual structure area when calling if the Matlab prompt (left) and from gui_evocom (right), which will be described in detail next.

a) when called from Matlab

b) when called from gui_evocom

Figure 22. Individual Structure area

Page 33: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 33 EVOCOM Toolbox

• When calling gui_os from the Matlab prompt the individual structure area of this GUI has several objects for letting users load an individual structure from a file. The objects presented in this area has the following functionality:

o Check using the individual structure information radio button, which is used for enabling the possibility of performing the extra-checking (and so loading the individual structure) or not:

§ When enabling the possibility, a path browser window is opened to let users select the file where the individual structure is saved. Additionally, all the other objects of this area are also enable, so users can provide the name of the file where the individual structure is saved and decide if the genetic and chromosome population will have a numeric or cell implementation. The name of the selected file is displayed in the Editable/Writable object of this area.

§ When disabling this possibility, the individual structure stored so far is removed and all the other objects of this area disable.

o The IND_STR file pushbutton can be used for opening a path browser for selecting the name of the file where the individual structure to be loaded. If an individual structure was already loaded, the new one will substitute the old. The name of the selected file is displayed in the Editable/Writable object of this area.

o The Editable/Writable object is used for showing the name of the file from which the individual structure is loaded. Writing a name of a new file and pressing enter will make this GUI load a new individual structure.

o Gen popup menu is used for deciding in the genetic population should be implemented in a numeric matrix (Gen Matrix) or in a cell matrix (Gen Cell). Information about the implementation of the genetic population can be found in the Population Implementation section of the EVOCOM ver 2.0. User’s Manual.

o Chrom popup menu is used for deciding in the chromosome population should be implemented in a numeric matrix (Ghrom Matrix) or in a cell matrix (Chrom Cell). Information about the implementation of the chromosome population can be found in the Population Implementation section of the EVOCOM ver 2.0. User’s Manual.

All the objects of this area are disable while the objective structure is empty. When the first element of the objective structure is created, the Check using the individual structure information radio button is enable to let users decide if they want to perform the extra error checking or not. When the objective structure becomes empty due to the deletion of objective functions or the reset of gui_os all the elements are disable again and if there is an individual structure loaded it will be removed.

• When calling gui_os from gui_evocom the individual structure area is used for displaying a message to let users know if an individual structure is loaded (because it was already loaded/defined in gui_evocom) or not. The displayed messages are:

o The individual structure is filled and so the objective structure is checked according with that information

o The individual structure is empty and so the objective structure cannot be checked.

Ø Editable Area (Status of the current Objective Function) In this area the error status of the information of the currently selected objective function is displayed. The information is arranged in several lines:

1) The number of the currently selected objective function 2) Function: name of the generating-law method or an error message related with this field 3) Param: extra-parameters of the objective function or an error message related with this field 4) Objective: Number of objective values returned for the objective function or an error message related

with this field 5) If the individual structure is no loaded a message warning users about the impossibility of checking

the contents of the objective structure completely. When the objective structure is empty instead of showing the information previously explained the message The objective structure is empty is displayed.

Page 34: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 34 Ingeniería de Sistemas y Automática

Ø Color Bar (Status of the all the objective functions) A color bar is used to represent the error status of the information of all the objective functions stored in the objective structure variable.

The bar is divided in as many elements (rectangles) as objective functions are specified in the objective structure. The first rectangle represents the first objective function, the second rectangle to the second objective function and so on. The width of each rectangle is related with the number of objective values returned by each objective functions, so objective functions that return many objective values will have a wider rectangle than chromosomes returning less objective values.

The color of each rectangle depends on the error status of each objective function and on the kind of error checking that can be performed. We have decided to use a different color schema when there is no an individual structure loaded in gui_os because less error checking is performed in that case.

• If there is an individual structure loaded the color schema is:

1) Green: all the information for that objective structure is considered free of error.

2) Red: the information for the objective structure is erroneous. Read the information of the Editable area and see which Editable/Writable objects of the Providing Information for each Objective Function area are written in red to identify the causes of error.

• If there is not an individual structure loaded all the rectangles will be Grey

The currently selected objective function has one of the previous colors but in a lighter version. So, the color bar can also be used to identify the currently selected objective function: it is the one that highlights over the remaining ones. So it will be in light-green, light red or white. Use the moving buttons (<<,<,>,>>) to see how the lighter element moves.

When the objective structure is empty, the color bar disappears.

Differences in the gui_os when calling it from Matlab or gui_evocom The main difference in the gui_os presented when calling it directly from the Matlab prompt (typing gui_os) and when calling it from gui_evocom (pressing the define pushbutton of gui_evocom when the objective structure is selected in the list menu of gui_evocom) is the content of the individual structure area of the displaying area, which is explained in the individual structure area section of this GUI.

When calling the GUI from the Matlab prompt is always initialized with an empty objective structure. So, resetting the objective structure (using the reset entry of the options menu) will have the same effect as deleting the objective structure. When closing this GUI if there is a no empty objective structure, users will be asked if they want to save the information because if there has not been yet saved it will be lost.

When calling the GUI from gui_evocom the individual structure and objective structure stored in gui_evocom are provided to gui_os and use it to initialize both variables of the GUI. So, resetting the objective structure (using the reset entry of the options menu) will initialize them to the input provided values. If you want to delete all the information of the objective structure, use the Delete all pushbutton. The individual structure cannot be changed inside this GUI. When closing this GUI if the information is different to the initialization one, users will be asked if they want to return the new information, return the original information or stay working with gui_os.

Page 35: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 35 EVOCOM Toolbox

EVOLUTIONARY STRUCTURE GUI: GUI_GAS EVOCOM provides a general evolutionary algorithm which can be used for solving optimization problems with different evolutionary techniques such as GA, MOEA, GP, … The main aspects of the algorithm, which is explained in detail in the GA_ALGORITHM section of Evocom ver 2.0. User’s manual, are summarized in the following schema:

INITIALIZATION STEP 1) If the population provided is smaller than the initial population size,

some more initialization individuals are obtained randomly 2) If no initial population is provided, so all of it is generated randomly 3) Obtaining the chromosome representation of the population, the objective

values and the fitness. 4) The population is sorted according to the fitness 5) Information about the population displayed if desired 6) Information about the initial population stored if desired MAIN LOOP OF THE EVOLUTIONARY ALGORITHM While the condition stop has not been reached 1) Select the pairs of parents 2) Crossing the parents 3) Mutating the new individuals 4) Additionally to the children, a group of immigrants can be added to the new

population 5) The new population is evaluated: the chromosomes and the objective values

obtained 6) The old and new population are recombine in a unique population, the

current one 7) New generation number 8) It is also possible to modify the individuals which are repeated in the

population 9) The fitness of the current population is obtained 10) The population sorted according to the fitness 11) The population can also be "improved" by a not genetic method (for instance

a high climbing procedure, simulated annealing...) 12) The information about the current population is then displayed 13) And some of it can be stored to show the evolution of the algorithm End

The information of the different methods selected for implementing each of the steps and some other parameters are provided to the general evolutionary algorithm in the EA structure (also called GA structure). The EA structure has been implemented as a structure of structures, so the information is grouped in two levels:

1) In the first structure level, information referent to different steps of the evolutionary algorithm is grouped.

2) In the second level, all the information referred to the same high-level group is stored.

This structure is explained in detail in the EA Structure of EVOCOM ver 2.0. User’s Manual.

All this information can be provided to the EA structure with gui_gas. In this section we will explain in detail how to provide all this information to this GUI. In the following figure the GUI is presented (as it is when just created by calling it from the Matlab prompt) and their three main areas highlighted with different colors. The Selecting EA field Area (orange) is used for selecting which fields will be displayed (and so can be modified) in the Providing Information for each Field area (green). The Initialization Area (blue) is used for letting gui_gas know how many chromosomes, objective values showing methods will be. In gui_gas there is an special element in the menu bar (modify) to let users decide if they are going to change information in the Initialization Area or in the Providing Information for each Field Area. It is no possible to interact with both areas simultaneously.

In this GUI there is no a Displaying (Error Status) area because checking that all the information is easy is not that straightforward and in gui_is and gui_os. Performing the checking will be similar as running one iteration of the general evolutionary algorithm and so we have preferred to avoid performing it.

Page 36: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 36 Ingeniería de Sistemas y Automática

Selecting the EA field area

Providing information for each field area

Initialisation area

Modify Menu

Figure 23. Main areas of the EA Structure Graphic User Interface

Modify Menu This menu entry should be used for selecting what kind of information to modify: the initialization information or the fields of the EA structure. So, it enables/disables the Initialization area, or the Selecting the AE field area and the Providing information for each field area. The following figure shows the options of the modify menu.

Figure 24. Modify Menu of gui_gas

If the user selects:

• Fields the Initialization area is disable, and the Selecting the EA field area and Providing information for each field area are enable. So users can see and modify the information of the fields of the EA structure

• Initial the Initialization area is enable, and the Selecting the EA field area and Providing information for each field area are disable. In this case users are warned about the possibility of destroying the information in the EA structure if the fields in Initialisation area are modified. In the following section, what happens when modifying this fields is explained in detail.

IMPORTANT

When gui_gas is called (either from the Matlab prompt or from gui_evocom) the Initialization Area is enable, so to modify the contents of the EA structure, select the fields entry of the modify menu.

Page 37: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 37 EVOCOM Toolbox

Initialization Area This area is used for specifying how many chromosomes, objective values and showing functions will be used in the EA. The information is really important to let this GUI get the necessary amount of memory for storing the methods for the correct number of chromosomes, the objectives (min/max) for the correct number of objective values, and the methods for the showing functions.

The number of objects existing in this area depends on how gui_gas was called. When calling it from gui_evocom the numbers of chromosomes and the number of objective values can be obtained from the individual structure and objective structure stored in gui_evocom and so users will no be allowed to change these values inside gui_gas. For that reason, the pushbuttons used for selecting the number of chromosomes and the number of objective values is not present in this case.

The following figure shows the Initialization Area for both cases. The + and – pushbuttons for the number of chromosomes and for the number of objective values is not present in the case of calling gui_gas from gui_evocom, so this values will not be changed inside gui_gas. In the example of Initialization area when calling gui_gas from Matlab 4 chromosomes, 2 objective values and 1 showing method are specified. In the example of Initialization area when calling gui_gas from gui_evocom 1 chromosome, 2 objective values and 1 showing method are specified. The numbers are modified by pushing the incrementing (+) and decrementing (–) pushbuttons placed in the same row.

a) when calling from Matlab

b) when calling from gui_evcocom

Figure 25. Initialization Area of gui_gas

Ø Incrementing pushbuttons (+) These pushbuttons are to be used for incrementing the number of the variable placed in the same row. While providing initialization information, these pushbuttons are always enable.

Ø Decrementing pushbuttons (+) These pushbutton are to be used for decrementing the number of the variable placed in the same row. These pushbuttons are enable only when the number of the variable placed in the same row is bigger than one and the users are providing initialization information.

Ø Chrom This tag and the number beside are used for letting this GUI know how many chromosomes will constitute the individuals. This information is necessary because EVOCOM lets users provide different methods for the steps of the algorithms that work directly with the population in its genetic representation level. So, when more than one chromosome will be used, gui_gas needs know how many space it should for storing a different the method for each of the chromosomes.

Users will be asked if they want to have one or more methods for each of the chromosomes when chrom is bigger than 1 in the Providing Information for each Field Area. A radio button object will be presented in that area when selecting the fields of the methods that are allowed to be different for each chromosome.

When the number of chromosomes is decremented some information of the methods which are different for each of the chromosome is lost. The information of the last methods is deleted.

When the number of chromosomes is incremented some information of the methods which are different for each of the chromosome is added. The new methods are filled with the information already provided for the first chromosome.

Page 38: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 38 Ingeniería de Sistemas y Automática

Ø Obj This tag and the number beside are used for letting this GUI know how many objective values will returned for all the objective functions. I.e., it is no the number of objective function, it is the total number of objective values returned for all the objective functions. This information is necessary because EVOCOM lets users provide a different objective (‘min’/‘max’) for each of the objectives. So, gui_gas uses this information for getting the necessary memory for the objectives.

When the number of objectives is decremented the information of the last objective is deleted. When the number of objectives is incremented the information of the new objective is the same as the information of the first one.

Ø Show This tag and the number beside are used for letting this GUI know how many showing methods will be used in the EA. This information is necessary because EVOCOM lets users provide several showing methods and so gui_gas uses this information for getting the necessary memory for the all the methods.

When the number of showing methods is decremented the information of the last one is deleted. When the number of methods is incremented the information of the new method is the same as the information of the first one.

Selecting the EA field area This area is used for selecting the field of the EA structure whose information will be displayed (to let users modify it) in the Providing Information for each Field Area. Two list boxes are used in order to organize the information in the same way as in the EA structure: the top list box is related with the first structure level (corresponding to the different high level EA functions) and the bottom list box organize the fields present in the second structure level. The information displayed in the top list box is always the same while the information displayed in the bottom list box depends of the field selected in the top list box. The objects displayed in the Providing Information for each field area is changed, so users will be able to see and provide the information related with the selected field of the second list box.

The following figure shows this area in two different cases. When the field in the top list box is Numbers, users can select the Initial Pop Size, Number of Parents, Number of immigrants and Immigrant Probability fields of the button list box. When the field in the top list box is Coding user can select the Gene Coding and Chrom coding field.

Figure 26. Selecting the EA field Areas

Page 39: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 39 EVOCOM Toolbox

IMPORTANT

When initializing gui_gas this area is no enable. Use the Field entry of the Modify menu for enabling it.

The following table summarizes options that will appear in the bottom list box for each of the top list box options and describes its utility. It also relates each of the options with the EA structure fields (written in italics). The methods that need to be specified are marked with (#) and the methods that do not be to be specified are marked with (*). For more information about each of the fields and types of methods see the Evolutionary Operators and Functions section of EVOCOM ver 2.0. User’s Manual. Numbers (number) some numeric information about the evolutionary algorithm.

Initial Pop Size (popinit): size of the initial population Number of Parents (parents): number of pairs of parents Number of Inmigrants (ninmigrant): maximum number of immigrants Inmigrant Probability (pinmigrant): immigrant probability to survive

Coding (coding) implementation type of the genetic and chromosome populations

Gene coding (gen) Chrom coding (chrom)

Fitness (fitness): information related with the fitness high level function

Fitness fun (fitfun and fitparam): fitness method (#) Nitching fun (nichfun and nichparam): nitching method (*) Optimasion criteria (obj): objective (min/max) of each objective

Stop (stop) information of the stop high level function

Stop Function (fun and param): stop method (#)

Show (show) information related with the showing high level function Show Function (fun and param): showing method (*)

Selection (selec) information related with the selection high level function

Selection Function (fun and param): selection method (#) Incest Parameter (incest): 2*1 array used for deciding if parents can

be repeated in a pair or incest avoided

Compare (compare) information related with the comparing high level function Compare Function (fun and param): comparing method (*)

Crossing (cross) information related with the crossing high level function

Crossing Point (pointfun and pointparam): cross-point method (*) Crossing (crossfun and crossparam): cross-performing method (*) Probability (prob): crossing probability

Mutation (mut) information related with the mutation high level function Mutation Point (selgenesfun and selgenesparam): mutation-point method

(*) Mutation (new_valuefun and new_valueparam): mutation-performing method

(*)

Equal (equal) information related with the equal high level function Equal Function (fun and param): equal method (*)

Change (change) information related with the changing high level function Change Function (fun and param): change method (*)

Recombine (recombine) information of the recombination high level function Recombine Function (fun and param): recombination method (#)

SuperIndividual (super) information of the super high level function SuperIndividual Function (fun and param): super method (*) Step (step): how often to perform this step of the algorithm Fixed (fixed):identifies if the method is going to be applied to the

first (0) or groups of best (1) individuals Howmany (howmany): the number of first/group of best individuals

Store (store) information of the storing high level function Store Function (fun and param): storing method (*)

Page 40: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 40 Ingeniería de Sistemas y Automática

Providing Information for each field Area This area is used for seeing and providing the information of the selected field (with the Selecting the EA field Area). The objects presented in this area depend on the selected field and on the number of chromosomes, objectives and showing functions. We will describe the different types of displays present in the Area, and in that description we will indicate in which cases they are presented.

Ø Area for specifying a unique parameter This area is used for letting users visualize and modify the information of the following numeric parameters of the GA structure (between brackets the name of the main field they belong to):

• Initial Pop size (numbers): it should be a single integer value. • Number of parents (numbers): it should be a single integer value. • Number of Inmigrants (numbers): it should be a single integer value. • Inmigrant Probability (numbers): it should be a float value in the range [0,1]. • Incest parameter (select): it should be an array with two elements. • Probability (crossing): it should be a float value in the range [0,1]. • Step (superindividual): it should be a single integer value. • Howmany (superindividual): it should be a single integer value. • Fixed (superindividual): it should be either 0 or 1.

According with the rules for providing information to the Editable/Writable objects (see the Providing information to the Editable/Writable Elements section of this manual) the information can be the parameter itself or the name of a variable containing the parameter with the correct information.

This area is shown in the following figure. At the top, a message about the selected field is shown (in this case the field selected is the Initial Pop Size). In the middle there is an Editable/Writable object for inputting the information related with the selected field. At the button an Update pushbutton exists. After modifying the information in the Editable/Writable object, users have to push the Update pushbutton to actually update the EA structure with that new information.

Figure 27. Providing information for each field area: providing a unique parameter

Ø Area for selecting a unique parameter This area is used for letting users visualize and select (from a group of proposed possibilities) the value of the following parameters of the GA structure (between brackets the name of the main field they belong to):

• Gene coding (coding): the population genetic implementation can be matrix (numeric) or cell. • Chrom coding (coding): the population chromosome implementation can be matrix (numeric)

or cell.

Page 41: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 41 EVOCOM Toolbox

• Optimization criteria (fitness): it can be either ‘min’ or ‘max’. This type of area is present for the Optimization criteria when the problem will have only one objective value (Obj number in the Initialization Area). In case of having several (more than 1) objective values, the type of area described in Area for selecting several parameters section will be displayed.

This area is shown in the following figure. At the top, a message about the selected field is shown (in this case the field selected is the Gene coding). In the middle there is a popup menu to let users select any of the possible values of the selected field. At the button an Update pushbutton exists. After selecting a new value from the popup menu, users have to push the Update pushbutton to actually update the EA structure with that new information.

Figure 28. Providing information for each field area: selecting a unique parameter

Ø Area for selecting several parameters This area is used for letting users visualize and select (from a group of proposed possibilities) the value of the Optimization criteria (fitness) when several objective values will be used value (i.e. when the Obj number in the Initialization Area is bigger than 1). The following figure shows the area when only one objective value can be specified (explained in the previous section) and when several objective values can be specified.

a) Only one objective value

b) Several objective values

Figure 29. Providing information for each field area: selecting several parameters

Page 42: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 42 Ingeniería de Sistemas y Automática

For selecting the objective value four moving pushbuttons (<<, <, >, >>) have been added to the area. The number of the selected objective value appears by the tag that identifies the field selected (Optimization Criteria). In the example, the first (1) objective value is shown. By pressing the moving pushbuttons, the optimization criteria for the different objective values are displayed and can be modified:

< the selected objective value will be the previous of the current one << the selected objective value will be the first one

> the selected objective value will be the next of the current one >> the selected objective value will be the last one

The information for the optimization criteria is selected between the possibilities of the popup menu (‘min’ and ‘max’). After modifying the information of any objective value, EVOCOM users should use the updating pushbuttons for really modifying the information in the EA structure. Two updating pushbuttons are presented in this case:

Update should be used for updating the information of the currently selected objective value

Update all can be used for updating the information of all the objective values with the information shown in the popup menu.

Ø Area for providing information for a unique method For specifying each of the methods it is necessary to provide both the name of the method and its extra-parameters. Section Providing the information of a method of this manual explains how to provide the names and extra-parameters of a methods using EVOCOMOM GUIs by using the Name Pushbuttons (Function pushbutton of this GUI), Name Edit Objects (Edit/Writable object by the Function pushbutton), Parameter Pushbuttons (Param pushbutton) and Parameter Edit Objects (Edit/Writable object by the Param pushbutton).

This area is used for letting users visualize and provide the information of the selected method in all the cases where a method (function) should be supplied except in the following cases (which will be explained in the following section):

• Show Function (show) when several showing functions will be used (i.e. when the Show number in the Initialization Area is bigger than 1).

• Methods that deal directly with the genetic populations when several chromosomes will be used (i.e. when the Chrom number in the Initialization Area is bigger than 1). This methods are related with the following fields:

Compare Function (compare) Crossing Point (crossing) Crossing (crossing) Mutation Point (mutation) Mutation (mutation) Equal Function (equal) Change Function (change)

Method name

Extra-parameters

Figure30 . Providing information for each field area: providing information for a unique method

Page 43: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 43 EVOCOM Toolbox

After modifying the information of the methods, EVOCOM users should make use the Update pushbutton for really modifying the information in the EA structure.

Ø Area for providing information for several methods For specifying each of the methods it is necessary to provide both the name of the method and its extra-parameters. Section Providing the information of a method of this manual explains how to provide the names and extra-parameters of a methods using EVOCOMOM GUIs by using the Name Pushbuttons (Function pushbutton of this GUI), Name Edit Objects (Edit/Writable object by the Function pushbutton), Parameter Pushbuttons (Param pushbutton) and Parameter Edit Objects (Edit/Writable object by the Param pushbutton).

In the cases of the methods that work with the genetic population when several chromosomes constitute the individuals (i.e. when the Chrom number in the Initialization Area is bigger than 1) and of the showing method when several methods can be provided (i.e. when the Show number in the Initialization Area is bigger than 1), it is necessary to include in the Providing Information for each Field Area objects for selecting the information of the method to see/modify. Two different types of areas have been designed for this purpose, one for the showing method case and another for the methods related with the genetic population.

• Showing method case:

For selecting the showing method four moving pushbuttons (<<, <, >, >>) have been added to the area. The number of the selected objective value appears by the tag that identifies the field selected (Show Function). By pressing the moving pushbuttons, the information of the different Showing methods are displayed and can be modified:

< the selected showing method will be the previous of the current one << the selected showing method be the first one

> the selected showing method will be the next of the current one >> the selected showing method will be the last one

After modifying the information of any showing method, EVOCOM users should use the updating pushbuttons for really modifying the information in the EA structure. Two updating pushbuttons are presented in this case:

Update should be used for updating the information of the selected showing method Update all can be used for updating the information of all the showing methods values with the

information shown for the currently selected one.

In the following figure the contents of this area when only one showing method can be specified or when several showing methods can be specified is presented.

a) Only one showing method

b) Several showing methods

Figure31. Providing information for each field area: providing information for several Showing methods

Page 44: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 44 Ingeniería de Sistemas y Automática

• Genetic population method case:

When having several chromosomes specifying different functions for the methods that work directly with the genetic population is possible, but not compulsory. So, a radio button (identified with the tag A different function for each chrom) for letting users decide if they want to provide a different method for each of the chromosomes or not is presented in this type of area.

The following figure shows the type of areas displayed when selecting the methods that work with the genetic population. The first type of area (explained in the Area for providing information for a unique method section) is displayed when only one chromosome will be used (i.e. when the Chrom number in the Initialization Area is 1). The two other types are displayed when several chromosomes will be used (i.e. when the Chrom number in the Initialization Area is bigger than 1). In the second case (32b), the radio button is empty, and so the same function will be used for the whole individual. In the third case, the radio button is full, and so a different function will be specified for each chromosome. For letting users select the chromosome the moving pushbuttons (<<, <, >, >>) have been added and the number of the currently selected chromosome is displayed by the top tag that identifies which fields of the EA structure have been selected. In the two first cases, a unique pushbutton Update is used for really updating the EA structure with the information displayed in the area. In the last case, two update pushbuttons can be used.

a) Only one chrom b) Several chrom, one method

c) Several chrom, several methods Figure 32. Providing information for each field area: providing information for several genetic

population methods

For the third case, by pressing the moving pushbuttons, the information of the different methods is displayed and can be modified:

< the selected method will be the previous of the current one << the selected method be the first one

> the selected method will be the next of the current one >> the selected method will be the last one

After modifying the information of any method, EVOCOM users should use the updating pushbuttons for really modifying the information in the EA structure. Two updating pushbuttons are presented in the third case:

Update should be used for updating the information of the selected method Update all can be used for updating the information of all the methods values with the

information shown for the currently selected one.

IMPORTANT

When clicking in the radio button, the information of the EA structure changes (so only use it if necessary) in the following way:

§ When a different function for each chromosome is selected, the EA structure is modified so it has space for saving the information of as many functions as chromosomes for the method selected. The information that the unique method that existed so far is initially used for filling the function information for each chromosome.

Page 45: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 45 EVOCOM Toolbox

§ When the same function for the whole individual is selected, the EA structure is modified so it has only space for saving the information of the method for the whole individual. The information used to fill that method is the information of the method for the first chromosome.

Ways of identifying each type of method In the following table the first letters that can be used for identifying each kind of method are presented. When users implement their own methods, they do not need to follow these combinations. However, when using the Method Name Pushbutton, the names of the functions displayed initially in each of the cases are the ones with start with the letters in the following table. Fitness method: fit_ Nitching method: nich_ Stop method: stop_ Show method: show_ Selection method: sel_ Compare method: comp_ Crossing Point method: crosspoint_ Crossing method: crossing_ Mutation Point method: mutsel_ Mutation method: mutnew_ Equal method: equal_ Change method: the toolbox does not provide any change method, but ga_mut can be used for this purpose Recombine method: rec_ SuperIndividual method: super_ Store method: store_

Erroneous information considerations Information is considered to be correct according with the rules for providing method names, extra-parameters and any kind of parameters (see Providing information to the Editable/Writable Elements and Providing the information of a Method sections).

Extra-error checking has not been implemented because it is equivalent to run the general EA algorithm. So, what we recommend is providing the information to gui_gas and use it to run the algorithm, either by saving the information in a Matlab Script file and call it from the Matlab prompt of running the EA from gui_evocom.

Differences in the gui_gas when calling it from Matlab or gui_evocom The main difference in the gui_gas presented when calling it directly from the Matlab prompt (typing gui_gas) and when calling it from gui_evocom (pressing the define pushbutton of gui_evocom when the GA structure is selected in the list menu of gui_evocom) is the content of the Initialization Area, which is explained in the Initialization Area section of this GUI.

When calling the GUI from the Matlab prompt is always initialized with the default GA structure. Resetting the GA structure (using the reset entry of the options menu) will initialize them to the default values When closing this GUI if there is a no default GA structure, users will be asked if they want to save the information because if there has not been yet saved it will be lost. The default GA structure is filled with the following values:

Page 46: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 46 Ingeniería de Sistemas y Automática

Numbers: Initial Pop Size: 50 Number of Parents: 10 Number of Inmigrants: 0 Inmigrant Probability: 1

Coding: Gene coding: Matrix Chrom coding: Matrix

Fitness: Fitness fun (fun: fit_default and param: )

Nitching fun (fun: and param: ) Optimasion criteria: 'min'

Stop: Stop Function (fun: stop_generation and param: 500) Show: Show Function (fun: and param: )

Selection: Selection Function (fun: sel_random and param: )

Incest Parameter: [0 1]

Compare: Compare Function (fun: comp_basic param: )

Crossing: Crossing Point (fun: crosspoint_multipoin1 and param: 1) Crossing (fun: crossing_basic and param: ) Probability: 0.8

Mutation: Mutation Point (fun: mutsel_default and param: 0.008) Mutation (fun: mutnew_uniform and param: )

Equal: Equal Function (fun: equal_basic and param: )

Change: Change Function (fun: and param: )

Recombine Recombine Function (fun: rec_subgen and param: )

SuperIndividual: SuperIndividual Function (fun: and param: ) Step (step): 1 Fixed: 1 Howmany: 1

Store Store Function (fun: store_firstn and param: 1)

When calling gui_gas from gui_evocom the GA structure, the total number of chromosomes and the total number of objective values are provided to gui_gas and use it to initialize these three variables of the GUI. Resetting the GA structure (using the reset entry of the options menu) will initialize them to the input provided values. The total number of chromosomes and the total number of objective values cannot be changed inside this GUI. When closing this GUI if the information is different to the initialization one, users will be asked if they want to return the new information, return the original information or stay working with gui_gas.

IMPORTANT

When calling gui_gas from gui_evocom it is checked in the number of different methods for functions that work with the genetic population and the number of optimization criteria inside the EA structure is the same as the number of chromosomes and number of objective values. If they are no equal, users will be warned about that fact, and in case of proceeding, the EA structure will be modified to have the current name of methods and optimization criteria:

§ If there are more methods/criterias than needed, information of the last ones will be eliminated.

§ If there are less methods/criterias than needed, the new methods/criteria will have the same information as the first one.

Page 47: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 47 EVOCOM Toolbox

EVOCOM MAIN GUI: GUI_EVOCOM The general evolutionary algorithm provided with EVOCOM can be used for solving different kinds of problems with different evolutionary techniques (such as GA, GP, MOEA, …). The technique and the behavior of the algorithm depend on the specifications provided for the individuals of the population, on the objective functions that guide the search, and on the characteristics of each step of the EA. All that information can be provided to the general evolutionary algorithm in the individual structure, objective structure and EA (GA) structure. Some initial information (initial population and a random seed) can also be provided in two other variables. Once all the information is specified in that structures properly, the general evolutionary algorithm can be run.

EVOCOM Main GUI, gui_evocom, has been designed for letting users specify the information of the three structures and then running the algorithm. It is also possible to save the specified algorithm in a Script Matlab file, that called from the Matlab prompt will run the same general evolutionary algorithm as the one specified in the GUI.

In the following figure the GUI is presented (as it is when just created by calling it from the Matlab prompt) and their three main areas highlighted with different colors. The Defining/Loading Structure Area (green) is used for defining (by means of gui_is, gui_os, gui_gas and gui_init) or loading each of the three structures and the initialization information. The Displaying Area (yellow) is used for displaying which structures have been defined/load so far. Once all the information has been specified, the Running Area can be used for running the general evolutionary algorithm provided with the toolbox.

Defining/ Loading Structure Area

Running Area

Displaying Area

Figure 33. Main areas of the EVOCOM User Interface

Defining/Loading Structure Area This area is used for defining/loading the individual structure, objective structure, EA (GA) structure and initialization information. The list box in the left is used for selecting one of the three structures. The pushbuttons in the right for loading the information about the selected structure/information from an EVOCOM data file (LOAD) and for defining the selected structure/information using the GUI related with it (DEFINE). In the following figure the Area is presented.

Page 48: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 48 Ingeniería de Sistemas y Automática

Figure 34. Defining/Loading Structure Area

Ø List box Before defining/loading any of the structures/information, users should select it from one of the possibilities of the list box. Then the LOAD pushbutton can be used for loading the information from a file and the DEFINE pushbuttons to define the selected structure or visualize its contents.

Ø Load When pushing LOAD, a path browser is opened for letting users select the name of the file where the information of the selected structure is saved. If no file or an EVOCOM data file without the type of structure/information selected is chosen, the current information in gui_evocom for that structure is not modified.

When loading any of the structures/information, it is not checked that the information stored in all of them are correct according with the information stored for the others.

The three structures and initial information can be loaded from an EVOCOM data file which contains them using the Load entry of the Options Menu.

Ø Define When pushing DEFINE either gui_is (if the individual structure is selected), gui_os (if the objective structure is selected) gui_gas (if the EA (GA) structure is selected) or gui_init (if the Initialisation Info is selected) will be called. The called GUI will be initialized with the information stored so far in gui_evocom.

Any defining order is possible, although users should be award of:

§ If the individuals structure is initialized before the objective structure, the objective functions of the objective structure can be tested in gui_os. If it is no initialized, the objective structure can be defined, although it will not be checked if the functions and their parameters are well defined.

§ If the EA (GA) structure is not defined before the objective structure, gui_os will consider that the genetic and chromosomes populations will be implemented as numeric matrix. If the EA structure is defined before gui_os the coding information (gen and chrom) of the EA structure will be provided to gui_os.

§ If the individual structure and objective structure is not initialized before the EA (GA) structure, gui_gas will consider that the number of chromosomes and the number of objective values will be 1 (for both cases).

§ Changing the number of chromosomes and objective values once the GA structure has been initialized can make the GA structure will not be longer valid.

§ If providing an initial genetic population (using gui_init), it should have the same format as the population generated according with the individual structure and the same genetic coding.

So, it is advisable to start by defining the individual structure, following with the objective structure and the EA structure and ending with the initialization information. If any of the populations is implemented as a cell matrix, after defining the EA structure, select the objective structure and push DEFINE to see if the information of the objective structure is valid.

Page 49: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 49 EVOCOM Toolbox

Displaying Area This area is used for showing which structures/information have been initialized so far:

§ If the bullet is black, the structure/information has been initialized § If the bullet is white, the structure/information has not been initialized. The area is displayed in the following figure for three different cases. In the first no information has been specified, in the second the individual structure and the objective structure have been defined and in the third the three structures have been specified.

a) Nothing initialised

b) First two initialised c) Structures initialised

Figure 35. Displaying Area

Running Area Once the individual, objective and EA (GA) structures have been defined, the specified algorithm can be run. The RUN pushbutton should be used for calling the general evolutionary algorithm provided with the toolbox with the three structures (and if provided, also initially information). Before running the algorithm, the information of the structures and the initialization information can be evaluated if desired, so in case the information specified depends on variables in the Base Workspace it is possible to change the value of that parameters, evaluate the variables in the structures/inforamation and so run the EA with the updated values. After running the algorithm, the information (about the last population and about the evolution of the population) can be saved if desired. In the following figure the Running Area is shown.

Figure 36. Running Area

Ø Run This pushbutton is enable once the individual, objective and EA (GA) structures have been specified. The initial information does not need to be specified. Pushing RUN the general evolutionary algorithm will be run with all the information provided. The information displayed while running the algorithm depends on the selected showing methods.

For running the algorithm is only necessary having specified the three structures, not having specified with correct information. So, errors can occur while running the algorithm. In case of error, the algorithm is interrupted and a warning message is displayed. In the Matlab prompt the cause of error is usually displayed in more detail. Users can make use of the list box and define pushbuttons for analyzing the causes of error of the individual structure and objective structure. The EA (GA) structure is not checked in gui_gas because that task is equivalent to run the algorithm.

If the error message in the Matlab prompt does not help users to identify the cause of error, saving the information in an Script file (by using the Save M-File, Save entry of the Options menu) and running it from Matlab can help them to identify the causes of errors. The saved algorithm can be then run from

Page 50: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 50 Ingeniería de Sistemas y Automática

Matlab (typing the name of the M-file where it is saved). This will help users because the messages of error are more complete, and it is also possible to use the Matlab debugger if necessary.

Running the algorithm from the Matlab Script after saving it, it is also advisable when the general evolutionary algorithm will run during many generations.

Ø Eval Structures before running This GUI stores the information of the individual, objective and evolutionary algorithm structures and initialisiation information under two different formats:

1) In the intermediate format the variables contains strings that can be later evaluated.

2) In the final format, the variables contains values obtained evaluating the intermediate format variable.

So when some information of the structures/initialization is related with the names of variables in the Base Workspace the information can be updated according with the values of that variables. That is, if users change the information of the Base Workspace variables, the information of the three structures/initialization is also updated.

Users can decide to evaluate the intermediate format variables or not before running the algorithm using the Eval Structure before running bullet.

IMPORTANT

Updating before running is necessary if some information depends on Base Workspace variables that have been modified and users wants those changes to take place in the information of the structures.

Updating before running when the structures depend on Base Workspace variables that do not exist, will make the evaluation process fill the variable with default values (usually empty matrix or strings), and so the algorithm could not work properly.

Ø Ask if results should be saved Users can decide if the results of running the general evolutionary algorithm should be saved or not. With that purpose, the Ask if results should be saved bullet has been included in this GUI. If the option is selected (black bullet), once the general EA is finished, users are asked if the results should be saved in a file or not. If the user decides to save them, the name of the file is asked and the results of the last generation population and of the evolution of the population is saved in the file. The variables stored are:

• gen: the last generation genetic population • chrom: the last generation chromosome population • value: the last generation objective values • fitness: the fitness of the individuals of the last generation • popt: the genetic population evolution • chromt: the chromosome population evolution • valuet: the objective values evolution+ • fitnesst: the evolution of the fitness • itert: a two column matrix that lets users identify which of the information of popt, chromt, valuet

and fitnesst. • seed: initial random seed used for the algorithm (if none is used it is empty) • pop: initial genetic population (if none is provided it is empty) • ind_str: the individual structure used for running the general EA • objs_str: the objective structure used for running the general EA • gas_str: the EA (GA) structure used for running the general EA

The contents of popt, chromt, valuet and fitnesst depend on the storing method selected for the algorithm. Itert will let users to identify which information of those variables is related with each generation of the algorithm. In the GA_ALGORITHM section of the EVOCOM ver 2.0. Reference Manual the contents of these variables are explained in detail.

The structures (individual, objective and GA) and initial information variables saved are the final variables, not the intermediate ones. So, users can load them from the Matlab prompt and call ga_algorithm with that input variables for running the same type of evolutionary algorithm.

Page 51: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 51 EVOCOM Toolbox

Erroneous information considerations This GUI does not perform any kind of checking about the error status of the individual, objective and EA (GA) structures and of the initial information. For running the general evolutionary algorithm it is only necessary having initialized the structure variables, not having initialized any of them correctly.

If the structures do not contain correct information, the algorithm will end due to the erroneous information in those variables. The information of the cause of error is displayed in the Matlab prompt. Users can push DEFINE to see the information stored in each of the variables to analyze the causes of error.

If they cannot identify the causes of error, saving the information in an Script file (by using the Save M-File, Save entry of the Options menu) and running it from Matlab can help them to identify the causes of errors. The saved algorithm can be then run from Matlab (typing the name of the M-file where it is saved). This will help users because the messages of error are more complete, and it is also possible to use the Matlab debugger if necessary.

Gui_evocom can only be called from the Matlab prompt This GUI is not called from any other EVOCOM GUI. It should be called without input parameters, and when exiting, users are asked if they want to save the information provided to it before exiting or not.

Page 52: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 52 Ingeniería de Sistemas y Automática

INITIAL INFORMATION GUI: GUI_INIT The general evolution algorithm necessary input parameters are the individual structure, the objective structure and the EA (GA) structure. Additionaly, a random seed and an initial genetic population can also be provided to the algorithm. The seed is used for initializing the Matlab random generator and so, if a fixed seed is set the results of the same algorithm will be always the same. The initial population is used for initializing the first population. If the initial population provided is smaller than the initial size of the population (defined in the EA structure – Pop init size-), as many individuals as needed to have a population of the initial size will be randomly created (using the generating-law functions of the individual structure).

This GUI has been designed for letting users provide and define the seed and the initial population if desired. In this section we will explain in detail how to provide this information to gui_init. In the following figure the GUI is presented (as it is when just created by calling it from the Matlab prompt) and their two main areas highlighted with different colors: inside the green frame the elements used for specifying the seed variable, and inside the red frame the elements used for specifying the initial genetic population. Both areas are equal, and so only one is explained.

Seed Information Initial genetic Population

Figure 37. Main areas of the Initial Information Graphic User Interface

The radio button is used for enabling or disabling the definition of each of the variables. When the definition is enable (radiobutton in black) the Editable/Writable object and the Update pushbutton are enable. When is disable, no information can be provided for that variable and if some information was defined before it will be cleared and so lost.

Writing the information in the Editable/Writable object does not imply modifying the information of the variable. In order to update the information of the variable with the contents of the Editable/Writable object use the Update button. Note that there is an update button for each of the variables and so updating one does not update the other.

NOTE

When starting Matlab, the random generator is re-started, and so running several times the same algorithm after opening Matlab will obtain the same values. Setting the seed to a variable number (as the clock of the system) can solve this problem

Error checking The information provided in the Editable/Writable area is evaluated in the Base WorkSpace. If the evaluation is not possible, the information is written in red to draw the attention of the users. The contents of the erroneous variables will be empty matrixes and so it will be equivalent to not provide any initialization information.

Page 53: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 53 EVOCOM Toolbox

Differences in gui_init when calling it from Matlab or from gui_evocom There are no important differences when calling this GUI directly from the Matlab prompt (typing gui_init) and when calling it from gui_evocom (pressing DEFINE when Initialisation Info is selected). The same objects will be shown in both cases.

When calling the GUI from the Matlab prompt is always initialized without a seed and without an initial population. So, resetting the variables (using the reset entry of the options menu) will empty them. When closing this GUI if there is some information for the variables, users will be asked if they want to save the information because if there has not been yet saved it will be lost.

When calling the GUI from gui_evocom the initialization information stored in it is provided to gui_init and used to initialize its variables. So, resetting the variables (using the reset entry of the options menu) will initialize them to the input provided values. When closing this GUI if the information is different to the initialization one, users will be asked if they want to return the new information, return the original information or stay working with gui_init.

Page 54: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 54 Ingeniería de Sistemas y Automática

EXTRA-PARAMETER VARIABLE GUI: GUI_PARAM Each of the step of the algorithm are implemented with a high level function. The behavior of the high level functions always depends on the input parameters used for defining the methods that implement part of the functionality. The low level methods should maintain a header (input and outputs) so they can be called by the high level function. To relax this restriction it is possible to provide more input parameters whose values are selected by users. The way of providing all the input extra-parameters to the high level functions so they can provide them to the low level methods is using an extra-parameter variable.

When using EVOCOM GUI users can write directly the contents of the extra-parameter variables or the name of a variable that stores an extra-parameter variable in the Edit Parameter Objects of the GUIs. In the Providing the information of a method section of this manual how to write the extra-parameter variables in the Edit Parameter Objects is explained in detail. In the Handling extra-parameters section of Gui ver 2.0. User’s manual how to fill an extra-parameter variable is explained also.

Extra-parameter variables can also be filled by using the extra-parameter variable GUI gui_param. In this section we will explain in detail how to provide all this information to this GUI. In the following figure the GUI is presented (as it is when just created by calling it from the Matlab prompt) and their three main areas highlighted with different colors. The different areas are explained in the following sections.

Providing the information for each extra-parameter area

Creating/Destroying/ Selecting Extra-Parameterrea

Displaying (Error Status) area

Figure 38. Main areas of the Extra-parameter Graphic User Interface

Creating/Destroying/Selecting Extra-Parameter Area This area is used for creating the extra-parameter variable for storing the information of as many extra-parameters as needed. The space for storing each extra-parameter is created by using the New Param pushbutton. It is also possible to delete the space (and so the information) of any existing extra-parameter or delete the whole extra-parameter variable. For these purpose the Del Param and Del All pushbuttons have been created.

The number of total parameters is also displayed and the number of the parameter whose information is displayed in the other two areas is also presented. Using the moving pushbuttons (<<,<,>,>>) the user can select other extra-parameter.

Page 55: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 55 EVOCOM Toolbox

When the extra-parameter variable is empty, only the New Param pushbutton is enable. When the extra-parameter variable stores the information of only one parameter the moving pushbuttons are disable. When more than a parameter exists and the first one is the selected one the < and << pushbuttons are disable while if the last parameter is the selected one the > and >> pushbuttons are disable.

This area is displayed in the following figure. In the example a total of 4 extra-parameters have been created and in the other areas the information of the 1st parameter will be displayed.

Figure 39. Creating/Destroying/Selecting Extra-parameter Area

All the elements of this area are explained with more detail in the following sections. Ø New Param This pushbutton should be used for creating the space for the information for a new parameter. The information of the new parameter is placed in the last position of the extra-parameter variable. The number of extra-parameters is incremented and the selected parameter becomes the new created one (the last). The area created for the new parameter is filled with the default value [].

Ø Del Param This pushbutton should be used for deleting the information (and the space) of the currently selected parameter. The number of extra-parameters is decremented and the selected parameter becomes the last one, except in the case where no parameters are left (because only one existed before deleting it).

Ø Del all This pushbutton should be used for deleting the whole extra-parameter variable and so make it empty.

Ø Number of Parameters It displays the total number of parameters defined in the extra-parameters so far. When the extra-parameter variable is empty nothing is displayed beside this tag.

Ø Parameter Selected It displays the number of the currently selected parameter, whose information is displayed in the providing information of each parameter and displaying areas. For changing the currently selected parameter use the moving pushbuttons.

Ø Moving Pushbuttons (<<,<,>,>>) These pushbuttons should be used for selecting the currently selected parameter. By pressing:

< the selected parameter will be the previous of the current one << the selected parameter will be the first one

> the selected parameter will be the next of the current one >> the selected parameter will be the last one

Page 56: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 56 Ingeniería de Sistemas y Automática

Providing Information for each Extra-parameter Area This area is used for changing the information of the currently selected parameter (whose number is shown by the Parameter Selected tag of the Creating/Deleting/Selecting extra-parameter area). In the following figure this area is presented and the different parts highlighted with different colors. The Editable/Writable object is used for providing the information of the parameter. The information is updated (put in the extra-parameter variable) after pushing the update buttons.

Parameter information

Updating the Extra-Parameter variable

Figure 40. Providing information for each extra-parameter area

Ø Specifying the information of the extra-parameter For specifying the information of a parameter users should write it in the Editable/Writable object of this area. Section Providing the information to the Editable/Writable elements of this manual explains how to provide the information of the parameters properly.

The Editable/Writable objects of this section are written in black when the information is considered correct after updating it, red if it is considered erroneous and green if it has been modified and no update it. When the information is considered erroneous is explained in the Displaying (Error Status) Area section of this GUI.

Ø Updating pushbuttons The information provided in this area is not updated in the extra-parameter variable until any of the updating buttons is pushed. We decided not to update the values after modifying them in case users want to return to the ones defined before. After modifying the information use the pushbuttons for updating the information provided. There are two pushbuttons in this area:

Update parameter should be used for updating the information of the currently selected parameter

Update all can be used for updating the information of all the parameter of the parameter variable with the information shown in the Editable/Writable object.

If the information of the Writable/Editable element of this area is changed and no updated, and any of the pushbuttons of the Creating/Deleting/Selecting extra-parameter area are pushed the GUI will displayed a warning message to ask if users want to update the information before proceeding or not. The information of the changed Writable/Editable object is displayed in green to draw the attention of the users.

Displaying (Error Status) Area This area is used for showing if the information about the currently selected parameter and of the whole extra-parameter variable is valid or not. It consists of a text displaying area where the status of the current parameter is displayed and of a color bar where the status of all the elements of the extra-parameter variable are present. In the following figure the displaying area is presented.

Ø Erroneous information considerations Information is considered to be correct according with the rules for providing information described in the Providing information to the Editable/Writable Elements section of this manual.

Page 57: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 57 EVOCOM Toolbox

Color Bar (Status of all the extra-parameters)

Editable Area (Status of the current parameter)

Figure 41. Displaying (Error Status) area

Ø Editable Area (Status of the current parameter) In this area the error status of the information of the currently selected parameter is displayed, starting by the number of the selected parameter and following with the parameter itself or an error message related with this field.

When the extra-parameter variable is empty instead of showing the information previously explained the message There are no parameters is displayed.

Ø Color Bar (Status of the all the extra-parameters) A color bar is used to represent the error status of the information of all the parameters stored in the extra-parameter variable.

The bar is divided in as many elements (rectangles) as parameters are specified in the extra-parameter variable. The first rectangle represents the first parameter, the second rectangle to the second parameter and so on. The width of all the rectangles is the same.

The color of each rectangle depends on the error status of each parameter:

1) Green: the information of the parameter is free of error.

2) Red: the information for the parameter is considered erroneous.

The currently selected parameter has one of the previous colors but in a lighter version. So, the color bar can also be used to identify the currently selected parameter: it is the one that highlights over the remaining ones. So it will be in light green or light red. Use the moving buttons (<<,<,>,>>) to see how the lighter element moves.

When the extra-parameter variable is empty, the color bar disappears.

Differences in gui_param when calling it from Matlab or from a Parameter Pushbutton There are no important differences when calling this GUI directly from the Matlab prompt (typing gui_param) and when calling it from another GUI (pressing a Parameter Pushbutton). The same objects will be shown in both cases.

When calling the GUI from the Matlab prompt is always initialized with an empty extra-parameter variable. So, resetting the extra-parameter variable (using the reset entry of the options menu) will have the same effect as deleting it. When closing this GUI if there is a no empty extra-parameter variable, users will be asked if they want to save the information because if there has not been yet saved it will be lost.

When calling the GUI from another GUI the extra-parameter variable stored in the calling GUI is provided to gui_param and used to initialize its extra-parameter variable. So, resetting the extra-parameter variable (using the reset entry of the options menu) will initialize it to the input provided value. If you want to delete all the information of the extra-parameter variable, use the Delete all pushbutton. When closing this GUI if the information is different to the initialization one, users will be asked if they want to return the new information, return the original information or stay working with gui_param.

Page 58: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 58 Ingeniería de Sistemas y Automática

The rules used for initializing the extra-parameter variable of gui_param with the information of the Edit Parameter object of the calling GUI are:

1) If the contents of the Edit Parameter Object is either [], {} or there is nothing in the object, the extra-parameter variable of gui_param will be initialized to empty.

2) If the content of the Edit Parameter Object is no surrounded by {} the extra-parameter variable of gui_param will be initialized with an extra-parameter variable with a unique element. The information of this element is the content of the Edit Parameter Object.

3) If the content of the Edit Parameter Object is surrounded by {} the extra-parameter variable of gui_param will be initialized with an extra-parameter variable with as many elements as variables inside the {}

IMPORTANT

If the information in the Edit Parameter Object can no be translated correctly to a extra-parameter variable, the extra-parameter variable of gui_param will be initialized as empty. Before that initialization, users are asked if they really want to open gui_param or not.

Page 59: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 59 EVOCOM Toolbox

EVOCOM HELP GUI: GUI_GAHELP An additional GUI has been implemented for providing to users quick help about all EVOCOM GUIs. This GUI can be called from any other GUI or directly from the Matlab prompt. The functionality of the GUIs is explained in more detail than the characteristics of EVOCOM. In any case, users are referred to this manual or to any of the EVOCOM ver 2.0 manuals for a more detailed description.

The GUI is presented in the following figure. The three main areas are highlighted with different colors. The Main Parameter Area information to this GUI. In the following figure the GUI is presented (as it is when just created by calling it from the Matlab prompt) and their two main areas highlighted with different colors. The Selecting Area (green) is used for selecting the item of information about what to display help. The Displaying area (yellow) is used for showing the information stored in gui_gahelp about the selected item. The areas are explained in detail in the following sections.

Selecting Area

Displaying Area

Figure 42. Main areas of the EVOCOM Help Graphic User Interface

Selecting Area This area is used for selecting the item of information users want to know about. The help is organized in two levels:

1) The higher-level groups items related. To select any item of this group, use the Main Menu List box.

2) The second level shows all the information related with information of the higher level. To select any item of this group, use the Submenu List box. Selecting a different item in the Main Menu List box will change the information displayed in this object.

Displaying Area This area is used for showing the information stored in gui_gahelp about the selected item. The present information is a short and quick description. All the information is explained in more detail in this manual, so users are referred to it (or any of the EVOCOM ver 2.0 manuals) in case of needing more help

Page 60: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 60 Ingeniería de Sistemas y Automática

Differences in gui_gahelp when calling it from Matlab or from another GUI There are no important differences when calling this GUI directly from the Matlab prompt (typing gui_gahelp) and when calling it from another GUI (using the Help Menu entry of the Help menu). The same objects will be shown in both cases.

The only difference is the item of information selected in each case, which will be referred to the calling GUI or to itself (when calling the GUI from Matlab).

A unique EVOCOM help GUI can be opened in each Matlab session. The same GUI will be used when calling it more than once.

This GUI differs from the others that when it is called, the calling GUI is not disable. So users can interact with the calling GUI and with gui_gahelp simultaneously.

When closing any other GUI, if the EVOCOM Help GUI is opened, it will be closed. The GUI can also be closed using the X pushbutton. In this case no message is displayed because this GUI does not store any information that can be lost when closing it.

Page 61: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 61 EVOCOM Toolbox

EXAMPLES OF USE In this section three of the examples provided with the toolbox are presented. The same examples are described in the Example of Use section of EVOCOM ver 2.0 User’s Manual. In this manual we will focus on describing how to specify the examples to EVOCOM GUI.

The first example is the Stuckman’s problem. The solution of this problem can be easily found by using the methods provided with the toolbox. By only changing the recombination method, two different EA with obtain different kind of solutions can be implemented.

The second example is the multiobjective Shaffer’s problem, which will be solved by selecting a fitness pareto method.

The third example is finding the minimum path in a maze. For this example, we decide also to implement special methods, to ensure that the population always stores feasible population.

The toolbox is provided with more examples. In each of the folders inside EVOCOM’s sample folder a different example is presented. Use Matlab path browser to go to each of the folders and type help_problem in the Matlab prompt to see a description of the example in the current path working directory.

All the examples have been solved using EVOCOM with the GUIs and without them. The information stored in the different structures when solving the problem with the GUIs has been saved under the different folders with the following names:

• ind_str.mat is the EVOCOM data file saved from gui_is • obj_str.mat is the EVOCOM data file saved from gui_os • gas_str.mat is the EVOCOM data file saved from gui_gas • evocom.mat is the EVOCOM data file saved from gui_evocom

Loading the information from this files will let users run the general evolutionary algorithm without having to specify all the information from the beginning. No initialization information (seed or initial population) is used in any of the examples.

The toolbox has also been used for solving some real problems such as the optimization of the beer fermentation process and the improving of the comfort of the passengers of fast ferries

In the following sections the three examples are presented. In the first case all the steps followed to define the problem and EA are shown. In the second case, we will show how to load and see the information from the files. In the last case, we will also load the information from files and generate a M-Script for running the algorithm form the Matlab prompt.

Page 62: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 62 Ingeniería de Sistemas y Automática

Stuckman’s Problem The Stuckman’s problem consists in finding the maximum of the following function, which depends on two floating-point numbers (x1 and x2) and a group of fixed parameters (b, r11, r12, r21, r22, m1 and m2):

The maximum of the Stuckman function when the values of the fixed parameters are b=2.5, r11=2, r12=6, r21=3, r22=7, m1=3 and m2=10 is 10 and it is found in the region I={(x1,x2) / 2.5<=x1<4 ∧ 6<x2<8}.

We solve the problem with two different genetic algorithm. They only differ in the recombination method used. In the first case, the generational substitution is used while in the second an elitism substitution that ensures that the all the best individuals are maintained in the following generation.

IMPORTANT

All the Base Workspace variables are stored in data.m, so this Script should be run before specifying the problem with EVOCOM GUI.

Problem Description Ø Problem Codification We will consider 2 chromosomes, each storing a float value in the range [0,10], implemented with NBITS binary numbers. To obtain this chromosomes the gen_bin and gev_bin methods will be selected with the correct parameters. The two populations will be implemented as numeric matrixes.

Ø Objectives Description A single value obtained with the proce_stuckman function.

Ø EA Specification We will use the default EA structure definition, with the following changes :

POP initial size: NPOBL Pairs of children: NSUBT Fitness: max Selection: sel_roulette, [] Recombination: Depending on the value of the REC variable

if REC==1 rec_subgen, [] otherwise rec_elitism, 1

Stop: stop_generation (generation NGENER) Change: ga_mut, as ga_mut but with instead of MUTA, with 0.1 Show: show_basic (param 1)

Using EVOCOM GUI for solving the problem

We will solve the problem completely with GUI EVOCOM and in this section we will describe all the steps we follow for defining the problem.

As we are going to define and solve the problem, we will use EVOCOM Main GUI. So, users should type gui_evocom in the Matlab prompt and the following figure is displayed.

)222()211(2

)122()111(112/)2sin(5.02

11/)1sin(5.01)2,1(

rxabsrxabsarxabsrxabsa

bxaambxaam

xxF

−+−=−+−=

≥⋅+<⋅+

=

Page 63: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 63 EVOCOM Toolbox

Figure 43. Stuckman Example: Step 1

Once gui_evocom is opened, we will define the individual structure, the objective structure and the EA (GA) structure. We will start by defining the individual structure, and so we select that option from the List box and push DEFINE. Gui_evocom is disable and gui_is is called with an empty individual structure, because it was not yet initialized in gui_evocom. The following figure shows the gui_is displayed after pushing DEFINE.

Figure 44. Stuckman Example: Step 2

As we need to describe an individual with two chromosomes with the same properties, we will create one chromosome, specify it, and then create the other one by copying the first. For creating the first chromosome we will push New Chrom. Then, a chromosome is created with default properties. In figure 45, the state of gui_is after creating the chromosome is presented.

Page 64: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 64 Ingeniería de Sistemas y Automática

Figure 45. Stuckman Example: Step 3

The EVOCOM default information for a chromosome is the same information we need for creating the chromosomes we need, except for the number of genes, that we want to make it equal to the Workspace variable NBITS. So, we modify that information in the Genes Editable/Writable object. Changing the information of any of the fields does not mean changing the information of the individual structure. In the following figure, users can see that after changing Genes, Gen_number in the Editable Area keeps on being 10.

Figure 46. Stuckman Example: Step 4

In order to update the information of the individual structure with the information in the Providing Information for Each Chromosome Area users should push Update Chrom (or Update All, because in this case the individual structure only has a chromosome right now). The following figure shows the information once updated.

Page 65: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 65 EVOCOM Toolbox

Figure 47. Stuckman Example: Step 5

The information of the first chromosome has been completely defined. So, as the second chromosome has the same information, we can create it and copy the information of the currently selected chromosome (the first one) in the new chromosome. This can be done by pushing Copy Chrom. The state of gui_is after having created and copied the new chromosome is shown in the following figure. The individual structure has two chromosomes, and the second one (which is the currently selected) has the same information as the first one.

Figure 48. Stuckman Example: Step 6

So, the individual structure has been defined with the necessary information, which is also correct (the color bar is in green). So, this GUI can be closed (by pushing X). After pushing the closing button, as the individual structure has changed (originally it was empty) a window is opened for asking users if they want to return the new information (option a), return to original individual structure (option b) or stay in this GUI (option c). The window is displayed in the following figure.

Page 66: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 66 Ingeniería de Sistemas y Automática

Figure 49. Stuckman Example: Step 7

Users should select option a. Selecting option b will return the original individual structure and so all the information provided will be lost. Staying (option c) is not a problem, but at some point users should select option a to return to gui_evocom with a filled individual structure. The state of gui_evocom when returning with a non-empty individual structure is shown in the following figure. Note how the GUI shows that the individual structure is now filled.

Figure 50. Stuckman Example: Step 8

Now we will define the objective structure. With this purpose we select the Objective Structure option from the List box and push DEFINE, as it is shown in the following figure.

Figure 51. Stuckman Example: Step 9

Page 67: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 67 EVOCOM Toolbox

When pushing DEFINE, Gui_evocom is disable and gui_os is called with an empty objective structure, because it was not yet initialized in gui_evocom. The following figure shows the gui_os displayed. Note that as it is called from gui_evocom once an individual structure has already been specified, the message in the Individual Structure Area says that the Individual Structure is filled, and so the objective structure is checked according with that information.

Figure 52. Stuckman Example: Step 10

The Stuckman problem is a mono-objective problem and so the objective values can be obtained from a unique objective function. That is, only a objective function needs to be provided to EVOCOM, so we will only create one element for the objective structure using the New Obj pushbutton. Figure 53 shows the state of gui_os after having created the space for specifying one objective function. It is filled with default values, so the name of the objective function and the extra-parameters are not provided. The color bar is all red because it is necessary to specify the objective function to consider correct the information. In the Editable Area, the cause of error is explained.

So, we will specify the objective function and its extra-parameter. The function has been implemented in proce_stuckman.m so the name of the objective function is proce_stuckman. We have decided not to provide extra-parameters to the function, so the Parameter Editable/Writable area is left empty. The function only returns an objective value. The state of gui_os after providing the information is shown in figure 54. Filling the Editable/Writable objects of the Providing Information for each Objective function Area does not update the information of the currently selected element of the objective structure. So, before updating the information, it keeps on being consider erroneous and that explains why the name of the objective function is written in red and the color bar is all red. Note also that the information of the Editable area has not changed yet.

To update the objective structure push Update objective (in this case, as an objective structure with only one function has been created you can also push Update all). The state of gui_os after updating is shown in figure 55. Note that the information is not considered erroneous any longer (the name of the function is written in black and the color bar is green) and that the Editable Area shows now the updated information.

Page 68: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 68 Ingeniería de Sistemas y Automática

Figure 53. Stuckman Example: Step 11

Figure 54. Stuckman Example: Step 12

Page 69: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 69 EVOCOM Toolbox

Figure 55. Stuckman Example: Step 13

So, the objective structure has been defined with the necessary information, which is also correct (the color bar is in green). So, this GUI can be closed (by pushing X). After pushing the closing button, as the objective structure has changed (originally it was empty) a window is opened for asking users if they want to return the new information (option a), return to original objective structure (option b) or stay in this GUI (option c). The window is displayed in the following figure.

Figure 56. Stuckman Example: Step 14

Users should select option a. Selecting option b will return the original objective structure and so all the information provided will be lost. Staying (option c) is not a problem, but at some point users should select option a to return to gui_evocom with a filled objective structure. The state of gui_evocom when returning with a non-empty objective structure is shown in the following figure. Note how the GUI shows that the objective structure is now filled.

Page 70: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 70 Ingeniería de Sistemas y Automática

Figure 57. Stuckman Example: Step 15

Now we will define the objective structure. With this purpose we select the Objective Structure option from the List box and push DEFINE, as it is shown in the following figure.

Figure 58. Stuckman Example: Step 16

When pushing DEFINE, Gui_evocom is disable and gui_gas is called with the default EA (GA) structure, because it was not yet initialized in gui_evocom. The following figure shows the gui_gas displayed. The Initialization Area is enable and the Selecting the EA field Area and providing information for each field Area are disable. Note that as it is called from gui_evocom once the individual structure and objective structure have already been specified, the number of chromosomes and the number of objective values of the Initialization Area are the number of chromosomes of the individual structure (2) and the number of objective values of the objective structure (1). These two values cannot be changed. The number of total show methods can be changed using the + and – buttons. As we will only use one show method, the original number (1) is ok and so we do not change it.

Page 71: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 71 EVOCOM Toolbox

Figure 59. Stuckman Example: Step 17

In order to be able to see and change the information of the different fields the Fields option of the Modify menu should be selected. Then the Initialization Area is disable and the Selecting the EA field Area and Providing information for each field Area are enable. So, we can use the list box for selecting the fields we are going to modify, according with the EA described before.

We will start by modifying the initial pop size, so the fields Numbers and Initial Pop Size are selected. The new information (the Base Workspace NPOBL variable) is written in the Editable/Writable object of the Providing Information for each Field Area. Do not forget to use the Update pushbutton for updating the EA structure with the new information provided.

Figure 60. Stuckman Example: Step 18

Page 72: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 72 Ingeniería de Sistemas y Automática

Then we will modify the number of pairs of parents for the selection step, so the fields Numbers and Number of Parents are selected. The new information (the Base Workspace NSUBT variable) is written in the Editable/Writable object of the Providing Information for each Field Area. Do not forget to use the Update pushbutton for updating the EA structure with the new information provided.

Figure 61. Stuckman Example: Step 19

Then we will modify the number of Optimization criteria, so the fields Fitness and Optimization Criteria are selected. The new criteria (max) is selected in the popup menu of the Providing Information for each Field Area. Do not forget to use the Update pushbutton for updating the EA structure. Note that as the problem is mono-objective, only one optimization criteria can be selected.

Figure 62. Stuckman Example: Step 20

Page 73: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 73 EVOCOM Toolbox

The information of the stop method will also be changed, so the fields Stop and Stop Functions are selected. The new information (the Base Workspace NGENER variable) is written in the Editable Parameter object of the Providing Information for each Field Area. Do not forget to use the Update pushbutton for updating the EA structure.

Figure 63. Stuckman Example: Step 21

The information of the show method will also be changed, so the fields Show and Show Function are selected. The new information (the show_basic method with the parameter 1) is written in the Writable/Editable objects of the Providing Information for each Field Area. Do not forget to use the Update pushbutton for updating the EA structure.

Figure 64. Stuckman Example: Step 22

Page 74: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 74 Ingeniería de Sistemas y Automática

The selection method is also to be changed, so the fields Selection and Selection Function are selected. The new information (the sel_roulette method without extra-parameters) is written in the objects of the Providing Information for each Field Area. Do not forget to use the Update pushbutton.

Figure 65. Stuckman Example: Step 23

The information of the changing method will also be changed, so the fields Change and Change Function are selected. The new information (the ga_mut method with the extra-parameters {‘mutsel_default’,0.1, ‘mutnew_uniform’,[]}) is written in the Providing Information for each Field Area. Do not forget to use the Update pushbutton for updating the EA structure. Note that in this case it is possible to provide a different method for each of the chromosomes, but we have decided to use always the same.

Figure 66. Stuckman Example: Step 24

Page 75: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 75 EVOCOM Toolbox

The information of the recombination method will also be changed, so the fields Recombine and Recombine Function are selected. The new information (the method and extra-parameters specified in the REC_METHOD and REC_PARAM Base Workspace variables) is written in the Editable/Writable objects of the Providing Information for each Field Area. Do not forget to use the Update pushbutton.

Figure 67. Stuckman Example: Step 25

After all these changes, the EA structure contains the information needed for implementing the EA that we want to run. So, this GUI can be closed (by pushing X). After pushing the closing button, as the EA structure has changed (originally it was no defined) a window is opened for asking users if they want to return the new information (option a), return to original EA structure (option b) or stay in this GUI (option c). The window is displayed in the following figure.

Figure 68. Stuckman Example: Step 26

Users should select option a. Selecting option b will return the original EA structure (which was empty) and so all the information provided will be lost. Staying (option c) is not a problem, but at some point users should select option a to return to gui_evocom with a filled EA structure. The state of gui_evocom when returning with a non-empty EA structure is shown in the following figure. Note how the GUI shows that the EA structure is now filled.

Page 76: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 76 Ingeniería de Sistemas y Automática

Figure 69. Stuckman Example: Step 27

Once all the structure information has been specified, the algorithm can be run by pushing RUN. Before that, we decided to select the options of Evaluating the Structures before Running (so if we change the information of the Base Workspace variables the new information will be updated in the structures) and Ask if results should be saved (so the final results of the algorithm can be saved if desired). The state of gui_evocom after selecting those options is shown in the following figure.

Figure 70. Stuckman Example: Step 28

Then RUN is pushed and the general evolutionary algorithm starts running. As the selected showing method is show_basic and that method displays the evolution of the objective values of the algorithm in the Matlab prompt, users can see how the algorithm is evoluting. Figure 71 shows the Matlab prompt once the algorithm has finished (after 50 generations, because that was the value in NGENER). The maximum value (10) has been reached.

Page 77: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 77 EVOCOM Toolbox

Figure 71. Stuckman Example: Step 29

Once the algorithm is finished, a window for asking if the results should be saved or not is displayed. So users can still decide what to do with the results. Figure 72 shows that window. We decided not to save the results in this case.

Figure 72. Stuckman Example: Step 30

After running the EA as many times as desired, we will close gui_evocom pushing X. The following message is displayed, to warn users about the possibility of losing the information of the structures if they have not been saved before. The window is shown in the following figure.

Figure 73. Stuckman Example: Step 31

IMPORTANT

In the EVOCOM data files the algorithm defined with the three structures has been saved, so users can load them if they do not want to specify from the beginning.

Page 78: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 78 Ingeniería de Sistemas y Automática

Multiobjective Schaffer Problem EVOCOM can also be used for solving multi-objective problems. Several examples are provided with the toolbox. In this section we present the EA used for solving the Schaffer problem, which consists in finding the floating-point value that minimize simultaneously the following two functions:

The minimum of the problem is a real number x belonging to the intervals [1,2] or [4,5].

We solve the problem with an EA (which is completely described in the pareto2 folder inside EVOCOM’s example folder) that makes use of one of the pareto fitness methods provided with the toolbox. For the habitual pareto dominance definition, EVOCOM provides several pareto ranking methods such as the one by Fonseca and Fleming, and the one by Goldberg. These types of rankings assign the same ranking value to all the pareto optimal (not dominated) solutions found in the current population, which means that several solutions can be equally ‘good’. For using these kinds of methods, several substitution strategies are usually followed. In the multiobjective tests we use a really basic one: the new population consists of all the pareto optimal individuals of the old population and all the new individuals obtained after the crossing and mutation steps.

IMPORTANT

All the Base Workspace variables are stored in data.m, so this Script should be run before specifying the problem with EVOCOM GUI.

Problem Description Ø Problem Codification We will consider 1 chromosome, each storing a float value in the range [0,10], implemented with NBITS binary numbers. To obtain this chromosomes the gen_bin and gev_bin methods will be selected with the correct parameters. The two populations will be implemented as numeric matrixes.

Ø Objectives Description We will use two objective functions for obtaining the objective values of the problem. f1(x) is implemented in proce_1pareto2 and f2(x) is implemented in proce_2pareto2. For the first function no extra-parameters are needed, while for the second the extra-parameter 5 is needed because proce_2pareto2 implements (x-param)^2.

Ø EA Specification We will use the default EA structure definition, with the following changes:

POP initial size: NPOBL Pairs of children: NSUBT Fitness: min Fitness method: fit_pareto

Fitness param: {PAR_METHOD,10}, wit PAR_METHOD selected in data.m according with the values of PAR:

If PAR==1 PAR_METHOD='Goldberg' Otherwise PAR_METHOD='Fonseca'

Selection: sel_roulette, [] Recombination: rec_elitism, param=1 Stop: stop_generation (generation NGENER) Change: ga_mut, with the default parameters of ga_mut Show: show_bestn (param 1)

2)5()(2

34434312

1

)(1

−=

>−≤<−≤<−

≤−

=

xxf

xxxxxx

xx

xf

Page 79: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 79 EVOCOM Toolbox

Using EVOCOM GUI for solving the problem

We will solve the problem completely with GUI EVOCOM. In this case we have already specified the problem and save it in EVOCOM data files, so we will load the information from that files. Before running the specified algorithm we will display some of the information in the structures using the DEFINE pushbutton.

We will start by changing the path working directory of Matlab to the folder where the files of the problem are stored (that is $path_to_evocom/examples/demos/pareto/pareto2). Then we type gui_evocom in the Matlab prompt for using EVOCOM GUI to run the algorithm. For loading the information of the three structures simultaneously, the Load EVOCOM entry of the Options menu should be selected as it is shown in the following figure.

Figure 74. Schaffer Example: Step 1

In order to load the information, a Windows path browser is displayed. For the possible EVOCOM files, the information of the three structures is saved in evocom.dat so that is the file to be selected. Figure 75 shows the window displayed from Windows 2000.

Figure 75. Schaffer Example: Step 2

Page 80: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 80 Ingeniería de Sistemas y Automática

Once the file is opened, as it contains the information of the three structures (in the intermediate and final formats), the gui_evocom structures are filled with that information. The state of gui_evocom after loading the information is presented in the following figure. Note that the bullets used for showing if there is information related with each of the structures are now black.

Figure 76. Schaffer Example: Step 3

Although the information is already specified, and so the algorithm can already be run, we will show the information stored in each of the structures. By selecting the structure in the list box and using the DEFINE pushbuttons, the information stored in each variable is displayed in its corresponding GUI.

To show the information of the Individual Structure select the Individual Structure option of the gui_evocom list box and push DEFINE (as in figure 76). The individual structure stored in gui_evocom is provided to gui_is and gui_evocom is disable. The following figure shows the gui_is displayed. The population will only have a chromosome. Each of the individuals of the genetic population will consists of NBITS binary genes (generated with gen_bin). Each of the individuals of the chromosome population will consists of a unique floating point value in the range [0,10] (which is obtained from the genetic individual with gev_bin. The information is considered correct (green bar). After seeing the contents of the individual structure variable this GUI is closed (pushing X).

Figure 77. Schaffer Example: Step 4

Page 81: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 81 EVOCOM Toolbox

A warning message will not be displayed when closing gui_is because the information has not changed. Once gui_is has been closed, gui_evocom is enable again. For showing the information of the Objective Structure select the Objective Structure option of the gui_evocom list box and push DEFINE (as in the following figure).

Figure 78. Schaffer Example: Step 5

The objective structure stored in gui_evocom is provided to gui_os and gui_evocom is disable. The following figure shows the gui_os displayed. Two objective functions have been specified. In the Displaying information for each objective function Area the information related with the second objective function is displayed: the name of the method proce_2pareto2 with a unique extra-parameter whose value is 5, that returns only one objective value. For seeing the information of the first chromosome use the < pushbutton.

Figure 79. Schaffer Example: Step 6

Page 82: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 82 Ingeniería de Sistemas y Automática

The following figure shows the state of gui_os after pushing <. In the Displaying information for each objective function Area the information related with the first objective function is displayed: the name of the method proce_1pareto2 without extra-parameters that returns only one objective value. After seeing the contents of the objective structure variable this GUI is closed (pushing X).

Figure 80. Schaffer Example: Step 7

A warning message will not be displayed when closing gui_os because the information has not changed. Once gui_os has been closed, gui_evocom is enable again. For showing the information of the EA (GA) Structure select the GA Structure option of the gui_evocom list box and push DEFINE (as in the following figure).

Figure 81. Schaffer Example: Step 8

Page 83: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 83 EVOCOM Toolbox

The EA structure stored in gui_evocom is provided to gui_gas and gui_evocom is disable. The following figure shows the gui_gas displayed. The Initialization Area is enable and the Selecting the EA field Area and Providing information for each field Area are disable. Note that as it is called from gui_evocom the number of chromosomes and the number of objective values of the Initialization Area are the number of chromosomes of the individual structure (1) and the number of objective values of the objective structure (2). These two values cannot be changed. The number of total show methods is also the number of showing methods specified so far in the EA. As we are only seeing the information do not change the number of showing methods with the + and – buttons.

In order to be able to see the information of the different fields the Fields option of the Modify menu should be selected. Then the Initialization Area is disable and the Selecting the EA field Area and Providing information for each field Area are enable. So, we can use the list box for selecting the fields we want to see. We will only show the information of some of the fields.

Figure 82. Schaffer Example: Step 9

The information of the fitness method can be seen selecting the fields Fitness and Fitness Function. Figure 83 shows the contents of gui_gas when selecting these fields. The name of the method is fit_pareto and it has two extra-parameters. The first extra-parameter is the variable that stores the name of the function for obtaining the fitness giving the pareto dominance matrix (see fit_pareto in EVOCOM ver 2.0. Reference manual). The second extra-parameter (10) is the difference between two individuals one in a fitness group, and the other in the following.

The information of the optimization criteria can be seen selecting the fields Fitness and Optimization Criteria. Figure 84 shows the contents of gui_gas when selecting these fields. The criteria of the second name of the method is min and can be seen in the Providing Information for each Field Area. For seeing the optimization criteria of the first objective value, which is also minimizing, use the moving buttons (<< or <).

Page 84: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 84 Ingeniería de Sistemas y Automática

Figure 83. Schaffer Example: Step 10

Figure 84. Schaffer Example: Step 11

The information of the recombination method criteria can be seen selecting the fields Recombination and Recombination Function. The following figure shows the contents of gui_gas when selecting these fields. The method selected is rec_elitism with the extra-parameter 1.

Page 85: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 85 EVOCOM Toolbox

Figure 85. Schaffer Example: Step 12

After closing gui_gas we can run the general EA specified by pushing RUN. Before that, we decided to select the options of Evaluating the Structures before Running (so if we change the information of the Base Workspace variables the new information will be updated in the structures) and Ask if results should be saved (so the final results of the algorithm can be saved if desired). The state of gui_evocom after selecting those options is shown in the following figure.

Figure 86. Schaffer Example: Step 13

Then RUN is pushed and the general evolutionary algorithm starts running. If any of the variables are not defined in the Base Workspace the EA ends with an error, displaying a message (see figure 87).

Figure 87. Schaffer Example: Step 14

Page 86: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 86 Ingeniería de Sistemas y Automática

After defining all the variables in the Base Workspace (for instance running the Script M-file data), DEFINE is pushed again and the EA run. As the selected showing method is show_bestn and that method displays the objective values of the best individuals of each generation in the Matlab prompt, users can see how the algorithm is evoluting. Figure 88 shows the Matlab prompt once the algorithm has finished (after 10 generations, because that was the value in NGENER).

Figure 88. Schaffer Example: Step 15

Once the algorithm is finished, a window for asking if the results should be saved or not is displayed. So users can still decide what to do with the results. Figure 89 shows that window. We decided not to save the results in this case.

Figure 89. Schaffer Example: Step 16

After running the EA as many times as desired, we will close gui_evocom pushing X. The following message is displayed, to warn users about the possibility of losing the information of the structures if they have not been saved before. The window is shown in the following figure.

Figure 90. Stuckman Example: Step 19

Page 87: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 87 EVOCOM Toolbox

Results In the following figure some results of the implemented algorithm are presented. a) Shows the pareto optimal solutions found for different number of iterations and b) the bigger error between the pareto solutions founded by the toolbox and the analytic solution (elements belonging to the intervals [1,2] or [4,5]). While the number of generations grows, the number of pareto solutions is incremented and the error decremented.

Figure 91. Experimental Results of the Schaffer Problem

Page 88: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 88 Ingeniería de Sistemas y Automática

Finding a path in a maze The problem presented in this section consists in finding the shorter path between two selected points in a maze. It has been chosen as an example of genetic programming (the length of the path is variable) and to show the benefits of developing low level functions problem specific. The maze will be provided in a Matlab matrix (Maze) of 0 (free) and 1 (occupied).

The path can be represented in different ways: by the points of the maze visited, by a string of instructions (GoLeft, GoRigth, GoUpwards, GoDownwards), ... We decided to implement it as a string of instructions because then, the low level representation of the path can be an array whose values belong to the set {1,2,3,4} and the upper level representation obtained by an easy mapping function gev_maze that assigns a letter to each of those values {U,D,L,R}.

The EVOCOM low-level functions gev_int, cross_multipoint and mut_uniform let us generate, cross and mutate paths of a random length with elements in the selected domain. However, there is a problem: these functions will not generate always valid solutions (paths that reach the end without going through an occupied position) because they do not use information about the problem (the maze). If these functions were used the user should provide repairing functions or implement an objective function that penalizes the not valid solutions making the EA converge. Both tasks are difficult, so we decide to follow a different approach: develop our own methods ensuring that the individuals always hold valid solutions. As the individuals will now be always valid, the objective function proce_path will only return the length of the instruction string. The implemented methods are explained in detail in the maze folder.

IMPORTANT

All the Base Workspace variables are stored in data.m, so this Script should be run before specifying the problem with EVOCOM GUI.

Problem Description Ø Problem Codification We will consider individuals with 1 chromosome of variable number of genes. The chromosome will store an string of instructions (for instance ‘UULLRLDDU’) that will make the object go from the initial to the final position. Each instruction is codified in the genetic representation level as 1,2 3 or 4.

For obtaining the individuals of the genetic population the gen_maze (whose extra-parameters are the sour, the destination and the maze variables) is used. The mapping from the genetic individual (array with numbers) to the chromosome individual (string with instructions) is performed with gev_maze.

The genetic and chromosome populations need to be implemented in cell matrix (because not all the individuals have the same length).

Ø Objectives Description We will use a unique objective function, proce_maze, without extra-parameters, that returns the length of the string (that is the length of the path).

Ø EA Specification We will use the default EA structure definition, with the following changes:

POP initial size: NPOBL Pairs of children: NSUBT Coding: genetic and chromosome, cell matrixes. Fitness: min Fitness function: fit_ranklinear with extra-parameter = 0.7 Selection: sel_roulette, [] Recombination: rec_subgen, without extra-parameters Crossing: crosspoint_maze (parameter {2,sour}), crossing_maze (without extra-parameters) Mutation: mutsel_maze (parameter 0.5), mutnew_maze (parameter {sour,maze})

Page 89: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 89 EVOCOM Toolbox

Stop: stop_goal (final goal TOPE) Change: ga_mut, with the same parameters as ga_mut Show: Two showing methods: show_basic (param 1) show_maze ({2,maze,sour}).

Using EVOCOM GUI for solving the problem

We will solve the problem completely with GUI EVOCOM. In this case we have already specified the problem and save it in EVOCOM data files, so we will load the information from that files. Instead of running the algorithm from EVOCOM GUI, we will generate the M-file and run the general EA specified from Matlab.

We will start by changing the path working directory of Matlab to the folder where the files of the problem are stored (that is $path_to_evocom/examples/demos/maze/knowledge). Then we type gui_evocom in the Matlab prompt for using EVOCOM GUI to run the algorithm. For loading the information of the three structures simultaneously, the Load EVOCOM entry of the Options menu should be selected. The file to be provided for loading the three structures is evocom.dat.

Once the information has been specified, the M-file which contains the same information and that can be run from the Matlab prompt can be saved. For doing that, select the M-File entry of the Save EVOCOM option of the Options menu (as shown in the following figure).

Figure 92. Maze Example: Step 1

Once that option is selected, a window path browser is opened and so the name of the output file can be selected. We decided to save it as algorithm_maze.m and the contents of the generated file are next presented.

% File generated with the evocom gui % Exectuting it will run the algorithm in EVOCOM (the file will be generated with incomplete % information if the algorithm was not totally defined % If variables were defined in the Base WorkSpace while using the GUIS, they should be % defined before executing this file to prevent errors. % When running the algorithm, make sure that all the functions are in the path. % Date 13-Sep-2001 % ----- Initial Information -------------- seed=[]; pop_init=[]; % ----- Individual Structure --------------- ind_str=is_new(1);

Page 90: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 90 Ingeniería de Sistemas y Automática

ind_str=is_set(ind_str,'gen_number',[],1); ind_str=is_set(ind_str,'fungen','gen_maze',1); ind_str=is_set(ind_str,'paramgen',{sour,dest,maze},1); ind_str=is_set(ind_str,'funeval','gev_maze',1); ind_str=is_set(ind_str,'parameval',[],1); ind_str=is_set(ind_str,'funrepair','',1); ind_str=is_set(ind_str,'paramrepair',[],1); % ----- Objective Structure --------------- obj_str=objs_new(1); obj_str=objs_set(obj_str,'proce_maze',[],1,1); % ----- EA (GA) Structure --------------- gas_str=gas_new(1,1,2,[0,0,0,0,0,0,0]); gas_str=gas_set(gas_str,'number','popinit',NPOBL); gas_str=gas_set(gas_str,'number','parents',NSUBT); gas_str=gas_set(gas_str,'number','pinmigrant',1); gas_str=gas_set(gas_str,'number','ninmigrant',0); gas_str=gas_set(gas_str,'coding','gen',1); gas_str=gas_set(gas_str,'coding','chrom',1); gas_str=gas_set(gas_str,'fitness','fitfun','fit_ranklinear'); gas_str=gas_set(gas_str,'fitness','fitparam',0.7); gas_str=gas_set(gas_str,'fitness','nichfun',''); gas_str=gas_set(gas_str,'fitness','nichparam',[]); gas_str=gas_set(gas_str,'fitness','obj','min'); gas_str=gas_set(gas_str,'stop','fun','stop_goal'); gas_str=gas_set(gas_str,'stop','param',{TOPE,-1}); gas_str=gas_set(gas_str,'show','fun','show_basic',1); gas_str=gas_set(gas_str,'show','param',1,1); gas_str=gas_set(gas_str,'show','fun','show_maze',2); gas_str=gas_set(gas_str,'show','param',{2,maze,sour},2); gas_str=gas_set(gas_str,'selec','fun','sel_roulette'); gas_str=gas_set(gas_str,'selec','param',[]); gas_str=gas_set(gas_str,'selec','incest',[0 1]); gas_str=gas_set(gas_str,'compare','fun','comp_vector'); gas_str=gas_set(gas_str,'compare','param',[]); gas_str=gas_set(gas_str,'cross','pointfun','crosspoint_maze'); gas_str=gas_set(gas_str,'cross','pointparam',{2,sour}); gas_str=gas_set(gas_str,'cross','crossfun','crossing_maze'); gas_str=gas_set(gas_str,'cross','crossparam',[]); gas_str=gas_set(gas_str,'cross','prob',0.8); gas_str=gas_set(gas_str,'mut','selgenesfun','mutsel_maze'); gas_str=gas_set(gas_str,'mut','selgenesparam',0.5); gas_str=gas_set(gas_str,'mut','new_valuefun','mutnew_maze'); gas_str=gas_set(gas_str,'mut','new_valueparam',{sour,maze}); gas_str=gas_set(gas_str,'equal','fun','equal_vector'); gas_str=gas_set(gas_str,'equal','param',[]); gas_str=gas_set(gas_str,'change','fun','ga_mut'); gas_str=gas_set(gas_str,'change','param',{'mutsel_maze',0.5,'mutnew_maze',{sour,maze}}); gas_str=gas_set(gas_str,'recombine','fun','rec_subgen'); gas_str=gas_set(gas_str,'recombine','param',[]); gas_str=gas_set(gas_str,'super','fun',''); gas_str=gas_set(gas_str,'super','param',[]); gas_str=gas_set(gas_str,'super','step',[]); gas_str=gas_set(gas_str,'super','howmany',1); gas_str=gas_set(gas_str,'super','fixed',1); gas_str=gas_set(gas_str,'store','fun','store_firstn'); gas_str=gas_set(gas_str,'store','param',1); % ----- General Algorithm --------------- [gen,chrom,value,fitness,popt,chromt,valuet,fitnesst,itert]=ga_algorithm(ind_str,gas_str,obj_str,seed,pop_init);

So, the algorithm can be run from Matlab typing in the prompt algorithm_maze. As the second showing method displays in a figure the best path obtained, while running the algorithm not only the length of the shorter path is displayed in Matlab prompt but also a figure is opened and the best path drawn.

Page 91: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

Dacya – U.C.M

Ingeniería de Sistemas y Automática 91 EVOCOM Toolbox

In figure 93 one of the best paths obtained (before reaching the minimum) is presented. The minimum path was obtained after 63 generations. Figure 94 shows the Matlab prompt once the algorithm has finished.

Figure 93. Maze Example: Step 2

Figure 94. Maze Example: Step 3

Page 92: EVOCOM GUI - UCM · EVOCOM GRAPHIC USER INTERFACE OVERVIEW The following group of GUIs composes the graphic user interface provided with EVOCOM: • GUI_IS, the individual structure

.Dacya – U.C.M

EVOCOM Toolbox 92 Ingeniería de Sistemas y Automática

References

B. de Andres, S. Esteban, D. Rivera, J.I. Hidalgo, M. Prieto (2000b). Parallel Genetic Algorithms: An application for Model Parameter Identification in Process Control. Proceeding of GECCO 2000, pp 65-69.

B.de Andrés Toro, J.M. Girón Sierra, J.A.López Orozco, C. Fernández Conde, José Martínez Peinado, Felix García Ochoa (1998). A kinetic model for beer production under industrial operational conditions. Mathematics and Computers in Simulation. International Association for Mathematics and Computer in Simulation. Vol 48, Pag.63-73. November 1998.

P. J. Bentley and J. P. Wakefield (1997). Finding Acceptable Solution in the Pareto-Optimal Range using Multiobjetive Genetic algorrithms. In P.K chawdrhy, R. Roy, and R.K. Pant editors, Soft Computing in Engineering and Design. Springer-Verlag, London, England.

C. Darwin (1859). On the Origin of Species by Means of Natural Selection or the Preservation of Favoured Races in the Struggle for Life. John Murray, London.

C. M. Fonseca and P. J. Flemming (1998). Multiobjetive Optimization and Multiple Constraint Handling with Evolutionary algorithms – Part I: A Unifed Formulation. IEEE Transactions on System, Man and Cybernetics – Part A: Systems and Humans 28(1):26-37.

Goldberg, D.E. (1989). Genetic Algorithms in Search, Optimization and Machine Learning. Addison-Wesley, Reading, MA.

J. H. Holland (1975). Adaptation in Natural and Artificial System. The University of Michigan Press.

J. D. Knowles and D. W. Corne (2000). Approximating the Nondominated Front Using the Pareto Archived Evolution Strategy. Evolutionary Computation 8(2):149-172.

Lazauskas, Leo (1999). Department of Applied Mathematics, University of Adelaide, South Australia. http://www.maths.adelaide.edu.au/Applied/llazausk/alife/

Michalewicz, Z. (1999). Genetic Algoritm + Data Structures = Evolution Programs. 3rd Edition. Springer-Verlag.

D.A. Ban Veldhuizen, G.B Lamont. Multiobjective Evolutionary Algorithms: Analysing the State-of-the-Art. (2000) Evolutionary Computation 8(2):149-172.