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

hjg at myxo.css.msu.edu hjg at myxo.css.msu.edu
Mon Oct 27 19:20:53 PDT 2008


Author: hjg
Date: 2008-10-27 22:20:52 -0400 (Mon, 27 Oct 2008)
New Revision: 2889

Modified:
   branches/hjg-dev/source/cpu/cHardwareCPU.cc
   branches/hjg-dev/source/cpu/cHardwareCPU.h
Log:
modified the pose instruction

Modified: branches/hjg-dev/source/cpu/cHardwareCPU.cc
===================================================================
--- branches/hjg-dev/source/cpu/cHardwareCPU.cc	2008-10-27 18:23:57 UTC (rev 2888)
+++ branches/hjg-dev/source/cpu/cHardwareCPU.cc	2008-10-28 02:20:52 UTC (rev 2889)
@@ -458,7 +458,7 @@
     tInstLibEntry<tMethod>("get-reputation", &cHardwareCPU::Inst_GetReputation, nInstFlag::STALL),
     tInstLibEntry<tMethod>("get-raw-mat-amount", &cHardwareCPU::Inst_GetAmountOfRawMaterials, nInstFlag::STALL),
     tInstLibEntry<tMethod>("get-other-raw-mat-amount", &cHardwareCPU::Inst_GetAmountOfOtherRawMaterials, nInstFlag::STALL),
-    tInstLibEntry<tMethod>("donation-scam", &cHardwareCPU::Inst_DonationScam, nInstFlag::STALL),
+    tInstLibEntry<tMethod>("pose", &cHardwareCPU::Inst_Pose, nInstFlag::STALL),
 		tInstLibEntry<tMethod>("punish-neighbor", &cHardwareCPU::Inst_PunishNeighbor, nInstFlag::STALL),
     tInstLibEntry<tMethod>("praise-neighbor", &cHardwareCPU::Inst_PraiseNeighbor, nInstFlag::STALL),
     tInstLibEntry<tMethod>("inc-recip", &cHardwareCPU::Inst_IncRecipProb, nInstFlag::STALL),
@@ -6813,16 +6813,11 @@
 }  
 
 /* An organism artificially increases its reputation without donating. */
-bool cHardwareCPU::Inst_DonationScam(cAvidaContext& ctx)
+bool cHardwareCPU::Inst_Pose(cAvidaContext& ctx)
 {
 	// update reputation to include this phony donation.
-	// get the current reputation; increment by 1.
-	if (organism->HasOpinion()) {
-		int opinion = organism->GetOpinion().first + 1;
-		organism->SetOpinion(opinion);
-	} else {
-		organism->SetOpinion(1);
-	}
+	// get the current reputation; increment by 1.	
+	organism->SetReputation(organism->GetReputation() + 1);
 
   return true;
 }

Modified: branches/hjg-dev/source/cpu/cHardwareCPU.h
===================================================================
--- branches/hjg-dev/source/cpu/cHardwareCPU.h	2008-10-27 18:23:57 UTC (rev 2888)
+++ branches/hjg-dev/source/cpu/cHardwareCPU.h	2008-10-28 02:20:52 UTC (rev 2889)
@@ -696,7 +696,7 @@
 	// has gotten from others
   bool Inst_GetAmountOfOtherRawMaterials(cAvidaContext& ctx);	
   // Pretend to donate
-  bool Inst_DonationScam(cAvidaContext& ctx);
+  bool Inst_Pose(cAvidaContext& ctx);
 	// Punish Neighbor - increase reputation of neighbor
   bool Inst_PunishNeighbor(cAvidaContext& ctx);	
 	// Praise Neighbor - decrease reputation of neighbor




More information about the Avida-cvs mailing list