[Avida-cvs] [avida-svn] r1025 - in branches/coopcomm/source: classification main

beckma24 at myxo.css.msu.edu beckma24 at myxo.css.msu.edu
Wed Oct 4 11:08:28 PDT 2006


Author: beckma24
Date: 2006-10-04 14:08:28 -0400 (Wed, 04 Oct 2006)
New Revision: 1025

Modified:
   branches/coopcomm/source/classification/cClassificationManager.cc
   branches/coopcomm/source/main/cPopulationCell.cc
   branches/coopcomm/source/main/cTaskLib.cc
Log:
Fixed null message reward for sent-not-toward-sink

Modified: branches/coopcomm/source/classification/cClassificationManager.cc
===================================================================
--- branches/coopcomm/source/classification/cClassificationManager.cc	2006-10-01 04:17:54 UTC (rev 1024)
+++ branches/coopcomm/source/classification/cClassificationManager.cc	2006-10-04 18:08:28 UTC (rev 1025)
@@ -721,8 +721,6 @@
   return true;
 }
 
-
-
 void cClassificationManager::DumpDetailHeading (ofstream& fp)
 {
   fp << "#filetype genotype_data" << endl

Modified: branches/coopcomm/source/main/cPopulationCell.cc
===================================================================
--- branches/coopcomm/source/main/cPopulationCell.cc	2006-10-01 04:17:54 UTC (rev 1024)
+++ branches/coopcomm/source/main/cPopulationCell.cc	2006-10-04 18:08:28 UTC (rev 1025)
@@ -190,7 +190,7 @@
   // This whole function is a hack.
 	cPopulationCell* faced = ConnectionList().GetFirst();
 	
-	int x=0,y=0,lr=0,du=0;
+        int x=0,y=0,lr=0,du=0;
 	faced->GetPosition(x,y);
   
 	if((x==m_x-1) || (x>m_x+1))

Modified: branches/coopcomm/source/main/cTaskLib.cc
===================================================================
--- branches/coopcomm/source/main/cTaskLib.cc	2006-10-01 04:17:54 UTC (rev 1024)
+++ branches/coopcomm/source/main/cTaskLib.cc	2006-10-04 18:08:28 UTC (rev 1025)
@@ -1949,8 +1949,10 @@
 }
 
 double cTaskLib::Task_SendTowardSink(cTaskContext* ctx) const {
-  if(ctx->GetMessage() == NULL)
+  if(ctx->GetMessage() == NULL) {
+    //catch IO
     return 0.0;
+  }
 
   tVector<int> BS_iter = m_world->GetPopulation().GetBaseStations();
   int x_sender, y_sender, x_receiver, y_receiver, x_BS, y_BS;
@@ -1970,7 +1972,7 @@
     } else if(nGeometry::TORUS == m_world->GetConfig().WORLD_GEOMETRY.Get()) {    //torus
       int x_world = m_world->GetConfig().WORLD_X.Get();
       int y_world = m_world->GetConfig().WORLD_Y.Get();
-      
+      std::cerr<<"TORUS cTaskLib::Task_SendTowardSink\n";
       if(min(max(abs(x_receiver-x_BS), abs(y_receiver-y_BS)), max(x_world-abs(x_receiver-x_BS), y_world-abs(y_receiver-y_BS))) <
           min(max(abs(x_sender-x_BS), abs(y_sender-y_BS)), max(x_world-abs(x_sender-x_BS), y_world-abs(y_sender-y_BS)))) {
         //sent to closer organisms
@@ -1985,7 +1987,11 @@
 }
 
 double cTaskLib::Task_SendNotTowardSink(cTaskContext* ctx) const {
-  if(Task_SendTowardSink(ctx) == 0.0)
+  if(ctx->GetMessage() == NULL) {
+    //catch IO
+    return 0.0;
+  }
+  else if(Task_SendTowardSink(ctx) == 0.0)
     return 1.0;
   return 0.0;
 }




More information about the Avida-cvs mailing list