フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

generate crossover process and make matrix of new created childs

3 ビュー (過去 30 日間)
Pratik Anandpara
Pratik Anandpara 2016 年 12 月 15 日
編集済み: Pratik Anandpara 2016 年 12 月 16 日
entry = randi(9,6,3)
now convert this entry matrix in 8 digit binary now change two conecutive element column and created new 8 digit number now this new number convert into decimal and 6*3 size in this new 6*3 matrix each raw sum<=9 if not satisfy than do process with any other digit and raw swappinf and create new raw untill this process do row sum<=9 example
entry(1,:)=7 3 6
entry(2,:)=4 6 8
de2bi(entry(1,1)) : 0 0 0 0 0 1 0 1 =parent1
de2bi(entry(1,2)) : 0 0 0 0 0 0 1 1 =parent2
de2bi(entry(1,3)) : 0 0 0 0 0 1 1 0 =parent3
de2bi(entry(2,1)) : 0 0 0 0 0 1 0 0 =parent4
de2bi(entry(2,2)) : 0 0 0 0 0 1 1 0 =parent5
de2bi(entry(2,3)) : 0 0 0 0 1 0 0 0 =parent6
column swapping [7 8]
parent1 :0 0 0 0 0 1 0 1
paretn2 :0 0 0 0 0 0 1 1
child1 :0 0 0 0 0 1 1 1
child2 :0 0 0 0 0 0 0 1
paretn3 :0 0 0 0 0 1 1 0
paretn4 :0 0 0 0 0 1 0 0
child3 :0 0 0 0 0 1 0 0
child4 :0 0 0 0 0 1 1 0
parent5:0 0 0 0 0 1 1 0
paretn6:0 0 0 0 1 0 0 0
child5 :0 0 0 0 0 1 0 0
child6 :0 0 0 0 1 0 1 0
child 1=7 child2=1,child3=4.child4=6.child5=4 child6=10
7 1 4=12
6 4 10=20
child is not valid than do its process with another raw create again child and check this condition do until row sum<=9
crossover is actually column swapping process in 8 bit digit and create new digit
  3 件のコメント
Pratik Anandpara
Pratik Anandpara 2016 年 12 月 15 日
remove that some point is unclear in tht question
Pratik Anandpara
Pratik Anandpara 2016 年 12 月 16 日
編集済み: Pratik Anandpara 2016 年 12 月 16 日
this is parent matrix-->
entry = randi(9,6,3)
in next step convert into 8 digit binary and swap 7 & 8 digit of 1&2 element of parent now swap 7&8 digit of parent 1&2 so create some new digit (first six is same only last two change) now that 8 digit convert into decimal than check child1+child2+child3<=9 if not follow than swap again 7&8 digit of child which not satisfy total<=9 ...suppose raw 2 have child4+child5+child6=11 so condition not follow...so child 4 &5,child5&6 ,child 6&4 convert in 8 digit and swap 7&8 digit internally so create new 8 digit and convert in decimal check again –

回答 (0 件)

この質問は閉じられています。

製品

Community Treasure Hunt

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

Start Hunting!

Translated by