Try   HackMD

令人懷念ㄉ東西 XDDD

  • 基因演算法

  • 找近似解

  • 天擇論

    1. 估算分數
    2. 天擇:挑其中幾個較好的,挑 fitness 好的
    3. 交配:天擇後的答案去繁衍下一代,重組
    4. 突變:產生原本的人口中沒有的種類

      演化一定會經過得過程

    • 繁衍很多代後理論上答案就會愈來愈好
    • 為了產生不一樣的基因
  • 近似的演算法

    • 鳥群演算法
    • 螞蟻演算法
  • FITNESS : 適應值,分數越高越可能活下來

  • SELECTION : 天擇

  • : 突變 :

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

    • 分數越高,被選到的機率越大

基因演算

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

  1. 第一代:亂數產生
  2. 計算 fitness
  3. 得到所有結果的分數後,就可以做天擇
  • 轉換成二進位字串
    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →
  • 例子
    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

    (12,6) => (1100 0110)

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

  • 天擇
    • 做正規化

      自己的分數/全部加總起來的分數

  • 交配 (PC,0.7~0.9)
    • A B 為父母
    • 以單點交配為例:亂數產生一個交配點,子女各取一部分父母的基因
      Image Not Showing Possible Reasons
      • The image file may be corrupted
      • The server hosting the image is unavailable
      • The image path is incorrect
      • The image format is not supported
      Learn More →
    • 單點交配
      • 先產生一個亂數,決定要從哪裡開始切,切一刀(一段父,一段母),然後將父母不同的基因接在一起
    • 雙點交配
    • 多點交配
  • 突變(pm,0.1)
    • 隨機產生突變點,依據突變率骰骰子決定會不會突變,1 變 0,0 變 1
    • 針對排列的問題,想出以下幾種方法
      • 刪除插入突變:隨機擷取幾段刪除/插入基因
      • 交換突變:兩條染色體,兩個個別隨機擷取一段,交換剛剛擷取的基因
      • 反轉突變:隨機擷取一段基因,將順序反過來,再放回去
  • 排列(tsp旅行銷售員問題)
    • np problem: 只能找近似解
    • 隨機產生兩個點

MetaYourHeuristic 實習課教材 20190401

  • visual studio
  • 有說明書
  • GA_lib
  • propoty 切換主程式
  • paper_present: 期末報告的要求
  • 只需要改 fitness

    新計畫的環境&二氧化碳排放量需要改 fitness => 值越小越佳

numRepetitiveRuns 幾次基因(?)
ga.Run 多久
Dimension x1 x2 有幾個
DimensionsLowerBound 下限
DimensionsupperBound 上限
可以改整數,二進位,實數(EncodingType)
RepeatableoOption 看可不可以重複SS
突變 : 高斯,均勻(3種)

ga.Run(MFE, ?機率,突變機率)
代數 * 染色體數(fitness 要一致,MFE

  • GA_Lib_TSP