<?xml version="1.0"?>
<!DOCTYPE nta PUBLIC "-//Uppaal Team//DTD Flat System 1.0//EN" "http://www.docs.uu.se/docs/rtmv/uppaal/xml/flat-1_0.dtd">
<nta>
  <declaration>//Insert declarations of global clocks, variables, constants and channels.

const max 10000;
int[-max,max] w;
int c;
int y;

chan tick, tock, tack;
</declaration>
  <template>
    <name x="5" y="5">Wind</name>
    <parameter x="5" y="20"/>
    <declaration>//Insert local declarations of clocks, variables and constants.
</declaration>
  <location id="id0" x="96" y="128"/><location id="id1" x="256" y="128"><committed/></location><init ref="id0"/><transition><source ref="id0"/><target ref="id1"/><label kind="assignment" x="128" y="96">w := w+1</label><label kind="guard" x="128" y="72">w &lt; max</label><nail x="96" y="96"/><nail x="256" y="96"/></transition><transition><source ref="id0"/><target ref="id1"/></transition><transition><source ref="id0"/><target ref="id1"/><label kind="assignment" x="128" y="192">w := w-1</label><label kind="guard" x="128" y="168">w &gt; -max</label><nail x="96" y="192"/><nail x="256" y="192"/></transition><transition><source ref="id1"/><target ref="id0"/><label kind="synchronisation" x="160" y="224">tick!</label><nail x="288" y="128"/><nail x="288" y="224"/><nail x="64" y="224"/><nail x="64" y="128"/></transition></template>
  <template><name x="5" y="5">Car</name><parameter x="5" y="20"/><declaration>int v;</declaration><location id="id2" x="128" y="96"/><location id="id3" x="320" y="96"><committed/></location><location id="id4" x="320" y="224"/><init ref="id2"/><transition><source ref="id2"/><target ref="id3"/><label kind="synchronisation" x="160" y="72">tick?</label><label kind="assignment" x="160" y="104">y :=  y + ( v + w)</label></transition><transition><source ref="id3"/><target ref="id4"/><label kind="synchronisation" x="336" y="168">tock!</label></transition><transition><source ref="id4"/><target ref="id2"/><label kind="synchronisation" x="160" y="200">tack?</label><label kind="assignment" x="160" y="224">v := v+c</label><nail x="128" y="224"/></transition></template><template><name x="5" y="5">Controller</name><parameter x="5" y="20"/><declaration>int sen1;
int sen2;</declaration><location id="id5" x="96" y="128"/><location id="id6" x="416" y="128"><committed/></location><init ref="id5"/><transition><source ref="id5"/><target ref="id6"/><label kind="synchronisation" x="128" y="104">tock?</label><label kind="assignment" x="128" y="136">sen2 :=sen1,
sen1 :=(y &gt; 0 ? 1 : (y == 0 ? 0 : -1)),
c := 2*sen2 - 3*sen1</label></transition><transition><source ref="id6"/><target ref="id5"/><label kind="synchronisation" x="128" y="256">tack!</label><nail x="416" y="256"/><nail x="96" y="256"/></transition></template><instantiation>//Insert process assignments.
</instantiation>
  <system>//Edit system definition.
system Wind, Car, Controller;</system>
</nta>