[Avida-SVN] r2932 - in branches/movement/source: actions main

grabow38 at myxo.css.msu.edu grabow38 at myxo.css.msu.edu
Tue Nov 11 07:08:43 PST 2008


Author: grabow38
Date: 2008-11-11 10:08:43 -0500 (Tue, 11 Nov 2008)
New Revision: 2932

Modified:
   branches/movement/source/actions/PopulationActions.cc
   branches/movement/source/main/cDeme.cc
   branches/movement/source/main/cResourceCount.cc
   branches/movement/source/main/cResourceCount.h
Log:
Removing temporary resource fix.

Modified: branches/movement/source/actions/PopulationActions.cc
===================================================================
--- branches/movement/source/actions/PopulationActions.cc	2008-11-11 05:00:35 UTC (rev 2931)
+++ branches/movement/source/actions/PopulationActions.cc	2008-11-11 15:08:43 UTC (rev 2932)
@@ -1753,30 +1753,30 @@
 	  cString res_name;												// Name of resource
 	  double fitnessOfDeme = 0.0;									// Fitness of deme
 	  
-	  //cout << "Deme " << deme.GetID() << ": " << endl;
+	  cout << "Deme " << deme.GetID() << ": " << endl;
 	  
 	  for (int i = 0; i < curr_counts.GetSize(); i++) {                                                                                                                        
 	    if ( (res.GetResourcesGeometry())[i] != nGeometry::GLOBAL) {                                                                                                   
 	      cSpatialResCount sp_res = res.GetSpatialResource(i);  
 		  res_name = res.GetResName(i);
-		  //cout << "Resource Name " << res_name << endl;
+		  cout << "Resource Name " << res_name << endl;
 		  if ( res_name != "poison" ) { 																
 		    initial_good_res += init_counts[i];
 			current_good_res += curr_counts[i];  
-			//cout << "Init good at " <<  i << "  " << init_counts[i]
-			//     << " Curr good at " <<  i << "  " << curr_counts[i] << endl;
+			cout << "Init good at " <<  i << "  " << init_counts[i]
+			     << " Curr good at " <<  i << "  " << curr_counts[i] << endl;
 		  }
 		  else {                                                                                                           
 		    initial_poison += init_counts[i];  
 			current_poison += curr_counts[i];  
-			//cout << "Init poison at " <<  i << "  " << init_counts[i]
-			//     << " Curr poison at " <<  i << "  " << curr_counts[i] << endl;
+			cout << "Init poison at " <<  i << "  " << init_counts[i]
+			     << " Curr poison at " <<  i << "  " << curr_counts[i] << endl;
 		  }
 	    } 
 		
-		//cout << "Totals so far: " << endl
-		//	 << "Initial good " << initial_good_res << " Current good " << current_good_res
-		//	 << " Initial poison " << initial_poison << " Current poison " << current_poison << endl;
+		cout << "Totals so far: " << endl
+			 << "Initial good " << initial_good_res << " Current good " << current_good_res
+			 << " Initial poison " << initial_poison << " Current poison " << current_poison << endl;
       }   
 	  
 	  consumed_good = initial_good_res - current_good_res;
@@ -1787,9 +1787,9 @@
 	    fitnessOfDeme = pow( (consumed_good - consumed_poison), 2.0 );
 	  
 	  // Debugging output
-	  // cout << " Consumed Good " << consumed_good 
-	 //      << " Consumed Poison " << consumed_poison
-	 //      << " Fitness " << fitnessOfDeme << endl<< endl;
+	   cout << " Consumed Good " << consumed_good 
+	        << " Consumed Poison " << consumed_poison
+	        << " Fitness " << fitnessOfDeme << endl<< endl;
 	  
       return fitnessOfDeme;
     }

Modified: branches/movement/source/main/cDeme.cc
===================================================================
--- branches/movement/source/main/cDeme.cc	2008-11-11 05:00:35 UTC (rev 2931)
+++ branches/movement/source/main/cDeme.cc	2008-11-11 15:08:43 UTC (rev 2932)
@@ -469,11 +469,7 @@
 //	cout << "Deme res count " << deme_resource_count.GetSize() << endl;
     for (int j = 0; j < deme_resource_count.GetSize(); j++) {
 	  if ( cell_res_counts[j] > 0.0 ) {
-		if ( cell_res_counts[j] < 1.0 ) {
-		  cell_res_counts[j] = 0.0;
-		  deme_resource_count.ResetCell(i, j, 0.0);
-		}
-	    deme_res_count_array[j] += cell_res_counts[j];
+		deme_res_count_array[j] += cell_res_counts[j];
 		//cout << "Deme resource array position " << j << " Res name " << deme_resource_count.GetResName(j)
 		//	 << " res amount " << deme_res_count_array[j] << " Cell res amt " << cell_res_counts[j] << endl;
 	  }

Modified: branches/movement/source/main/cResourceCount.cc
===================================================================
--- branches/movement/source/main/cResourceCount.cc	2008-11-11 05:00:35 UTC (rev 2931)
+++ branches/movement/source/main/cResourceCount.cc	2008-11-11 15:08:43 UTC (rev 2932)
@@ -416,18 +416,6 @@
   }
 }
 
-// @ LMG
-// Resets
-void cResourceCount::ResetCell(int cell_id, int res_id, double reset_amt)
-{
-  // Process only spatial resources
-  if(geometry[res_id] == nGeometry::GLOBAL) {
-    return; }
-  else {
-    spatial_resource_count[res_id].SetCellAmount(cell_id, reset_amt);
-  }
-}
-
 double cResourceCount::Get(int id) const
 {
   assert(id < resource_count.GetSize());

Modified: branches/movement/source/main/cResourceCount.h
===================================================================
--- branches/movement/source/main/cResourceCount.h	2008-11-11 05:00:35 UTC (rev 2931)
+++ branches/movement/source/main/cResourceCount.h	2008-11-11 15:08:43 UTC (rev 2932)
@@ -101,7 +101,6 @@
   void Modify(const tArray<double>& res_change);
   void Modify(int id, double change);
   void ModifyCell(const tArray<double> & res_change, int cell_id);
-  void ResetCell(int cell_id, int res_id, double reset_amt); // @LMG, resets a particular cell resource amount
   void Set(int id, double new_level);
   double Get(int id) const;
   void ResizeSpatialGrids(int in_x, int in_y);




More information about the Avida-cvs mailing list