From 308675e7b40b685f0201317400f9239dc1be09b6 Mon Sep 17 00:00:00 2001
From: Louis Fink <uutyc@student.kit.edu>
Date: Wed, 19 Mar 2025 16:22:34 +0100
Subject: [PATCH] fix: update example automatas

---
 examples/backToStart.xml | 47 +++++++++++-----------------------------
 examples/figureEight.xml |  7 ++++--
 2 files changed, 18 insertions(+), 36 deletions(-)

diff --git a/examples/backToStart.xml b/examples/backToStart.xml
index 422a9b2..7a5004c 100644
--- a/examples/backToStart.xml
+++ b/examples/backToStart.xml
@@ -3,7 +3,6 @@
 <nta>
 	<declaration>// Place global declarations here.
 
-chan change_direction;
 chan drive;
 chan drive_backwards;
 chan stop;
@@ -30,7 +29,7 @@ bool potential_collision() {
 		<transition id="id5">
 			<source ref="id3"/>
 			<target ref="id4"/>
-			<label kind="guard" x="144" y="127">clk &gt; distance</label>
+			<label kind="guard" x="144" y="127">clk &gt;= distance</label>
 			<label kind="synchronisation" x="195" y="144">stop!</label>
 		</transition>
 		<transition id="id6">
@@ -43,9 +42,10 @@ bool potential_collision() {
 		<transition id="id7">
 			<source ref="id1"/>
 			<target ref="id2"/>
-			<label kind="guard" x="144" y="-76">potential_collision()</label>
+			<label kind="guard" x="144" y="-76">potential_collision(0.5)</label>
 			<label kind="synchronisation" x="204" y="-59">stop!</label>
-			<label kind="assignment" x="178" y="-42">clk = 0</label>
+			<label kind="assignment" x="178" y="-42">distance = clk,
+clk = 0</label>
 		</transition>
 		<transition id="id8">
 			<source ref="id0"/>
@@ -61,43 +61,22 @@ void set_speed(double speed) {}</declaration>
 		</location>
 		<location id="id10" x="68" y="0">
 		</location>
-		<location id="id11" x="340" y="0">
-		</location>
 		<init ref="id9"/>
-		<transition id="id12">
-			<source ref="id11"/>
-			<target ref="id9"/>
-			<label kind="synchronisation" x="195" y="-93">stop?</label>
-			<label kind="assignment" x="195" y="-76">set_speed(0.0)</label>
+		<transition id="id11">
+			<source ref="id9"/>
+			<target ref="id10"/>
+			<label kind="synchronisation" x="221" y="-85">drive_backwards?</label>
+			<label kind="assignment" x="221" y="-68">set_speed(-0.2)</label>
+			<nail x="212" y="-110"/>
+			<nail x="212" y="0"/>
 		</transition>
-		<transition id="id13">
+		<transition id="id12">
 			<source ref="id10"/>
 			<target ref="id9"/>
 			<label kind="synchronisation" x="-17" y="-76">stop?</label>
 			<label kind="assignment" x="-51" y="-59">set_speed(0.0)</label>
 		</transition>
-		<transition id="id14">
-			<source ref="id9"/>
-			<target ref="id11"/>
-			<label kind="synchronisation" x="127" y="-153">drive_backwards?</label>
-			<label kind="assignment" x="127" y="-136">set_speed(-0.2)</label>
-			<nail x="340" y="-110"/>
-		</transition>
-		<transition id="id15">
-			<source ref="id11"/>
-			<target ref="id10"/>
-			<label kind="synchronisation" x="85" y="-42">change_direction?</label>
-			<label kind="assignment" x="85" y="-25">set_speed(0.2)</label>
-		</transition>
-		<transition id="id16">
-			<source ref="id10"/>
-			<target ref="id11"/>
-			<label kind="synchronisation" x="127" y="85">change_direction?</label>
-			<label kind="assignment" x="136" y="102">set_speed(-0.2)</label>
-			<nail x="68" y="76"/>
-			<nail x="340" y="76"/>
-		</transition>
-		<transition id="id17">
+		<transition id="id13">
 			<source ref="id9"/>
 			<target ref="id10"/>
 			<label kind="synchronisation" x="-42" y="-153">drive?</label>
diff --git a/examples/figureEight.xml b/examples/figureEight.xml
index e8c1e2c..17bd88a 100644
--- a/examples/figureEight.xml
+++ b/examples/figureEight.xml
@@ -10,10 +10,13 @@ void set_speed(double speed) {}
 void turn(double theta) {}
 </declaration>
 		<location id="id0" x="59" y="8">
+			<name x="49" y="-26">turn1</name>
 		</location>
 		<location id="id1" x="246" y="8">
+			<name x="236" y="-26">turn2</name>
 		</location>
 		<location id="id2" x="-119" y="8">
+			<name x="-129" y="-26">start</name>
 		</location>
 		<init ref="id2"/>
 		<transition id="id3">
@@ -24,12 +27,12 @@ void turn(double theta) {}
 		<transition id="id4">
 			<source ref="id1"/>
 			<target ref="id0"/>
-			<label kind="assignment" x="102" y="17">turn(-360.0)</label>
+			<label kind="assignment" x="102" y="17">turn(-300.0)</label>
 		</transition>
 		<transition id="id5">
 			<source ref="id0"/>
 			<target ref="id1"/>
-			<label kind="assignment" x="102" y="-17">turn(360.0)</label>
+			<label kind="assignment" x="102" y="-17">turn(300.0)</label>
 		</transition>
 	</template>
 	<system>// Place template instantiations here.
-- 
GitLab