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

hjg at myxo.css.msu.edu hjg at myxo.css.msu.edu
Fri Mar 9 09:48:15 PST 2007


Author: hjg
Date: 2007-03-09 12:48:15 -0500 (Fri, 09 Mar 2007)
New Revision: 1394

Modified:
   branches/uml/source/main/cOrganism.cc
Log:
adds now move indices to point to the most recently created element of the vector.


Modified: branches/uml/source/main/cOrganism.cc
===================================================================
--- branches/uml/source/main/cOrganism.cc	2007-03-09 13:27:12 UTC (rev 1393)
+++ branches/uml/source/main/cOrganism.cc	2007-03-09 17:48:15 UTC (rev 1394)
@@ -917,6 +917,10 @@
 		orig_state_index = 0;
 		dest_state_index = 0;
 	}
+	
+	// Move the destination state to the most recently created.
+	dest_state_index = total_states - 1;
+	
 	return true;
 }
 
@@ -928,11 +932,16 @@
 	t.guard = getGuard();
 	t.action = getAction();
 	
-	if (findTransLabel(t)){
+	// no dupes
+/*	if (findTransLabel(t)){
 		return false;
-	 }
+	 }*/
 	
 	transition_labels.push_back(t);
+	
+	// Move the transition label index to the most recently created
+	trans_label_index = transition_labels.size() - 1;
+	
 	return true;
 }
 
@@ -948,11 +957,13 @@
 	t.dest_state = getDestState();
 	t.trans = getTransLabel();
 	
-    if (findTrans(t)) {
+	// no dupes
+/*    if (findTrans(t)) {
 		return false;
-	}
+	}*/
 
 	transitions.push_back(t);
+		
 	return true;
 
 }




More information about the Avida-cvs mailing list