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

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

?? symbreg2.cc

?? genetic programming in C++ Adam Fraser University Of Salford, Salford, M5 4WT, United Kingdom
?? CC
字號:
// symbreg2.cc.................28 April 1994

//--------------------------------------------------------------------------
// This code is a component of Genetic Programming in C++ (Version 0.40)
// Copyright Adam P. Fraser, 1993,1994
// This code is released for non-commercial use only.
// For comments, improvements, additions (or even money !?) contact:
// Adam Fraser, Postgraduate Section, Dept of Elec & Elec Eng,
// Maxwell Building, University Of Salford, Salford, M5 4WT, United Kingdom.
// Internet: a.fraser@eee.salford.ac.uk
// Tel: (UK) 061 745 5000 x3633
// Fax: (UK) 061 745 5999
//--------------------------------------------------------------------------


// a slightly more difficult problem function which needs some real numbers to solve it
// Code designed and created by Adam P. Fraser 8 February 1994 for gpcpp v0.4

// This produces a genetic program which attempts to evolve a function which fits
// the curve outlined by that defined in FUNCTION. It does this by taking 10 points
// between 0->10 and evaluating for each point.  The accumulated difference between
// the two set of values should tend to zero as the genetic program gets closer to
// the function.

// if you give the system a population = 500 and generations = 50 it will probably
// come up with a solution. There are no certainties in this game......

// Include header files of genetic programming system.
#include "gpmain.hpp" 
#include "function.hpp"
#include "terminal.hpp"

// global def'ns
// define the returning value of each block within the genetic program..............
#define FITNESS float

// define the function to be symbolically regressed.................................
#define FUNCTION( x )  x*x*x*x - 3*x*x*x - 2*x*x + x

// Global function set..............................................................
FS *FunctionSets[1];
TS *TerminalSets[1];

// set up question and answer array with 10 points for the function.................
float ques[10];
float answ[10];

// this variable will be used by genetic programming system.........................
float globalX;

// For ADFs really but can also be used when we dont need ADF's
GP *pgpGlobal;

#define ROOT *(pgpGlobal->ppgHeader)

// These four functions MUST be included and written................................ 
unsigned int EvaluateFitness( Gene *,int );
ostream& (*TranslatePrint)( ostream&, Gene* );
void InitialiseGPS();
void CleanUpGPS();

FITNESS (*Translate)( Gene* );
FITNESS TranslateROOT( Gene* );
ostream& TranslatePrintROOT( ostream&, Gene* );
// divide with closure property.....................................................
FITNESS Divide( Gene* );


// main block of code...
// The evaluate of function generally the most difficult to define for a problem
unsigned int EvaluateFitness( GP *pgp, int Evals )
{
	FITNESS rawfitness = 0, diff = 0;

// set up global genetic program variable to use ROOT macro defined above
// this is useful for ADFs but not particularly helpful here
	pgpGlobal = pgp;                                                

// this next line is included just to stop any warnings in compilation
// it makes no difference to the code and can be deleted if wished...
	Evals--;                                         

// the evaluation function checks with 10 values of the mathematical function
	for ( int i = 0; i < 10; i++ )
	{
	float tempGPAnswer;
// set up X variable for mathematical function.......................
		globalX = ques[i];

// calculate genetic programs answer.....................................
		tempGPAnswer = Translate( ROOT );

// calculate difference between the genetic program and the actual answer
		if ( answ[i] > tempGPAnswer )   diff = answ[i] - tempGPAnswer;
		else                                                                                                            diff = tempGPAnswer - answ[i];

// if this is really big don't make it to big................................
		if ( diff > 100 ) diff = 100;

// add this difference to total rawfitness.................................
		rawfitness += diff;
	}

// in this case the higher the rawfitness ( or accumulated differences ) the
// lower the fitness hence the next line..............................
	return (1000 - (unsigned int)rawfitness );
}


// The translate function for the procedural calls from GP iValues
FITNESS TranslateROOT( Gene *pg )
{
	switch ( pg->iValue )
	{
// FUNCTIONS
// The multiplier values.........................................................
		case 1: return Translate( pg->pgChild ) * Translate( pg->pgChild->pgNext );

// the summation values..........................................................
		case 2: return Translate( pg->pgChild ) + Translate( pg->pgChild->pgNext );

// the subtraction values........................................................
		case 3: return Translate( pg->pgChild ) - Translate( pg->pgChild->pgNext );

// divide is a special operator in GP (no closure property) so is somewhere else.
		case 4: return Divide( pg->pgChild );

// TERMINALS
// only one the X variable which is set in evaluatefitness()
		case 5: return globalX;

// the default which returns a value between 0 and 9.........................
		default: return (unsigned int)(pg->iValue - 32768);
	}
}

// The translateprint function for the character strings from GP iValues
ostream& TranslatePrintROOT( ostream& os, Gene *pg )
{
	switch ( pg->iValue )
	{
// FUNCTIONS
// The multiplier values.........................................................
		case 1:         os << " ( *";
							break;

// the summation values..........................................................
		case 2:         os << " ( +";
							break;

// the subtraction values........................................................
		case 3:         os << " ( -";
							break;

// special form of divide which has closure traditonally shown as a %............
		case 4:         os << " ( %";
							break;

// TERMINALS
// only one the X variable which is set in evaluatefitness()
		case 5:   os << " X";
							break;

// the default which return a real number between 0 and 9.....................
		default:        os << " " << (unsigned int)(pg->iValue - 32768);
							break;

	}

// return this even though you probably don't need to as you have been acting
// on a reference all along better to be safe than sorry in my opinion...
	return os;
}


// Unfortunately because of ADFS and the need to alter the printing style of GPs
// the GP operator << needs to know reside here..................................
// This does not need to be understood just used by example if you wish..........
ostream& operator <<(ostream& os, GP *pgp )
{
	if ( pgp )
	{
// set up global genetic program variable to use ROOT macro defined above
// this is useful for ADFs but not particularly helpful here
		pgpGlobal = pgp;

// prints out a GP simple really isnt here. The initial bracket is a hack to get
// the total number of opening and closing number of brackets right.............
		os << "(" << ROOT << endl;
	}

// must return this value even though it isnt really needed.....................
	return os;
}

// This function is called right at the start of the GP system before creating any GPs
// at all. This means all global variable, function and terminal set should be defined
// here. Also all Translate function should have all their initial pointers set up here

// In gpcpp all function and terminals are considered as number this tells the system
// what those number should be so they can be use in Translate...() functions
void InitialiseGPS()
{

// F(main) = { *,+,-,% }
// T(main) = { X }
	if (!(FunctionSets[0] = new FS( 3, 1,2,3, 2,2,2 )) ) ExitSystem( "Initialise");
	if (!(TerminalSets[0] = new TS( 2, 5, RandomReal, 10 )) ) ExitSystem( "Initialise" );

// only need to be set up once so use global ....
  Translate = TranslateROOT;
	TranslatePrint = TranslatePrintROOT;

// Run through the function and values working out answers to function defined at
// the beginning of this file.....................................................
	for ( int i = 0; i < 10; i++ )
	{
		ques[i] = (float)i;
		answ[i] = FUNCTION( (float)i );
	}
}

//This is called right at the end of the GP system and can clear up all global variables
// created in InitialiseGPS() and anywhere else.........................................
void CleanUpGPS()
{
	delete FunctionSets[0];
	delete TerminalSets[0];
}

// this function is the divide with closure basically if you divide anything by zero you
// get an error so we have to stop this process. We check for a denom == 0 and return 0.
FITNESS Divide( Gene *pg )
{
	FITNESS numer = Translate( pg );
	FITNESS denom = Translate( pg->pgNext );

	if ( denom == 0.0 )     return 0.0;
	else                                                                    return numer / denom;
}

// symbreg.cc

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本sm残虐另类| 免费在线一区观看| 日本成人在线看| 韩国精品久久久| 91麻豆精品秘密| 欧美精品日韩综合在线| 精品久久久三级丝袜| 国产精品毛片大码女人 | 亚洲狠狠爱一区二区三区| 午夜国产精品一区| 成人午夜激情在线| 91精品福利在线一区二区三区 | 国产一区二区三区在线观看免费视频| 精品在线亚洲视频| 欧美色窝79yyyycom| 国产精品麻豆一区二区| 色综合天天天天做夜夜夜夜做| 精品日韩一区二区三区| 亚洲一区二区三区四区在线观看| 黄一区二区三区| 欧美日本精品一区二区三区| 中文字幕永久在线不卡| 蜜桃av噜噜一区二区三区小说| 91国偷自产一区二区开放时间| 精品91自产拍在线观看一区| 午夜一区二区三区视频| a级高清视频欧美日韩| 国产欧美综合色| 国产91在线看| 中文字幕精品—区二区四季| 精品无人码麻豆乱码1区2区| 欧美剧在线免费观看网站 | 大尺度一区二区| 国产欧美日韩不卡免费| 国产麻豆精品久久一二三| 精品国产欧美一区二区| 国内精品写真在线观看| 国产欧美日韩另类视频免费观看 | 91精品在线免费观看| 毛片一区二区三区| 一区二区三区日本| 在线免费观看不卡av| 天堂成人免费av电影一区| 欧美成人三级电影在线| 国产丶欧美丶日本不卡视频| 亚洲精品欧美激情| 日韩一区二区三区免费看| 国产米奇在线777精品观看| 国产精品久久久久久亚洲毛片 | 三级成人在线视频| 欧美精品一区二区三区四区| 成人免费毛片a| 青娱乐精品视频| 国产精品国产自产拍高清av王其 | 丝袜美腿亚洲综合| 中文在线资源观看网站视频免费不卡| 日本久久一区二区三区| 国产一区二区成人久久免费影院| 亚洲同性同志一二三专区| 日韩欧美一区二区视频| 色94色欧美sute亚洲线路二 | 久久一夜天堂av一区二区三区| 色综合色狠狠天天综合色| 久久不见久久见中文字幕免费| 综合久久久久综合| 国产亚洲精品福利| 欧美va日韩va| 日韩午夜av一区| 欧美日韩国产精品成人| 一本久道中文字幕精品亚洲嫩| 韩国成人福利片在线播放| 首页欧美精品中文字幕| 亚洲午夜久久久| 亚洲成av人片观看| 国产一区 二区| 久久精品国产亚洲一区二区三区 | 99这里都是精品| 成人黄色国产精品网站大全在线免费观看| 亚洲国产精品一区二区久久| 一区二区三区在线观看欧美| 亚洲女厕所小便bbb| 一区二区三区免费网站| 午夜精品福利在线| 日韩精品乱码免费| 韩日av一区二区| 成人免费黄色在线| 91麻豆福利精品推荐| 91福利在线导航| 日韩欧美亚洲国产精品字幕久久久| 7777精品伊人久久久大香线蕉| 精品国产免费久久 | 成人小视频免费在线观看| 99久久精品国产麻豆演员表| 在线亚洲一区观看| 精品国产91久久久久久久妲己| 国产亚洲精品福利| 亚洲一区中文在线| 激情六月婷婷综合| 91精品办公室少妇高潮对白| 日韩免费视频线观看| 亚洲日本在线看| 韩国av一区二区三区| 色婷婷综合久久久| 日本一区二区三区在线不卡| 午夜视频久久久久久| 不卡一区二区三区四区| 国产精品国产三级国产aⅴ原创 | 91精品久久久久久久99蜜桃| 中文字幕一区日韩精品欧美| 久久国产精品色| 欧美巨大另类极品videosbest | 日韩精品一区二区三区四区| 亚洲综合偷拍欧美一区色| 国产黑丝在线一区二区三区| 欧美一级午夜免费电影| 亚洲欧美日韩国产成人精品影院| 国产乱子伦视频一区二区三区| 欧美精品v日韩精品v韩国精品v| 亚洲女厕所小便bbb| 色综合天天综合网天天看片| 国产日韩av一区| 粉嫩一区二区三区在线看| 国产亚洲视频系列| 国产精华液一区二区三区| 精品福利一区二区三区| 美国毛片一区二区三区| 欧美大片国产精品| 国产黄人亚洲片| 日本一区二区成人在线| 日韩午夜激情视频| 国产一区二区三区久久久 | 日本va欧美va瓶| 日韩欧美国产三级| 成人一区二区三区在线观看| 国产精品久久久久婷婷二区次| 91色在线porny| 青草国产精品久久久久久| 精品福利一区二区三区免费视频| 国产精品99久| 天天影视涩香欲综合网| 久久精品视频在线看| 欧美专区日韩专区| 中文字幕不卡在线| 丝袜亚洲另类丝袜在线| 99久久99久久精品免费看蜜桃 | 久久亚洲综合色| 精品久久久久久久久久久久久久久| 欧美性猛交xxxx乱大交退制版 | 成人精品视频一区二区三区尤物| 亚洲精品免费在线观看| 国产欧美日韩亚州综合 | 99久久99久久精品国产片果冻| 三级欧美韩日大片在线看| 亚洲天堂免费看| 国产午夜一区二区三区| 制服丝袜在线91| 欧美色区777第一页| 色综合久久88色综合天天免费| 国产一区二区在线影院| 麻豆精品在线观看| 视频在线观看一区| 视频一区在线播放| 亚洲一区二区欧美日韩 | 欧美午夜精品一区二区三区 | 亚洲国产欧美一区二区三区丁香婷| wwwwxxxxx欧美| 久久理论电影网| 18成人在线观看| 香蕉加勒比综合久久| 久久精工是国产品牌吗| 国产精品一区三区| www.欧美色图| 日韩亚洲欧美在线| 国产精品污污网站在线观看 | 欧美一区二区三区公司| 久久网站热最新地址| 中文字幕视频一区二区三区久| 一区二区三区在线视频观看58| 亚洲不卡一区二区三区| 国产a级毛片一区| 欧美三级日韩在线| 国产欧美视频在线观看| 一区二区三区.www| 精品在线播放免费| 欧美日韩一区二区在线观看| 国产欧美日韩综合精品一区二区| 视频精品一区二区| va亚洲va日韩不卡在线观看| 欧美欧美欧美欧美| 亚洲精品国产a| 国产精品一区二区视频| 日韩女优毛片在线| 日本伊人色综合网| 91精品久久久久久蜜臀| 亚洲一级电影视频| 天天色 色综合| 国产精品久线在线观看| 久久成人羞羞网站| 国产亚洲欧美激情| 91网站在线播放|