[Avida-SVN] r3123 - in development: . source/actions source/main source/tools tests/energy_asex_1000u/config tests/energy_deme_level_res/config

beckma24 at myxo.css.msu.edu beckma24 at myxo.css.msu.edu
Sun Jan 18 10:18:46 PST 2009


Author: beckma24
Date: 2009-01-18 13:18:46 -0500 (Sun, 18 Jan 2009)
New Revision: 3123

Modified:
   development/build_avida
   development/source/actions/EnvironmentActions.cc
   development/source/main/cAvidaConfig.h
   development/source/main/cPopulation.cc
   development/source/tools/cMerit.cc
   development/tests/energy_asex_1000u/config/avida.cfg
   development/tests/energy_deme_level_res/config/avida.cfg
Log:
ENERGY MODEL USERS: changed NUM_INST_EXC_BEFORE_0_ENERGY to NUM_CYCLES_EXC_BEFORE_0_ENERGY, makes naming more accurate.  Also, added config option FIX_METABOLIC_RATE that fixes the metabolic rate of all organism when turned on.  Lastly, modified cPopulation::PrintDemeEnergySharingStats so stats produced are more accurate

Modified: development/build_avida
===================================================================
--- development/build_avida	2009-01-18 17:27:43 UTC (rev 3122)
+++ development/build_avida	2009-01-18 18:18:46 UTC (rev 3123)
@@ -3,6 +3,6 @@
 mkdir -p cbuild
 cd cbuild
 cmake "$@" ../
-make
+make -j 10
 make install
 

Modified: development/source/actions/EnvironmentActions.cc
===================================================================
--- development/source/actions/EnvironmentActions.cc	2009-01-18 17:27:43 UTC (rev 3122)
+++ development/source/actions/EnvironmentActions.cc	2009-01-18 18:18:46 UTC (rev 3123)
@@ -683,7 +683,7 @@
   
   void Process(cAvidaContext& ctx)
   {
-    m_world->GetConfig().NUM_INST_EXC_BEFORE_0_ENERGY.Set(newValue);
+    m_world->GetConfig().NUM_CYCLES_EXC_BEFORE_0_ENERGY.Set(newValue);
   }
 };
 

Modified: development/source/main/cAvidaConfig.h
===================================================================
--- development/source/main/cAvidaConfig.h	2009-01-18 17:27:43 UTC (rev 3122)
+++ development/source/main/cAvidaConfig.h	2009-01-18 18:18:46 UTC (rev 3123)
@@ -517,9 +517,10 @@
   CONFIG_ADD_VAR(FRAC_PARENT_ENERGY_GIVEN_TO_DEME_AT_BIRTH, double, 0.5, "Fraction of parent's energy given to offspring deme.");
   CONFIG_ADD_VAR(FRAC_ENERGY_DECAY_AT_ORG_BIRTH, double, 0.0, "Fraction of energy lost due to decay during organism reproduction.");
   CONFIG_ADD_VAR(FRAC_ENERGY_DECAY_AT_DEME_BIRTH, double, 0.0, "Fraction of energy lost due to decay during deme reproduction.");
-  CONFIG_ADD_VAR(NUM_INST_EXC_BEFORE_0_ENERGY, int, 0, "Number of instructions executed before energy is exhausted.");
+  CONFIG_ADD_VAR(NUM_CYCLES_EXC_BEFORE_0_ENERGY, int, 0, "Number of virtual CPU cycles executed before energy is exhausted.");
   CONFIG_ADD_VAR(ENERGY_CAP, double, -1.0, "Maximum amount of energy that can be stored in an organism.  -1 means the cap is set to Max Double");  // TODO - is this done?
   CONFIG_ADD_VAR(APPLY_ENERGY_METHOD, int, 0, "When should rewarded energy be applied to current energy?\n0 = on divide\n1 = on completion of task\n2 = on sleep");  
+  CONFIG_ADD_VAR(FIX_METABOLIC_RATE, double, -1.0, "Fix organism metobolic rate to value.  This value is static.  Feature disabled by default (value == -1)");
   CONFIG_ADD_VAR(FRAC_ENERGY_TRANSFER, double, 0.0, "Fraction of replaced organism's energy take by new resident");
   CONFIG_ADD_VAR(LOG_SLEEP_TIMES, bool, 0, "Log sleep start and end times. 0/1 (off/on)\nWARNING: may use lots of memory.");
   CONFIG_ADD_VAR(FRAC_ENERGY_RELINQUISH, double, 1.0, "Fraction of organisms energy to relinquish");

Modified: development/source/main/cPopulation.cc
===================================================================
--- development/source/main/cPopulation.cc	2009-01-18 17:27:43 UTC (rev 3122)
+++ development/source/main/cPopulation.cc	2009-01-18 18:18:46 UTC (rev 3123)
@@ -2639,9 +2639,9 @@
   df_donor.WriteTimeStamp();
   df_donor.Write(stats.GetUpdate(), "update");
   
-  int num_requestors = 0;
-  int num_donors = 0;
-  int num_receivers = 0;
+  double num_requestors = 0;
+  double num_donors = 0;
+  double num_receivers = 0;
   double amount_donated = 0.0;
   double amount_received = 0.0;
   double amount_applied = 0.0;  
@@ -2662,11 +2662,11 @@
     }
   }
   df_donor.Write(num_requestors/num_demes, "Average number of organisms that have requested energy");
-  df_donor.Write(num_donors/num_demes, "Average umber of organisms that have donated energy");
+  df_donor.Write(num_donors/num_demes, "Average number of organisms that have donated energy");
   df_donor.Write(num_receivers/num_demes, "Average number of organisms that have received energy");
-  df_donor.Write(amount_donated/num_demes, "Average total amount of energy donated");
-  df_donor.Write(amount_received/num_demes, "Average total amount of energy received");
-  df_donor.Write(amount_applied/num_demes, "Average total amount of donated energy applied");
+  df_donor.Write(amount_donated/num_demes, "Average total amount of energy donated per deme");
+  df_donor.Write(amount_received/num_demes, "Average total amount of energy received per deme");
+  df_donor.Write(amount_applied/num_demes, "Average total amount of donated energy applied per deme");
   df_donor.Endl();  
   
 }

Modified: development/source/tools/cMerit.cc
===================================================================
--- development/source/tools/cMerit.cc	2009-01-18 17:27:43 UTC (rev 3122)
+++ development/source/tools/cMerit.cc	2009-01-18 18:18:46 UTC (rev 3123)
@@ -72,7 +72,10 @@
 
 double cMerit::EnergyToMerit(const double orgEnergy, cWorld* m_world) {
   assert(m_world->GetConfig().ENERGY_ENABLED.Get() == 1);
-  int inst_2_exc = m_world->GetConfig().NUM_INST_EXC_BEFORE_0_ENERGY.Get();
+	static double FIX_METABOLIC_RATE = m_world->GetConfig().FIX_METABOLIC_RATE.Get();
+	if(FIX_METABOLIC_RATE > 0.0)
+		return 100 * FIX_METABOLIC_RATE;
+  int inst_2_exc = m_world->GetConfig().NUM_CYCLES_EXC_BEFORE_0_ENERGY.Get();
   return 100 * orgEnergy / (inst_2_exc);
 }
 

Modified: development/tests/energy_asex_1000u/config/avida.cfg
===================================================================
--- development/tests/energy_asex_1000u/config/avida.cfg	2009-01-18 17:27:43 UTC (rev 3122)
+++ development/tests/energy_asex_1000u/config/avida.cfg	2009-01-18 18:18:46 UTC (rev 3123)
@@ -228,6 +228,6 @@
 ENERGY_GIVEN_AT_BIRTH 0.0                # Energy given to offspring upon birth.
 FRAC_PARENT_ENERGY_GIVEN_TO_ORG_AT_BIRTH 0.5  # Fraction of energy given to offspring.
 FRAC_ENERGY_DECAY_AT_ORG_BIRTH 0.05         # Fraction of energy lost due to decay during reproduction.
-NUM_INST_EXC_BEFORE_0_ENERGY 1000000         # Number of instructions executed before energy is exhausted.
+NUM_CYCLES_EXC_BEFORE_0_ENERGY 1000000         # Number of instructions executed before energy is exhausted.
 ENERGY_CAP -1                          # Maximun amount of energy that can be stored in an organism.  -1 means the cap is set to Max Int
 ENERGY_VERBOSE 0                       # Print energy and merit values. 0/1 (off/on)

Modified: development/tests/energy_deme_level_res/config/avida.cfg
===================================================================
--- development/tests/energy_deme_level_res/config/avida.cfg	2009-01-18 17:27:43 UTC (rev 3122)
+++ development/tests/energy_deme_level_res/config/avida.cfg	2009-01-18 18:18:46 UTC (rev 3123)
@@ -252,6 +252,6 @@
 FRAC_PARENT_ENERGY_GIVEN_TO_ORG_AT_BIRTH 0.5  # Fraction of energy given to offspring.
 FRAC_ENERGY_DECAY_AT_ORG_BIRTH 0.05         # Fraction of energy lost due to decay during reproduction.
 FRAC_ENERGY_DECAY_AT_DEME_BIRTH 1.0
-NUM_INST_EXC_BEFORE_0_ENERGY 1000000         # Number of instructions executed before energy is exhausted.
+NUM_CYCLES_EXC_BEFORE_0_ENERGY 1000000         # Number of instructions executed before energy is exhausted.
 ENERGY_CAP -1                          # Maximun amount of energy that can be stored in an organism.  -1 means the cap is set to Max Int
 ENERGY_VERBOSE 0                       # Print energy and merit values. 0/1 (off/on)




More information about the Avida-cvs mailing list