[Avida-SVN] r1471 - branches/collect/source/main

blwalker at myxo.css.msu.edu blwalker at myxo.css.msu.edu
Sat Apr 7 19:42:34 PDT 2007


Author: blwalker
Date: 2007-04-07 22:42:33 -0400 (Sat, 07 Apr 2007)
New Revision: 1471

Modified:
   branches/collect/source/main/cOrganism.cc
   branches/collect/source/main/cStats.cc
Log:

Fixed erroneous use of 2-argument tArray::Resize.  Now using 1-arg Resize() + SetAll().


Modified: branches/collect/source/main/cOrganism.cc
===================================================================
--- branches/collect/source/main/cOrganism.cc	2007-04-07 13:56:24 UTC (rev 1470)
+++ branches/collect/source/main/cOrganism.cc	2007-04-08 02:42:33 UTC (rev 1471)
@@ -87,12 +87,8 @@
   }
 
   // Ensure all those nice new resource bins are set to 0
-  m_rbins.Resize(m_world->GetNumResources(), 0.0);
+  m_rbins.SetAll(0.0);
   
-	//since they're *not* actually set to zero due to some really wierd stuff...
-	for(int i = 0; i < m_rbins.GetSize(); i++)
-	{m_rbins[i] = 0.0;}
-
   if (m_world->GetConfig().NET_ENABLED.Get()) m_net = new cNetSupport();
   m_id = m_world->GetStats().GetTotCreatures();
 }

Modified: branches/collect/source/main/cStats.cc
===================================================================
--- branches/collect/source/main/cStats.cc	2007-04-07 13:56:24 UTC (rev 1470)
+++ branches/collect/source/main/cStats.cc	2007-04-08 02:42:33 UTC (rev 1471)
@@ -129,6 +129,21 @@
   task_cur_max_quality.SetAll(0);
   task_last_max_quality.SetAll(0);
   task_exe_count.SetAll(0);
+  
+  // Stats for internal resource use
+  task_internal_cur_count.Resize(num_tasks);
+  task_internal_last_count.Resize(num_tasks);
+  task_internal_cur_quality.Resize(num_tasks);
+  task_internal_last_quality.Resize(num_tasks);
+  task_internal_cur_max_quality.Resize(num_tasks);
+  task_internal_last_max_quality.Resize(num_tasks);
+  task_internal_cur_count.SetAll(0.0);
+  task_internal_last_count.SetAll(0.0);
+  task_internal_cur_quality.SetAll(0.0);
+  task_internal_last_quality.SetAll(0.0);
+  task_internal_cur_max_quality.SetAll(0.0);
+  task_internal_last_max_quality.SetAll(0.0);
+  
 
 #if INSTRUCTION_COUNT
   sum_exe_inst_array.Resize( m_world->GetNumInstructions() );
@@ -151,14 +166,6 @@
   
   reaction_names.Resize( m_world->GetNumReactions() );
   resource_names.Resize( m_world->GetNumResources() );
-  
-  // Stats for internal resource bins and use of internal resources
-  task_internal_cur_count.Resize(num_tasks, 0);
-  task_internal_last_count.Resize(num_tasks, 0);
-  task_internal_cur_quality.Resize(num_tasks, 0);
-  task_internal_last_quality.Resize(num_tasks, 0);
-  task_internal_cur_max_quality.Resize(num_tasks, 0);
-  task_internal_last_max_quality.Resize(num_tasks, 0);
 
   // This block calculates how many slots we need to
   // make for paying attention to different label combinations 




More information about the Avida-cvs mailing list