1 / 10

Pmutation 算有幾個變數 算一個變數有 幾個 chromsize 算出 stop 以亂數機率決定 哪個位元突變 突變結束

Pmutation 算有幾個變數 算一個變數有 幾個 chromsize 算出 stop 以亂數機率決定 哪個位元突變 突變結束. operator. individual. individual. Old population new population. 從 population 以亂數選出一個 individual 經過 mutation 產生 New population. 下圖是 chromsize = 4 . 每個 child 的大小會等於 UINTSIZE . UINTSIZE 的大小是在程式裡設定 .

mae
Download Presentation

Pmutation 算有幾個變數 算一個變數有 幾個 chromsize 算出 stop 以亂數機率決定 哪個位元突變 突變結束

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Pmutation 算有幾個變數 算一個變數有 幾個chromsize 算出stop 以亂數機率決定 哪個位元突變 突變結束

  2. operator individual individual Old populationnew population

  3. 從population以亂數選出一個individual經過mutation產生New population.

  4. 下圖是chromsize = 4 . 每個child 的大小會等於UINTSIZE . UINTSIZE的大小是在程式裡設定. 在此的UINTSIZE設定為16bits UINTSIZE

  5. Stop計算方式: For(k=0;k<chromsize;k++) { mask=0; if(k= =(chromsize-1)) stop=lchrom-(k*UINTSIZE); else stop=UINTSIZE;

  6. 60位元 k=0 k=1 k=2 k=3 0 stop stop stop stop lchrom 假設輸入的變數長度為60,那就須要要有4個chromsize. 如果k等於chromsize-1,那就stop=lchrom-(k*UINTSIZE) 因為k=3不滿16位元,所以這個式子就是要算出k=3佔了幾位元. k=0~k=2都滿16位元所以套用stop=UINTSIZE

  7. Mask是決定哪個位元要突變的一串數列

  8. Mask是輸出一串二進制的數列 , 這串二進至數列是由上面這行程式經for迴圈產生得結果 , 它是由temp=1左移來決定j位元是否為1 . 那決定temp是否要左移是由flip (pmutation)隨機的決定的 , flip (pmutation)的輸出是“做”或者“不做”.

  9. 接下來就是最後的動作 child[k+i*chromsize]=child[k+i*chromsize]^mask 這個式子是說突變的結果是把child的數列跟mask數列做xor就成為了一串新的數列,突變結束. 如下張圖的例子 .

  10. 例: 10111101101101 child 11100110111001 msak xor 01011011010100 結果 突變結果

More Related