Info
Cette question est clôturée. Rouvrir pour modifier ou répondre.
generate crossover process and make matrix of new created childs
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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
Réponses (0)
Cette question est clôturée.
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!