亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? skeleton.cc

?? 用C++編寫的遺傳算法
?? CC
字號:
// skeleton.cc/* -------------------------------------------------------------------This is the skeleton for a new problem the user wants to tackle usinggenetic programming techniques.gpc++ - The Genetic Programming KernelThis program is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation; either version 1, or (at your option)any later version.This program is distributed in the hope that it will be useful, butWITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNUGeneral Public License for more details.You should have received a copy of the GNU General Public Licensealong with this program; if not, write to the Free SoftwareFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.Copyright 1993, 1994 Adam P. Fraser and 1996, 1997 Thomas WeinbrennerFor comments, improvements, additions (or even money) contact:Thomas WeinbrennerGrauensteinstr. 2635789 LaimbachGermanyE-mail: thomasw@emk.e-technik.th-darmstadt.deWWW:    http://www.emk.e-technik.th-darmstadt/~thomasw  or (Address may be out of date)Adam Fraser, Postgraduate Section, Dept of Elec & Elec Eng,Maxwell Building, University Of Salford, Salford, M5 4WT, United Kingdom.E-mail: a.fraser@eee.salford.ac.ukTel:    (UK) 061 745 5000 x3633Fax:    (UK) 061 745 5999------------------------------------------------------------------- */#include <stdlib.h>#include <new.h>#include <fstream.h>#include <strstream.h>#include "gp.h"#include "gpconfig.h"// Define configuration parameters and the neccessary array to// read/write the configuration to a file.  If you need more// variables, just add them below and insert an entry in the// configArray.GPVariables cfg;struct GPConfigVarInformation configArray[]={  {"PopulationSize", DATAINT, &cfg.PopulationSize},  {"NumberOfGenerations", DATAINT, &cfg.NumberOfGenerations},  {"CreationType", DATAINT, &cfg.CreationType},  {"CrossoverProbability", DATADOUBLE, &cfg.CrossoverProbability},  {"CreationProbability", DATADOUBLE, &cfg.CreationProbability},  {"MaximumDepthForCreation", DATAINT, &cfg.MaximumDepthForCreation},  {"MaximumDepthForCrossover", DATAINT, &cfg.MaximumDepthForCrossover},  {"SelectionType", DATAINT, &cfg.SelectionType},  {"TournamentSize", DATAINT, &cfg.TournamentSize},  {"DemeticGrouping", DATAINT, &cfg.DemeticGrouping},  {"DemeSize", DATAINT, &cfg.DemeSize},  {"DemeticMigProbability", DATADOUBLE, &cfg.DemeticMigProbability},  {"SwapMutationProbability", DATADOUBLE, &cfg.SwapMutationProbability},  {"ShrinkMutationProbability", DATADOUBLE, &cfg.ShrinkMutationProbability},  {"AddBestToNewPopulation", DATAINT, &cfg.AddBestToNewPopulation},  {"SteadyState", DATAINT, &cfg.SteadyState},  {"", DATAINT, NULL}};// Define function and terminal identifiersconst int FUNCTION1=0;const int FUNCTION2=1;const int TERMINAL1=2;const int TERMINAL2=3;// Define class identifiersconst int MyGeneID=GPUserID;const int MyGPID=GPUserID+1;const int MyPopulationID=GPUserID+2;// Inherit the three GP classes GPGene, GP and GPPopulationclass MyGene : public GPGene{public:  // Duplication (mandatory)  MyGene (const MyGene& gpo) : GPGene (gpo) { }  virtual GPObject& duplicate () { return *(new MyGene(*this)); }  // Creation of own class objects (mandatory)  MyGene (GPNode& gpo) : GPGene (gpo) {}  virtual GPGene* createChild (GPNode& gpo) {    return new MyGene (gpo); }  // Tree evaluation (not mandatory, but somehow the trees must be  // parsed to evaluate the fitness)  double evaluate ();  // Load and save (not mandatory)  MyGene () {}  virtual int isA () { return MyGeneID; }  virtual GPObject* createObject() { return new MyGene; }  // virtual char* load (istream& is);  // virtual void save (ostream& os);  // Print (not mandatory)   // virtual void printOn (ostream& os);  // Access children (not mandatory)  MyGene* NthMyChild (int n) {    return (MyGene*) GPContainer::Nth (n); }};class MyGP : public GP {public:  // Duplication (mandatory)  MyGP (MyGP& gpo) : GP (gpo) { }  virtual GPObject& duplicate () { return *(new MyGP(*this)); }  // Creation of own class objects (mandatory)  MyGP (int genes) : GP (genes) {}  virtual GPGene* createGene (GPNode& gpo) {    return new MyGene (gpo); }  // Tree evaluation (mandatory)  virtual void evaluate ();  // Print (not mandatory)   // virtual void printOn (ostream& os);  // Load and save (not mandatory)  MyGP () {}  virtual int isA () { return MyGPID; }  virtual GPObject* createObject() { return new MyGP; }  // virtual char* load (istream& is);  // virtual void save (ostream& os);  // Access trees (not mandatory)  MyGene* NthMyGene (int n) {    return (MyGene*) GPContainer::Nth (n); }};class MyPopulation : public GPPopulation{public:  // Constructor (mandatory)  MyPopulation (GPVariables& GPVar_, GPAdfNodeSet& adfNs_) :     GPPopulation (GPVar_, adfNs_) {}  // Duplication (mandatory)  MyPopulation (MyPopulation& gpo) : GPPopulation(gpo) {}  virtual GPObject& duplicate () { return *(new MyPopulation(*this)); }  // Creation of own class objects (mandatory)  virtual GP* createGP (int numOfTrees) { return new MyGP (numOfTrees); }  // Load and save (not mandatory)  MyPopulation () {}  virtual int isA () { return MyPopulationID; }  virtual GPObject* createObject() { return new MyPopulation; }  // virtual char* load (istream& is);  // virtual void save (ostream& os);  // Print (not mandatory)   // virtual void printOn (ostream& os);  // Access genetic programs (not mandatory)  MyGP* NthMyGP (int n) {    return (MyGP*) GPContainer::Nth (n); }};// This function evaluates the fitness of a genetic tree.  We have the// freedom to define this function in any way we like.  double MyGene::evaluate (){  double returnValue;  switch (node->value ())    {    case FUNCTION1:       returnValue=NthMyChild(0)->evaluate ();      break;    case FUNCTION2:       returnValue=NthMyChild(0)->evaluate ();      break;          case TERMINAL1:      returnValue=0.0;      break;          case TERMINAL2:      returnValue=0.0;      break;    default:       GPExitSystem ("MyGene::evaluate", "Undefined node value");    }    return returnValue;}// Evaluate the fitness of a GP and save it into the class variable// fitness.void MyGP::evaluate (){  // Evaluate main tree  stdFitness=NthMyGene (0)->evaluate ();}// Create function and terminal setvoid createNodeSet (GPAdfNodeSet& adfNs){  // Reserve space for the node sets  adfNs.reserveSpace (1);    // Now define the function and terminal set for each ADF and place  // function/terminal sets into overall ADF container  GPNodeSet& ns=*new GPNodeSet (4);  adfNs.put (0, ns);    // Define functions/terminals and place them into the appropriate  // sets.  Terminals take two arguments, functions three (the third  // parameter is the number of arguments the function has)  ns.putNode (*new GPNode (FUNCTION1, "FUNCTION1", 1));  ns.putNode (*new GPNode (FUNCTION2, "FUNCTION2", 1));  ns.putNode (*new GPNode (TERMINAL1, "TERMINAL1"));  ns.putNode (*new GPNode (TERMINAL2, "TERMINAL2"));}void newHandler (){  cerr << "\nFatal error: Out of memory." << endl;  exit (1);}int main (){  // Set up a new-handler, because we might need a lot of memory, and  // we don't know it's there.  set_new_handler (newHandler);    // Init GP system.  GPInit (1, -1);    // Read configuration file.  GPConfiguration config (cout, "skeleton.ini", configArray);    // Print the configuration  cout << cfg << endl;    // Create the adf function/terminal set and print it out.  GPAdfNodeSet adfNs;  createNodeSet (adfNs);  cout << adfNs << endl;     // Open the main output file for the data and statistics file.  // First set up names for data file.  Remember we should delete the  // string from the stream, well just a few bytes  ostrstream strOutFile, strStatFile;  strOutFile  << "data.dat" << ends;  strStatFile << "data.stc" << ends;  ofstream fout (strOutFile.str());  ofstream bout (strStatFile.str());    // Create a population with this configuration  cout << "Creating initial population ..." << endl;  MyPopulation* pop=new MyPopulation (cfg, adfNs);  pop->create ();  cout << "Ok." << endl;  pop->createGenerationReport (1, 0, fout, bout);    // This next for statement is the actual genetic programming system  // which is in essence just repeated reproduction and crossover loop  // through all the generations ...  MyPopulation* newPop=NULL;  for (int gen=1; gen<=cfg.NumberOfGenerations; gen++)    {      // Create a new generation from the old one by applying the      // genetic operators      if (!cfg.SteadyState)	newPop=new MyPopulation (cfg, adfNs);      pop->generate (*newPop);            // Delete the old generation and make the new the old one      if (!cfg.SteadyState)	{	  delete pop;	  pop=newPop;	}      // Create a report of this generation and how well it is doing      pop->createGenerationReport (0, gen, fout, bout);    }  return 0;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区三区黄视频| 午夜av一区二区三区| 亚洲自拍偷拍欧美| 国产一区激情在线| 欧美日韩国产经典色站一区二区三区 | 国产精品国产a| 亚洲成av人片在线观看| 不卡高清视频专区| 欧美不卡视频一区| 亚洲一区二区不卡免费| 国产精品一区二区久久不卡| 欧美男人的天堂一二区| 国产嫩草影院久久久久| 精品一区二区三区免费| 在线播放中文字幕一区| 一区二区久久久久| 99久久免费精品| 欧美激情一区在线| 国产一区日韩二区欧美三区| 777欧美精品| 午夜精品在线看| 欧美色综合天天久久综合精品| 中文无字幕一区二区三区| 久草这里只有精品视频| 在线播放/欧美激情| 亚洲国产日日夜夜| 欧美色涩在线第一页| 亚洲精品免费在线观看| 99久久精品一区二区| 综合色天天鬼久久鬼色| 99久久夜色精品国产网站| 欧美国产亚洲另类动漫| 成人午夜视频福利| 国产精品乱码久久久久久| 国产成人亚洲综合色影视| 2欧美一区二区三区在线观看视频| 免费观看在线综合| 日韩欧美亚洲国产精品字幕久久久| 日韩成人免费看| 日韩三级免费观看| 国内成人精品2018免费看| 欧美精品一区二区三区视频| 国产一区二区三区蝌蚪| 欧美国产精品久久| 成人h精品动漫一区二区三区| 国产精品不卡一区| 色激情天天射综合网| 亚洲成人自拍一区| 欧美一级精品在线| 国产在线一区二区综合免费视频| 国产日产欧美一区| 色综合天天综合在线视频| 亚洲福利视频三区| 日韩欧美一级片| 国产成人在线视频网站| 亚洲精品日产精品乱码不卡| 欧美美女视频在线观看| 精品一区免费av| 国产精品美女久久久久av爽李琼| 日本久久电影网| 免费观看在线综合| 中文字幕一区二区三区在线不卡| 欧美日韩亚洲不卡| 国产一区久久久| 一区二区三区在线免费观看| 91精品国产免费久久综合| 国产精品一二二区| 亚洲午夜影视影院在线观看| 欧美电影免费观看高清完整版在| 成人久久久精品乱码一区二区三区| 亚洲综合激情小说| 欧美哺乳videos| 91网站在线播放| 韩国精品免费视频| 亚洲精品乱码久久久久久久久| 欧美一区二区三区成人| av不卡免费电影| 青娱乐精品在线视频| 综合在线观看色| 久久久久久久久久看片| 欧美日韩中字一区| 成人高清视频在线观看| 人人精品人人爱| 亚洲精选视频在线| 国产欧美一区视频| 日韩精品一区二区三区swag| 欧美日韩中文一区| av爱爱亚洲一区| 国产精品18久久久久久久网站| 亚洲成人动漫av| 亚洲免费伊人电影| 国产精品国产三级国产普通话蜜臀 | 亚洲欧美电影院| 2024国产精品| 777精品伊人久久久久大香线蕉| 91视频www| 国产不卡一区视频| 精品写真视频在线观看| 亚洲国产精品麻豆| 一区二区三区中文免费| 国产日韩亚洲欧美综合| 精品国产一区二区三区不卡| 欧美日韩国产影片| 欧美图区在线视频| 在线观看av一区二区| 99综合电影在线视频| 国产精品一级片在线观看| 狠狠色综合日日| 蜜乳av一区二区| 伦理电影国产精品| 日韩av电影天堂| 天堂成人免费av电影一区| 亚洲午夜久久久久久久久电影院| 亚洲精品高清在线| 亚洲综合一区二区精品导航| 亚洲欧美日本韩国| 亚洲激情一二三区| 亚洲精品国产一区二区三区四区在线| 国产精品久久久久久妇女6080 | 欧美一区二区性放荡片| 欧美群妇大交群中文字幕| 欧美日韩视频在线观看一区二区三区 | 日韩欧美一卡二卡| 精品久久久三级丝袜| 精品国偷自产国产一区| 日韩精品一区二区在线| 26uuu亚洲| 久久久国产精品不卡| 国产免费成人在线视频| 亚洲日本va在线观看| 一区二区三区毛片| 午夜影院久久久| 日本成人在线电影网| 国产在线视频一区二区| caoporn国产精品| 日本伦理一区二区| 欧美日韩dvd在线观看| 精品美女被调教视频大全网站| 久久天天做天天爱综合色| 亚洲欧洲日韩在线| 亚洲1区2区3区视频| 激情丁香综合五月| av日韩在线网站| 欧美久久久久中文字幕| 精品国产乱码久久久久久浪潮| 亚洲国产精品激情在线观看 | 欧美三级电影在线看| 日韩一区二区三区av| 国产精品网曝门| 亚洲成人久久影院| 国产高清精品久久久久| 色婷婷av一区二区三区gif | 欧美精品xxxxbbbb| 久久久综合精品| 一区2区3区在线看| 国产麻豆91精品| 欧美中文字幕不卡| 久久久777精品电影网影网 | 欧美一级免费观看| 国产精品美女久久久久aⅴ国产馆| 午夜精品一区二区三区三上悠亚| 国产一区二区免费在线| 91麻豆国产福利在线观看| 欧美精品一级二级| 国产精品成人一区二区艾草| 奇米四色…亚洲| 91黄色小视频| 国产片一区二区| 青青草国产精品97视觉盛宴| 99久久精品国产一区| 精品国产伦一区二区三区观看方式 | 综合久久给合久久狠狠狠97色| 麻豆成人免费电影| 在线免费av一区| 国产三级三级三级精品8ⅰ区| 亚洲mv在线观看| 色综合久久久久| 欧美激情一区二区三区| 久久精品国产第一区二区三区| 在线中文字幕一区| 国产精品三级av| 国产一区不卡在线| 日韩免费观看2025年上映的电影| 亚洲最大成人网4388xx| 成人av在线影院| 久久久99久久精品欧美| 蜜桃视频在线观看一区二区| 欧美日韩久久久久久| 夜夜操天天操亚洲| 色综合一个色综合| 最新日韩av在线| av不卡一区二区三区| 国产精品美女久久久久高潮| 韩日精品视频一区| 久久久亚洲高清| 国产一本一道久久香蕉| 久久久亚洲精品石原莉奈| 久久国产日韩欧美精品| 欧美一区二区美女| 奇米亚洲午夜久久精品|