91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

采用c#編寫的三元函數求最值問題,例子是有三個未知數,且三個未知數有取值范圍,依據遺傳算法求得三元函數的最大值

資源截圖

代碼片段和文件信息

using?System;
using?System.Collections.Generic;
using?System.Linq;
using?System.Text;
using?System.Threading.Tasks;

namespace?ycsf3x_new
{
????class?Program
????{
????????private?const?double?PI?=?3.1415926535897932384;
????????private?double[]?m_minValue;//變量取值范圍-最小值
????????private?double[]?m_maxValue;//變量取值范圍-最大
????????private?double[]?m_length;//m_maxValue-m_minValue
????????private?int[]?m_codingLength;//編碼長度?[131412]
????????private?int?m_populationNumber;//種群大小?50
????????private?int?dimention;//維數
????????private?string[][][]?m_populations;//種群
????????private?string[][]?m_population;//種群123...
????????private?double[][]?m_doublePopulation;
????????private?double[]?m_double;//每個種子的實數值
????????private?double[]?m_fitness;//適應度
????????private?double?m_crossRate;//交叉概率
????????private?double?m_varRate;//變異概率
????????private?double?m_winFitness;//獲勝適應度
????????private?int?popLength;//染色體長度

????????public?string[][]?WinCoding?{?get;?set;?}
????????public?double[]?WinValue?{?get;?set;?}

????????public?Program(int?populationNumber?int?populationDimension?double[]?minValue?double[]?maxValue?double?crossRate?double?varRate)
????????{
????????????m_minValue?=?minValue;//區間范圍最小值數組
????????????m_maxValue?=?maxValue;?//區間范圍最大值數組
????????????m_length?=?new?double[maxValue.Length];//區間長度
????????????for?(var?i?=?0;?i?????????????{
????????????????m_length[i]?=?maxValue[i]?-?minValue[i];
????????????}
????????????m_populationNumber?=?populationNumber;//種群大學
????????????dimention?=?populationDimension;//未知數個數
????????????popLength?=?15;?//染色體長度?暫定15
????????????m_crossRate?=?crossRate;//交叉概率
????????????m_varRate?=?varRate;//變異概率
????????}

????????///?
????????///?初始化種群
????????///?

????????public?void?InitPopulation()
????????{
????????????m_codingLength?=?GetCodingLength(m_length?3);
????????????m_populations?=?new?string[m_populationNumber][][];
????????????for?(int?i?=?0;?i?????????????{
????????????????m_population?=?new?string[dimention][];
????????????????for?(var?j?=?0;?j?????????????????{
????????????????????m_population[j]?=?GetRandomBinaryArray(m_codingLength[j]?i);
????????????????????//foreach?(var?c?in?m_population[j])
????????????????????//{
????????????????????//????Console.Write(c);
????????????????????//}
????????????????????//Console.WriteLine();
????????????????}
????????????????m_populations[i]?=?m_population;
????????????????//Console.WriteLine();
????????????}
????????}

????????public?string[]?GetRandomBinaryArray(int?count?int?ii)
????????{
????????????Random?rnd?=?new?Random(DateTime.Now.Millisecond?+?ii);//添加種子確保每次取得0-1不一樣
????????????byte[]?keys?=?new?byte[count];
????????????rnd.NextBytes(keys);
????????????List?items?=?new?List();
????????????for?(int?i?=?0;?i?????????????{
????????????????if?(keys[i]?>?127)
???????

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-09-12?16:49??ycsf3x_new\
?????目錄???????????0??2018-09-12?16:49??ycsf3x_new\.vs\
?????目錄???????????0??2018-09-12?16:49??ycsf3x_new\.vs\ycsf3x_new\
?????目錄???????????0??2018-09-12?16:49??ycsf3x_new\.vs\ycsf3x_new\v14\
?????文件???????36864??2018-09-13?09:46??ycsf3x_new\.vs\ycsf3x_new\v14\.suo
?????目錄???????????0??2018-09-13?09:44??ycsf3x_new\ycsf3x_new\
?????文件?????????189??2018-09-12?16:49??ycsf3x_new\ycsf3x_new\App.config
?????文件???????13805??2018-09-13?09:44??ycsf3x_new\ycsf3x_new\Program.cs
?????目錄???????????0??2018-09-12?16:49??ycsf3x_new\ycsf3x_new\Properties\
?????文件????????1328??2018-09-12?16:49??ycsf3x_new\ycsf3x_new\Properties\AssemblyInfo.cs
?????目錄???????????0??2018-09-12?16:49??ycsf3x_new\ycsf3x_new\bin\
?????目錄???????????0??2018-09-12?18:10??ycsf3x_new\ycsf3x_new\bin\Debug\
?????文件????????9728??2018-09-13?09:44??ycsf3x_new\ycsf3x_new\bin\Debug\ycsf3x_new.exe
?????文件?????????189??2018-09-12?16:49??ycsf3x_new\ycsf3x_new\bin\Debug\ycsf3x_new.exe.config
?????文件???????24064??2018-09-13?09:44??ycsf3x_new\ycsf3x_new\bin\Debug\ycsf3x_new.pdb
?????文件???????22696??2018-09-13?09:44??ycsf3x_new\ycsf3x_new\bin\Debug\ycsf3x_new.vshost.exe
?????文件?????????189??2018-09-12?16:49??ycsf3x_new\ycsf3x_new\bin\Debug\ycsf3x_new.vshost.exe.config
?????文件?????????490??2018-04-12?07:35??ycsf3x_new\ycsf3x_new\bin\Debug\ycsf3x_new.vshost.exe.manifest
?????目錄???????????0??2018-09-12?16:49??ycsf3x_new\ycsf3x_new\obj\
?????目錄???????????0??2018-09-13?09:10??ycsf3x_new\ycsf3x_new\obj\Debug\
?????文件????????6809??2018-09-12?16:49??ycsf3x_new\ycsf3x_new\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????目錄???????????0??2018-09-13?11:52??ycsf3x_new\ycsf3x_new\obj\Debug\TempPE\
?????文件???????????0??2018-09-12?16:49??ycsf3x_new\ycsf3x_new\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
?????文件???????????0??2018-09-12?16:49??ycsf3x_new\ycsf3x_new\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
?????文件???????????0??2018-09-12?16:49??ycsf3x_new\ycsf3x_new\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
?????文件?????????562??2018-09-13?09:44??ycsf3x_new\ycsf3x_new\obj\Debug\ycsf3x_new.csproj.FileListAbsolute.txt
?????文件????????1922??2018-09-13?09:10??ycsf3x_new\ycsf3x_new\obj\Debug\ycsf3x_new.csprojResolveAssemblyReference.cache
?????文件????????9728??2018-09-13?09:44??ycsf3x_new\ycsf3x_new\obj\Debug\ycsf3x_new.exe
?????文件???????24064??2018-09-13?09:44??ycsf3x_new\ycsf3x_new\obj\Debug\ycsf3x_new.pdb
?????文件????????2680??2018-09-12?16:49??ycsf3x_new\ycsf3x_new\ycsf3x_new.csproj
?????文件?????????997??2018-09-12?16:49??ycsf3x_new\ycsf3x_new.sln
............此處省略0個文件信息

評論

共有 條評論