What is the Matlab genetic algorithm toolbox?
Genetic algorithm has the advantages of simple thinking and obvious application effect. Experts and scholars in various fields have conducted in-depth research on it, and used C, C++ and other programming languages to implement algorithms. However, these languages require users to write genetic algorithm programs, which brings certain difficulties to researchers who are not familiar with programming languages. The genetic algorithm toolbox of Matlab can realize the operation of genetic algorithm through a graphical user interface (GUI) . The problem can be quickly defined by writing a small amount of fitness function program and setting the corresponding parameters in the toolbox. Flexible, easy to use, and easy to modify parameters.
This article takes the genetic algorithm toolbox in Matlab7.1 version as an example to introduce the structure and parameter settings of the toolbox. Type “gatool” in the Matlab working window. After the command is run, you can open the Genetic Algorithm Tool box, or find and open the tool box in the Start menu in Matlab. The operation interface is shown in Figure.
The genetic algorithm toolbox is divided into 5 parts from left to right, mainly including defining function handles and variable numbers, running displays (Plots), constraints (Constraints), running commands and results (Run Solver), parameter settings (Options), etc.
(1) When solving actual problems, first determine the fitness function of the problem, and write it as an M file and store it on the working path of Matlab. Fill in the handle of the compiled fitness function in Fitness Function, the format is “@funtname”, and enter the number of variables to be solved in Number of vari.
(2) Constraints include constraints such as Linear inequalities, Linear equalities, and Bounds. For example, boundary constraints limit the minimum and maximum values of variables, and the maximum value constraints of multiple variables can be expressed in matrix form.
(3) Operation display (Plots) displays the operation process of the selected item in image form during operation. For example, after checking Best fitness, the algorithm operation process will display the best function value and average value in each generation of the group; checking Best individual will display the individual corresponding to the best fitness value under the current iteration number.
(4) The run command and result (Run solver) includes operation buttons such as run, pause, stop, etc. The number of iterations and operation status will be displayed during the running process, and the final optimization result will be displayed in the final point after the algorithm stops.
(5) Parameter settings (Options) mainly affect the calculation speed and accuracy of the algorithm, mainly including population (Population), fitness scale (Fitness scaling), selection (Selection), mutation (Mutation), stop condition (Stopping Criteria), Crossover (Crossover) and other parameter settings. The relevant parameters can be selected and set through the drop-down menu.