[Avida-SVN] r3066 - in branches/hjg-dev/source: cpu main
hjg at myxo.css.msu.edu
hjg at myxo.css.msu.edu
Fri Dec 19 20:05:52 PST 2008
Author: hjg
Date: 2008-12-19 23:05:52 -0500 (Fri, 19 Dec 2008)
New Revision: 3066
Modified:
branches/hjg-dev/source/cpu/cHardwareCPU.cc
branches/hjg-dev/source/main/cAvidaConfig.h
branches/hjg-dev/source/main/cTaskLib.cc
Log:
Modified: branches/hjg-dev/source/cpu/cHardwareCPU.cc
===================================================================
--- branches/hjg-dev/source/cpu/cHardwareCPU.cc 2008-12-19 23:54:19 UTC (rev 3065)
+++ branches/hjg-dev/source/cpu/cHardwareCPU.cc 2008-12-20 04:05:52 UTC (rev 3066)
@@ -7424,12 +7424,14 @@
int len = 1;
if (strings_to_match.size()) len = strings_to_match[0].GetSize();
// organism->SetAverageReputation(max);
- int rep = (max - floor(len/2));
+ int rep = (max - floor((double)len/2));
- if (m_world->GetConfig().STRING_REPUTATION.Get() == 0) {
- organism->SetAverageReputation(rep);
- } else if ((m_world->GetConfig().STRING_REPUTATION.Get() == 1) && (rep > 0)){
- organism->AddReputation(rep);
+ if (rep > 0) {
+ if (m_world->GetConfig().STRING_REPUTATION.Get() == 0) {
+ organism->SetAverageReputation(rep);
+ } else if (m_world->GetConfig().STRING_REPUTATION.Get() == 1){
+ organism->AddReputation(rep);
+ }
}
Modified: branches/hjg-dev/source/main/cAvidaConfig.h
===================================================================
--- branches/hjg-dev/source/main/cAvidaConfig.h 2008-12-19 23:54:19 UTC (rev 3065)
+++ branches/hjg-dev/source/main/cAvidaConfig.h 2008-12-20 04:05:52 UTC (rev 3066)
@@ -570,7 +570,7 @@
CONFIG_ADD_VAR(RANDOMIZE_RAW_MATERIAL_AMOUNT, int, 0, "Should all the organisms receive the same amount 0/1 (off/on)");
CONFIG_ADD_VAR(DONATION_RESTRICTIONS, int, 0, "0=none\n1=inter-species only\n2=different tag only");
CONFIG_ADD_VAR(INHERIT_REPUTATION, int, 0, "0=reputations are not inherited\n1=reputations are inherited\n2=tags are inherited");
- CONFIG_ADD_VAR(STRING_REPUTATION, int, 0, "0=reputation is average\n2=reputation is additive");
+ CONFIG_ADD_VAR(STRING_REPUTATION, int, 0, "0=reputation is average\n1=reputation is additive");
#endif
Modified: branches/hjg-dev/source/main/cTaskLib.cc
===================================================================
--- branches/hjg-dev/source/main/cTaskLib.cc 2008-12-19 23:54:19 UTC (rev 3065)
+++ branches/hjg-dev/source/main/cTaskLib.cc 2008-12-20 04:05:52 UTC (rev 3066)
@@ -1982,7 +1982,8 @@
// Update tag
ctx.GetOrganism()->UpdateTag(1, (int)(max_num_matched/m_strings.size()));
// Update reputation
- ctx.GetOrganism()->SetAverageReputation( (int)(max_num_matched/m_strings.size()));
+ int rep = (max_num_matched/m_strings.size());
+ ctx.GetOrganism()->SetAverageReputation(rep);
cString name;
name = "[catted]";
More information about the Avida-cvs
mailing list