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

hjg at myxo.css.msu.edu hjg at myxo.css.msu.edu
Wed Jan 10 05:55:21 PST 2007


Author: hjg
Date: 2007-01-10 08:55:21 -0500 (Wed, 10 Jan 2007)
New Revision: 1175

Modified:
   branches/uml/source/main/cOrganism.cc
   branches/uml/source/main/cTaskLib.cc
Log:
Improved tasks for brightness sensor.


Modified: branches/uml/source/main/cOrganism.cc
===================================================================
--- branches/uml/source/main/cOrganism.cc	2007-01-08 15:43:26 UTC (rev 1174)
+++ branches/uml/source/main/cOrganism.cc	2007-01-10 13:55:21 UTC (rev 1175)
@@ -621,7 +621,9 @@
 			break;
 		case 7:
 			temp = "";
-			temp += " <UML:Transition.effect> ";
+			temp += "<UML:Transition.guard> <UML:Guard> <UML:Guard.expression> ";
+			temp += "<UML:BooleanExpression body=\"brightnessValue &gt;=0 &amp; brightnessValue&lt;=1000\" language=\"\"/>";
+			temp += " </UML:Guard.expression> </UML:Guard> </UML:Transition.guard> <UML:Transition.effect> ";
 			temp += " <UML:UninterpretedAction xmi.id=\"XDE-8E3B2DF6-D63B-4A70-9CD3-FF0DE13EEDAD\" ";
 			temp += " isAsynchronous=\"false\" name=\"\" isSpecification=\"false\"> <UML:Action.script> ";
 			temp += " <UML:ActionExpression language=\"\" body=\"correctedBrightnessValue:=brightnessValue\"/> ";
@@ -657,18 +659,7 @@
 			temp += " <UML:ActionExpression language=\"\" body=\"correctedBrightnessValue:=1000\"/> ";
 			temp += " </UML:Action.script> </UML:UninterpretedAction> </UML:Transition.effect> ";
 			(*it).second = temp;
-			break;
-		case 11:
-			temp = "";
-			temp += "<UML:Transition.guard> <UML:Guard> <UML:Guard.expression> ";
-			temp += "<UML:BooleanExpression body=\"brightnessValue &gt;=0 &amp; brightnessValue&lt;=1000\" language=\"\"/>";
-			temp += " </UML:Guard.expression> </UML:Guard> </UML:Transition.guard> <UML:Transition.effect> ";
-			temp += " <UML:UninterpretedAction xmi.id=\"XDE-8E3B2DF6-D63B-4A70-9CD3-FF0DE13EEDAD\" ";
-			temp += " isAsynchronous=\"false\" name=\"\" isSpecification=\"false\"> <UML:Action.script> ";
-			temp += " <UML:ActionExpression language=\"\" body=\"correctedBrightnessValue:=brightnessValue\"/> ";
-			temp += " </UML:Action.script> </UML:UninterpretedAction> </UML:Transition.effect> ";
-			(*it).second = temp;
-			break;
+			break;			
 		default:
 			(*it).second = " ";
 	}
@@ -749,7 +740,7 @@
 void cOrganism::deleteTrans(int pos) 
 {
 
-	Graph::edge_iterator e, eend;
+	Graph::edge_iterator e, eend, q;
 	int count = 0;
 	int num_trans_w_lab = 0;
 	int trans_name;
@@ -764,6 +755,9 @@
 	}
 	
 	trans_name = getTransNumber(pos);
+	//e[pos]
+	//tie(e, eend) = edges(uml_state_diagram);
+	//q = e[pos];
 
 	for (tie(e, eend) = edges(uml_state_diagram); e != eend; ++e) { 
 		if (count == pos) {

Modified: branches/uml/source/main/cTaskLib.cc
===================================================================
--- branches/uml/source/main/cTaskLib.cc	2007-01-08 15:43:26 UTC (rev 1174)
+++ branches/uml/source/main/cTaskLib.cc	2007-01-10 13:55:21 UTC (rev 1175)
@@ -2098,9 +2098,14 @@
 {
 	double bonus = 0.0;
 
-	if (ctx->organism->findTrans(5, 6, 7)) { 
+	// This has been modified to check if the 7th transition is present... we don't care
+	// where it is in the model. This is enough to cause the property check to fail.
+	//if (ctx->organism->findTrans(5, 6, 7)) { 
+	if (ctx->organism->NumStates() > 7) { 
 		bonus = 1.0;
 	}
+	
+	
 	return bonus;
 }
 




More information about the Avida-cvs mailing list