[Avida-SVN] r3437 - in development/source: actions main

goingssh at myxo.css.msu.edu goingssh at myxo.css.msu.edu
Thu Oct 1 19:58:45 PDT 2009


Author: goingssh
Date: 2009-10-01 22:58:45 -0400 (Thu, 01 Oct 2009)
New Revision: 3437

Modified:
   development/source/actions/PrintActions.cc
   development/source/main/cPhenotype.cc
Log:
fixed bugs in 2 new events from last commit 

Modified: development/source/actions/PrintActions.cc
===================================================================
--- development/source/actions/PrintActions.cc	2009-10-01 01:51:44 UTC (rev 3436)
+++ development/source/actions/PrintActions.cc	2009-10-02 02:58:45 UTC (rev 3437)
@@ -2210,7 +2210,7 @@
       
 	  int sum_tasks = 0;
       for (int j = 0; j < num_tasks; j++) 
-        sum_tasks += ( phenotype.GetCurTaskCount()[j] == 0 ) ? 0 : 1;
+        sum_tasks += ( phenotype.GetLastTaskCount()[j] == 0 ) ? 0 : 1;
 	  if (sum_tasks>0) {
 		  ave_tot_tasks += sum_tasks;
 		  num_task_orgs++;

Modified: development/source/main/cPhenotype.cc
===================================================================
--- development/source/main/cPhenotype.cc	2009-10-01 01:51:44 UTC (rev 3436)
+++ development/source/main/cPhenotype.cc	2009-10-02 02:58:45 UTC (rev 3437)
@@ -1183,7 +1183,6 @@
       eff_task_count[i]++;
       //cerr << "eff: " << eff_task_count[i] << endl;
       if(result.UsedEnvResource() == false) { cur_internal_task_count[i]++; }
-	  if (last_task_count[i]==0) { m_world->GetStats().AddNewTaskCount(i); }
     }
 
     if (result.TaskQuality(i) > 0) 
@@ -1195,8 +1194,9 @@
     cur_task_time[i] = cur_update_time; // Find out time from context
   }
   for (int i = 0; i < num_tasks; i++) {
-	  if (cur_task_count[i] && !last_task_count[i])
+	  if (result.TaskDone(i) && !last_task_count[i])
 	  {
+		  m_world->GetStats().AddNewTaskCount(i);
 		  int prev_num_tasks = 0;
 		  int cur_num_tasks = 0;
 		  for (int j=0; j< num_tasks; j++)




More information about the Avida-cvs mailing list