Cultured Perl

Genetic algorithms applied with Perl

Algorithm GA

Comments

系列内容:

此内容是该系列 # 部分中的第 # 部分: Cultured Perl

敬请期待该系列的后续内容。

此内容是该系列的一部分:Cultured Perl

敬请期待该系列的后续内容。

Back to the article.

	  // start with an initial time
	  t := 0;
	
	  // initialize a usually random population of individuals
	  initpopulation P (t);
	
	  // evaluate fitness of all initial individuals of population
	  evaluate P (t);
	
	  // test for termination criterion (time, fitness, etc.)
	  while not done do
	
	       // increase the time counter
	       t := t + 1;
	
	       // select a sub-population for offspring production
	       P' := selectparents P (t);
	
	       // recombine the "genes" of selected parents
	       recombine P' (t);
	
	       // perturb the mated population stochastically
	       mutate P' (t);
	
	       // evaluate its new fitness
	       evaluate P' (t);
	
	       // select the survivors from actual fitness
	       P := survive P,P' (t);
	
	  od
     end GA.

Back to the article.


评论

添加或订阅评论,请先登录注册

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=10
Zone=Linux, Open source
ArticleID=163208
ArticleTitle=Cultured Perl: Genetic algorithms applied with Perl
publish-date=08012001