• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            隨筆 - 1  文章 - 0  trackbacks - 0
            <2025年5月>
            27282930123
            45678910
            11121314151617
            18192021222324
            25262728293031
            1234567

            常用鏈接

            留言簿(3)

            隨筆檔案

            搜索

            •  

            最新評論

            共2頁: 1 2 
            H好長的對話
            re: 英語網站(超全) pass86 2007-07-19 12:58
            謝謝LZ,贊。
            re: subversion服務器的配置 pass86 2007-07-12 22:31
            推薦subversion,贊一個
            re: VS9中C++少得可憐的更新 pass86 2007-07-12 21:55
            用VS是用的它的IDE,一些庫,如MFC,這是我看中的,至于編譯器,我還是看中GCC,
            re: mutable的用法 pass86 2007-07-11 12:53
            mutalbe是否是是標準的關鍵字呢?在GCC中編譯不過去。
            re: UUID是什么? pass86 2007-07-09 13:59
            hava a look.
            re: 遠程過程調用 pass86 2007-07-09 13:57
            have a look.
            re: IDL是什么? pass86 2007-07-09 13:57
            hava a look
            re: subversion安裝配置記錄 pass86 2007-07-06 23:00
            在WINDOWS下怎么配置呢?TortoiseSVN在WINDOWS下的。
            支持第二種。
            re: do...while(0)的妙用 pass86 2007-07-06 22:52
            贊一個。
            贊一個。
            re: 管理信息系統論文 pass86 2007-06-25 17:07
            是否有其它論文啊,如軟件工程的,我需要。
            re: COM組件簡介 pass86 2007-06-22 23:30
            路過。
            記得以前學習的時候用了回溯的算法。
            偶有過。
            re: 程序員的十種級別 pass86 2007-06-21 17:47
            先當個工頭也不錯啊。
            re: Qt4.2.3編譯記錄 pass86 2007-06-21 17:37
            在學習列表中,支持。
            英文比較好啊。
            re: VC調試進階(2)--多個exe pass86 2007-06-13 13:57
            基本操作。
            偶也考,努力。
            。NET 2003,應該就沒有。
            估計PFnCreateObject creatorFuncTable[MAX_TYPE_ID];因該是
            PFnCreateObject* creatorFuncTable[MAX_TYPE_ID];
            re: boost1.34.0編譯日志 pass86 2007-06-07 16:45
            ...updated 5279 targets...
            re: boost1.34.0編譯日志 pass86 2007-06-07 16:36
            搞定,原來是我用的vsvars32.bat應該在一個控制臺下完成,因為它只在當前控制臺中設置的環境變量生效。
            LIB下生成了216個項目,1.2G。
            re: boost1.34.0編譯日志 pass86 2007-06-07 14:00
            bjam "sTOOLS=vc-7_1" --prefix=D:\Boost install
            編譯中無法找到windows.h

            完成結果
            ...failed updateing 244 targets...
            ...skiped 228 targets...
            ...updated 1022 targets...

            WHY?

            LIB文件夾下有102個項目。
            我用GCC編譯不過去,
            re: boost1.34.0編譯日志 pass86 2007-06-06 22:26
            我把/*?/去掉了,代會編譯試試。
            我編譯了一次1.33.1,只是復制了些頭文件到我的目標我的文件架,沒有生成。LIB文件,是怎么回事情呢,用的是。NET 2003選項,能夠給我發個
            。NET2003的編譯明命令行嗎,謝謝。
            pass86@gmail.com
            恩,是個知識點,細致入微,
            學到了。
            你倆都學C++阿。
            re: C++遺傳算法源程序 pass86 2007-05-26 17:38
            我也寫過一點,從書上改編的。
            /********************************************************************
            Filename: aiWorld.h
            Purpose: 遺傳算法,花朵演化。
            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;

            /**
            第一代花朵
            */
            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);
            }
            }

            /**
            顯示數值
            */
            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;
            }
            re: boost asio 2:threading pass86 2007-05-25 17:41
            亂碼顯示源代碼
            re: C++模版全掌握(實例) pass86 2007-05-25 17:10
            HAO.
            re: 有一類程序員 pass86 2007-05-22 17:40
            其實每個人不是一生下來就是高手。
            這樣的人我到遇到。
            還是應該虛心學習。
            不知道.a文件做什么的,在boost中看到,偶孤陋寡聞。
            由此看來是庫文件。
            下下來看看,速度太慢。
            VC6.0編譯錯誤:
            console.cpp(72) : fatal error C1010: unexpected end of file while looking for precompiled header directive
            但是用其它IDE能編譯成功,為什么呢?
            這個東西真的挺有用的,DEBUG時用,不用MessageBox那么麻煩了。
            re: 如何實現UI pass86 2007-05-08 13:49
            UI的設計愈來愈重要,它能增強用戶的體驗,但是用過很多軟件後發現,單純的用圖片來做UI并不大吸引人,有點死板。
            Picasa2的UI做的就很好啊,用戶的體驗很好,不知怎么做的,貌似用了OPENGL。
            共2頁: 1 2 
            精品欧美一区二区三区久久久| 99精品国产综合久久久久五月天| 国产成人综合久久综合| 久久精品免费一区二区三区| 久久福利片| 久久久久亚洲AV成人片| 久久久精品国产亚洲成人满18免费网站 | 中文字幕精品无码久久久久久3D日动漫| 欧美熟妇另类久久久久久不卡| 老司机国内精品久久久久| 婷婷久久五月天| 热99re久久国超精品首页| 久久www免费人成看片| 国产精品综合久久第一页| 久久国产亚洲精品无码| 四虎影视久久久免费观看| 国产精品久久久久久影院| 亚洲精品无码久久千人斩| 久久综合狠狠综合久久97色| 粉嫩小泬无遮挡久久久久久| 污污内射久久一区二区欧美日韩| 久久精品国产影库免费看| 久久强奷乱码老熟女网站| 日韩久久久久中文字幕人妻| 国产精品免费久久| 久久精品成人国产午夜| 精品久久久久久久久午夜福利| 久久AV高潮AV无码AV| 久久久这里有精品| 久久人妻少妇嫩草AV无码蜜桃| 成人久久久观看免费毛片| 99久久免费国产精品热| 99久久人妻无码精品系列蜜桃| 久久人人爽人人爽人人片AV不| 99久久精品国产一区二区 | 久久国产精品免费| 一本大道久久a久久精品综合| 亚洲精品国产成人99久久| 狠狠狠色丁香婷婷综合久久俺| 久久国产热精品波多野结衣AV| 久久香蕉超碰97国产精品|