How to change Crossover Function in GA midway through solving?
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi all,
I have a GA setup to search for a minimum of a problem. I think my problem is well defined, except it has many local optima. I read in the documentation that changing the Crossover and Mutation Functions midway through iterations can be very useful in aiding of finding global optima. I understand it needs to be modified by the 'OutputFcn' settings, but all the documentation I see include cases where multiple things are being changed. Say if I just want to change the Crossover from 0.2 at the beginning to 0.8 after a certain number of iterations, what would the script for OutputFcn look like?
All the best.
0 Kommentare
Antworten (1)
Alan Weiss
am 6 Aug. 2018
I think that this will work, but I have not tested it, so use at your own risk.
Suppose that you want to change the crossover probability at generation 27.
function [state,options,optchanged] = gaoutfun(options,state,flag)
optchanged = false;
if state.Generation == 27
options.CrossoverFraction = 0.8;
optchanged = true;
end
Pass @gaoutfun as the OutputFcn option (I assume that you use optimoptions to set your options).
Alan Weiss
MATLAB mathematical toolbox documentation
0 Kommentare
Siehe auch
Kategorien
Mehr zu Genetic Algorithm finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!