Skip to content
Snippets Groups Projects
Commit 308675e7 authored by Louis Kevin Fink's avatar Louis Kevin Fink
Browse files

fix: update example automatas

parent 4d08b701
Branches demo
No related tags found
No related merge requests found
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
<nta> <nta>
<declaration>// Place global declarations here. <declaration>// Place global declarations here.
chan change_direction;
chan drive; chan drive;
chan drive_backwards; chan drive_backwards;
chan stop; chan stop;
...@@ -30,7 +29,7 @@ bool potential_collision() { ...@@ -30,7 +29,7 @@ bool potential_collision() {
<transition id="id5"> <transition id="id5">
<source ref="id3"/> <source ref="id3"/>
<target ref="id4"/> <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> <label kind="synchronisation" x="195" y="144">stop!</label>
</transition> </transition>
<transition id="id6"> <transition id="id6">
...@@ -43,9 +42,10 @@ bool potential_collision() { ...@@ -43,9 +42,10 @@ bool potential_collision() {
<transition id="id7"> <transition id="id7">
<source ref="id1"/> <source ref="id1"/>
<target ref="id2"/> <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="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>
<transition id="id8"> <transition id="id8">
<source ref="id0"/> <source ref="id0"/>
...@@ -61,43 +61,22 @@ void set_speed(double speed) {}</declaration> ...@@ -61,43 +61,22 @@ void set_speed(double speed) {}</declaration>
</location> </location>
<location id="id10" x="68" y="0"> <location id="id10" x="68" y="0">
</location> </location>
<location id="id11" x="340" y="0">
</location>
<init ref="id9"/> <init ref="id9"/>
<transition id="id12"> <transition id="id11">
<source ref="id11"/> <source ref="id9"/>
<target ref="id9"/> <target ref="id10"/>
<label kind="synchronisation" x="195" y="-93">stop?</label> <label kind="synchronisation" x="221" y="-85">drive_backwards?</label>
<label kind="assignment" x="195" y="-76">set_speed(0.0)</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>
<transition id="id13"> <transition id="id12">
<source ref="id10"/> <source ref="id10"/>
<target ref="id9"/> <target ref="id9"/>
<label kind="synchronisation" x="-17" y="-76">stop?</label> <label kind="synchronisation" x="-17" y="-76">stop?</label>
<label kind="assignment" x="-51" y="-59">set_speed(0.0)</label> <label kind="assignment" x="-51" y="-59">set_speed(0.0)</label>
</transition> </transition>
<transition id="id14"> <transition id="id13">
<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">
<source ref="id9"/> <source ref="id9"/>
<target ref="id10"/> <target ref="id10"/>
<label kind="synchronisation" x="-42" y="-153">drive?</label> <label kind="synchronisation" x="-42" y="-153">drive?</label>
......
...@@ -10,10 +10,13 @@ void set_speed(double speed) {} ...@@ -10,10 +10,13 @@ void set_speed(double speed) {}
void turn(double theta) {} void turn(double theta) {}
</declaration> </declaration>
<location id="id0" x="59" y="8"> <location id="id0" x="59" y="8">
<name x="49" y="-26">turn1</name>
</location> </location>
<location id="id1" x="246" y="8"> <location id="id1" x="246" y="8">
<name x="236" y="-26">turn2</name>
</location> </location>
<location id="id2" x="-119" y="8"> <location id="id2" x="-119" y="8">
<name x="-129" y="-26">start</name>
</location> </location>
<init ref="id2"/> <init ref="id2"/>
<transition id="id3"> <transition id="id3">
...@@ -24,12 +27,12 @@ void turn(double theta) {} ...@@ -24,12 +27,12 @@ void turn(double theta) {}
<transition id="id4"> <transition id="id4">
<source ref="id1"/> <source ref="id1"/>
<target ref="id0"/> <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>
<transition id="id5"> <transition id="id5">
<source ref="id0"/> <source ref="id0"/>
<target ref="id1"/> <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> </transition>
</template> </template>
<system>// Place template instantiations here. <system>// Place template instantiations here.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment