xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

  • 大小: 45.01MB
    文件類(lèi)型: .rar
    金幣: 1
    下載: 0 次
    發(fā)布日期: 2023-07-24
  • 語(yǔ)言: C/C++
  • 標(biāo)簽: NSGA??I??

資源簡(jiǎn)介

NSGA II代碼實(shí)現(xiàn)集合包含實(shí)例、講解及 網(wǎng)絡(luò)模型與多目標(biāo)遺傳算法書(shū)記(python、C、C++、matlab) 應(yīng)用數(shù)學(xué)譯叢 網(wǎng)絡(luò)模型與多目標(biāo)遺傳算法_(日)玄光男,林林著;梁承姬,于歆杰譯_北京:清華大學(xué)出版社_2017.03_248_14182156

資源截圖

代碼片段和文件信息

/*
程序功能:實(shí)現(xiàn)nsga2算法,測(cè)試函數(shù)為ZDT1ZDT2ZDT3ZDT4ZDT6DTLZ1DTLZ2
說(shuō)明:遺傳算子為二進(jìn)制競(jìng)賽選擇,模擬二進(jìn)制交叉和多項(xiàng)式變異
作者:(曉風(fēng))
email:?18821709267@163.com?
參考論文:
A?fast?and?Elitist?Multiobjective?Genetic?Algorithm:NSGA-Ⅱ
Kalyanmoy?DebAssociate?Member?IEEE?Amrit?Pratap?Sameer?Agarwal?and?T.Meyarivan
IEEE?TRANSACTIONS?ON?EVOLUTIONARY?COMPUTATION
最初建立時(shí)間:2018.10.12?
最近修改時(shí)間:2018.10.19?
*/
/*
算法使用說(shuō)明:
1.本算法為NSGA2,實(shí)驗(yàn)采用的測(cè)試函數(shù)為ZDT1ZDT2ZDT3ZDT4ZDT6DTLZ1DTLZ2,要選擇哪個(gè)函數(shù)請(qǐng)修改第123行。
2.文件輸出路徑請(qǐng)修改中127行的a數(shù)組,格式必須與a保持相同,第125行設(shè)置路徑中的實(shí)驗(yàn)次數(shù)(做幾次實(shí)驗(yàn)就設(shè)到幾,比如設(shè)置十次實(shí)驗(yàn)就1-10,最大實(shí)驗(yàn)次數(shù)為10,增加最大實(shí)驗(yàn)次數(shù)還需修改213行之后,增加與上述相同的隨機(jī)種子選項(xiàng)即可)。
3.采用新的測(cè)試函數(shù)請(qǐng)修改input.h(13行開(kāi)始是函數(shù)的約束條件)和func.h(41行開(kāi)始是函數(shù)編寫(xiě)的部分)兩個(gè)文件。
4.本算法默認(rèn)采用實(shí)數(shù)編碼,但迭代過(guò)程中進(jìn)行了二進(jìn)制編碼,二進(jìn)制編碼采用了兩種交叉類(lèi)型,單點(diǎn)交叉和均勻交叉,選擇那個(gè)修改input.h的11行。如果要使用二進(jìn)制編碼,請(qǐng)將func.h中的33-38行注釋變成代碼,29-32行加上注釋?zhuān)吹玫蕉M(jìn)制編碼的結(jié)果。
5.本實(shí)驗(yàn)可修改的參數(shù)(input.h中)有popsize(種群大小),gener(迭代次數(shù)),pcross(交叉概率),di(SBX交叉參數(shù)),dim(多項(xiàng)式變異參數(shù)),pmut_r(實(shí)數(shù)編碼的變異概率),pmut_b(二進(jìn)制編碼的變異概率)
6.實(shí)驗(yàn)的最大種群數(shù)為500,最大染色體長(zhǎng)度為300,最大變量數(shù)目為30,最大函數(shù)數(shù)目為10,pi定義為3.1415926
7.實(shí)驗(yàn)輸出結(jié)果有三個(gè)文件:1)output.txt?包含參數(shù)設(shè)置,每代的自變量值(實(shí)數(shù)編碼,二進(jìn)制編碼),函數(shù)值,等級(jí)和擁擠度。2)fun.txt包含最后一代輸出的函數(shù)值?3)time.txt包含程序運(yùn)行時(shí)間
8.本實(shí)驗(yàn)沒(méi)有實(shí)現(xiàn)約束問(wèn)題,得再次算法的基礎(chǔ)上進(jìn)行修改。
*/
#include
#include
#include
#include
#include?

#define?square(x)?((x)*(x))
#define?maxpop?500//最大種群數(shù)
#define?maxchrom?300/*最大染色體長(zhǎng)度*/
#define?maxvar?30?//最大變量數(shù)目
#define?maxfun?10?//最大函數(shù)數(shù)目
#define?PI?3.1415926

int?gener//迭代數(shù)目
????nvarnchrom//變量數(shù)目,染色體數(shù)目(二進(jìn)制)
????vlen[maxvar]//儲(chǔ)存每個(gè)變量的位的個(gè)數(shù)的數(shù)組(二進(jìn)制)
????optype//交叉類(lèi)型:1為單點(diǎn)交叉和2為均勻交叉(二進(jìn)制)
????nfunc//函數(shù)數(shù)目
????nmut//變異的個(gè)數(shù)
????ncross;//交叉的次數(shù)

float?seed//隨機(jī)種子
??????pcross//交叉概率
??????pmut_bpmut_r//變異概率
??????lim_b[maxvar][2]lim_r[maxvar][2]//數(shù)組中變量的限制
??????di//交叉的分布指數(shù)
??????dim;//變異的分布指數(shù)

static?int?popsize//種群數(shù)目
???????????chrom;//染色體總長(zhǎng)度

double?coef[maxvar];//解碼使用的變量

/*個(gè)體*/
typedef?struct
{
????int?genes[maxchrom]//二進(jìn)制染色體
????????rank???????????//個(gè)體等級(jí)
????????flag;???????????//等級(jí)標(biāo)志
????float?xreal[maxvar]//實(shí)變量的集合
??????????xbin[maxvar];//染色體解碼之后的集合
????float?fitness[maxfun]//適應(yīng)度函數(shù)
??????????crowd;??????????//擁擠距離??????
}individual;

/*種群*/
typedef?struct
{
????int?maxrank;//當(dāng)前種群的最大等級(jí)
????int?rankno[maxpop];//個(gè)體的等級(jí)
????individual?ind[maxpop]//個(gè)體的集合
???????????????*ind_str;
}population;

#include?“input.h“????????/*輸入條件*/

#include?“random.h“???????/*隨機(jī)數(shù)量的算子*/

#include?“realinit.h“?????/*隨機(jī)初始化種群*/

#include?“init.h“?????????/*隨機(jī)初始化種群*/

#include?“decode.h“???????/*解碼二進(jìn)制串*/

#include?“ranking.h“??????/*產(chǎn)生pareto前端*/

#include?“func.h“?????/*函數(shù)設(shè)置*/

#include?“select.h“???????/*二進(jìn)制錦標(biāo)賽*/

#include?“bincross.h“????/*二進(jìn)制交叉*/

#include?“uniformxr.h“????/*均勻交叉*/

#include?“realcross.h“???/*實(shí)數(shù)交叉*/

#include?“binmut.h“??????????/*二進(jìn)制變異*/

#include?“realmut.h“?????/*實(shí)數(shù)變異*/

#include?“keepaliven.h“???/*精英選擇和共享機(jī)制*/

#include?“report.h“???????/*打印輸出報(bào)告*/

population?old_pop
???new_pop
???mate_pop
???*old_pop_ptr
???*new_pop_ptr
???*mate_pop_ptr;
//定義種群結(jié)構(gòu)

//計(jì)算程序運(yùn)行時(shí)間
clock_t?st

?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----

?????文件???????9288??2019-03-22?22:13??NSGA?II\nsga2?C++版\NSGA2算法源代碼C++.txt

?????文件????????251??2019-03-22?22:18??NSGA?II\nsga2?C++版\算法說(shuō)明.txt

?????文件???????1753??2018-10-17?16:09??NSGA?II\nsga2?C語(yǔ)言版\bincross.h

?????文件????????676??2018-10-17?09:52??NSGA?II\nsga2?C語(yǔ)言版\binmut.h

?????文件????????853??2018-10-15?11:58??NSGA?II\nsga2?C語(yǔ)言版\decode.h

?????文件???????3378??2018-10-19?20:52??NSGA?II\nsga2?C語(yǔ)言版\func.h

?????文件????????512??2018-10-15?11:57??NSGA?II\nsga2?C語(yǔ)言版\init.h

?????文件???????4844??2018-10-19?20:52??NSGA?II\nsga2?C語(yǔ)言版\input.h

?????文件??????10579??2018-10-18?12:34??NSGA?II\nsga2?C語(yǔ)言版\keepaliven.h

?????文件??????11692??2018-10-23?16:31??NSGA?II\nsga2?C語(yǔ)言版\nsga2.cpp

?????文件?????199694??2018-10-19?20:48??NSGA?II\nsga2?C語(yǔ)言版\nsga2.exe

?????文件???????1519??2018-10-15?11:00??NSGA?II\nsga2?C語(yǔ)言版\random.h

?????文件???????4378??2018-10-15?21:25??NSGA?II\nsga2?C語(yǔ)言版\ranking.h

?????文件???????3919??2018-10-17?09:29??NSGA?II\nsga2?C語(yǔ)言版\realcross.h

?????文件????????370??2018-10-15?11:57??NSGA?II\nsga2?C語(yǔ)言版\realinit.h

?????文件???????1650??2018-10-17?15:42??NSGA?II\nsga2?C語(yǔ)言版\realmut.h

?????文件???????2826??2018-10-18?19:46??NSGA?II\nsga2?C語(yǔ)言版\report.h

?????文件???????3309??2018-10-16?20:18??NSGA?II\nsga2?C語(yǔ)言版\select.h

?????文件???????1383??2018-10-19?20:45??NSGA?II\nsga2?C語(yǔ)言版\uniformxr.h

?????文件????????121??2019-03-22?22:01??NSGA?II\nsga2?C語(yǔ)言版\算法說(shuō)明.txt

?????文件???????1273??2017-05-27?17:03??NSGA?II\nsga2?matlab\crowding_distance.m

?????文件????????970??2017-05-27?17:03??NSGA?II\nsga2?matlab\evaluate_objective.m

?????文件???????3509??2017-05-27?17:03??NSGA?II\nsga2?matlab\genetic_operator.m

?????文件???????5128??2017-05-27?17:03??NSGA?II\nsga2?matlab\html\crowding_distance.html

?????文件??????10289??2017-05-27?17:03??NSGA?II\nsga2?matlab\html\genetic_operator.html

?????文件???????4434??2017-05-27?17:03??NSGA?II\nsga2?matlab\html\initialize_variables.html

?????文件??????11714??2017-05-27?17:03??NSGA?II\nsga2?matlab\html\non_domination_sort_mod.html

?????文件??????13753??2017-05-27?17:03??NSGA?II\nsga2?matlab\html\nsga_2.html

?????文件???????6346??2017-05-27?17:03??NSGA?II\nsga2?matlab\html\replace_chromosome.html

?????文件???????6186??2017-05-27?17:03??NSGA?II\nsga2?matlab\html\tournament_selection.html

............此處省略39個(gè)文件信息

評(píng)論

共有 條評(píng)論