freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

齒輪傳動(dòng)優(yōu)化設(shè)計(jì)的遺傳算法研究-畢業(yè)設(shè)計(jì)-資料下載頁

2025-08-07 11:27本頁面
  

【正文】 ,這個(gè)評估個(gè)體適應(yīng)度的函數(shù)稱為適應(yīng)度函數(shù)。適應(yīng)度較高的個(gè)體遺傳到下一代的概率較大;而適應(yīng)度較底的個(gè)體遺傳到下一代的概率相對小一些 [6]。通常優(yōu)化問題求解時(shí)是把待求問題的目標(biāo)函數(shù)映射成適應(yīng)度函數(shù)。對于求最小的目標(biāo)函數(shù) 映射成適應(yīng)度函數(shù)的方法可為:??xf 若 (4????xfCxp??ma ?maxCf?7)這里的 可取為最大目標(biāo)函數(shù)的 倍,即適應(yīng)函數(shù)為:maxCfitness( ) = * max_objf objf( ) (48)xx由前面的式(313)得目標(biāo)函數(shù)為: (49)????3232 4/14/1 zuzmuxf dd?????????青島理工大學(xué)本科畢業(yè)設(shè)計(jì)(論文)說明書25 選擇復(fù)制操作選擇復(fù)制操作是對群體中的個(gè)體按優(yōu)勝劣汰的方式選取,并遺傳到下一代群體的運(yùn)算操作,它是建立在群體中個(gè)體的適應(yīng)函數(shù)值評估基礎(chǔ)上的。適應(yīng)函數(shù)值較大的個(gè)體被遺傳到下一代群體中的概率較大,適應(yīng)函數(shù)值較小的個(gè)體被遺傳到下一代群體中的概率較小。通過選擇操作可避免基因缺失,提高全局收斂性和計(jì)算效率 [6]。適應(yīng)度比例選擇方法是基本的選擇方法,也叫輪盤賭選擇。該方法的基本思想是:各個(gè)個(gè)體的被選中的概率與其適應(yīng)度大小成正比。由第 2 章中式(26)得每個(gè)個(gè)體的累計(jì)概率為: (410)sizepo,21,sizepo?????fji顯然,概率反映了個(gè)體的適應(yīng)度在整個(gè)群體的個(gè)體適應(yīng)度總和中所占的比例,個(gè)體適應(yīng)度越大,其被選擇的概率就越高,反之亦然。此優(yōu)化設(shè)計(jì)中我們隨機(jī)產(chǎn)生一隨機(jī)數(shù) temp_a,當(dāng)累計(jì)概率大于 temp_a 時(shí),則選擇對應(yīng)的個(gè)體,并用 temp_b 來記錄。選擇的輪盤賭函數(shù)程序如下:Function select_lunpandu()RandomizeDim temp_a As DoubleDim temp_b As Integertemp_a = Rnd()For i = 1 To popsizeIf leijigailv(i) temp_a Thentemp_b = iselect_lunpandu = temp_bExit ForEnd IfNext i青島理工大學(xué)本科畢業(yè)設(shè)計(jì)(論文)說明書26 交叉操作遺傳算法的交叉是產(chǎn)生新個(gè)體的主要操作過程。某兩個(gè)個(gè)體之間的部分染色體是以某一概率,進(jìn)行部分基因交換,產(chǎn)生兩個(gè)新的染色體。這一過程是模擬生物進(jìn)化過程中繁殖的雜交現(xiàn)象。對于整數(shù)和實(shí)數(shù)編碼的染色體可采用算術(shù)交叉的方法 [6]。它是由兩個(gè)個(gè)體的線形組合而產(chǎn)生出兩個(gè)新個(gè)體,若兩個(gè)個(gè)體 、 之間進(jìn)行算術(shù)交叉,則交叉運(yùn)算后所產(chǎn)tAXtB生出的兩個(gè)新個(gè)體為: (411)??????????ttt BA1B?式中: 為一隨機(jī)產(chǎn)生的[0,1]間的隨機(jī)數(shù)。?本設(shè)計(jì)程序中用 temp_gema 表示 。程序中利用隨機(jī)產(chǎn)生的 temp_pc,若temp_pc=jiaochagailv_pc(交叉概率)則兩個(gè)個(gè)體進(jìn)行交叉,從而得到新的兩個(gè)個(gè)體;若不交叉則個(gè)體保持不變。在交叉操作的過程中,交叉概率的選擇是要認(rèn)真考慮的。交叉概率的取值范圍按經(jīng)驗(yàn)得一般是[,],本例中交叉概率為 。程序如下:Public Sub cross(n1 As Integer, n2 As Integer, i As Integer) RandomizeDim temp_gema As DoubleDim temp_pc As Doubletemp_pc =Rnd()If temp_pc = jiaochagailv_pc Thentemp_gema = Rnd()newpop_m(i)=Int(temp_gema*pop_m(n1)+(1temp_gema)*pop_m(n2))newpop_m(i+1)=Int(temp_gema*pop_m(n2)+(1temp_gema)*pop_m(n1))newpop_z(i)=CInt(temp_gema*pop_z(n1)+(1temp_gema)*pop_z(n2))newpop_z(i+1)=CInt(temp_gema*pop_z(n2)+(1temp_gema)*pop_z(n1))newpop_faidi(i)=temp_gema*pop_faidi(n1)+(1temp_gema)*pop_faidi(n2)青島理工大學(xué)本科畢業(yè)設(shè)計(jì)(論文)說明書27newpop_faidi(i+1)=temp_gema*pop_faidi(n2)+(1temp_gema)*pop_faidi(n1)Elsenewpop_m(i)=pop_m(i)newpop_m(i+1)=pop_m(i+1)newpop_z(i)=pop_z(i)newpop_z(i+1)=pop_z(i+1)newpop_faidi(i)=pop_faidi(i)newpop_faidi(i+1)=pop_faidi(i+1)End IfEnd Sub 變異運(yùn)算變異的目的是為了防止丟失一些有用的遺傳基因,即增強(qiáng)遺傳算法搜索最優(yōu)解的能力,尤其是當(dāng)群體中的個(gè)體經(jīng)遺傳算法可能使某些串位失去多樣性,從而可能失去檢驗(yàn)有用遺傳基因的機(jī)會。目前有多種主要的變異算子,我選擇了非均勻變異算子。所謂非均勻變異即對原有的基因值作一隨機(jī)擾動(dòng),以擾動(dòng)后的結(jié)果作為變異后的新基因值。對每一個(gè)基因都以相同的概率進(jìn)行變異之后,相當(dāng)于整個(gè)解矢量在解空間中作一個(gè)輕微的變動(dòng)。非均勻變異的操作過程不同之處在于重點(diǎn)搜索原個(gè)體附近的微小區(qū)域 [6]。由第 2 章得,對于實(shí)數(shù)編碼的個(gè)體,隨機(jī)選擇某位基因,其一般形式為: (412)????x式中: 為一較小的波動(dòng)量,其選擇比較困難,最優(yōu)值視具體情況而定,甚至在優(yōu)化?過程中可以改變。本論文中有三個(gè)設(shè)計(jì)變量,即相當(dāng)于三個(gè)基因。為了保持選擇交叉后得到的優(yōu)秀個(gè)體,每個(gè)個(gè)體只有一個(gè)基因進(jìn)行變異。函數(shù) Int(Rnd * 3 + 1)只能產(chǎn)生 2 或 3,即隨機(jī)產(chǎn)生為 1 時(shí),第一個(gè)設(shè)計(jì)變量摸數(shù)進(jìn)行變異,而其它兩個(gè)變量保持不變(函數(shù)隨機(jī)產(chǎn)生 2 或 3 時(shí)類似,即 2 時(shí)是齒數(shù)變量進(jìn)行變異,3 時(shí)為設(shè)計(jì)變量齒寬系數(shù)進(jìn)行變異),這樣就保證了每次只有一個(gè)基因進(jìn)行變異。至于基因變異時(shí)是“ ”還是“ ”問題,???可通過一隨機(jī)數(shù) 0 或 1,當(dāng)為 0 時(shí)進(jìn)行 操作,為 1 時(shí)進(jìn)行 操作。三個(gè)設(shè)計(jì)變量???青島理工大學(xué)本科畢業(yè)設(shè)計(jì)(論文)說明書28的 視具體情況可選取如下:模數(shù)的 = temp2 * temp4(temp2 為一隨機(jī)數(shù),temp4 = ??3) ;齒數(shù)的 = temp3 * temp7(temp3 為一隨機(jī)數(shù),temp7 = 8) ;齒寬系數(shù)的 = temp5 ?* temp8(temp5 為隨機(jī)數(shù),temp8 = )在進(jìn)行變異處理后,產(chǎn)生的新染色體即生成了一組新的設(shè)計(jì)變量。若產(chǎn)生的新的基因值超過約束條件,則強(qiáng)迫產(chǎn)生的新的基因返回到原先的最大或最小基因,例如若某一基因變異后得到的新基因值大于了約束條件要求的最大值,則強(qiáng)迫新的基因值為原先的最大值。變異運(yùn)算中的變異概率的選擇也是十分關(guān)鍵的。如果變異概率選擇過大,特別是對規(guī)模較大的算例時(shí),會造成解的振蕩,使收斂速度緩慢。變異概率一般取值范圍為[, ],本例變異概率取為:bianyigailv_pm=。變異程序如下:Sub mut(i As Integer)RandomizeDim mutionjiyin_num As IntegerDim temp1 As DoubleDim temp2 As DoubleDim temp3 As DoubleDim temp4 As DoubleDim temp5 As DoubleDim temp6 As DoubleDim temp7 As DoubleDim temp8 As Doubletemp4 = 3temp7 = 8temp8 = temp6 = Int(Rnd() + )temp1 = Rnd()If temp1 = bianyigailv_pm Thentemp2 = Rnd()temp3 = Rnd()青島理工大學(xué)本科畢業(yè)設(shè)計(jì)(論文)說明書29temp5 = Rnd()mutionjiyin_num = Int(Rnd * 3 + 1)Select Case mutionjiyin_numCase 1If temp6 = 0 Thennewpop_m(i) = Int(newpop_m(i) + temp2 * temp4)If newpop_m(i) 18 Then newpop_m(i) = 18Elsenewpop_m(i) = Int(newpop_m(i) temp2 * temp4)If newpop_m(i) 1 Then newpop_m(i) = 1End IfCase 2If temp6 = 0 Thennewpop_z(i) = CInt(newpop_z(i) + temp3 * temp7)If newpop_z(i) 40 Then newpop_z(i) = 40Elsenewpop_z(i) = CInt(newpop_z(i) temp3 * temp7)If newpop_z(i) 20 Then newpop_z(i) = 20End IfCase 3If temp6 = 0 Thennewpop_faidi(i) = newpop_faidi(i) + temp5 * temp8If newpop_faidi(i) Then newpop_faidi(i) = Elsenewpop_faidi(i) = newpop_faidi(i) temp5 * temp8If newpop_faidi(i) Then newpop_faidi(i) = End IfEnd SelectEnd IfEnd Sub青島理工大學(xué)本科畢業(yè)設(shè)計(jì)(論文)說明書30 終止規(guī)則通過監(jiān)測最優(yōu)染色體的變化情況來判斷算法是否終止。實(shí)施時(shí),當(dāng)種群中最優(yōu)染色體至少連續(xù) q_numMax 代沒有發(fā)生變化時(shí)可認(rèn)為算法收斂,停止計(jì)算,輸出最優(yōu)解。 優(yōu)化算例針對本論文的題目,分別采用常規(guī)優(yōu)化設(shè)計(jì)方法、遺傳算法優(yōu)化方法進(jìn)行優(yōu)化設(shè)計(jì),優(yōu)化結(jié)果見表 1。從優(yōu)化結(jié)果中可以看到,采用本文遺傳算法優(yōu)化比采用常規(guī)優(yōu)化方法時(shí)體積降低了 %,其優(yōu)化效果十分顯著。表 1 優(yōu)化結(jié)果對比表Table 1 Comparison between optimization results設(shè)計(jì)方法 模數(shù) 小齒輪齒數(shù) 齒寬系數(shù) 目標(biāo)函數(shù)/mm 3常規(guī)優(yōu)化設(shè)計(jì)方法 3 27 ?遺傳算法優(yōu)化方法 3 28 794 優(yōu)化設(shè)計(jì)程序代碼Dim popsize As IntegerDim pop_m(200) As IntegerDim pop_z(200) As IntegerDim pop_faidi(200) As DoubleDim const_m(18) As DoubleDim objf(200) As DoubleDim fitness(200) As DoubleConst pai = Const chishubi_u = Dim max_objf As DoubleDim min_objf As DoubleDim max_fitness_num As Integer青島理工大學(xué)本科畢業(yè)設(shè)計(jì)(論文)說明書31Dim max_fitness As DoubleDim a(200) As DoubleDim cycle_num As IntegerDim quanju_min_objf As SingleDim q_num As IntegerDim newpop_z(200) As DoubleDim newpop_faidi(200) As DoubleDim newpop_m(200) As IntegerDim leijigailv(200) As DoubleConst jiaochagailv_pc = Const bianyigailv_pm = 初始解:Private Sub generateori()RandomizeFor i = 1 To popsizepop_m(i) = Int(Rnd() * 18) + 1pop_z(i) = CInt(Rnd() * 20 + 20)pop_faidi(i) = (Rnd() * 600 + 800) / 1000Next iEnd SubPrivate Sub Command2_Click()RandomizeDim q_numMax As Integer q_numMax = 20Dim sel_num1 As Integer Dim sel_num2 As IntegerDim i As Integerconst_m(1) = 2青島理工大學(xué)本科畢業(yè)設(shè)計(jì)(論文)說明書32const_m(2) = const_m(3) = const_m(4) = const_m(5) = 3const_m(6) = const_m(7
點(diǎn)擊復(fù)制文檔內(nèi)容
規(guī)章制度相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1