[Avida-SVN] r1815 - in branches/energy/source: cpu main

beckma24 at myxo.css.msu.edu beckma24 at myxo.css.msu.edu
Tue Jul 17 13:27:18 PDT 2007


Author: beckma24
Date: 2007-07-17 16:27:18 -0400 (Tue, 17 Jul 2007)
New Revision: 1815

Modified:
   branches/energy/source/cpu/cHardwareCPU.cc
   branches/energy/source/main/cOrganism.cc
   branches/energy/source/main/cPhenotype.cc
   branches/energy/source/main/cPopulation.cc
Log:
Changed some energy model config vars.

Modified: branches/energy/source/cpu/cHardwareCPU.cc
===================================================================
--- branches/energy/source/cpu/cHardwareCPU.cc	2007-07-17 17:56:48 UTC (rev 1814)
+++ branches/energy/source/cpu/cHardwareCPU.cc	2007-07-17 20:27:18 UTC (rev 1815)
@@ -4119,7 +4119,7 @@
   int cellID = organism->GetCellID();
   pop.GetCell(cellID).GetOrganism()->SetSleeping(false);  //this instruction get executed at the end of a sleep cycle
   pop.decNumAsleep();
-  if(m_world->GetConfig().APPLY_ENERGY_METHOD.Get() == 2) {
+  if(m_world->GetConfig().ENERGY_METABOLISM_PROCESS.Get() == 2) {
     organism->GetPhenotype().RefreshEnergy();
     double newMerit = organism->GetPhenotype().ApplyToEnergyStore();
     if(newMerit != -1) {

Modified: branches/energy/source/main/cOrganism.cc
===================================================================
--- branches/energy/source/main/cOrganism.cc	2007-07-17 17:56:48 UTC (rev 1814)
+++ branches/energy/source/main/cOrganism.cc	2007-07-17 20:27:18 UTC (rev 1815)
@@ -226,7 +226,7 @@
                        other_output_list, net_valid, 0, on_divide, received_messages_point);
   bool task_completed = m_phenotype.TestOutput(ctx, taskctx, resource_count, res_change, insts_triggered);
   
-  if(m_world->GetConfig().ENERGY_ENABLED.Get() == 1 && m_world->GetConfig().APPLY_ENERGY_METHOD.Get() == 1 && task_completed) {
+  if(m_world->GetConfig().ENERGY_ENABLED.Get() == 1 && m_world->GetConfig().ENERGY_METABOLISM_PROCESS.Get() == 1 && task_completed) {
     m_phenotype.RefreshEnergy();
     double newMerit = m_phenotype.ApplyToEnergyStore();
     if(newMerit != -1) {

Modified: branches/energy/source/main/cPhenotype.cc
===================================================================
--- branches/energy/source/main/cPhenotype.cc	2007-07-17 17:56:48 UTC (rev 1814)
+++ branches/energy/source/main/cPhenotype.cc	2007-07-17 20:27:18 UTC (rev 1815)
@@ -252,7 +252,7 @@
   merit           = genome_length;
   copied_size     = genome_length;
   executed_size   = genome_length;
-  energy_store    = min(m_world->GetConfig().ENERGY_GIVEN_ON_INJECT.Get(), m_world->GetConfig().ENERGY_CAP.Get());
+  energy_store    = min(m_world->GetConfig().ENERGY_GIVEN_TO_ORG_ON_INJECT.Get(), m_world->GetConfig().ENERGY_CAP.Get());
   energy_tobe_applied = 0.0;
   gestation_time  = 0;
   gestation_start = 0;
@@ -1189,12 +1189,12 @@
  */
 void cPhenotype::RefreshEnergy() {
   if(cur_energy_bonus > 0) {
-    if(m_world->GetConfig().APPLY_ENERGY_METHOD.Get() == 0 || m_world->GetConfig().APPLY_ENERGY_METHOD.Get() == 2) {
+    if(m_world->GetConfig().ENERGY_METABOLISM_PROCESS.Get() == 0 || m_world->GetConfig().ENERGY_METABOLISM_PROCESS.Get() == 2) {
       energy_tobe_applied += cur_energy_bonus;
-    } else if(m_world->GetConfig().APPLY_ENERGY_METHOD.Get() == 1) {
+    } else if(m_world->GetConfig().ENERGY_METABOLISM_PROCESS.Get() == 1) {
       energy_store += cur_energy_bonus;
     } else {
-      cerr<< "Unknown APPLY_ENERGY_METHOD value " << m_world->GetConfig().APPLY_ENERGY_METHOD.Get();
+      cerr<< "Unknown APPLY_ENERGY_METHOD value " << m_world->GetConfig().ENERGY_METABOLISM_PROCESS.Get();
       exit(-1);
     }
     cur_energy_bonus = 0;
@@ -1211,13 +1211,13 @@
   assert(m_world->GetConfig().ENERGY_ENABLED.Get() == 1);
 
   // energy model config variables
-  double energy_given_at_birth = m_world->GetConfig().ENERGY_GIVEN_AT_BIRTH.Get();
+  double energy_given_at_birth = m_world->GetConfig().ENERGY_GIVEN_TO_ORG_AT_BIRTH.Get();
   double frac_parent_energy_given_at_birth = m_world->GetConfig().FRAC_PARENT_ENERGY_GIVEN_AT_BIRTH.Get();
-  double frac_energy_decay_at_birth = m_world->GetConfig().FRAC_ENERGY_DECAY_AT_BIRTH.Get();
+  double frac_energy_decay_at_birth = m_world->GetConfig().FRAC_ORG_ENERGY_DECAY_AT_BIRTH.Get();
   double energy_cap = (double) m_world->GetConfig().ENERGY_CAP.Get();
 
   // apply energy if APPLY_ENERGY_METHOD is set to "on divide" (0)
-  if(m_world->GetConfig().APPLY_ENERGY_METHOD.Get() == 0) {
+  if(m_world->GetConfig().ENERGY_METABOLISM_PROCESS.Get() == 0) {
     RefreshEnergy();
     ApplyToEnergyStore();
   }

Modified: branches/energy/source/main/cPopulation.cc
===================================================================
--- branches/energy/source/main/cPopulation.cc	2007-07-17 17:56:48 UTC (rev 1814)
+++ branches/energy/source/main/cPopulation.cc	2007-07-17 20:27:18 UTC (rev 1815)
@@ -2585,7 +2585,7 @@
   phenotype.SetupInject(new_genotype->GetGenome());  //TODO  sets merit to lenght of genotype
   
   if(m_world->GetConfig().ENERGY_ENABLED.Get() == 1) {
-    double initial_energy = min(m_world->GetConfig().ENERGY_GIVEN_ON_INJECT.Get(), m_world->GetConfig().ENERGY_CAP.Get());
+    double initial_energy = min(m_world->GetConfig().ENERGY_GIVEN_TO_ORG_ON_INJECT.Get(), m_world->GetConfig().ENERGY_CAP.Get());
     phenotype.SetEnergy(initial_energy);
   }
   // BB - Don't need to fix metabolic rate here, only on birth




More information about the Avida-cvs mailing list