[Avida-SVN] r3070 - in branches/hjg-dev/source: . cpu main

hjg at myxo.css.msu.edu hjg at myxo.css.msu.edu
Sun Dec 21 19:26:58 PST 2008


Author: hjg
Date: 2008-12-21 22:26:57 -0500 (Sun, 21 Dec 2008)
New Revision: 3070

Modified:
   branches/hjg-dev/source/cpu/cHardwareCPU.cc
   branches/hjg-dev/source/defs.h
   branches/hjg-dev/source/main/cOrganism.cc
   branches/hjg-dev/source/main/cTaskLib.cc
Log:
modified prodstring to work with the matchstr tasks.

Modified: branches/hjg-dev/source/cpu/cHardwareCPU.cc
===================================================================
--- branches/hjg-dev/source/cpu/cHardwareCPU.cc	2008-12-21 21:02:04 UTC (rev 3069)
+++ branches/hjg-dev/source/cpu/cHardwareCPU.cc	2008-12-22 03:26:57 UTC (rev 3070)
@@ -7500,9 +7500,9 @@
 	int num = 0;
 	// For the time being this instruction is hardcoded for 2 strings and
 	// two species.
-	if (organism->GetLineageLabel() == 0) {
+	if ((organism->GetLineageLabel() == 0)) {
 		num = organism->MatchOutputBuffer(cString("0000")); 
-	} else if (organism->GetLineageLabel() == 1) { 
+	} else if ((organism->GetLineageLabel() == 1)){ 
 		num =  organism->MatchOutputBuffer(cString("1111")); 
 	}
 	

Modified: branches/hjg-dev/source/defs.h
===================================================================
--- branches/hjg-dev/source/defs.h	2008-12-21 21:02:04 UTC (rev 3069)
+++ branches/hjg-dev/source/defs.h	2008-12-22 03:26:57 UTC (rev 3070)
@@ -71,7 +71,7 @@
 
 // Number of distinct input and outputs stored in the IOBufs (to test tasks)
 const int INPUT_SIZE_DEFAULT = 3;
-const int OUTPUT_SIZE_DEFAULT = 4;
+const int OUTPUT_SIZE_DEFAULT = 1;
 #define RECEIVED_MESSAGES_SIZE 10
 const int MARKET_SIZE = 10000;
 

Modified: branches/hjg-dev/source/main/cOrganism.cc
===================================================================
--- branches/hjg-dev/source/main/cOrganism.cc	2008-12-21 21:02:04 UTC (rev 3069)
+++ branches/hjg-dev/source/main/cOrganism.cc	2008-12-22 03:26:57 UTC (rev 3070)
@@ -1024,3 +1024,4 @@
 	}
 	m_output_buf.Clear(); 
 }
+

Modified: branches/hjg-dev/source/main/cTaskLib.cc
===================================================================
--- branches/hjg-dev/source/main/cTaskLib.cc	2008-12-21 21:02:04 UTC (rev 3069)
+++ branches/hjg-dev/source/main/cTaskLib.cc	2008-12-22 03:26:57 UTC (rev 3070)
@@ -2074,7 +2074,11 @@
   }
 	
 	// Update the organism's tag. 
-	ctx.GetOrganism()->UpdateTag(ctx.GetTaskEntry()->GetArguments().GetInt(2), max_num_matched);
+	int tag = ctx.GetTaskEntry()->GetArguments().GetInt(2);
+	ctx.GetOrganism()->UpdateTag(tag, max_num_matched);
+	if (ctx.GetOrganism()->GetTagLabel() == tag) {
+		ctx.GetOrganism()->SetLineageLabel(ctx.GetTaskEntry()->GetArguments().GetInt(2));
+	}
 	// Update stats
 	cString name;
 	name = "[produced"; 




More information about the Avida-cvs mailing list