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

beckma24 at myxo.css.msu.edu beckma24 at myxo.css.msu.edu
Mon Feb 25 12:44:20 PST 2008


Author: beckma24
Date: 2008-02-25 15:44:20 -0500 (Mon, 25 Feb 2008)
New Revision: 2376

Modified:
   branches/energy/source/main/cOrgMovementPredicate.h
   branches/energy/source/main/cPopulation.cc
Log:
Bug Fix: used absolute when I wanted relative

Modified: branches/energy/source/main/cOrgMovementPredicate.h
===================================================================
--- branches/energy/source/main/cOrgMovementPredicate.h	2008-02-25 16:20:49 UTC (rev 2375)
+++ branches/energy/source/main/cOrgMovementPredicate.h	2008-02-25 20:44:20 UTC (rev 2376)
@@ -404,10 +404,11 @@
     if(m_event->IsActive()) {
       // find organism coordinates
       int absolute_cell_ID = org.GetCellID();
-      std::pair<int, int> pos = pop.GetDeme(deme_id).GetRelativeCellPosition(absolute_cell_ID); 
+      int relative_cell_ID = pop.GetDeme(deme_id).GetRelativeCellID(absolute_cell_ID);  
+      
+//      std::pair<int, int> pos = pop.GetDeme(deme_id).GetRelativeCellPosition(absolute_cell_ID); 
+//      int relative_cell_ID = pop.GetDeme(deme_id).GetCellID(pos.first, pos.second);
 
-      int relative_cell_ID = pop.GetDeme(deme_id).GetCellID(pos.first, pos.second);
-
       // is the organism in an event cell
       if(m_event->OnEventCell(relative_cell_ID)) {
         unique_org_ids.insert(org.GetID());

Modified: branches/energy/source/main/cPopulation.cc
===================================================================
--- branches/energy/source/main/cPopulation.cc	2008-02-25 16:20:49 UTC (rev 2375)
+++ branches/energy/source/main/cPopulation.cc	2008-02-25 20:44:20 UTC (rev 2376)
@@ -2242,6 +2242,7 @@
     
     int out_pos = m_world->GetRandom().GetUInt(deme_size);
     int out_cell_id = deme_array[deme_id].GetCellID(out_pos);
+    
     while (parent_ok == false && out_cell_id == parent_cell.GetID()) {
       out_pos = m_world->GetRandom().GetUInt(deme_size);
       out_cell_id = deme_array[deme_id].GetCellID(out_pos);




More information about the Avida-cvs mailing list