<?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.
int[0,2000] logSize1, logSize2, logSize3, logSizeFiltered, userNum, detected, y1, y2, y3, totalSize;
urgent chan filter, add, stored;
const F_RATE_HIGH 5, AVE_ACC_NUM 70, PRIOD_LOG_CHECK 7;</declaration>
  <template>
    <name x="5" y="5">LogSize</name>
    <parameter x="5" y="20">int[0,2000] logSize, detected, y, totalSize, logSizeFiltered; urgent chan filter, add</parameter>
    <declaration>//Insert local declarations of clocks, variables and constants.
</declaration>
  <location id="id0" x="240" y="272"><name x="256" y="256">Logon</name></location><location id="id1" x="240" y="336"><name x="224" y="304">Event</name></location><location id="id2" x="240" y="464"><name x="248" y="400">Filtered</name></location><location id="id4" x="432" y="336"><name x="384" y="352">Collected</name></location><location id="id8" x="336" y="336"><name x="320" y="304">Recorded</name><committed/></location><init ref="id0"/><transition><source ref="id0"/><target ref="id1"/></transition><transition><source ref="id8"/><target ref="id2"/><label kind="synchronisation" x="256" y="384">filter?</label><label kind="assignment" x="224" y="416">logSizeFiltered:=AVE_ACC_NUM</label></transition><transition><source ref="id8"/><target ref="id4"/><label kind="guard" x="344" y="288">y==PRIOD_LOG_CHECK</label><label kind="synchronisation" x="368" y="320">add!</label><label kind="assignment" x="360" y="368">totalSize:=totalSize+logSize,
userNum++</label><nail x="344" y="336"/></transition><transition><source ref="id2"/><target ref="id8"/><label kind="assignment" x="304" y="432">logSize:=logSize+logSizeFiltered,
detected:=0, y++</label><label kind="synchronisation" x="312" y="392">stored?</label><nail x="336" y="464"/></transition><transition><source ref="id1"/><target ref="id8"/><label kind="assignment" x="256" y="336">detected:=1</label></transition><transition><source ref="id8"/><target ref="id1"/><label kind="guard" x="264" y="272">y&lt;PRIOD_LOG_CHECK,
detected==0</label><nail x="288" y="312"/></transition></template>
  <template><name x="5" y="5">StaticPolicy2</name><parameter x="5" y="20">int[0,2000] logSizeFiltered, detectedNo; urgent chan filter</parameter><declaration/><location id="id6" x="304" y="240"><name x="294" y="210">idle</name></location><location id="id7" x="400" y="240"><name x="390" y="210">objectFilter</name><committed/></location><init ref="id6"/><transition><source ref="id6"/><target ref="id7"/><label kind="synchronisation" x="336" y="216">filter!</label><label kind="guard" x="312" y="248">detected &gt; 0</label></transition><transition><source ref="id7"/><target ref="id6"/><label kind="assignment" x="224" y="176">logSizeFiltered:=2*logSizeFiltered/F_RATE_HIGH</label><label kind="synchronisation" x="352" y="200">stored!</label><nail x="352" y="192"/></transition></template><template><name x="5" y="5">SecMng</name><parameter x="5" y="20">int[0,2000] totalSize; urgent chan add</parameter><declaration/><location id="id9" x="304" y="208"><name x="294" y="178">Totaled</name><committed/></location><location id="id10" x="400" y="144"><name x="328" y="128">Complete</name></location><location id="id11" x="400" y="208"><name x="352" y="184">Tired</name></location><location id="id12" x="400" y="272"><name x="336" y="264">GiveUp</name></location><location id="id13" x="208" y="208"/><init ref="id13"/><transition><source ref="id9"/><target ref="id10"/><label kind="guard" x="304" y="152">totalSize &lt; 500,
userNum==3</label></transition><transition><source ref="id9"/><target ref="id11"/><label kind="guard" x="304" y="208">totalSize &lt; 1000,
totalSize &gt;= 500,
userNum==3</label></transition><transition><source ref="id9"/><target ref="id12"/><label kind="guard" x="232" y="248">totalSize &gt; 1000,
userNum==3</label></transition><transition><source ref="id13"/><target ref="id9"/><label kind="synchronisation" x="240" y="192">add?</label></transition><transition><source ref="id9"/><target ref="id13"/><label kind="guard" x="200" y="224">userNum&lt;3</label><nail x="256" y="256"/></transition></template><instantiation>//Insert process assignments.
LogSizeU1 := LogSize(logSize1, detected, y1, totalSize, logSizeFiltered, filter, add);
LogSizeU2 := LogSize(logSize2, detected, y2, totalSize, logSizeFiltered, filter, add);
LogSizeU3 := LogSize(logSize3, detected, y3, totalSize, logSizeFiltered, filter, add);
StaticPolicy2 := StaticPolicy2(logSizeFiltered, detected, filter);
SecMng:= SecMng(totalSize, add);</instantiation>
  <system>//Edit system definition.
system LogSizeU1, LogSizeU2, LogSizeU3, StaticPolicy2, SecMng;</system>
</nta>