[Avida-SVN] r1970 - in branches/uml/source: cpu main

hjg at myxo.css.msu.edu hjg at myxo.css.msu.edu
Tue Aug 21 06:48:41 PDT 2007


Author: hjg
Date: 2007-08-21 09:48:41 -0400 (Tue, 21 Aug 2007)
New Revision: 1970

Modified:
   branches/uml/source/cpu/cHardwareCPU.cc
   branches/uml/source/cpu/cHardwareCPU.h
   branches/uml/source/main/cTaskLib.cc
   branches/uml/source/main/cUMLStateDiagram.cc
Log:
Added a 13 state; enabled both properties to be checked. 



Modified: branches/uml/source/cpu/cHardwareCPU.cc
===================================================================
--- branches/uml/source/cpu/cHardwareCPU.cc	2007-08-21 11:47:33 UTC (rev 1969)
+++ branches/uml/source/cpu/cHardwareCPU.cc	2007-08-21 13:48:41 UTC (rev 1970)
@@ -414,6 +414,8 @@
 					"Change the origin to state 10"),
 	tInstLibEntry<tMethod>("s-orig-11", &cHardwareCPU::Inst_OrigState11, false, 
 					"Change the origin to state 11"),
+	tInstLibEntry<tMethod>("s-orig-12", &cHardwareCPU::Inst_OrigState12, false, 
+							 "Change the origin to state 12"),	  
 	tInstLibEntry<tMethod>("s-dest-0", &cHardwareCPU::Inst_DestState0, false, 
 					"Change the destination to state 0"),																																									
 	tInstLibEntry<tMethod>("s-dest-1", &cHardwareCPU::Inst_DestState1, false, 
@@ -434,10 +436,12 @@
 					"Change the destination to state 8"),		
 	tInstLibEntry<tMethod>("s-dest-9", &cHardwareCPU::Inst_DestState9, false, 
 					"Change the destination to state 9"),	
-	tInstLibEntry<tMethod>("s-dest-10", &cHardwareCPU::Inst_DestState9, false, 
+	tInstLibEntry<tMethod>("s-dest-10", &cHardwareCPU::Inst_DestState10, false, 
 					"Change the destination to state 10"),
-	tInstLibEntry<tMethod>("s-dest-11", &cHardwareCPU::Inst_DestState9, false, 
-					"Change the destination to state 11"),											
+	tInstLibEntry<tMethod>("s-dest-11", &cHardwareCPU::Inst_DestState11, false, 
+					"Change the destination to state 11"),		
+	tInstLibEntry<tMethod>("s-dest-12", &cHardwareCPU::Inst_DestState12, false, 
+							 "Change the destination to state 12"),	  
 	tInstLibEntry<tMethod>("trans-0", &cHardwareCPU::Inst_TransLab0, false, 
 					"Change to transition label 0"),		
 	tInstLibEntry<tMethod>("trans-1", &cHardwareCPU::Inst_TransLab1, false, 
@@ -4869,6 +4873,9 @@
 bool cHardwareCPU::Inst_OrigState11(cAvidaContext& ctx)
 { return (organism->getStateDiagram()->absoluteJumpOriginState(11)); }
 
+bool cHardwareCPU::Inst_OrigState12(cAvidaContext& ctx)
+{ return (organism->getStateDiagram()->absoluteJumpOriginState(12)); }
+
 bool cHardwareCPU::Inst_DestState0(cAvidaContext& ctx)
 { return (organism->getStateDiagram()->absoluteJumpDestinationState(0)); }
 
@@ -4905,6 +4912,9 @@
 bool cHardwareCPU::Inst_DestState11(cAvidaContext& ctx)
 { return (organism->getStateDiagram()->absoluteJumpDestinationState(11)); }
 
+bool cHardwareCPU::Inst_DestState12(cAvidaContext& ctx)
+{ return (organism->getStateDiagram()->absoluteJumpDestinationState(12)); }
+
 bool cHardwareCPU::Inst_TransLab0(cAvidaContext& ctx)
 { return (organism->getStateDiagram()->absoluteJumpTransitionLabel(0)); }
 

Modified: branches/uml/source/cpu/cHardwareCPU.h
===================================================================
--- branches/uml/source/cpu/cHardwareCPU.h	2007-08-21 11:47:33 UTC (rev 1969)
+++ branches/uml/source/cpu/cHardwareCPU.h	2007-08-21 13:48:41 UTC (rev 1970)
@@ -575,6 +575,8 @@
   bool Inst_OrigState9(cAvidaContext& ctx);
   bool Inst_OrigState10(cAvidaContext& ctx);
   bool Inst_OrigState11(cAvidaContext& ctx);
+  bool Inst_OrigState12(cAvidaContext& ctx);
+  
 
   bool Inst_DestState0(cAvidaContext& ctx);
   bool Inst_DestState1(cAvidaContext& ctx);
@@ -588,6 +590,8 @@
   bool Inst_DestState9(cAvidaContext& ctx);
   bool Inst_DestState10(cAvidaContext& ctx);
   bool Inst_DestState11(cAvidaContext& ctx);
+  bool Inst_DestState12(cAvidaContext& ctx);
+
   
   bool Inst_TransLab0(cAvidaContext& ctx);
   bool Inst_TransLab1(cAvidaContext& ctx);

Modified: branches/uml/source/main/cTaskLib.cc
===================================================================
--- branches/uml/source/main/cTaskLib.cc	2007-08-21 11:47:33 UTC (rev 1969)
+++ branches/uml/source/main/cTaskLib.cc	2007-08-21 13:48:41 UTC (rev 1970)
@@ -3085,9 +3085,15 @@
 double cTaskLib::SpinCoprocess(cTaskContext& ctx, const std::string& neverclaimFile) const {
 //	cOrganism* organism = ctx.getOrganism();
 	
-	std::string cmd = "cat " + neverclaimFile + " >> tmp.pr && ./spin -a tmp.pr &> /dev/null";
+	std::string file_name = "tmp-" + neverclaimFile + ".pr";
+	std::string cmd = "cp tmp.pr "+ file_name;
 	if(system(cmd.c_str())!=0) return 0.0;
 	
+
+//	std::string cmd = "cat " + neverclaimFile + " >> tmp.pr && ./spin -a tmp.pr &> /dev/null";
+	cmd = "cat " + neverclaimFile + " >> " + file_name + " && ./spin -a " +  file_name + " &> /dev/null";
+	if(system(cmd.c_str())!=0) return 0.0;
+	
 	if(system("/usr/bin/gcc -DMEMLIM=512 pan.c -o pan &> /dev/null")!=0) return 0.0;
 	if(system("./pan -a &> ./pan.out")!=0) return 0.0;
 	if(system("cat pan.out | perl -e 'while(<STDIN>) { if(/errors:\\s(\\d+)/) {exit($1);}}'")!=0) return 0.0;
@@ -3096,7 +3102,7 @@
 
 // Commented out to remove overhead...	
 	std::ostringstream strstrm;
-	strstrm << "cp tmp.xmi " << neverclaimFile << "." << m_world->GetStats().GetUpdate() << "." << ctx.getOrganism()->GetID();
+	strstrm << "cp " << file_name << " "  << neverclaimFile << "." << m_world->GetStats().GetUpdate() << "." << ctx.getOrganism()->GetID();
 	strstrm << ".xml";	
 	if(system(strstrm.str().c_str())!=0) return 0.0;
 			
@@ -3107,10 +3113,12 @@
 	int num_witness = 0;
 //	const int max_witness = 1;
 	
-	std::string cmd = "cp tmp.pr tmp-witness.pr" ;
+	std::string file_name = "tmp-witness" + neverclaimFile + ".pr";
+	std::string cmd = "cp tmp.pr "+ file_name;
+	
 	if(system(cmd.c_str())!=0) return 0.0;
 	
-	cmd = "cat " + neverclaimFile + " >> tmp-witness.pr && ./spin -a tmp-witness.pr &> /dev/null";
+	cmd = "cat " + neverclaimFile + " >> " + file_name + " && ./spin -a " +  file_name + " &> /dev/null";
 	if(system(cmd.c_str())!=0) return 0.0;
 	
 	if(system("/usr/bin/gcc -DMEMLIM=512 pan.c -o pan &> /dev/null")!=0) return 0.0;

Modified: branches/uml/source/main/cUMLStateDiagram.cc
===================================================================
--- branches/uml/source/main/cUMLStateDiagram.cc	2007-08-21 11:47:33 UTC (rev 1969)
+++ branches/uml/source/main/cUMLStateDiagram.cc	2007-08-21 13:48:41 UTC (rev 1970)
@@ -5,7 +5,7 @@
 {
 
   // initialize the state diagram with 10 states.
-  sd0 = state_diagram(12); 
+  sd0 = state_diagram(13); 
 
   // initialize / seed UML state diagram here
 //  orig_state_index = 0;




More information about the Avida-cvs mailing list