<?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>chan take , release;
int L ;
clock time;

const fastest 5;
const fast    10;
const slow    20;
const slowest 25;</declaration><template><name x="32" y="16">Soldier</name><parameter x="192" y="16"> const delay</parameter><declaration>clock y;</declaration><location id="id0" x="64" y="216"><name x="48" y="232">over</name></location><location id="id1" x="216" y="216"><name x="200" y="232">ready</name></location><location id="id2" x="360" y="216"><name x="344" y="232">safe</name></location><location id="id3" x="360" y="80"><name x="352" y="48">u_over</name></location><location id="id4" x="216" y="80"><name x="208" y="48">u_ready</name></location><location id="id5" x="64" y="80"><name x="56" y="48">unsafe</name></location><init ref="id5"/><transition><source ref="id0"/><target ref="id5"/><label kind="synchronisation" x="72" y="136">release !</label></transition><transition><source ref="id1"/><target ref="id0"/><label kind="guard" x="112" y="192">y>= delay</label></transition><transition><source ref="id2"/><target ref="id1"/><label kind="guard" x="272" y="192">L== 1</label><label kind="synchronisation" x="272" y="216">take !</label><label kind="assignment" x="280" y="232">y:= 0</label></transition><transition><source ref="id3"/><target ref="id2"/><label kind="synchronisation" x="304" y="144">release !</label></transition><transition><source ref="id4"/><target ref="id3"/><label kind="guard" x="256" y="88">y>= delay</label></transition><transition><source ref="id5"/><target ref="id4"/><label kind="guard" x="128" y="56">L== 0</label><label kind="synchronisation" x="128" y="80">take !</label><label kind="assignment" x="128" y="104">y:= 0</label></transition></template><template><name x="32" y="-16">Torch</name><parameter x="168" y="-16"/><declaration/><location id="id6" x="64" y="48"><name x="56" y="16">free1</name></location><location id="id7" x="200" y="48"><name x="192" y="16">free2</name><urgent/></location><location id="id8" x="200" y="192"><name x="192" y="200">one</name></location><location id="id9" x="336" y="48"><name x="328" y="16">two</name></location><init ref="id6"/><transition><source ref="id6"/><target ref="id7"/><label kind="synchronisation" x="112" y="24">take?</label></transition><transition><source ref="id7"/><target ref="id8"/></transition><transition><source ref="id7"/><target ref="id9"/><label kind="synchronisation" x="248" y="24">take?</label></transition><transition><source ref="id8"/><target ref="id6"/><label kind="guard" x="136" y="200">L== 0</label><label kind="synchronisation" x="40" y="200">release?</label><label kind="assignment" x="24" y="112">L:= 1</label><nail x="64" y="193"/></transition><transition><source ref="id8"/><target ref="id6"/><label kind="guard" x="128" y="128">L== 1</label><label kind="synchronisation" x="104" y="104">release?</label><label kind="assignment" x="96" y="80">L:= 0</label><nail x="111" y="144"/></transition><transition><source ref="id9"/><target ref="id8"/><label kind="synchronisation" x="272" y="200">release?</label><nail x="336" y="193"/></transition></template><instantiation>Viking1 := Soldier( fastest );
Viking2 := Soldier( fast );
Viking3 := Soldier( slow );
Viking4 := Soldier( slowest );</instantiation><system>system Viking1, Viking2, Viking3, Viking4, Torch;</system></nta>
