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

hjg at myxo.css.msu.edu hjg at myxo.css.msu.edu
Mon Dec 22 20:44:37 PST 2008


Author: hjg
Date: 2008-12-22 23:44:36 -0500 (Mon, 22 Dec 2008)
New Revision: 3076

Modified:
   branches/hjg-dev/source/cpu/cHardwareCPU.cc
   branches/hjg-dev/source/main/cTaskLib.cc
Log:
more bug fixes...

Modified: branches/hjg-dev/source/cpu/cHardwareCPU.cc
===================================================================
--- branches/hjg-dev/source/cpu/cHardwareCPU.cc	2008-12-23 03:55:20 UTC (rev 3075)
+++ branches/hjg-dev/source/cpu/cHardwareCPU.cc	2008-12-23 04:44:36 UTC (rev 3076)
@@ -7377,7 +7377,7 @@
 		num =  organism->MatchOutputBuffer(cString("11111111")); 
 	}*/ 
 	
-	if (organism->GetTagLabel() != -1){
+	if (organism->GetLineageLabel() != -1){
 		map < int, cString> my_strings = 	m_world->GetEnvironment().GetMatchStringsFromTask();
 	// iterate through the vector until you find the right tag. 
 	// then check if the buffer matches it. 
@@ -7389,11 +7389,11 @@
 		//}
 	//}
 	
-		num = organism->MatchOutputBuffer(my_strings[organism->GetTagLabel()]); 
-		size = my_strings[organism->GetTagLabel()].GetSize();
+		num = organism->MatchOutputBuffer(my_strings[organism->GetLineageLabel()]); 
+		size = my_strings[organism->GetLineageLabel()].GetSize();
 	
 		if (num == size) {
-			organism->AddRawMaterials(organism->GetTagLabel(), 1, organism->GetID()); 
+			organism->AddRawMaterials(organism->GetLineageLabel(), 1, organism->GetID()); 
 			organism->SetOutputNegative1() ; 
 		}
 	}

Modified: branches/hjg-dev/source/main/cTaskLib.cc
===================================================================
--- branches/hjg-dev/source/main/cTaskLib.cc	2008-12-23 03:55:20 UTC (rev 3075)
+++ branches/hjg-dev/source/main/cTaskLib.cc	2008-12-23 04:44:36 UTC (rev 3076)
@@ -3208,10 +3208,11 @@
 	
 	map< int, cString >::const_iterator iter; 
 	for (iter = m_strings.begin(); iter != m_strings.end(); iter++) { 
+		int val = ctx.GetOrganism()->GetRawMaterialAmount(iter->first);
 		if (iter->first == org_tag) { 
-			bonus += (my_mult_val * ctx.GetOrganism()->GetRawMaterialAmount(iter->first)); 
+			bonus += (my_mult_val * val); 
 		} else {
-			bonus += (other_mult_val * ctx.GetOrganism()->GetRawMaterialAmount(iter->first)); 
+			bonus += (other_mult_val * val); 
 		}
 		
 	}




More information about the Avida-cvs mailing list