[Avida-SVN] r2003 - branches/energy/source/actions

beckma24 at myxo.css.msu.edu beckma24 at myxo.css.msu.edu
Fri Aug 24 12:19:22 PDT 2007


Author: beckma24
Date: 2007-08-24 15:19:22 -0400 (Fri, 24 Aug 2007)
New Revision: 2003

Modified:
   branches/energy/source/actions/PrintActions.cc
Log:
Minor output changes

Modified: branches/energy/source/actions/PrintActions.cc
===================================================================
--- branches/energy/source/actions/PrintActions.cc	2007-08-24 18:35:07 UTC (rev 2002)
+++ branches/energy/source/actions/PrintActions.cc	2007-08-24 19:19:22 UTC (rev 2003)
@@ -2136,9 +2136,9 @@
     if (filename == "") filename.Set("grid_energy.%d.dat", m_world->GetStats().GetUpdate());
     ofstream& fp = m_world->GetDataFileOFStream(filename);
     
-    for (int i = 0; i < m_world->GetPopulation().GetWorldX(); i++) {
-      for (int j = 0; j < m_world->GetPopulation().GetWorldY(); j++) {
-        cPopulationCell& cell = m_world->GetPopulation().GetCell(j * m_world->GetPopulation().GetWorldX() + i);
+    for (int i = 0; i < m_world->GetPopulation().GetWorldY(); i++) {
+      for (int j = 0; j < m_world->GetPopulation().GetWorldX(); j++) {
+        cPopulationCell& cell = m_world->GetPopulation().GetCell(i * m_world->GetPopulation().GetWorldX() + j);
         double cell_energy = (cell.IsOccupied()) ? cell.GetOrganism()->GetPhenotype().GetStoredEnergy() : 0.0;
         fp << cell_energy << " ";
       }
@@ -2166,10 +2166,10 @@
     if (filename == "") filename.Set("grid_exe_ratio.%d.dat", m_world->GetStats().GetUpdate());
     ofstream& fp = m_world->GetDataFileOFStream(filename);
     
-    for (int i = 0; i < m_world->GetPopulation().GetWorldX(); i++) {
-      for (int j = 0; j < m_world->GetPopulation().GetWorldY(); j++) {
-        cPopulationCell& cell = m_world->GetPopulation().GetCell(j * m_world->GetPopulation().GetWorldX() + i);
-        double cell_executionRatio = (cell.IsOccupied()) ? cell.GetOrganism()->GetPhenotype().GetEnergyUsageRatio() : 0.0;
+    for (int i = 0; i < m_world->GetPopulation().GetWorldY(); i++) {
+      for (int j = 0; j < m_world->GetPopulation().GetWorldX(); j++) {
+        cPopulationCell& cell = m_world->GetPopulation().GetCell(i * m_world->GetPopulation().GetWorldX() + j);
+        double cell_executionRatio = (cell.IsOccupied()) ? cell.GetOrganism()->GetPhenotype().GetEnergyUsageRatio() : 1.0;
         fp << cell_executionRatio << " ";
       }
       fp << endl;




More information about the Avida-cvs mailing list