[Avida-SVN] r2128 - branches/energy/source/main

beckma24 at myxo.css.msu.edu beckma24 at myxo.css.msu.edu
Mon Oct 8 10:56:28 PDT 2007


Author: beckma24
Date: 2007-10-08 13:56:28 -0400 (Mon, 08 Oct 2007)
New Revision: 2128

Modified:
   branches/energy/source/main/cDeme.cc
   branches/energy/source/main/cDeme.h
   branches/energy/source/main/cDemeCellEvent.cc
   branches/energy/source/main/cDemeCellEvent.h
   branches/energy/source/main/cPopulation.cc
   branches/energy/source/main/cStats.cc
Log:
Minor changes

Modified: branches/energy/source/main/cDeme.cc
===================================================================
--- branches/energy/source/main/cDeme.cc	2007-10-05 19:02:06 UTC (rev 2127)
+++ branches/energy/source/main/cDeme.cc	2007-10-08 17:56:28 UTC (rev 2128)
@@ -30,6 +30,14 @@
 #include "cStats.h"
 #include "cWorld.h"
 
+
+cDeme::~cDeme() {
+//  delete stuff;
+  for(int i = 0; i < message_pred_list.GetSize(); i++) {
+    delete message_pred_list[i];
+  }
+}
+
 void cDeme::Setup(const tArray<int> & in_cells, int in_width, cWorld* world)
 {
   cell_ids = in_cells;
@@ -87,7 +95,7 @@
 
         eventCell = event.GetNextEventCellID();
       }
-    } else if(event.GetDelay()+event.GetDuration() == _age) {
+    } else if(event.GetDelay() + event.GetDuration() == _age) {
       int eventCell = event.GetNextEventCellID();
       while(eventCell != -1) {
         if(event.GetEventID() == m_world->GetPopulation().GetCell(GetCellID(eventCell)).GetCellData()) { // eventID == CellData
@@ -205,7 +213,7 @@
 }
 
 void cDeme::SetCellEvent(int x1, int y1, int x2, int y2, int delay, int duration, bool static_pos) {
-  cDemeCellEvent demeEvent = cDemeCellEvent(x1, y1, x2, y2, delay, duration, width, GetHeight(), static_pos, m_world);
+  cDemeCellEvent demeEvent = cDemeCellEvent(x1, y1, x2, y2, delay, duration, width, GetHeight(), static_pos);
   cell_events.Push(demeEvent);
 }
 

Modified: branches/energy/source/main/cDeme.h
===================================================================
--- branches/energy/source/main/cDeme.h	2007-10-05 19:02:06 UTC (rev 2127)
+++ branches/energy/source/main/cDeme.h	2007-10-08 17:56:28 UTC (rev 2128)
@@ -66,7 +66,7 @@
   
 public:
   cDeme() : width(0), birth_count(0), org_count(0), _age(0), deme_resource_count(0) { ; }
-  ~cDeme() { ; }
+  ~cDeme();
 
   void Setup(const tArray<int>& in_cells, int in_width = -1, cWorld* world = NULL);
 

Modified: branches/energy/source/main/cDemeCellEvent.cc
===================================================================
--- branches/energy/source/main/cDemeCellEvent.cc	2007-10-05 19:02:06 UTC (rev 2127)
+++ branches/energy/source/main/cDemeCellEvent.cc	2007-10-08 17:56:28 UTC (rev 2128)
@@ -1,7 +1,7 @@
 #include "cDemeCellEvent.h"
 #include "cWorld.h"
 
-cDemeCellEvent::cDemeCellEvent(int x1, int y1, int x2, int y2, int delay, int duration, int deme_width, int deme_height, bool static_pos, cWorld* m_world) : 
+cDemeCellEvent::cDemeCellEvent(int x1, int y1, int x2, int y2, int delay, int duration, int deme_width, int deme_height, bool static_pos) : 
   m_delay(delay)
   , m_duration(duration)
   , m_iter(0)

Modified: branches/energy/source/main/cDemeCellEvent.h
===================================================================
--- branches/energy/source/main/cDemeCellEvent.h	2007-10-05 19:02:06 UTC (rev 2127)
+++ branches/energy/source/main/cDemeCellEvent.h	2007-10-08 17:56:28 UTC (rev 2128)
@@ -13,8 +13,8 @@
   bool m_active, m_static_pos;
   
 public:
-  cDemeCellEvent() { cDemeCellEvent(-1, -1, -1, -1, 0, 0, 0, 0, true, NULL); }
-  cDemeCellEvent(int x1, int y1, int x2, int y2, int delay, int duration, int deme_width, int deme_height, bool static_pos, cWorld* m_world);
+  cDemeCellEvent() { cDemeCellEvent(-1, -1, -1, -1, 0, 0, 0, 0, true); }
+  cDemeCellEvent(int x1, int y1, int x2, int y2, int delay, int duration, int deme_width, int deme_height, bool static_pos);
   int GetNextEventCellID();
   int GetDelay() { return m_delay; }
   int GetDuration() { return m_duration; }

Modified: branches/energy/source/main/cPopulation.cc
===================================================================
--- branches/energy/source/main/cPopulation.cc	2007-10-05 19:02:06 UTC (rev 2127)
+++ branches/energy/source/main/cPopulation.cc	2007-10-08 17:56:28 UTC (rev 2128)
@@ -109,10 +109,10 @@
   
   // Invalid settings should be changed to one deme
   if (num_demes <= 0) {
-    cout << "**********************************************\n"
-         << "******* There must be at least 1 deme. *******\n"
-         << "**** Update your Avida configuration file.****\n"
-         << "**********************************************\n";
+    cout << "\n\n**********************************************\n"
+         <<     "******* There must be at least 1 deme. *******\n"
+         <<     "**** Update your Avida configuration file.****\n"
+         <<     "**********************************************\n\n\n";
     num_demes = 1; // One population == one deme.
   }
 

Modified: branches/energy/source/main/cStats.cc
===================================================================
--- branches/energy/source/main/cStats.cc	2007-10-05 19:02:06 UTC (rev 2127)
+++ branches/energy/source/main/cStats.cc	2007-10-08 17:56:28 UTC (rev 2128)
@@ -1129,8 +1129,6 @@
   num_msg_sent++;
   
   from_to_message_list[msg.GetSender()->GetCellID()] = msg.GetReceiver()->GetCellID();
-//  pair<int, int> connection = make_pair(msg.GetSender()->GetID(), msg.GetReceiver()->GetID());
-//  from_to_message_list.Push(&connection);
 }
 
 




More information about the Avida-cvs mailing list