[Avida-SVN] r2528 - branches/jobScheduling/source/main

beckma24 at myxo.css.msu.edu beckma24 at myxo.css.msu.edu
Wed Apr 9 13:17:42 PDT 2008


Author: beckma24
Date: 2008-04-09 16:17:42 -0400 (Wed, 09 Apr 2008)
New Revision: 2528

Modified:
   branches/jobScheduling/source/main/cDeme.cc
   branches/jobScheduling/source/main/cPhenotype.cc
   branches/jobScheduling/source/main/cPhenotype.h
Log:


Modified: branches/jobScheduling/source/main/cDeme.cc
===================================================================
--- branches/jobScheduling/source/main/cDeme.cc	2008-04-08 20:07:27 UTC (rev 2527)
+++ branches/jobScheduling/source/main/cDeme.cc	2008-04-09 20:17:42 UTC (rev 2528)
@@ -77,6 +77,11 @@
 }
 
 void cDeme::ProcessUpdate() {
+  if(IsEmpty()) {  // deme is not processed if no organisms are present
+    total_energy_testament = 0.0;
+    return;
+  }
+
   for(int i = 0; i < cell_events.GetSize(); i++) {
     cDemeCellEvent& event = cell_events[i];
     if(event.GetDelay() == _age) {
@@ -103,7 +108,7 @@
   for(vector<pair<int, int> >::iterator iter = event_slot_end_points.begin(); iter < event_slot_end_points.end(); iter++) {
     if(_age == (*iter).first) {
       // at end point
-      (m_world->GetStats().FlowRateTuple())[(*iter).second].first.Add(GetSize());
+      (m_world->GetStats().FlowRateTuple())[(*iter).second].first.Add(GetOrgCount());
       (m_world->GetStats().FlowRateTuple())[(*iter).second].second.Add(GetEventsKilledThisSlot());
       eventsKilledThisSlot = 0;
       break;

Modified: branches/jobScheduling/source/main/cPhenotype.cc
===================================================================
--- branches/jobScheduling/source/main/cPhenotype.cc	2008-04-08 20:07:27 UTC (rev 2527)
+++ branches/jobScheduling/source/main/cPhenotype.cc	2008-04-09 20:17:42 UTC (rev 2528)
@@ -1412,6 +1412,12 @@
   energy_testament = 0.0;
 }
 
+void cPhenotype::EnergyTestament(const double value) {
+  assert(value > 0.0);
+  energy_tobe_applied += value;
+  energy_testament += value;
+} //! external energy given to organism
+
 double cPhenotype::ExtractParentEnergy() {
   assert(m_world->GetConfig().ENERGY_ENABLED.Get() > 0);
   // energy model config variables

Modified: branches/jobScheduling/source/main/cPhenotype.h
===================================================================
--- branches/jobScheduling/source/main/cPhenotype.h	2008-04-08 20:07:27 UTC (rev 2527)
+++ branches/jobScheduling/source/main/cPhenotype.h	2008-04-09 20:17:42 UTC (rev 2528)
@@ -458,7 +458,7 @@
   void HalfEnergyUsage();
   void RefreshEnergy();
   void ApplyToEnergyStore();
-  void EnergyTestament(double value) { assert(value > 0.0);  energy_tobe_applied += value; } //! external energy given to organism
+  void EnergyTestament(const double value); //! external energy given to organism
   double ExtractParentEnergy();
   
   bool operator<(const cPhenotype& rhs) const;




More information about the Avida-cvs mailing list