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

beckma24 at myxo.css.msu.edu beckma24 at myxo.css.msu.edu
Tue Apr 1 13:58:47 PDT 2008


Author: beckma24
Date: 2008-04-01 16:58:47 -0400 (Tue, 01 Apr 2008)
New Revision: 2513

Modified:
   branches/jobScheduling/source/main/cDeme.cc
   branches/jobScheduling/source/main/cDemeCellEvent.h
   branches/jobScheduling/source/main/cStats.cc
Log:
Added killed events to deme_average and fix reporting of a killed event

Modified: branches/jobScheduling/source/main/cDeme.cc
===================================================================
--- branches/jobScheduling/source/main/cDeme.cc	2008-04-01 20:45:48 UTC (rev 2512)
+++ branches/jobScheduling/source/main/cDeme.cc	2008-04-01 20:58:47 UTC (rev 2513)
@@ -260,13 +260,13 @@
 void cDeme::KillCellEvent(const int eventID) {
   for(int i = 0; i < cell_events.GetSize(); i++) {
     cDemeCellEvent& event = cell_events[i];
-    if(event.GetEventID() == eventID) {
-      // remove event ID for all cells
+    if(event.IsActive() && event.GetEventID() == eventID) {
+      // remove event ID from all cells
       int eventCell = event.GetNextEventCellID();
       while(eventCell != -1) {
         if(event.GetEventID() == m_world->GetPopulation().GetCell(GetCellID(eventCell)).GetCellData()) { // eventID == CellData
-          //set cell data to -1
-          m_world->GetPopulation().GetCell(GetCellID(eventCell)).SetCellData(-1);
+          //set cell data to 0
+          m_world->GetPopulation().GetCell(GetCellID(eventCell)).SetCellData(0);
           eventCell = event.GetNextEventCellID();
         }
       }

Modified: branches/jobScheduling/source/main/cDemeCellEvent.h
===================================================================
--- branches/jobScheduling/source/main/cDemeCellEvent.h	2008-04-01 20:45:48 UTC (rev 2512)
+++ branches/jobScheduling/source/main/cDemeCellEvent.h	2008-04-01 20:58:47 UTC (rev 2513)
@@ -19,6 +19,7 @@
   int GetDelay() { return m_delay; }
   int GetDuration() { return m_duration; }
   int GetEventID() { return m_eventID; }
+  bool IsActive() { return m_active; }
 
   void ActivateEvent();
   void DeactivateEvent();

Modified: branches/jobScheduling/source/main/cStats.cc
===================================================================
--- branches/jobScheduling/source/main/cStats.cc	2008-04-01 20:45:48 UTC (rev 2512)
+++ branches/jobScheduling/source/main/cStats.cc	2008-04-01 20:58:47 UTC (rev 2513)
@@ -584,6 +584,7 @@
   df.Write(sum_deme_merit.Average(),                        "Merit");
   df.Write(sum_deme_gestation_time.Average(),               "Gestation Time");
   df.Write(sum_deme_normalized_time_used.Average(),         "Time Used (normalized by org fitness)");
+  df.Write(sum_deme_events_killed.Average(),                "Events killed");
 
   df.Endl();
 }




More information about the Avida-cvs mailing list