How can I modify the 'SelectionFcn' between two generations when using the Genetic Algorithm and Direct Search Toolbox 1.0.3 (R14SP2) from the command line?

The Selection option ('SelectionFcn') specifies how the genetic algorithm chooses parents for the next generation. I am aware of the fact that I can modify the 'SelectionFcn' of a genetic algorithm when using the GATOOL, by pausing to stop the generation process and then choosing another selection function, and subsequently restarting the process. I would like to do the same from the command line.

 Accepted Answer

You may change the 'SelectionFcn' option from the command line by writing an output function and modifying the 'SelectionFcn' option in the options structure. To get started with this, you may use the gaoutputfcntemplate.m file, which illustrates how this can be done. You can study this function by typing the following at the command prompt:
edit gaoutputfcntemplate.m

More Answers (0)

Products

Release

R14SP2

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!