[Avida-SVN] r2918 - branches/hjg-dev/source/main
hjg at myxo.css.msu.edu
hjg at myxo.css.msu.edu
Wed Nov 5 06:29:35 PST 2008
Author: hjg
Date: 2008-11-05 09:29:35 -0500 (Wed, 05 Nov 2008)
New Revision: 2918
Modified:
branches/hjg-dev/source/main/cAvidaConfig.h
branches/hjg-dev/source/main/cOrganism.cc
branches/hjg-dev/source/main/cStats.cc
Log:
Added a config option to randomize the amount of raw materials that an organism receives at birth. This emulates phenotype errors.
Modified: branches/hjg-dev/source/main/cAvidaConfig.h
===================================================================
--- branches/hjg-dev/source/main/cAvidaConfig.h 2008-11-04 19:53:34 UTC (rev 2917)
+++ branches/hjg-dev/source/main/cAvidaConfig.h 2008-11-05 14:29:35 UTC (rev 2918)
@@ -564,6 +564,7 @@
CONFIG_ADD_VAR(ROTATE_ON_DONATE, int, 0, "Rotate an organism to face its donor 0/1 (off/on)");
CONFIG_ADD_VAR(REPUTATION_REWARD, int, 0, "Reward an organism for having a good reputation");
CONFIG_ADD_VAR(DONATION_FAILURE_PERCENT, int, 0, "Percentage of times that a donation fails");
+ CONFIG_ADD_VAR(RANDOMIZE_RAW_MATERIAL_AMOUNT, int, 0, "Should all the organisms receive the same amount 0/1 (off/on)");
#endif
Modified: branches/hjg-dev/source/main/cOrganism.cc
===================================================================
--- branches/hjg-dev/source/main/cOrganism.cc 2008-11-04 19:53:34 UTC (rev 2917)
+++ branches/hjg-dev/source/main/cOrganism.cc 2008-11-05 14:29:35 UTC (rev 2918)
@@ -142,6 +142,14 @@
if (m_world->GetConfig().NET_ENABLED.Get()) m_net = new cNetSupport();
m_id = m_world->GetStats().GetTotCreatures();
+
+ // randomize the amout of raw materials an organism has at its
+ // disposal.
+ if (m_world->GetConfig().RANDOMIZE_RAW_MATERIAL_AMOUNT.Get()) {
+ int raw_mat = m_world->GetConfig().RAW_MATERIAL_AMOUNT.Get();
+ m_self_raw_materials = m_world->GetRandom().GetUInt(0, raw_mat+1);
+ }
+
}
Modified: branches/hjg-dev/source/main/cStats.cc
===================================================================
--- branches/hjg-dev/source/main/cStats.cc 2008-11-04 19:53:34 UTC (rev 2917)
+++ branches/hjg-dev/source/main/cStats.cc 2008-11-05 14:29:35 UTC (rev 2918)
@@ -1784,8 +1784,8 @@
df.Write(num_alt, "Number of altruists [altruists]");
df.Write(num_coop, "Number of cooperators [cooperators]");
df.Write(k.Average(), "Avg. k of organisms [k]");
- df.Write(m_donate_to_donor, "Number of donate to donor [donatedonor]");
- df.Write(m_donate_to_facing, "Number of donate to facing [donatefacing]");
+// df.Write(m_donate_to_donor, "Number of donate to donor [donatedonor]");
+// df.Write(m_donate_to_facing, "Number of donate to facing [donatefacing]");
More information about the Avida-cvs
mailing list