single cross over function for genetic algorithm
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
abdulla ishaq
am 18 Mai 2015
Beantwortet: Geoff Hayes
am 19 Mai 2015
hello,
i'm working on a code for genetic algorithm and i have 2 random parents data for example
p1=[1 2 3 4 5 6 7 8 9 10] % parent #1
p2=[2 6 8 9 1 3 4 5 10 9] % parent #2
now if i want to make a single crossover on point 3 for example .. is there any specific function i can use to produce the child ?
i saw crossoversinglepoint function but i really don't know how to use it.. ps all the parents are integer numbers
thank you in advance
Abdulla Aqeel
0 Kommentare
Akzeptierte Antwort
Geoff Hayes
am 19 Mai 2015
Abdulla - since you want a single crossover point in your list of variables, then using crossoversinglepoint seems like the correct choice. To use this function, you will need to set the GA options using gaoptimset. Something like the following would probably work for you
options = gaoptimset('CrossoverFcn',@crossoversinglepoint);
Note that you can set other properties of options as well, so you are not limited to the above single option.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Genetic Algorithm finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!