[Avida-SVN] r2510 - in branches/jobScheduling/source: actions main

beckma24 at myxo.css.msu.edu beckma24 at myxo.css.msu.edu
Tue Apr 1 12:54:57 PDT 2008


Author: beckma24
Date: 2008-04-01 15:54:57 -0400 (Tue, 01 Apr 2008)
New Revision: 2510

Modified:
   branches/jobScheduling/source/actions/EnvironmentActions.cc
   branches/jobScheduling/source/main/cAvidaConfig.h
   branches/jobScheduling/source/main/cDeme.cc
   branches/jobScheduling/source/main/cDemeCellEvent.cc
   branches/jobScheduling/source/main/cPopulation.cc
Log:
Fixed recording issue with deme birth recording for facing replication.  HAS NOT BEEN DONE IN DEVELOPMENT

Modified: branches/jobScheduling/source/actions/EnvironmentActions.cc
===================================================================
--- branches/jobScheduling/source/actions/EnvironmentActions.cc	2008-04-01 16:53:42 UTC (rev 2509)
+++ branches/jobScheduling/source/actions/EnvironmentActions.cc	2008-04-01 19:54:57 UTC (rev 2510)
@@ -736,7 +736,16 @@
   bool m_static_position;
   
 public:
-  cActionDelayedDemeEvent(cWorld* world, const cString& args) : cAction(world, args), m_x1(-1), m_y1(-1), m_x2(-1), m_y2(-1), m_delay(-1), m_duration(-1), m_static_position(true), m_total_events(1)
+  cActionDelayedDemeEvent(cWorld* world, const cString& args) : 
+    cAction(world, args)
+  , m_x1(-1)
+  , m_y1(-1)
+  , m_x2(-1)
+  , m_y2(-1)
+  , m_delay(-1)
+  , m_duration(-1)
+  , m_total_events(1)
+  , m_static_position(true)
   {
     cString largs(args);
     if (largs.GetSize()) m_x1 = largs.PopWord().AsInt();

Modified: branches/jobScheduling/source/main/cAvidaConfig.h
===================================================================
--- branches/jobScheduling/source/main/cAvidaConfig.h	2008-04-01 16:53:42 UTC (rev 2509)
+++ branches/jobScheduling/source/main/cAvidaConfig.h	2008-04-01 19:54:57 UTC (rev 2510)
@@ -296,7 +296,7 @@
   CONFIG_ADD_GROUP(DEME_GROUP, "Demes and Germlines");
   CONFIG_ADD_VAR(NUM_DEMES, int, 1, "Number of independent groups in the\npopulation (default=1).");
   CONFIG_ADD_VAR(DEMES_USE_GERMLINE, int, 0, "Whether demes use a distinct germline (default=0).");
-  CONFIG_ADD_VAR(DEMES_PREVENT_STERILE, int, 0, "Whether to prevent sterile demes from\nreplicating (default=0).");
+  CONFIG_ADD_VAR(DEMES_PREVENT_STERILE, int, 0, "Whether to prevent sterile demes from\nreplicating (default=0 or no).");
   CONFIG_ADD_VAR(DEMES_RESET_RESOURCES, int, 0, "Reset resources in demes on replication. \n0 = reset both demes \n1 = reset target deme \n2 = deme resources remain unchanged\n");
   CONFIG_ADD_VAR(DEMES_REPLICATE_SIZE, int, 1, "Number of identical organisms to create or copy from the\nsource deme to the target deme (default=1).");
   CONFIG_ADD_VAR(DEMES_PROB_ORG_TRANSFER, double, 0.0, "Probablity of an organism being transferred from the\nsource deme to the target deme (default=0.0).");

Modified: branches/jobScheduling/source/main/cDeme.cc
===================================================================
--- branches/jobScheduling/source/main/cDeme.cc	2008-04-01 16:53:42 UTC (rev 2509)
+++ branches/jobScheduling/source/main/cDeme.cc	2008-04-01 19:54:57 UTC (rev 2510)
@@ -90,10 +90,10 @@
       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);
-          eventCell = event.GetNextEventCellID();
+          //set cell data to 0
+          m_world->GetPopulation().GetCell(GetCellID(eventCell)).SetCellData(0);
         }
+        eventCell = event.GetNextEventCellID();
       }
       event.DeactivateEvent();  //event over
     }
@@ -250,9 +250,10 @@
 }
 
 void cDeme::SetCellEvent(int x1, int y1, int x2, int y2, int delay, int duration, bool static_position, int total_events) {
+  cell_events.Resize(cell_events.GetSize() + total_events);
   for(int i = 0; i < total_events; i++) {
     cDemeCellEvent demeEvent = cDemeCellEvent(x1, y1, x2, y2, delay, duration, width, GetHeight(), static_position, m_world);
-    cell_events.Push(demeEvent);
+    cell_events[i] = demeEvent;
   }
 }
 

Modified: branches/jobScheduling/source/main/cDemeCellEvent.cc
===================================================================
--- branches/jobScheduling/source/main/cDemeCellEvent.cc	2008-04-01 16:53:42 UTC (rev 2509)
+++ branches/jobScheduling/source/main/cDemeCellEvent.cc	2008-04-01 19:54:57 UTC (rev 2510)
@@ -22,7 +22,7 @@
   m_event_cells.ResizeClear((x2-x1+1) * (y2-y1+1));
   
   if(m_delay == -1) {
-    delay = m_world->GetRandom().GetInt(m_world->GetConfig().DEMES_MAX_AGE.Get() - m_duration);
+    m_delay = m_world->GetRandom().GetInt(m_world->GetConfig().DEMES_MAX_AGE.Get() - m_duration);
   }
   
   int i = 0;

Modified: branches/jobScheduling/source/main/cPopulation.cc
===================================================================
--- branches/jobScheduling/source/main/cPopulation.cc	2008-04-01 16:53:42 UTC (rev 2509)
+++ branches/jobScheduling/source/main/cPopulation.cc	2008-04-01 19:54:57 UTC (rev 2510)
@@ -2620,7 +2620,7 @@
     return *out_cell;
   }
   else if (birth_method == POSITION_CHILD_DEME_RANDOM) {
-    const int deme_id = parent_cell.GetDemeID();    
+    const int deme_id = parent_cell.GetDemeID();
     const int deme_size = deme_array[deme_id].GetSize();
     
     deme_array[deme_id].IncBirthCount();
@@ -2656,6 +2656,8 @@
     return GetCell(out_cell_id);    
   }
   else if (birth_method == POSITION_CHILD_PARENT_FACING) {
+    const int deme_id = parent_cell.GetDemeID();
+    deme_array[deme_id].IncBirthCount();
     return parent_cell.GetCellFaced();
   }
   else if (birth_method == POSITION_CHILD_NEXT_CELL) {




More information about the Avida-cvs mailing list