锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久精品桃花综合,97精品伊人久久久大香线蕉,久久精品综合一区二区三区 http://www.shnenglu.com/assist/archive/2007/11/27/24736.html#37374th th Tue, 27 Nov 2007 03:40:00 GMT http://www.shnenglu.com/assist/archive/2007/11/27/24736.html#37374 ]]>re: VC++紿楀彛鍒嗗壊涓庨氫俊瀹炰緥[鏈櫥褰昡 http://www.shnenglu.com/assist/archive/2007/11/27/24736.html#37350th th Mon, 26 Nov 2007 16:16:00 GMT http://www.shnenglu.com/assist/archive/2007/11/27/24736.html#37350 ]]>re: C++閬椾紶綆楁硶婧愮▼搴?/title> http://www.shnenglu.com/assist/archive/2007/10/21/24873.html#34733starlet starlet Sun, 21 Oct 2007 00:15:00 GMT http://www.shnenglu.com/assist/archive/2007/10/21/24873.html#34733 ]]> re: VC++紿楀彛鍒嗗壊涓庨氫俊瀹炰緥 http://www.shnenglu.com/assist/archive/2007/10/06/24736.html#33597aa aa Sat, 06 Oct 2007 02:26:00 GMT http://www.shnenglu.com/assist/archive/2007/10/06/24736.html#33597 ]]>re: VC++紿楀彛鍒嗗壊涓庨氫俊瀹炰緥 http://www.shnenglu.com/assist/archive/2007/10/06/24736.html#33596aa aa Sat, 06 Oct 2007 02:13:00 GMT http://www.shnenglu.com/assist/archive/2007/10/06/24736.html#33596 Release/SplitWndDemo.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
鎬庝箞鍥炰簨? ]]> re: C++閬椾紶綆楁硶婧愮▼搴?/title> http://www.shnenglu.com/assist/archive/2007/06/25/24873.html#269167777 7777 Mon, 25 Jun 2007 09:33:00 GMT http://www.shnenglu.com/assist/archive/2007/06/25/24873.html#26916 ]]> re: C++閬椾紶綆楁硶婧愮▼搴?/title> http://www.shnenglu.com/assist/archive/2007/05/27/24873.html#24942姹熸按鍏?/dc:creator>姹熸按鍏?/author>Sun, 27 May 2007 11:04:00 GMT http://www.shnenglu.com/assist/archive/2007/05/27/24873.html#24942 ]]> re: C++閬椾紶綆楁硶婧愮▼搴?/title> http://www.shnenglu.com/assist/archive/2007/05/26/24873.html#24898pass86 pass86 Sat, 26 May 2007 09:38:00 GMT http://www.shnenglu.com/assist/archive/2007/05/26/24873.html#24898 /******************************************************************** Filename: aiWorld.h Purpose: 閬椾紶綆楁硶錛岃姳鏈墊紨鍖栥?br> Author: pass86 E-mail: pass86@gmail.com Created: 2007/03/29 Id: Copyright: Licence: *********************************************************************/ #ifndef AIWORLD_H_ #define AIWORLD_H_ #include <iostream> #include <ctime> #include <cstdlib> #include <cmath> #define kMaxFlowers 10 using std::cout; using std::endl; class ai_World { public: ai_World() { srand(time(0)); } ~ai_World() {} int temperature[kMaxFlowers]; //娓╁害 int water[kMaxFlowers]; //姘磋川 int sunlight[kMaxFlowers]; //闃沖厜 int nutrient[kMaxFlowers]; //鍏誨垎 int beneficialInsect[kMaxFlowers]; //鐩婅櫕 int harmfulInsect[kMaxFlowers]; //瀹寵櫕 int currentTemperature; int currentWater; int currentSunlight; int currentNutrient; int currentBeneficialInsect; int currentHarmfulInsect; /** 絎竴浠h姳鏈?br> */ void Encode(); /** 鑺辨湹閫傚悎鍑芥暟 */ int Fitness(int flower); /** 鑺辨湹婕斿寲 */ void Evolve(); /** 榪斿洖鍖洪棿[start, end]鐨勯殢鏈烘暟 */ inline int tb_Rnd(int start, int end) { if (start > end) return 0; else { //srand(time(0)); return (rand() % (end + 1) + start); } } /** 鏄劇ず鏁板?br> */ void show(); }; // ----------------------------------------------------------------- // void ai_World::Encode() // ----------------------------------------------------------------- // { int i; for (i=0;i<kMaxFlowers;i++) { temperature[i]=tb_Rnd(1,75); water[i]=tb_Rnd(1,75); sunlight[i]=tb_Rnd(1,75); nutrient[i]=tb_Rnd(1,75); beneficialInsect[i]=tb_Rnd(1,75); harmfulInsect[i]=tb_Rnd(1,75); } currentTemperature=tb_Rnd(1,75); currentWater=tb_Rnd(1,75); currentSunlight=tb_Rnd(1,75); currentNutrient=tb_Rnd(1,75); currentBeneficialInsect=tb_Rnd(1,75); currentHarmfulInsect=tb_Rnd(1,75); currentTemperature=tb_Rnd(1,75); currentWater=tb_Rnd(1,75); currentSunlight=tb_Rnd(1,75); currentNutrient=tb_Rnd(1,75); currentBeneficialInsect=tb_Rnd(1,75); currentHarmfulInsect=tb_Rnd(1,75); } // ----------------------------------------------------------------- // int ai_World::Fitness(int flower) // ----------------------------------------------------------------- // { int theFitness; theFitness=abs(temperature[flower]-currentTemperature); theFitness=theFitness+abs(water[flower]-currentWater); theFitness=theFitness+abs(sunlight[flower]-currentSunlight); theFitness=theFitness+abs(nutrient[flower]-currentNutrient); theFitness=theFitness+abs(beneficialInsect[flower]-currentBeneficialInsect); theFitness=theFitness+abs(harmfulInsect[flower]-currentHarmfulInsect); return (theFitness); } // ----------------------------------------------------------------- // void ai_World::Evolve() // ----------------------------------------------------------------- // { int fitTemperature[kMaxFlowers]; int fitWater[kMaxFlowers]; int fitSunlight[kMaxFlowers]; int fitNutrient[kMaxFlowers]; int fitBeneficialInsect[kMaxFlowers]; int fitHarmfulInsect[kMaxFlowers]; int fitness[kMaxFlowers]; int i; int leastFit=0; int leastFitIndex; for (i=0;i<kMaxFlowers;i++) if (Fitness(i)>leastFit) { leastFit=Fitness(i); leastFitIndex=i; } temperature[leastFitIndex]=temperature[tb_Rnd(0,kMaxFlowers - 1)]; water[leastFitIndex]=water[tb_Rnd(0,kMaxFlowers - 1)]; sunlight[leastFitIndex]=sunlight[tb_Rnd(0,kMaxFlowers - 1)]; nutrient[leastFitIndex]=nutrient[tb_Rnd(0,kMaxFlowers - 1)]; beneficialInsect[leastFitIndex]=beneficialInsect[tb_Rnd(0,kMaxFlowers - 1)]; harmfulInsect[leastFitIndex]=harmfulInsect[tb_Rnd(0,kMaxFlowers - 1)]; for (i=0;i<kMaxFlowers;i++) { fitTemperature[i]=temperature[tb_Rnd(0,kMaxFlowers - 1)]; fitWater[i]=water[tb_Rnd(0,kMaxFlowers - 1)]; fitSunlight[i]=sunlight[tb_Rnd(0,kMaxFlowers - 1)]; fitNutrient[i]=nutrient[tb_Rnd(0,kMaxFlowers - 1)]; fitBeneficialInsect[i]=beneficialInsect[tb_Rnd(0,kMaxFlowers - 1)]; fitHarmfulInsect[i]=harmfulInsect[tb_Rnd(0,kMaxFlowers - 1)]; } for (i=0;i<kMaxFlowers;i++) { temperature[i]=fitTemperature[i]; water[i]=fitWater[i]; sunlight[i]=fitSunlight[i]; nutrient[i]=fitNutrient[i]; beneficialInsect[i]=fitBeneficialInsect[i]; harmfulInsect[i]=fitHarmfulInsect[i]; } for (i=0;i<kMaxFlowers;i++) { if (tb_Rnd(1,100)==1) temperature[i]=tb_Rnd(1,75); if (tb_Rnd(1,100)==1) water[i]=tb_Rnd(1,75); if (tb_Rnd(1,100)==1) sunlight[i]=tb_Rnd(1,75); if (tb_Rnd(1,100)==1) nutrient[i]=tb_Rnd(1,75); if (tb_Rnd(1,100)==1) beneficialInsect[i]=tb_Rnd(1,75); if (tb_Rnd(1,100)==1) harmfulInsect[i]=tb_Rnd(1,75); } } void ai_World::show() { // cout << "\t temperature water sunlight nutrient beneficialInsect harmfulInsect\n"; cout << "current\t " << currentTemperature << "\t " << currentWater << "\t "; cout << currentSunlight << "\t " << currentNutrient << "\t "; cout << currentBeneficialInsect << "\t " << currentHarmfulInsect << "\n"; for (int i=0;i<kMaxFlowers;i++) { cout << "Flower " << i << ": "; cout << temperature[i] << "\t "; cout << water[i] << "\t "; cout << sunlight[i] << "\t "; cout << nutrient[i] << "\t "; cout << beneficialInsect[i] << "\t "; cout << harmfulInsect[i] << "\t "; cout << endl; } } #endif // AIWORLD_H_ //test.cpp #include <iostream> #include "ai_World.h" using namespace std; int main() { ai_World a; a.Encode(); // a.show(); for (int i = 0; i < 10; i++) { cout << "Generation " << i << endl; a.Evolve(); a.show(); } system("PAUSE"); return 0; } ]]>
影音先锋女人AV鲁色资源网久久 |
国产精品熟女福利久久AV |
久久亚洲AV永久无码精品 |
一97日本道伊人久久综合影院 |
国产免费久久精品99re丫y |
久久国产精品一国产精品金尊 |
品成人欧美大片久久国产欧美... |
国产国产成人久久精品 |
中文字幕无码av激情不卡久久
|
欧美亚洲国产精品久久高清 |
久久人人爽人人爽人人片AV东京热 |
国产一区二区精品久久 |
国产69精品久久久久9999APGF |
国产精品久久国产精麻豆99网站 |
国产精品美女久久福利网站 |
97久久香蕉国产线看观看 |
久久毛片一区二区 |
久久亚洲电影 |
日韩精品久久久久久 |
好属妞这里只有精品久久 |
免费无码国产欧美久久18 |
国产成人香蕉久久久久 |
…久久精品99久久香蕉国产 |
色播久久人人爽人人爽人人片AV |
成人午夜精品久久久久久久小说 |
久久99精品久久只有精品 |
久久久免费精品re6 |
中文精品99久久国产 |
精品国产91久久久久久久a |
国产成人精品久久亚洲高清不卡
国产成人精品久久亚洲高清不卡
国产成人精品久久亚洲
|
久久久久久精品久久久久 |
久久精品国产亚洲Aⅴ香蕉 |
国产精品无码久久久久 |
国产综合久久久久久鬼色 |
久久精品中文字幕一区 |
午夜精品久久久内射近拍高清 |
久久人人爽人爽人人爽av |
中文精品久久久久国产网址 |
久久人妻少妇嫩草AV无码蜜桃 |
久久久久久a亚洲欧洲aⅴ |
精品久久久久久综合日本 |