[Avida-SVN] r2823 - branches/hjg-dev/source/cpu

hjg at myxo.css.msu.edu hjg at myxo.css.msu.edu
Thu Oct 9 10:51:53 PDT 2008


Author: hjg
Date: 2008-10-09 13:51:53 -0400 (Thu, 09 Oct 2008)
New Revision: 2823

Modified:
   branches/hjg-dev/source/cpu/cHardwareCPU.cc
Log:
added back in the first part of opinion/reputation support

Modified: branches/hjg-dev/source/cpu/cHardwareCPU.cc
===================================================================
--- branches/hjg-dev/source/cpu/cHardwareCPU.cc	2008-10-09 17:32:23 UTC (rev 2822)
+++ branches/hjg-dev/source/cpu/cHardwareCPU.cc	2008-10-09 17:51:53 UTC (rev 2823)
@@ -6697,6 +6697,16 @@
 		while (neighbor->GetNeighbor() != organism) {
 			neighbor->Rotate(1);
 		}
+		
+		// update reputation to include this donation.
+		// get the current reputation; increment by 1.
+		if (organism->HasOpinion()) {
+			int opinion = organism->GetOpinion().first + 1;
+			organism->SetOpinion(opinion);
+		} else {
+			organism->SetOpinion(1);
+		}
+		
 	}
 	isSuccessful = true;
   }




More information about the Avida-cvs mailing list