[Avida-SVN] r1170 - branches/uml/source/main

hjg at myxo.css.msu.edu hjg at myxo.css.msu.edu
Sun Jan 7 10:16:17 PST 2007


Author: hjg
Date: 2007-01-07 13:16:17 -0500 (Sun, 07 Jan 2007)
New Revision: 1170

Modified:
   branches/uml/source/main/cOrganism.cc
   branches/uml/source/main/cTaskLib.cc
Log:


Modified: branches/uml/source/main/cOrganism.cc
===================================================================
--- branches/uml/source/main/cOrganism.cc	2007-01-06 18:38:39 UTC (rev 1169)
+++ branches/uml/source/main/cOrganism.cc	2007-01-07 18:16:17 UTC (rev 1170)
@@ -993,7 +993,7 @@
 	std::string temp, temp1, temp2;
 	int tempint;
 	
-	InitTransForBSXMI();
+	InitTransForMSXMI();
 
 	xmi = "";
 	// loop through all states

Modified: branches/uml/source/main/cTaskLib.cc
===================================================================
--- branches/uml/source/main/cTaskLib.cc	2007-01-06 18:38:39 UTC (rev 1169)
+++ branches/uml/source/main/cTaskLib.cc	2007-01-07 18:16:17 UTC (rev 1170)
@@ -2137,6 +2137,8 @@
 
 double cTaskLib::Task_Hydra(cTaskContext* ctx) const
 {
+	cOrganism* organism = ctx->organism;
+
 	if (ctx->task_failed == 0) {
 		return 0;
 	}
@@ -2144,7 +2146,6 @@
 
 	m_world->GetStats().HydraAttempt();
 
-	cOrganism* organism = ctx->organism;
 	double bonus = 0.0;
 	std::string temp;
 	unsigned int status_total = 0;
@@ -2232,10 +2233,18 @@
 	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;
 	//cmd = "cp tmp.xmi " + organism->GetGenotype()->GetID() + ".xml"; 
-	std::ostringstream strstrm;
-	strstrm << "cp tmp.xmi " << m_world->GetStats().GetUpdate() 
-		<< "." + organism->GetID() << "." << organism->GetGenotype()->GetID() << ".xml";
-	if(system(strstrm.str().c_str())!=0) return 0.0;
+	
+	if(organism->GetGenotype() != NULL) {
+		std::ostringstream strstrm;
+		strstrm << "cp tmp.xmi " << m_world->GetStats().GetUpdate() << "." + organism->GetID();
+	// << "." + organism->GetID() << ".xml";
+		//strstrm << "." << organism->GetGenotype()->GetID();
+		strstrm << ".xml";	
+		if(system(strstrm.str().c_str())!=0) return 0.0;
+	}
+	
+
+			
 	m_world->GetStats().PanPassed();
 	return 1.0;
 }




More information about the Avida-cvs mailing list