single cross over function for genetic algorithm
10 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
Geoff Hayes
2015 年 5 月 19 日
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Genetic Algorithm についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!