資源簡介
使用goat遺傳工具箱完成基于 模擬退火算法 優化的遺傳算法。
對goat遺傳工具箱,做了詳細的注釋。
matlab編譯環境
使用說明:函數需要調用goat工具箱的相關函數

代碼片段和文件信息
function?[xendPopbPoptraceInfo]?=?ga(boundsevalFNevalOpsstartPopopts...
termFNtermOpsselectFNselectOpsxOverFNsxOverOpsmutFNsmutOps)
%?goat這個工具箱是網上流傳最廣的一個,我僅僅針對其主函數做了注釋。?
%
%遺傳模擬退火,termFN,selectFN內定。用時,卻省或為[]也可。
%startPop=[]時,自動生成群
%termFN當為[]時,selectFN=[]select0ps=[]執行遺傳模擬退火默認為maxGenTerm_th
%GA?run?a?genetic?algorithm
%?function?[xendPopbPoptraceInfo]=ga(boundsevalFNevalOpsstartPopopts
%????????????????????????????????????????termFNtermOpsselectFNselectOps
%????????????????????????????????????????xOverFNsxOverOpsmutFNsmutOps)
%????????????????????????????????
%x=ga(boundsevalFNevalOps)
%
%
%
%Output?Arguments:
%????x?????????????-?the?best?solution?found?during?the?course?of?the?run?求得的最優解
%????endPop????????-?the?final?population?最終得到的種群
%????bPop??????????-?a?trace?of?the?best?population?最優種群的一個搜索軌跡
%????traceInfo?????-?a?matrix?of?best?and?means?of?the?ga?for?each?generation?每一代種群的最優個體和均值
%
%?Input?Arguments:
%????bounds????????-?a?matrix?of?upper?and?lower?bounds?on?the?variables?代表變量上下界的矩陣
%????evalFN????????-?the?name?of?the?evaluation?.m?function?適應度函數所在的m文件
%????evalOps???????-?options?to?pass?to?the?evaluation?function?([NULL])
%????傳遞給適應度函數的參數默認為空
%????startPop??????-?a?matrix?of?solutions?that?can?be?initialized?初始種群
%???????????????????from?initialize.m?
%????opts??????????-?[epsilon?prob_ops?display]?change?required?to?consider?two?
%???????????????????solutions?different?prob_ops?0?if?you?want?to?apply?the
%???????????????????genetic?operators?probabilisticly?to?each?solution?1?if
%???????????????????you?are?supplying?a?deterministic?number?of?operator
%???????????????????applications?and?display?is?1?to?output?progress?0?for
%???????????????????quiet.?([1e-6?1?0])
%???opts--選擇編碼形式(浮點編碼或是二進制編碼)[epsilon?prob_ops?display]如
%prob_ops-變量進行二進制編碼時指定的精度?
%prob_ops--為1時選擇浮點編碼,否則為二進制編碼由precision指定精度)?
%display0或1控制是否輸出結果;默認為[1e-6?1?0]
%????termFN????????-?name?of?the?.m?termination?function?([‘maxGenTerm‘])
%????終止函數所在的m文件,maxGenTerm為求最大值時的終止函數
%????termOps???????-?options?string?to?be?passed?to?the?termination?function?傳遞個終止函數的參數,一般為需要遺傳的代數
%???????????????????([100]).maxGenTerm將在這里面取得最大值
%????selectFN??????-?name?of?the?.m?selection?function?([‘normGeomSelect‘])?選擇函數的名稱
%????selectOpts????-?options?string?to?be?passed?to?select?after?傳遞給選擇函數的參數,一般為變異概率
%???????????????????select(pop#opts)?([0.08])
%????xOverFNS??????-?a?string?containing?blank?seperated?names?of?Xover.m?交叉函數名稱表,以空格分開
%???????????????????files?([‘arithXover?maxGenTermXover?simpleXover‘])?
%????xOverOps??????-?A?matrix?of?options?to?pass?to?Xover.m?files?with?the?傳遞給交叉函數的參數表
%???????????????????first?column?being?the?number?of?that?xOver?to?perform
%???????????????????similiarly?for?mutation?([2?0;2?3;2?0])
%????mutFNs????????-?a?string?containing?blank?seperated?names?of?mutation.m?變異函數表%???????????????????files?([‘boundaryMutation?multiNonUnifMutation?...
%??????????????????????
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2008-10-11?09:57??遺傳模擬退火算法\
?????文件???????16412??2007-07-23?18:00??遺傳模擬退火算法\ga_th.m
?????文件????????2179??2007-07-22?21:43??遺傳模擬退火算法\遺傳模擬退火算法.m
?????文件????????3370??2007-07-22?21:43??遺傳模擬退火算法\遺傳模擬退火算法2.?m.txt
評論
共有 條評論