[Avida-cvs] [Avida2-svn] r289 - trunk/source/main

ofria@myxo.css.msu.edu ofria at myxo.css.msu.edu
Wed Aug 24 20:22:34 PDT 2005


Author: ofria
Date: 2005-08-24 23:22:34 -0400 (Wed, 24 Aug 2005)
New Revision: 289

Modified:
   trunk/source/main/genotype_control.cc
Log:
Fixed genebank so that genotypes are once again printed in abundance order
(with most abundant first).


Modified: trunk/source/main/genotype_control.cc
===================================================================
--- trunk/source/main/genotype_control.cc	2005-08-24 20:16:27 UTC (rev 288)
+++ trunk/source/main/genotype_control.cc	2005-08-25 03:22:34 UTC (rev 289)
@@ -177,9 +177,9 @@
     prev_OK =true;
   }
 
-  if ((&in_genotype == best && next_OK) ||
-      (next_OK && prev_OK) ||
-      (&in_genotype == best->GetPrev() && prev_OK)) {
+  if ( (next_OK && prev_OK) ||
+       (&in_genotype == best && next_OK) ||
+       (&in_genotype == best->GetPrev() && prev_OK)) {
     return true;
   }
 
@@ -203,29 +203,28 @@
 
 bool cGenotypeControl::Adjust(cGenotype & in_genotype)
 {
-  if (in_genotype.GetDeferAdjust() == true) return true;
-
   cGenotype * cur_genotype = in_genotype.GetPrev();
 
   // Check to see if this genotype should be removed completely.
 
-  if (in_genotype.GetNumOrganisms() == 0) {
+  if (in_genotype.GetNumOrganisms() == 0 &&
+      in_genotype.GetDeferAdjust() == false) {
     genebank.RemoveGenotype(in_genotype);
     return false;
   }
 
-  // Do not adjust if this was and still is the best genotype, or is
-  // otherwise in the proper spot...
+  // Do not adjust the position of this genotype if it was and still is the
+  // best genotype, or if it is otherwise in the proper spot...
 
   if (CheckPos(in_genotype)) {
     return true;
   }
 
-  // Otherwise, remove it from the queue for just the moment.
+  // Otherwise, remove it from the queue (for just the moment).
 
   Remove(in_genotype);
 
-  // Also, if this genotype is the best, put it there.
+  // If this genotype is the best, put it there.
 
   if (in_genotype.GetNumOrganisms() > best->GetNumOrganisms()) {
     Insert(in_genotype, best->GetPrev());




More information about the Avida-cvs mailing list