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

hjg at myxo.css.msu.edu hjg at myxo.css.msu.edu
Wed Aug 15 17:01:20 PDT 2007


Author: hjg
Date: 2007-08-15 20:01:20 -0400 (Wed, 15 Aug 2007)
New Revision: 1943

Modified:
   branches/uml/source/main/cTaskLib.cc
   branches/uml/source/main/cUMLModel.cc
Log:
Added new case (4) for calling hydra when the scenarios are complete and it is deterministic. 




Modified: branches/uml/source/main/cTaskLib.cc
===================================================================
--- branches/uml/source/main/cTaskLib.cc	2007-08-15 20:46:50 UTC (rev 1942)
+++ branches/uml/source/main/cTaskLib.cc	2007-08-16 00:01:20 UTC (rev 1943)
@@ -3286,6 +3286,7 @@
 	cOrganism* organism = ctx.getOrganism();
 	unsigned int bonus = 0;
 
+	
 	for(unsigned int i=0; i<organism->getUMLModel()->getStateDiagramSize(); ++i) {
 		cUMLStateDiagram* sd=organism->getUMLModel()->getStateDiagram(i);
 		if(sd->numTrans() > 0) {
@@ -3293,5 +3294,7 @@
 		}
 	}
 	
+	organism->getUMLModel()->setBonusInfo("isDeterministic", !bonus);	
+
 	return !bonus;
 }

Modified: branches/uml/source/main/cUMLModel.cc
===================================================================
--- branches/uml/source/main/cUMLModel.cc	2007-08-15 20:46:50 UTC (rev 1942)
+++ branches/uml/source/main/cUMLModel.cc	2007-08-16 00:01:20 UTC (rev 1943)
@@ -314,6 +314,7 @@
 bool cUMLModel::readyForHydra() 
 {
 	// options: (0) ALL_COMPLETE, (1) ONE_COMPLETE, (2) ONE_NON_EMPTY, (3) ALL_NON_EMPTY
+	//          (4) ALL COMPLETE && DETERMINISTIC
 	// check which option was selected in the seed-model.cfg
 	// check to see if this condition is true. If so, return 1; otherwise, return 0.
 	
@@ -340,6 +341,15 @@
 	case 3:
 		ret_val = 0;
 		break;
+	case 4:
+		ret_val = 1;
+		if (!(getBonusInfo("isDeterministic"))) { ret_val=0; break; }
+		for (unsigned int i=0; i< scenario_completion.size(); i++) { 
+			//ret_val &= scenario_completion[i];
+			if (scenario_completion[i] != 1) ret_val &= 0;
+		}
+			
+		break;
 	default:
 		ret_val = 0;
 	}




More information about the Avida-cvs mailing list