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

hjg at myxo.css.msu.edu hjg at myxo.css.msu.edu
Tue May 22 11:58:21 PDT 2007


Author: hjg
Date: 2007-05-22 14:58:21 -0400 (Tue, 22 May 2007)
New Revision: 1591

Modified:
   branches/uml/source/main/cUMLModel.cc
   branches/uml/source/main/cUMLStateDiagram.cc
Log:
Removed the requirement that each state diagram *always* be connected. Rather, added merit if all states are reachable. 




Modified: branches/uml/source/main/cUMLModel.cc
===================================================================
--- branches/uml/source/main/cUMLModel.cc	2007-05-22 18:57:31 UTC (rev 1590)
+++ branches/uml/source/main/cUMLModel.cc	2007-05-22 18:58:21 UTC (rev 1591)
@@ -432,13 +432,14 @@
 	if(system("/usr/bin/gcc -DMEMLIM=512 pan.c -o pan &> /dev/null")!=0) return 0;
 	if(system("./pan -a &> ./pan.out")!=0) return 0;
 	if(system("cat pan.out | perl -e 'while(<STDIN>) { if(/errors:\\s(\\d+)/) {exit($1);}}'")!=0) return 0;
-	if(system("cat pan.out | perl -e 'while(<STDIN>) { if(/unreached/) {exit(1);}}'")!=0) return 0;
-	
-	
+		
 	std::ostringstream strstrm;
 	strstrm << "cp tmp.xmi " << world->GetStats().GetUpdate() << "." << id;
 	strstrm << ".xml";	
 	if(system(strstrm.str().c_str())!=0) return 0.0;
+	
+	if(system("cat pan.out | perl -e 'while(<STDIN>) { if(/unreached/) {exit(1);}}'")!=0) return 1;
+
 			
 //	m_world->GetStats().PanPassed();
 	return 3;

Modified: branches/uml/source/main/cUMLStateDiagram.cc
===================================================================
--- branches/uml/source/main/cUMLStateDiagram.cc	2007-05-22 18:57:31 UTC (rev 1590)
+++ branches/uml/source/main/cUMLStateDiagram.cc	2007-05-22 18:58:21 UTC (rev 1591)
@@ -311,11 +311,6 @@
 
 		return false;
 	} 
-
-	// Initialize the indices
-	if (o > 0 || d > 0) { 
-		 o = 0;
-	}
 		
 	absoluteMoveIndex(states, orig_state_index, o);
 	absoluteMoveIndex(states, dest_state_index, d);
@@ -329,9 +324,10 @@
 	
 	
 	// Do not create transition if the origin state is unreachable.
-	if ((trany.orig_state != 0) && (states[trany.orig_state].num_incoming == 0)) {
-		return false;
-	}
+// Taken out on 5/22
+//	if ((trany.orig_state != 0) && (states[trany.orig_state].num_incoming == 0)) {
+//		return false;
+//	}
 	
 	// increment number of edges for a state
 	states[getOrigStateIndex()].num_outgoing += 1;




More information about the Avida-cvs mailing list