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

brysonda at myxo.css.msu.edu brysonda at myxo.css.msu.edu
Wed May 20 05:39:25 PDT 2009


Author: brysonda
Date: 2009-05-20 08:39:24 -0400 (Wed, 20 May 2009)
New Revision: 3246

Modified:
   development/source/actions/PrintActions.cc
   development/source/cpu/cTestCPU.cc
   development/source/cpu/cTestCPUInterface.cc
   development/source/cpu/cTestCPUInterface.h
   development/source/main/cOrganism.cc
   development/source/main/cTaskLib.cc
Log:
Fix some compile warnings.

Modified: development/source/actions/PrintActions.cc
===================================================================
--- development/source/actions/PrintActions.cc	2009-05-19 20:01:47 UTC (rev 3245)
+++ development/source/actions/PrintActions.cc	2009-05-20 12:39:24 UTC (rev 3246)
@@ -1779,7 +1779,6 @@
   {
     
     //Setup
-    int num_tasks = m_world->GetEnvironment().GetNumTasks();
     ofstream& fot = m_world->GetDataFileOFStream(m_filename);
     if (m_first_run == true){
       PrintHeader(fot);

Modified: development/source/cpu/cTestCPU.cc
===================================================================
--- development/source/cpu/cTestCPU.cc	2009-05-19 20:01:47 UTC (rev 3245)
+++ development/source/cpu/cTestCPU.cc	2009-05-20 12:39:24 UTC (rev 3246)
@@ -295,7 +295,7 @@
   organism->MutationRates().Copy(test_info.MutationRates());
   
   test_info.org_array[cur_depth] = organism;
-  organism->SetOrgInterface(ctx, new cTestCPUInterface(this, test_info));
+  organism->SetOrgInterface(ctx, new cTestCPUInterface(this, test_info, cur_depth));
   organism->GetPhenotype().SetupInject(genome.GetGenome());
 
   // Run the current organism.

Modified: development/source/cpu/cTestCPUInterface.cc
===================================================================
--- development/source/cpu/cTestCPUInterface.cc	2009-05-19 20:01:47 UTC (rev 3245)
+++ development/source/cpu/cTestCPUInterface.cc	2009-05-20 12:39:24 UTC (rev 3246)
@@ -135,7 +135,8 @@
 
 bool cTestCPUInterface::UpdateMerit(double new_merit)
 {
-  return false;
+  m_test_info.GetTestPhenotype(m_cur_depth).SetMerit(cMerit(new_merit));
+  return true;
 }
 
 int cTestCPUInterface::GetStateGridID(cAvidaContext& ctx)

Modified: development/source/cpu/cTestCPUInterface.h
===================================================================
--- development/source/cpu/cTestCPUInterface.h	2009-05-19 20:01:47 UTC (rev 3245)
+++ development/source/cpu/cTestCPUInterface.h	2009-05-20 12:39:24 UTC (rev 3246)
@@ -41,9 +41,11 @@
 private:
   cTestCPU* m_testcpu;
   cCPUTestInfo& m_test_info;
+  int m_cur_depth;
 
 public:
-  cTestCPUInterface(cTestCPU* testcpu, cCPUTestInfo& test_info) : m_testcpu(testcpu), m_test_info(test_info) { ; }
+  cTestCPUInterface(cTestCPU* testcpu, cCPUTestInfo& test_info, int cur_depth)
+    : m_testcpu(testcpu), m_test_info(test_info), m_cur_depth(cur_depth) { ; }
   virtual ~cTestCPUInterface() { ; }
 
   int GetCellID() { return -1; }

Modified: development/source/main/cOrganism.cc
===================================================================
--- development/source/main/cOrganism.cc	2009-05-19 20:01:47 UTC (rev 3245)
+++ development/source/main/cOrganism.cc	2009-05-20 12:39:24 UTC (rev 3246)
@@ -83,9 +83,9 @@
   , m_self_raw_materials(world->GetConfig().RAW_MATERIAL_AMOUNT.Get())
   , m_other_raw_materials(0)
   , m_num_donate(0)
-  , m_num_reciprocate(0)
   , m_num_donate_received(0)
   , m_amount_donate_received(0)
+  , m_num_reciprocate(0)
   , m_failed_reputation_increases(0)
   , m_tag(make_pair(-1, 0))
 
@@ -124,9 +124,9 @@
   , m_self_raw_materials(world->GetConfig().RAW_MATERIAL_AMOUNT.Get())
   , m_other_raw_materials(0)
   , m_num_donate(0)
-  , m_num_reciprocate(0)
   , m_num_donate_received(0)
   , m_amount_donate_received(0)
+  , m_num_reciprocate(0)
   , m_failed_reputation_increases(0)
   , m_tag(make_pair(-1, 0))
 {

Modified: development/source/main/cTaskLib.cc
===================================================================
--- development/source/main/cTaskLib.cc	2009-05-19 20:01:47 UTC (rev 3245)
+++ development/source/main/cTaskLib.cc	2009-05-20 12:39:24 UTC (rev 3246)
@@ -3382,4 +3382,4 @@
 	if (min > 0) m_world->GetStats().IncPerfectMatchOrg();
 	
 	return bonus; 
-}
\ No newline at end of file
+}




More information about the Avida-cvs mailing list