[Avida-SVN] r2703 - development/source/main

connel42 at myxo.css.msu.edu connel42 at myxo.css.msu.edu
Wed Jul 2 13:30:06 PDT 2008


Author: connel42
Date: 2008-07-02 16:30:06 -0400 (Wed, 02 Jul 2008)
New Revision: 2703

Modified:
   development/source/main/cDeme.cc
Log:
fixed svn error

Modified: development/source/main/cDeme.cc
===================================================================
--- development/source/main/cDeme.cc	2008-07-02 20:16:33 UTC (rev 2702)
+++ development/source/main/cDeme.cc	2008-07-02 20:30:06 UTC (rev 2703)
@@ -136,6 +136,7 @@
     if(event.IsActive() && event.GetDelay() < _age && _age <= event.GetDelay()+event.GetDuration()) {
       //remove energy from cells  (should be done with outflow, but this will work for now)
       int eventCell = event.GetNextEventCellID();
+      cResource* res = m_world->GetEnvironment().GetResourceLib().GetResource("CELL_ENERGY");
       
       while(eventCell != -1) {
         cPopulationCell& cell = m_world->GetPopulation().GetCell(GetCellID(eventCell));
@@ -147,6 +148,7 @@
           }
           //remove energy from cell... organism might not takeup all of a cell's energy
           tArray<double> cell_resources = deme_resource_count.GetCellResources(eventCell);  // uses global cell_id; is this a problem
+          cell_resources[res->GetID()] *= m_world->GetConfig().ATTACK_DECAY_RATE.Get();
           deme_resource_count.ModifyCell(cell_resources, eventCell);
         }
         eventCell = event.GetNextEventCellID();




More information about the Avida-cvs mailing list