[Avida-SVN] r3069 - branches/hjg-dev/source/main
hjg at myxo.css.msu.edu
hjg at myxo.css.msu.edu
Sun Dec 21 13:02:04 PST 2008
Author: hjg
Date: 2008-12-21 16:02:04 -0500 (Sun, 21 Dec 2008)
New Revision: 3069
Modified:
branches/hjg-dev/source/main/cOrganism.h
branches/hjg-dev/source/main/cStats.cc
Log:
more stats tracking for raw materials & added a cap on raw materials.
Modified: branches/hjg-dev/source/main/cOrganism.h
===================================================================
--- branches/hjg-dev/source/main/cOrganism.h 2008-12-21 18:32:44 UTC (rev 3068)
+++ branches/hjg-dev/source/main/cOrganism.h 2008-12-21 21:02:04 UTC (rev 3069)
@@ -455,7 +455,7 @@
// receive raw materials
bool AddRawMaterials(int amount, int donor_id);
// receive raw materials
- void AddSelfRawMaterials(int amount) { m_self_raw_materials += amount;}
+ void AddSelfRawMaterials(int amount) { if (m_self_raw_materials < 10) m_self_raw_materials += amount;}
// retrieve the organism's own amount of raw materials
int GetSelfRawMaterials() { return m_self_raw_materials; }
// retrieve the amount of raw materials collected from others
Modified: branches/hjg-dev/source/main/cStats.cc
===================================================================
--- branches/hjg-dev/source/main/cStats.cc 2008-12-21 18:32:44 UTC (rev 3068)
+++ branches/hjg-dev/source/main/cStats.cc 2008-12-21 21:02:04 UTC (rev 3069)
@@ -1831,6 +1831,8 @@
cDoubleSum num_donations_received;
cDoubleSum amount_donations_received;
cDoubleSum num_failed_reputation_inc;
+ cDoubleSum own_raw_mat;
+ cDoubleSum other_raw_mat;
// difference between how many an organism donated & how many it received
cDoubleSum disparity;
@@ -1863,6 +1865,9 @@
donations.Add(org->GetNumberOfDonations());
num_donations_received.Add(org->GetNumberOfDonationsReceived());
amount_donations_received.Add(org->GetAmountOfDonationsReceived());
+ own_raw_mat.Add(org->GetSelfRawMaterials());
+ other_raw_mat.Add(org->GetOtherRawMaterials());
+
reciprocations.Add(org->GetNumberOfReciprocations());
donors.Add(org->GetNumberOfDonors());
num_failed_reputation_inc.Add(org->GetFailedReputationIncreases());
@@ -1878,21 +1883,24 @@
}
// float rep = reputations/pop_size;
df.Write(reputations.Average(), "Avg. reputation [reputation]");
- df.Write(reputations.StdDeviation(), "Standard Deviation [repstddev]");
+// df.Write(reputations.StdDeviation(), "Standard Deviation [repstddev]");
// df.Write(min_rep, "Minimum reputation");
// df.Write(max_rep, "Maximum reputation");
df.Write(donations.Average(), "Avg. donations [donation]");
- df.Write(num_donations_received.Average(), "Avg. donations received [received]");
- df.Write(amount_donations_received.Average(), "Avg. number donations received [amount]");
+// df.Write(num_donations_received.Average(), "Avg. donations received [received]");
+// df.Write(amount_donations_received.Average(), "Avg. number donations received [amount]");
// df.Write(reciprocations.Average(), "Avg. reciprocations [reciprocation]");
- df.Write(disparity.Average(), "Disparity between donations and collections [disparity]");
+// df.Write(disparity.Average(), "Disparity between donations and collections [disparity]");
df.Write(donors.Average(), "Avg. number of donor partners [partners]");
- df.Write(num_failed_reputation_inc.Average(), "Avg. number of reputation increase failures [failure]");
+// df.Write(num_failed_reputation_inc.Average(), "Avg. number of reputation increase failures [failure]");
// df.Write(recip_prob_change.Average(), "Avg. change in reciprocation probability [recipprob]");
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(own_raw_mat.Average(), "Avg. own raw mat [ownrawmat]");
+ df.Write(other_raw_mat.Average(), "Avg. other raw mat [otherrawmat]");
+
+// 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]");
More information about the Avida-cvs
mailing list