[Avida-SVN] r3034 - branches/hjg-dev/source/main
hjg at myxo.css.msu.edu
hjg at myxo.css.msu.edu
Sat Dec 13 13:20:45 PST 2008
Author: hjg
Date: 2008-12-13 16:20:44 -0500 (Sat, 13 Dec 2008)
New Revision: 3034
Modified:
branches/hjg-dev/source/main/cAvidaConfig.h
branches/hjg-dev/source/main/cPopulation.cc
branches/hjg-dev/source/main/cTaskLib.cc
Log:
modified parameter INHERIT_REPUTATION to enable inheritance of tags.
Modified: branches/hjg-dev/source/main/cAvidaConfig.h
===================================================================
--- branches/hjg-dev/source/main/cAvidaConfig.h 2008-12-13 21:20:09 UTC (rev 3033)
+++ branches/hjg-dev/source/main/cAvidaConfig.h 2008-12-13 21:20:44 UTC (rev 3034)
@@ -569,7 +569,7 @@
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)");
CONFIG_ADD_VAR(INTER_SPECIES_DONATION, int, 0, "Only donations from one species to another are allowed 0/1 (off/on)");
- CONFIG_ADD_VAR(INHERIT_REPUTATION, int, 0, "0=reputation are not inherited\n1=reputations are inherited");
+ CONFIG_ADD_VAR(INHERIT_REPUTATION, int, 0, "0=reputation are not inherited\n1=reputations are inherited\n2=tags are inherited");
#endif
Modified: branches/hjg-dev/source/main/cPopulation.cc
===================================================================
--- branches/hjg-dev/source/main/cPopulation.cc 2008-12-13 21:20:09 UTC (rev 3033)
+++ branches/hjg-dev/source/main/cPopulation.cc 2008-12-13 21:20:44 UTC (rev 3034)
@@ -357,9 +357,10 @@
// If inherited reputation is turned on, set the offspring's reputation
// to that of its parent.
- if (m_world->GetConfig().INHERIT_REPUTATION.Get()) {
+ if (m_world->GetConfig().INHERIT_REPUTATION.Get() == 1) {
child_array[i]->SetReputation(parent_organism.GetReputation());
- child_array[i]->SetTag(parent_organism.GetTag());
+ } else if (m_world->GetConfig().INHERIT_REPUTATION.Get() == 2) {
+ child_array[i]->SetTag(parent_organism.GetTag());
}
}
Modified: branches/hjg-dev/source/main/cTaskLib.cc
===================================================================
--- branches/hjg-dev/source/main/cTaskLib.cc 2008-12-13 21:20:09 UTC (rev 3033)
+++ branches/hjg-dev/source/main/cTaskLib.cc 2008-12-13 21:20:44 UTC (rev 3034)
@@ -2068,8 +2068,12 @@
double bonus = 0.0;
// return value between 0 & 1 representing the percentage of string that was matched
- double base_bonus = static_cast<double>(max_num_matched) * 2.0 / static_cast<double>(string_to_match.GetSize()) - 1;
-
+ // percent over 50% (Sherri)
+ //double base_bonus = static_cast<double>(max_num_matched) * 2.0 / static_cast<double>(string_to_match.GetSize()) - 1;
+
+ // percent (hjg)
+ double base_bonus = static_cast<double>(max_num_matched) / static_cast<double>(string_to_match.GetSize());
+
if (partial)
{
base_bonus=double(max_num_matched)*2/double(num_real) -1;
More information about the Avida-cvs
mailing list