From d763ee5a03d06ee706ff2a23f800fc72f020c2f0 Mon Sep 17 00:00:00 2001 From: Ludovic Apvrille <ludovic.apvrille@telecom-paristech.fr> Date: Thu, 15 Feb 2018 14:24:58 +0100 Subject: [PATCH] Update on TTool package and adding probabilities to avatar transitions. Prob are still not working in automatd simulation mode e.g. next breakpoint --- .idea/misc.xml | 2 +- Makefile | 1 + modeling/AVATAR/CoffeeMachine_Avatar.xml | 2900 +++-------------- .../avatartranslator/AvatarSyntaxChecker.java | 22 + .../avatartranslator/AvatarTransition.java | 5 + .../AvatarSimulationBlock.java | 147 +- .../AvatarSimulationPendingTransaction.java | 3 + .../AvatarSpecificationSimulation.java | 430 ++- .../toexecutable/AVATAR2CPOSIX.java | 221 +- src/main/java/common/SpecConfigTTool.java | 8 +- .../java/ui/AvatarDesignPanelTranslator.java | 13 + .../AvatarInteractiveSimulationActions.java | 56 +- .../JFrameAvatarInteractiveSimulation.java | 32 +- .../java/ui/avatarsmd/AvatarSMDConnector.java | 81 +- .../ui/avatarsmd/AvatarSMDTransitionInfo.java | 140 +- ...JDialogAvatarExecutableCodeGeneration.java | 123 +- .../ui/window/JDialogAvatarTransition.java | 42 +- ...ialogAvatarddExecutableCodeGeneration.java | 597 ++-- 18 files changed, 1566 insertions(+), 3257 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index b755d8ca46..51e5191ed4 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -38,7 +38,7 @@ <property name="caretWidth" class="java.lang.Integer" /> </properties> </component> - <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="false" project-jdk-name="1.7" project-jdk-type="JavaSDK"> + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK"> <output url="file://$PROJECT_DIR$/build" /> </component> </project> \ No newline at end of file diff --git a/Makefile b/Makefile index f5f1aff126..0855a25176 100755 --- a/Makefile +++ b/Makefile @@ -417,6 +417,7 @@ $(BASERELEASE:.tgz=.tar): $(JTTOOL_BINARY) $(TTOOL_BINARY) $(LAUNCHER_BINARY) $( @mkdir -p $(TTOOL_TARGET)/executablecode/src @mkdir -p $(TTOOL_TARGET)/executablecode/generated_src @mkdir -p $(TTOOL_TARGET)/executablecode/example + @cp $(TTOOL_EXECUTABLECODE)/LICENSE* $(TTOOL_TARGET)/executablecode/ @cp $(TTOOL_EXECUTABLECODE)/Makefile $(TTOOL_TARGET)/executablecode/ @cp $(TTOOL_EXECUTABLECODE)/Makefile.defs $(TTOOL_TARGET)/executablecode/ @cp $(TTOOL_EXECUTABLECODE)/Makefile.forsoclib $(TTOOL_TARGET)/executablecode/ diff --git a/modeling/AVATAR/CoffeeMachine_Avatar.xml b/modeling/AVATAR/CoffeeMachine_Avatar.xml index d5b4b4b4e6..dab29392ca 100644 --- a/modeling/AVATAR/CoffeeMachine_Avatar.xml +++ b/modeling/AVATAR/CoffeeMachine_Avatar.xml @@ -534,7 +534,7 @@ </AvatarRDPanel> -<AvatarPDPanel name="AVATAR PD" minX="10" maxX="1402" minY="10" maxY="902" zoom="1.0000000000000004" > +<AvatarPDPanel name="AVATAR PD" minX="10" maxX="1400" minY="10" maxY="900" zoom="1.0000000000000004" > <CONNECTOR type="5312" id="330" > <cdparam x="582" y="248" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> @@ -578,7 +578,7 @@ <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector from TGComponent to TGComponent" value="" /> <TGConnectingPoint num="0" id="337" /> -<P1 x="313" y="261" id="381" /> +<P1 x="313" y="261" id="368" /> <P2 x="361" y="261" id="356" /> <AutomaticDrawing data="true" /> </CONNECTOR> @@ -596,7 +596,7 @@ <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector from TGComponent to TGComponent" value="" /> <TGConnectingPoint num="0" id="341" /> -<P1 x="309" y="211" id="368" /> +<P1 x="309" y="211" id="381" /> <P2 x="361" y="211" id="355" /> <AutomaticDrawing data="true" /> </CONNECTOR> @@ -604,7 +604,7 @@ <cdparam x="446" y="334" /> <sizeparam width="112" height="55" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="10" maxX="1403" minY="10" maxY="903" /> +<cdrectangleparam minX="10" maxX="1401" minY="10" maxY="901" /> <infoparam name="TGComponent" value="WalletCoinProperty" /> <TGConnectingPoint num="0" id="343" /> <TGConnectingPoint num="1" id="344" /> @@ -620,7 +620,7 @@ <cdparam x="340" y="331" /> <sizeparam width="100" height="55" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="10" maxX="1403" minY="10" maxY="903" /> +<cdrectangleparam minX="10" maxX="1401" minY="10" maxY="901" /> <infoparam name="TGComponent" value="oneCoinProperty" /> <TGConnectingPoint num="0" id="348" /> <TGConnectingPoint num="1" id="349" /> @@ -636,7 +636,7 @@ <cdparam x="361" y="187" /> <sizeparam width="59" height="99" minWidth="50" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="10" maxX="1403" minY="10" maxY="903" /> +<cdrectangleparam minX="10" maxX="1401" minY="10" maxY="901" /> <infoparam name="TGComponent" value=">50" /> <TGConnectingPoint num="0" id="353" /> <TGConnectingPoint num="1" id="354" /> @@ -656,7 +656,7 @@ <cdparam x="150" y="142" /> <sizeparam width="168" height="154" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="10" maxX="1403" minY="10" maxY="903" /> +<cdrectangleparam minX="10" maxX="1401" minY="10" maxY="901" /> <infoparam name="Block0" value="CoffeeMachine" /> <TGConnectingPoint num="0" id="392" /> <TGConnectingPoint num="1" id="393" /> @@ -685,11 +685,11 @@ </COMPONENT> <SUBCOMPONENT type="5304" id="378" > <father id="416" num="0" /> -<cdparam x="170" y="191" /> -<sizeparam width="139" height="40" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="165" y="241" /> +<sizeparam width="148" height="40" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="0" maxX="29" minY="0" maxY="114" /> -<infoparam name="TGComponent" value="WaitingForFirstCoin_exit" /> +<cdrectangleparam minX="0" maxX="20" minY="0" maxY="114" /> +<infoparam name="TGComponent" value="WaitingForFirstCoin_enter" /> <TGConnectingPoint num="0" id="366" /> <TGConnectingPoint num="1" id="367" /> <TGConnectingPoint num="2" id="368" /> @@ -705,11 +705,11 @@ </SUBCOMPONENT> <SUBCOMPONENT type="5304" id="391" > <father id="416" num="1" /> -<cdparam x="165" y="241" /> -<sizeparam width="148" height="40" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="170" y="191" /> +<sizeparam width="139" height="40" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="0" maxX="20" minY="0" maxY="114" /> -<infoparam name="TGComponent" value="WaitingForFirstCoin_enter" /> +<cdrectangleparam minX="0" maxX="29" minY="0" maxY="114" /> +<infoparam name="TGComponent" value="WaitingForFirstCoin_exit" /> <TGConnectingPoint num="0" id="379" /> <TGConnectingPoint num="1" id="380" /> <TGConnectingPoint num="2" id="381" /> @@ -728,7 +728,7 @@ <cdparam x="459" y="61" /> <sizeparam width="150" height="116" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="10" maxX="1403" minY="10" maxY="903" /> +<cdrectangleparam minX="10" maxX="1401" minY="10" maxY="901" /> <infoparam name="Block0" value="Wallet" /> <TGConnectingPoint num="0" id="430" /> <TGConnectingPoint num="1" id="431" /> @@ -783,7 +783,7 @@ <cdparam x="467" y="209" /> <sizeparam width="100" height="49" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="10" maxX="1403" minY="10" maxY="903" /> +<cdrectangleparam minX="10" maxX="1401" minY="10" maxY="901" /> <infoparam name="TGComponent" value="nbOfCoins >= 0" /> <TGConnectingPoint num="0" id="455" /> <TGConnectingPoint num="1" id="456" /> @@ -839,7 +839,7 @@ <TGConnectingPoint num="0" id="475" /> <TGConnectingPoint num="1" id="476" /> <TGConnectingPoint num="2" id="477" /> -<P1 x="581" y="154" id="551" /> +<P1 x="581" y="154" id="564" /> <P2 x="546" y="305" id="621" /> <Point x="518" y="154" /> <Point x="518" y="305" /> @@ -867,7 +867,7 @@ <infoparam name="connector from TGComponent to TGComponent" value="" /> <TGConnectingPoint num="0" id="480" /> <TGConnectingPoint num="1" id="481" /> -<P1 x="631" y="164" id="546" /> +<P1 x="631" y="164" id="559" /> <P2 x="667" y="310" id="608" /> <Point x="631" y="310" /> <AutomaticDrawing data="true" /> @@ -895,7 +895,7 @@ <infoparam name="connector from TGComponent to TGComponent" value="" /> <TGConnectingPoint num="0" id="486" /> <TGConnectingPoint num="1" id="487" /> -<P1 x="721" y="158" id="557" /> +<P1 x="721" y="158" id="544" /> <P2 x="700" y="204" id="598" /> <Point x="700" y="158" /> <AutomaticDrawing data="true" /> @@ -1050,13 +1050,13 @@ <TGConnectingPoint num="22" id="591" /> <TGConnectingPoint num="23" id="592" /> </COMPONENT> -<SUBCOMPONENT type="5304" id="555" > +<SUBCOMPONENT type="5303" id="555" > <father id="593" num="0" /> -<cdparam x="581" y="125" /> -<sizeparam width="100" height="39" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="721" y="133" /> +<sizeparam width="100" height="50" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="0" maxX="168" minY="0" maxY="76" /> -<infoparam name="TGComponent" value="Start" /> +<cdrectangleparam minX="0" maxX="168" minY="0" maxY="65" /> +<infoparam name="TGComponent" value="nbOfCoins" /> <TGConnectingPoint num="0" id="543" /> <TGConnectingPoint num="1" id="544" /> <TGConnectingPoint num="2" id="545" /> @@ -1069,14 +1069,17 @@ <TGConnectingPoint num="9" id="552" /> <TGConnectingPoint num="10" id="553" /> <TGConnectingPoint num="11" id="554" /> +<extraparam> +<Toggle value="" /> +</extraparam> </SUBCOMPONENT> -<SUBCOMPONENT type="5303" id="568" > +<SUBCOMPONENT type="5304" id="568" > <father id="593" num="1" /> -<cdparam x="721" y="133" /> -<sizeparam width="100" height="50" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="581" y="125" /> +<sizeparam width="100" height="39" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="0" maxX="168" minY="0" maxY="65" /> -<infoparam name="TGComponent" value="nbOfCoins" /> +<cdrectangleparam minX="0" maxX="168" minY="0" maxY="76" /> +<infoparam name="TGComponent" value="Start" /> <TGConnectingPoint num="0" id="556" /> <TGConnectingPoint num="1" id="557" /> <TGConnectingPoint num="2" id="558" /> @@ -1089,9 +1092,6 @@ <TGConnectingPoint num="9" id="565" /> <TGConnectingPoint num="10" id="566" /> <TGConnectingPoint num="11" id="567" /> -<extraparam> -<Toggle value="" /> -</extraparam> </SUBCOMPONENT> <COMPONENT type="5306" id="605" > @@ -1208,12 +1208,12 @@ -<Modeling type="AVATAR Design" nameTab="MainDesign" > +<Modeling type="AVATAR Design" nameTab="AVATAR Design" > <AVATARBlockDiagramPanel name="Block Diagram" minX="10" maxX="1400" minY="10" maxY="900" > <MainCode value="void __user_init() {"/> <MainCode value="}"/> <Optimized value="true" /> -<Validated value="" /> +<Validated value="Wallet;CoffeeMachine;CoffeeButton;TeaButton;" /> <Ignored value="" /> <CONNECTOR type="5002" id="659" > @@ -1221,7 +1221,7 @@ <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector from Block1 to Block0" value="" /> <TGConnectingPoint num="0" id="658" /> -<P1 x="559" y="330" id="720" /> +<P1 x="559" y="330" id="695" /> <P2 x="560" y="377" id="753" /> <AutomaticDrawing data="true" /> <extraparam> @@ -1235,7 +1235,7 @@ <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector from Block0 to Block0" value="" /> <TGConnectingPoint num="0" id="660" /> -<P1 x="306" y="109" id="675" /> +<P1 x="306" y="110" id="675" /> <P2 x="445" y="108" id="749" /> <AutomaticDrawing data="true" /> <extraparam> @@ -1251,7 +1251,7 @@ <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector from Block1 to Block0" value="" /> <TGConnectingPoint num="0" id="662" /> -<P1 x="789" y="326" id="695" /> +<P1 x="789" y="326" id="720" /> <P2 x="790" y="377" id="754" /> <AutomaticDrawing data="true" /> <extraparam> @@ -1261,7 +1261,7 @@ </extraparam> </CONNECTOR> <COMPONENT type="5000" id="688" > -<cdparam x="106" y="55" /> +<cdparam x="106" y="56" /> <sizeparam width="200" height="218" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> @@ -1297,8 +1297,8 @@ <Attribute access="0" id="minUserDelay" value="50" type="8" typeOther="" /> <Attribute access="0" id="maxUserDelay" value="70" type="8" typeOther="" /> <Method value="contentOfWallet(int nbOfCoins)" /> -<Signal value="in getCoin(int nbOfCoins)" attached="false" /> -<Signal value="out putCoin(int nbOfCoins)" attached="false" /> +<Signal value="in getCoin(int nbOfCoins)" attached="true" /> +<Signal value="out putCoin(int nbOfCoins)" attached="true" /> </extraparam> </COMPONENT> @@ -1342,19 +1342,19 @@ <Attribute access="0" id="x" value="0" type="8" typeOther="" /> <Attribute access="0" id="nbOfCoins" value="0" type="8" typeOther="" /> <Method value="beverageReady()" /> -<Signal value="in pushCoffeeButton()" attached="false" /> -<Signal value="in pushTeaButton()" attached="false" /> -<Signal value="in getCoin(int nbOfCoins)" attached="false" /> -<Signal value="out ejectCoin(int nbOfCoins)" attached="false" /> +<Signal value="in pushCoffeeButton()" attached="true" /> +<Signal value="in pushTeaButton()" attached="true" /> +<Signal value="in getCoin(int nbOfCoins)" attached="true" /> +<Signal value="out ejectCoin(int nbOfCoins)" attached="true" /> </extraparam> </COMPONENT> <SUBCOMPONENT type="5000" id="713" > <father id="763" num="0" /> -<cdparam x="695" y="224" /> -<sizeparam width="189" height="102" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="464" y="228" /> +<sizeparam width="190" height="102" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="0" maxX="272" minY="0" maxY="256" /> -<infoparam name="Block1" value="TeaButton" /> +<cdrectangleparam minX="0" maxX="271" minY="0" maxY="256" /> +<infoparam name="Block1" value="CoffeeButton" /> <TGConnectingPoint num="0" id="689" /> <TGConnectingPoint num="1" id="690" /> <TGConnectingPoint num="2" id="691" /> @@ -1382,16 +1382,16 @@ <extraparam> <CryptoBlock value="false" /> <Attribute access="0" id="mechanicalDelay" value="10" type="8" typeOther="" /> -<Signal value="out push()" attached="false" /> +<Signal value="out push()" attached="true" /> </extraparam> </SUBCOMPONENT> <SUBCOMPONENT type="5000" id="738" > <father id="763" num="1" /> -<cdparam x="464" y="228" /> -<sizeparam width="190" height="102" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="695" y="224" /> +<sizeparam width="189" height="102" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="0" maxX="271" minY="0" maxY="256" /> -<infoparam name="Block1" value="CoffeeButton" /> +<cdrectangleparam minX="0" maxX="272" minY="0" maxY="256" /> +<infoparam name="Block1" value="TeaButton" /> <TGConnectingPoint num="0" id="714" /> <TGConnectingPoint num="1" id="715" /> <TGConnectingPoint num="2" id="716" /> @@ -1418,8 +1418,8 @@ <TGConnectingPoint num="23" id="737" /> <extraparam> <CryptoBlock value="false" /> -<Attribute access="0" id="mechanicalDelay" value="80" type="8" typeOther="" /> -<Signal value="out push()" attached="false" /> +<Attribute access="0" id="mechanicalDelay" value="10" type="8" typeOther="" /> +<Signal value="out push()" attached="true" /> </extraparam> </SUBCOMPONENT> @@ -1438,7 +1438,7 @@ </CONNECTOR><SUBCOMPONENT type="-1" id="768" > <father id="770" num="0" /> <cdparam x="493" y="251" /> -<sizeparam width="173" height="30" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<sizeparam width="161" height="30" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="List of all parameters of an Avatar SMD transition" value="" /> @@ -1452,6 +1452,7 @@ <afterMax value="" /> <computeMin value="" /> <computeMax value="" /> +<probability value="" /> <actions value="nbOfCoins = nbOfCoins + x" /> <actions value="contentOfWallet(nbOfCoins)" /> </extraparam> @@ -1482,6 +1483,7 @@ <afterMax value="" /> <computeMin value="" /> <computeMax value="" /> +<probability value="" /> </extraparam> </SUBCOMPONENT> @@ -1495,8 +1497,8 @@ <AutomaticDrawing data="true" /> </CONNECTOR><SUBCOMPONENT type="-1" id="782" > <father id="784" num="0" /> -<cdparam x="163" y="252" /> -<sizeparam width="221" height="45" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="175" y="246" /> +<sizeparam width="205" height="60" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="List of all parameters of an Avatar SMD transition" value="" /> @@ -1510,6 +1512,7 @@ <afterMax value="maxUserDelay" /> <computeMin value="" /> <computeMax value="" /> +<probability value="0.99" /> <actions value="nbOfCoins = nbOfCoins - x" /> <actions value="contentOfWallet(nbOfCoins)" /> </extraparam> @@ -1526,7 +1529,7 @@ </CONNECTOR><SUBCOMPONENT type="-1" id="789" > <father id="791" num="0" /> <cdparam x="220" y="174" /> -<sizeparam width="99" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<sizeparam width="93" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="List of all parameters of an Avatar SMD transition" value="" /> @@ -1540,6 +1543,7 @@ <afterMax value="" /> <computeMin value="" /> <computeMax value="" /> +<probability value="" /> </extraparam> </SUBCOMPONENT> @@ -1554,7 +1558,7 @@ </CONNECTOR><SUBCOMPONENT type="-1" id="796" > <father id="798" num="0" /> <cdparam x="376" y="105" /> -<sizeparam width="173" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<sizeparam width="156" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="List of all parameters of an Avatar SMD transition" value="" /> @@ -1568,13 +1572,14 @@ <afterMax value="" /> <computeMin value="" /> <computeMax value="" /> +<probability value="" /> <actions value="contentOfWallet(nbOfCoins)" /> </extraparam> </SUBCOMPONENT> <COMPONENT type="5103" id="809" > -<cdparam x="214" y="206" /> -<sizeparam width="74" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="217" y="206" /> +<sizeparam width="69" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="Send signal" value="putCoin(x)" /> @@ -1591,8 +1596,8 @@ </COMPONENT> <COMPONENT type="5104" id="820" > -<cdparam x="444" y="194" /> -<sizeparam width="82" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="447" y="194" /> +<sizeparam width="76" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="Receive signal" value="getCoin(x)" /> @@ -1796,6 +1801,7 @@ <afterMax value="" /> <computeMin value="" /> <computeMax value="" /> +<probability value="" /> </extraparam> </SUBCOMPONENT> @@ -1804,13 +1810,13 @@ <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector from Send signal to stop state" value="null" /> <TGConnectingPoint num="0" id="958" /> -<P1 x="437" y="525" id="1292" /> +<P1 x="437" y="525" id="1357" /> <P2 x="323" y="748" id="1218" /> <AutomaticDrawing data="true" /> </CONNECTOR><SUBCOMPONENT type="-1" id="957" > <father id="959" num="0" /> <cdparam x="420" y="552" /> -<sizeparam width="89" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<sizeparam width="85" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> <infoparam name="List of all parameters of an Avatar SMD transition" value="" /> @@ -1824,6 +1830,7 @@ <afterMax value="" /> <computeMin value="" /> <computeMax value="" /> +<probability value="" /> <actions value="nbOfCoins = 0" /> </extraparam> </SUBCOMPONENT> @@ -1833,13 +1840,13 @@ <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector from state0 to Send signal" value="null" /> <TGConnectingPoint num="0" id="965" /> -<P1 x="321" y="455" id="1319" /> -<P2 x="437" y="495" id="1291" /> +<P1 x="321" y="455" id="1306" /> +<P2 x="437" y="495" id="1356" /> <AutomaticDrawing data="true" /> </CONNECTOR><SUBCOMPONENT type="-1" id="964" > <father id="966" num="0" /> <cdparam x="395" y="448" /> -<sizeparam width="104" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<sizeparam width="94" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> <infoparam name="List of all parameters of an Avatar SMD transition" value="" /> @@ -1853,6 +1860,7 @@ <afterMax value="" /> <computeMin value="" /> <computeMax value="" /> +<probability value="" /> </extraparam> </SUBCOMPONENT> @@ -1861,13 +1869,13 @@ <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector from Send signal to stop state" value="null" /> <TGConnectingPoint num="0" id="972" /> -<P1 x="293" y="552" id="1357" /> +<P1 x="293" y="552" id="1292" /> <P2 x="289" y="748" id="1210" /> <AutomaticDrawing data="true" /> </CONNECTOR><SUBCOMPONENT type="-1" id="971" > <father id="973" num="0" /> <cdparam x="284" y="594" /> -<sizeparam width="248" height="45" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<sizeparam width="228" height="45" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="List of all parameters of an Avatar SMD transition" value="" /> @@ -1881,6 +1889,7 @@ <afterMax value="" /> <computeMin value="teaMinDelay" /> <computeMax value="teaMaxDelay" /> +<probability value="" /> <actions value="nbOfCoins = 0" /> <actions value="beverageReady()" /> </extraparam> @@ -1891,8 +1900,8 @@ <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector from state0 to Send signal" value="null" /> <TGConnectingPoint num="0" id="979" /> -<P1 x="288" y="475" id="1330" /> -<P2 x="293" y="522" id="1356" /> +<P1 x="288" y="475" id="1317" /> +<P2 x="293" y="522" id="1291" /> <AutomaticDrawing data="true" /> </CONNECTOR><SUBCOMPONENT type="-1" id="978" > <father id="980" num="0" /> @@ -1911,6 +1920,7 @@ <afterMax value="" /> <computeMin value="" /> <computeMax value="" /> +<probability value="" /> </extraparam> </SUBCOMPONENT> @@ -1919,13 +1929,13 @@ <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector from Send signal to stop state" value="null" /> <TGConnectingPoint num="0" id="986" /> -<P1 x="121" y="552" id="1303" /> +<P1 x="121" y="552" id="1346" /> <P2 x="255" y="748" id="1217" /> <AutomaticDrawing data="true" /> </CONNECTOR><SUBCOMPONENT type="-1" id="985" > <father id="987" num="0" /> <cdparam x="32" y="587" /> -<sizeparam width="284" height="45" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<sizeparam width="262" height="45" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="List of all parameters of an Avatar SMD transition" value="" /> @@ -1939,6 +1949,7 @@ <afterMax value="" /> <computeMin value="coffeeMinDelay" /> <computeMax value="coffeeMaxDelay" /> +<probability value="" /> <actions value="nbOfCoins = 0" /> <actions value="beverageReady()" /> </extraparam> @@ -1949,8 +1960,8 @@ <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector from state0 to Send signal" value="null" /> <TGConnectingPoint num="0" id="993" /> -<P1 x="222" y="475" id="1329" /> -<P2 x="121" y="522" id="1302" /> +<P1 x="222" y="475" id="1316" /> +<P2 x="121" y="522" id="1345" /> <AutomaticDrawing data="true" /> </CONNECTOR><SUBCOMPONENT type="-1" id="992" > <father id="994" num="0" /> @@ -1969,6 +1980,7 @@ <afterMax value="" /> <computeMin value="" /> <computeMax value="" /> +<probability value="" /> </extraparam> </SUBCOMPONENT> @@ -1977,8 +1989,8 @@ <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector from start state to state0" value="null" /> <TGConnectingPoint num="0" id="1000" /> -<P1 x="256" y="419" id="1313" /> -<P2 x="255" y="435" id="1316" /> +<P1 x="256" y="419" id="1343" /> +<P2 x="255" y="435" id="1303" /> <AutomaticDrawing data="true" /> </CONNECTOR><SUBCOMPONENT type="-1" id="999" > <father id="1001" num="0" /> @@ -1997,6 +2009,7 @@ <afterMax value="" /> <computeMin value="" /> <computeMax value="" /> +<probability value="" /> </extraparam> </SUBCOMPONENT> @@ -2011,7 +2024,7 @@ </CONNECTOR><SUBCOMPONENT type="-1" id="1006" > <father id="1008" num="0" /> <cdparam x="707" y="368" /> -<sizeparam width="89" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<sizeparam width="85" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="List of all parameters of an Avatar SMD transition" value="" /> @@ -2025,6 +2038,7 @@ <afterMax value="" /> <computeMin value="" /> <computeMax value="" /> +<probability value="" /> <actions value="nbOfCoins = 0" /> </extraparam> </SUBCOMPONENT> @@ -2040,7 +2054,7 @@ </CONNECTOR><SUBCOMPONENT type="-1" id="1013" > <father id="1015" num="0" /> <cdparam x="411" y="206" /> -<sizeparam width="104" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<sizeparam width="94" height="30" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="List of all parameters of an Avatar SMD transition" value="" /> @@ -2054,6 +2068,7 @@ <afterMax value="" /> <computeMin value="" /> <computeMax value="" /> +<probability value="0.1" /> </extraparam> </SUBCOMPONENT> @@ -2082,6 +2097,7 @@ <afterMax value="" /> <computeMin value="" /> <computeMax value="" /> +<probability value="" /> </extraparam> </SUBCOMPONENT> @@ -2110,6 +2126,7 @@ <afterMax value="" /> <computeMin value="" /> <computeMax value="" /> +<probability value="" /> </extraparam> </SUBCOMPONENT> @@ -2124,7 +2141,7 @@ </CONNECTOR><SUBCOMPONENT type="-1" id="1034" > <father id="1036" num="0" /> <cdparam x="328" y="178" /> -<sizeparam width="168" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<sizeparam width="161" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="List of all parameters of an Avatar SMD transition" value="" /> @@ -2138,6 +2155,7 @@ <afterMax value="" /> <computeMin value="" /> <computeMax value="" /> +<probability value="" /> <actions value="nbOfCoins = nbOfCoins + x" /> </extraparam> </SUBCOMPONENT> @@ -2167,6 +2185,7 @@ <afterMax value="" /> <computeMin value="" /> <computeMax value="" /> +<probability value="" /> </extraparam> </SUBCOMPONENT> @@ -2195,12 +2214,13 @@ <afterMax value="" /> <computeMin value="" /> <computeMax value="" /> +<probability value="" /> </extraparam> </SUBCOMPONENT> <COMPONENT type="5104" id="1061" > -<cdparam x="265" y="141" /> -<sizeparam width="82" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="268" y="141" /> +<sizeparam width="76" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> <infoparam name="Receive signal" value="getCoin(x)" /> @@ -2217,8 +2237,8 @@ </COMPONENT> <COMPONENT type="5103" id="1072" > -<cdparam x="629" y="321" /> -<sizeparam width="141" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="634" y="321" /> +<sizeparam width="130" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> <infoparam name="Send signal" value="ejectCoin(nbOfCoins)" /> @@ -2235,8 +2255,8 @@ </COMPONENT> <COMPONENT type="5104" id="1083" > -<cdparam x="236" y="280" /> -<sizeparam width="82" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="239" y="280" /> +<sizeparam width="76" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> <infoparam name="Receive signal" value="getCoin(x)" /> @@ -2561,13 +2581,13 @@ <extraparam> </extraparam> </COMPONENT> -<SUBCOMPONENT type="5103" id="1301" > +<SUBCOMPONENT type="5104" id="1301" > <father id="1407" num="0" /> -<cdparam x="367" y="500" /> -<sizeparam width="141" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="237" y="527" /> +<sizeparam width="112" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="0" maxX="447" minY="0" maxY="334" /> -<infoparam name="Send signal" value="ejectCoin(nbOfCoins)" /> +<cdrectangleparam minX="0" maxX="465" minY="0" maxY="334" /> +<infoparam name="Send signal" value="pushTeaButton()" /> <TGConnectingPoint num="0" id="1291" /> <TGConnectingPoint num="1" id="1292" /> <TGConnectingPoint num="2" id="1293" /> @@ -2580,13 +2600,13 @@ <TGConnectingPoint num="9" id="1300" /> <accessibility /> </SUBCOMPONENT> -<SUBCOMPONENT type="5104" id="1312" > +<SUBCOMPONENT type="5106" id="1342" > <father id="1407" num="1" /> -<cdparam x="51" y="527" /> -<sizeparam width="141" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="189" y="435" /> +<sizeparam width="132" height="40" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="0" maxX="450" minY="0" maxY="334" /> -<infoparam name="Send signal" value="pushCoffeeButton()" /> +<cdrectangleparam minX="0" maxX="445" minY="0" maxY="314" /> +<infoparam name="state0" value="WaitingForSelection" /> <TGConnectingPoint num="0" id="1302" /> <TGConnectingPoint num="1" id="1303" /> <TGConnectingPoint num="2" id="1304" /> @@ -2597,74 +2617,74 @@ <TGConnectingPoint num="7" id="1309" /> <TGConnectingPoint num="8" id="1310" /> <TGConnectingPoint num="9" id="1311" /> -<accessibility /> -</SUBCOMPONENT> -<SUBCOMPONENT type="5100" id="1314" > +<TGConnectingPoint num="10" id="1312" /> +<TGConnectingPoint num="11" id="1313" /> +<TGConnectingPoint num="12" id="1314" /> +<TGConnectingPoint num="13" id="1315" /> +<TGConnectingPoint num="14" id="1316" /> +<TGConnectingPoint num="15" id="1317" /> +<TGConnectingPoint num="16" id="1318" /> +<TGConnectingPoint num="17" id="1319" /> +<TGConnectingPoint num="18" id="1320" /> +<TGConnectingPoint num="19" id="1321" /> +<TGConnectingPoint num="20" id="1322" /> +<TGConnectingPoint num="21" id="1323" /> +<TGConnectingPoint num="22" id="1324" /> +<TGConnectingPoint num="23" id="1325" /> +<TGConnectingPoint num="24" id="1326" /> +<TGConnectingPoint num="25" id="1327" /> +<TGConnectingPoint num="26" id="1328" /> +<TGConnectingPoint num="27" id="1329" /> +<TGConnectingPoint num="28" id="1330" /> +<TGConnectingPoint num="29" id="1331" /> +<TGConnectingPoint num="30" id="1332" /> +<TGConnectingPoint num="31" id="1333" /> +<TGConnectingPoint num="32" id="1334" /> +<TGConnectingPoint num="33" id="1335" /> +<TGConnectingPoint num="34" id="1336" /> +<TGConnectingPoint num="35" id="1337" /> +<TGConnectingPoint num="36" id="1338" /> +<TGConnectingPoint num="37" id="1339" /> +<TGConnectingPoint num="38" id="1340" /> +<TGConnectingPoint num="39" id="1341" /> +<extraparam> +</extraparam> +</SUBCOMPONENT> +<SUBCOMPONENT type="5100" id="1344" > <father id="1407" num="2" /> <cdparam x="249" y="399" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="0" maxX="562" minY="0" maxY="339" /> <infoparam name="start state" value="null" /> -<TGConnectingPoint num="0" id="1313" /> +<TGConnectingPoint num="0" id="1343" /> </SUBCOMPONENT> -<SUBCOMPONENT type="5106" id="1355" > +<SUBCOMPONENT type="5104" id="1355" > <father id="1407" num="3" /> -<cdparam x="189" y="435" /> -<sizeparam width="132" height="40" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="58" y="527" /> +<sizeparam width="127" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="0" maxX="445" minY="0" maxY="314" /> -<infoparam name="state0" value="WaitingForSelection" /> -<TGConnectingPoint num="0" id="1315" /> -<TGConnectingPoint num="1" id="1316" /> -<TGConnectingPoint num="2" id="1317" /> -<TGConnectingPoint num="3" id="1318" /> -<TGConnectingPoint num="4" id="1319" /> -<TGConnectingPoint num="5" id="1320" /> -<TGConnectingPoint num="6" id="1321" /> -<TGConnectingPoint num="7" id="1322" /> -<TGConnectingPoint num="8" id="1323" /> -<TGConnectingPoint num="9" id="1324" /> -<TGConnectingPoint num="10" id="1325" /> -<TGConnectingPoint num="11" id="1326" /> -<TGConnectingPoint num="12" id="1327" /> -<TGConnectingPoint num="13" id="1328" /> -<TGConnectingPoint num="14" id="1329" /> -<TGConnectingPoint num="15" id="1330" /> -<TGConnectingPoint num="16" id="1331" /> -<TGConnectingPoint num="17" id="1332" /> -<TGConnectingPoint num="18" id="1333" /> -<TGConnectingPoint num="19" id="1334" /> -<TGConnectingPoint num="20" id="1335" /> -<TGConnectingPoint num="21" id="1336" /> -<TGConnectingPoint num="22" id="1337" /> -<TGConnectingPoint num="23" id="1338" /> -<TGConnectingPoint num="24" id="1339" /> -<TGConnectingPoint num="25" id="1340" /> -<TGConnectingPoint num="26" id="1341" /> -<TGConnectingPoint num="27" id="1342" /> -<TGConnectingPoint num="28" id="1343" /> -<TGConnectingPoint num="29" id="1344" /> -<TGConnectingPoint num="30" id="1345" /> -<TGConnectingPoint num="31" id="1346" /> -<TGConnectingPoint num="32" id="1347" /> -<TGConnectingPoint num="33" id="1348" /> -<TGConnectingPoint num="34" id="1349" /> -<TGConnectingPoint num="35" id="1350" /> -<TGConnectingPoint num="36" id="1351" /> -<TGConnectingPoint num="37" id="1352" /> -<TGConnectingPoint num="38" id="1353" /> -<TGConnectingPoint num="39" id="1354" /> -<extraparam> -</extraparam> +<cdrectangleparam minX="0" maxX="450" minY="0" maxY="334" /> +<infoparam name="Send signal" value="pushCoffeeButton()" /> +<TGConnectingPoint num="0" id="1345" /> +<TGConnectingPoint num="1" id="1346" /> +<TGConnectingPoint num="2" id="1347" /> +<TGConnectingPoint num="3" id="1348" /> +<TGConnectingPoint num="4" id="1349" /> +<TGConnectingPoint num="5" id="1350" /> +<TGConnectingPoint num="6" id="1351" /> +<TGConnectingPoint num="7" id="1352" /> +<TGConnectingPoint num="8" id="1353" /> +<TGConnectingPoint num="9" id="1354" /> +<accessibility /> </SUBCOMPONENT> -<SUBCOMPONENT type="5104" id="1366" > +<SUBCOMPONENT type="5103" id="1366" > <father id="1407" num="4" /> -<cdparam x="231" y="527" /> -<sizeparam width="124" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="372" y="500" /> +<sizeparam width="130" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="0" maxX="465" minY="0" maxY="334" /> -<infoparam name="Send signal" value="pushTeaButton()" /> +<cdrectangleparam minX="0" maxX="447" minY="0" maxY="334" /> +<infoparam name="Send signal" value="ejectCoin(nbOfCoins)" /> <TGConnectingPoint num="0" id="1356" /> <TGConnectingPoint num="1" id="1357" /> <TGConnectingPoint num="2" id="1358" /> @@ -2681,19 +2701,19 @@ </AVATARStateMachineDiagramPanel> -<AVATARStateMachineDiagramPanel name="CoffeeButton" minX="10" maxX="1400" minY="10" maxY="900" > +<AVATARStateMachineDiagramPanel name="TeaButton" minX="10" maxX="1400" minY="10" maxY="900" > <CONNECTOR type="5102" id="1414" > -<cdparam x="177" y="199" /> +<cdparam x="363" y="193" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector from start state to Send signal" value="null" /> +<infoparam name="connector from Send signal to state0" value="null" /> <TGConnectingPoint num="0" id="1413" /> -<P1 x="340" y="233" id="1520" /> -<P2 x="353" y="252" id="1522" /> +<P1 x="363" y="204" id="1430" /> +<P2 x="362" y="257" id="1441" /> <AutomaticDrawing data="true" /> </CONNECTOR><SUBCOMPONENT type="-1" id="1412" > <father id="1414" num="0" /> -<cdparam x="177" y="239" /> -<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="380" y="228" /> +<sizeparam width="135" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="List of all parameters of an Avatar SMD transition" value="" /> @@ -2703,24 +2723,25 @@ <TGConnectingPoint num="3" id="1411" /> <extraparam> <guard value="[ ]" /> -<afterMin value="" /> +<afterMin value="mechanicalDelay" /> <afterMax value="" /> <computeMin value="" /> <computeMax value="" /> +<probability value="" /> </extraparam> </SUBCOMPONENT> <CONNECTOR type="5102" id="1421" > -<cdparam x="322" y="69" /> +<cdparam x="363" y="150" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector from start state to state0" value="null" /> +<infoparam name="connector from state0 to Send signal" value="null" /> <TGConnectingPoint num="0" id="1420" /> -<P1 x="322" y="69" id="1518" /> -<P2 x="323" y="88" id="1478" /> +<P1 x="363" y="150" id="1487" /> +<P2 x="363" y="174" id="1429" /> <AutomaticDrawing data="true" /> </CONNECTOR><SUBCOMPONENT type="-1" id="1419" > <father id="1421" num="0" /> -<cdparam x="322" y="109" /> +<cdparam x="363" y="190" /> <sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> @@ -2735,20 +2756,21 @@ <afterMax value="" /> <computeMin value="" /> <computeMax value="" /> +<probability value="" /> </extraparam> </SUBCOMPONENT> <CONNECTOR type="5102" id="1428" > -<cdparam x="377" y="144" /> +<cdparam x="362" y="101" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector from state0 to Send signal" value="null" /> +<infoparam name="connector from start state to state0" value="null" /> <TGConnectingPoint num="0" id="1427" /> -<P1 x="323" y="118" id="1483" /> -<P2 x="356" y="174" id="1534" /> +<P1 x="362" y="101" id="1522" /> +<P2 x="363" y="120" id="1482" /> <AutomaticDrawing data="true" /> </CONNECTOR><SUBCOMPONENT type="-1" id="1426" > <father id="1428" num="0" /> -<cdparam x="377" y="184" /> +<cdparam x="362" y="141" /> <sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> @@ -2763,2293 +2785,443 @@ <afterMax value="" /> <computeMin value="" /> <computeMax value="" /> +<probability value="" /> </extraparam> </SUBCOMPONENT> -<CONNECTOR type="5102" id="1435" > -<cdparam x="377" y="187" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector from Send signal to state0" value="null" /> -<TGConnectingPoint num="0" id="1434" /> -<P1 x="353" y="282" id="1523" /> -<P2 x="399" y="352" id="1437" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="1433" > -<father id="1435" num="0" /> -<cdparam x="417" y="335" /> -<sizeparam width="149" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<COMPONENT type="5103" id="1439" > +<cdparam x="340" y="179" /> +<sizeparam width="46" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<infoparam name="Send signal" value="push()" /> <TGConnectingPoint num="0" id="1429" /> <TGConnectingPoint num="1" id="1430" /> <TGConnectingPoint num="2" id="1431" /> <TGConnectingPoint num="3" id="1432" /> -<extraparam> -<guard value="[ ]" /> -<afterMin value="mechanicalDelay" /> -<afterMax value="" /> -<computeMin value="" /> -<computeMax value="" /> -</extraparam> -</SUBCOMPONENT> +<TGConnectingPoint num="4" id="1433" /> +<TGConnectingPoint num="5" id="1434" /> +<TGConnectingPoint num="6" id="1435" /> +<TGConnectingPoint num="7" id="1436" /> +<TGConnectingPoint num="8" id="1437" /> +<TGConnectingPoint num="9" id="1438" /> +</COMPONENT> -<COMPONENT type="5106" id="1476" > -<cdparam x="374" y="352" /> +<COMPONENT type="5106" id="1480" > +<cdparam x="337" y="257" /> <sizeparam width="50" height="30" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="state0" value="main" /> -<TGConnectingPoint num="0" id="1436" /> -<TGConnectingPoint num="1" id="1437" /> -<TGConnectingPoint num="2" id="1438" /> -<TGConnectingPoint num="3" id="1439" /> -<TGConnectingPoint num="4" id="1440" /> -<TGConnectingPoint num="5" id="1441" /> -<TGConnectingPoint num="6" id="1442" /> -<TGConnectingPoint num="7" id="1443" /> -<TGConnectingPoint num="8" id="1444" /> -<TGConnectingPoint num="9" id="1445" /> -<TGConnectingPoint num="10" id="1446" /> -<TGConnectingPoint num="11" id="1447" /> -<TGConnectingPoint num="12" id="1448" /> -<TGConnectingPoint num="13" id="1449" /> -<TGConnectingPoint num="14" id="1450" /> -<TGConnectingPoint num="15" id="1451" /> -<TGConnectingPoint num="16" id="1452" /> -<TGConnectingPoint num="17" id="1453" /> -<TGConnectingPoint num="18" id="1454" /> -<TGConnectingPoint num="19" id="1455" /> -<TGConnectingPoint num="20" id="1456" /> -<TGConnectingPoint num="21" id="1457" /> -<TGConnectingPoint num="22" id="1458" /> -<TGConnectingPoint num="23" id="1459" /> -<TGConnectingPoint num="24" id="1460" /> -<TGConnectingPoint num="25" id="1461" /> -<TGConnectingPoint num="26" id="1462" /> -<TGConnectingPoint num="27" id="1463" /> -<TGConnectingPoint num="28" id="1464" /> -<TGConnectingPoint num="29" id="1465" /> -<TGConnectingPoint num="30" id="1466" /> -<TGConnectingPoint num="31" id="1467" /> -<TGConnectingPoint num="32" id="1468" /> -<TGConnectingPoint num="33" id="1469" /> -<TGConnectingPoint num="34" id="1470" /> -<TGConnectingPoint num="35" id="1471" /> -<TGConnectingPoint num="36" id="1472" /> -<TGConnectingPoint num="37" id="1473" /> -<TGConnectingPoint num="38" id="1474" /> -<TGConnectingPoint num="39" id="1475" /> -<extraparam> -</extraparam> -</COMPONENT> - -<COMPONENT type="5106" id="1517" > -<cdparam x="298" y="88" /> +<TGConnectingPoint num="0" id="1440" /> +<TGConnectingPoint num="1" id="1441" /> +<TGConnectingPoint num="2" id="1442" /> +<TGConnectingPoint num="3" id="1443" /> +<TGConnectingPoint num="4" id="1444" /> +<TGConnectingPoint num="5" id="1445" /> +<TGConnectingPoint num="6" id="1446" /> +<TGConnectingPoint num="7" id="1447" /> +<TGConnectingPoint num="8" id="1448" /> +<TGConnectingPoint num="9" id="1449" /> +<TGConnectingPoint num="10" id="1450" /> +<TGConnectingPoint num="11" id="1451" /> +<TGConnectingPoint num="12" id="1452" /> +<TGConnectingPoint num="13" id="1453" /> +<TGConnectingPoint num="14" id="1454" /> +<TGConnectingPoint num="15" id="1455" /> +<TGConnectingPoint num="16" id="1456" /> +<TGConnectingPoint num="17" id="1457" /> +<TGConnectingPoint num="18" id="1458" /> +<TGConnectingPoint num="19" id="1459" /> +<TGConnectingPoint num="20" id="1460" /> +<TGConnectingPoint num="21" id="1461" /> +<TGConnectingPoint num="22" id="1462" /> +<TGConnectingPoint num="23" id="1463" /> +<TGConnectingPoint num="24" id="1464" /> +<TGConnectingPoint num="25" id="1465" /> +<TGConnectingPoint num="26" id="1466" /> +<TGConnectingPoint num="27" id="1467" /> +<TGConnectingPoint num="28" id="1468" /> +<TGConnectingPoint num="29" id="1469" /> +<TGConnectingPoint num="30" id="1470" /> +<TGConnectingPoint num="31" id="1471" /> +<TGConnectingPoint num="32" id="1472" /> +<TGConnectingPoint num="33" id="1473" /> +<TGConnectingPoint num="34" id="1474" /> +<TGConnectingPoint num="35" id="1475" /> +<TGConnectingPoint num="36" id="1476" /> +<TGConnectingPoint num="37" id="1477" /> +<TGConnectingPoint num="38" id="1478" /> +<TGConnectingPoint num="39" id="1479" /> +<extraparam> +</extraparam> +</COMPONENT> + +<COMPONENT type="5106" id="1521" > +<cdparam x="338" y="120" /> <sizeparam width="50" height="30" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="state0" value="main" /> -<TGConnectingPoint num="0" id="1477" /> -<TGConnectingPoint num="1" id="1478" /> -<TGConnectingPoint num="2" id="1479" /> -<TGConnectingPoint num="3" id="1480" /> -<TGConnectingPoint num="4" id="1481" /> -<TGConnectingPoint num="5" id="1482" /> -<TGConnectingPoint num="6" id="1483" /> -<TGConnectingPoint num="7" id="1484" /> -<TGConnectingPoint num="8" id="1485" /> -<TGConnectingPoint num="9" id="1486" /> -<TGConnectingPoint num="10" id="1487" /> -<TGConnectingPoint num="11" id="1488" /> -<TGConnectingPoint num="12" id="1489" /> -<TGConnectingPoint num="13" id="1490" /> -<TGConnectingPoint num="14" id="1491" /> -<TGConnectingPoint num="15" id="1492" /> -<TGConnectingPoint num="16" id="1493" /> -<TGConnectingPoint num="17" id="1494" /> -<TGConnectingPoint num="18" id="1495" /> -<TGConnectingPoint num="19" id="1496" /> -<TGConnectingPoint num="20" id="1497" /> -<TGConnectingPoint num="21" id="1498" /> -<TGConnectingPoint num="22" id="1499" /> -<TGConnectingPoint num="23" id="1500" /> -<TGConnectingPoint num="24" id="1501" /> -<TGConnectingPoint num="25" id="1502" /> -<TGConnectingPoint num="26" id="1503" /> -<TGConnectingPoint num="27" id="1504" /> -<TGConnectingPoint num="28" id="1505" /> -<TGConnectingPoint num="29" id="1506" /> -<TGConnectingPoint num="30" id="1507" /> -<TGConnectingPoint num="31" id="1508" /> -<TGConnectingPoint num="32" id="1509" /> -<TGConnectingPoint num="33" id="1510" /> -<TGConnectingPoint num="34" id="1511" /> -<TGConnectingPoint num="35" id="1512" /> -<TGConnectingPoint num="36" id="1513" /> -<TGConnectingPoint num="37" id="1514" /> -<TGConnectingPoint num="38" id="1515" /> -<TGConnectingPoint num="39" id="1516" /> -<extraparam> -</extraparam> -</COMPONENT> - -<COMPONENT type="5100" id="1519" > -<cdparam x="315" y="49" /> +<TGConnectingPoint num="0" id="1481" /> +<TGConnectingPoint num="1" id="1482" /> +<TGConnectingPoint num="2" id="1483" /> +<TGConnectingPoint num="3" id="1484" /> +<TGConnectingPoint num="4" id="1485" /> +<TGConnectingPoint num="5" id="1486" /> +<TGConnectingPoint num="6" id="1487" /> +<TGConnectingPoint num="7" id="1488" /> +<TGConnectingPoint num="8" id="1489" /> +<TGConnectingPoint num="9" id="1490" /> +<TGConnectingPoint num="10" id="1491" /> +<TGConnectingPoint num="11" id="1492" /> +<TGConnectingPoint num="12" id="1493" /> +<TGConnectingPoint num="13" id="1494" /> +<TGConnectingPoint num="14" id="1495" /> +<TGConnectingPoint num="15" id="1496" /> +<TGConnectingPoint num="16" id="1497" /> +<TGConnectingPoint num="17" id="1498" /> +<TGConnectingPoint num="18" id="1499" /> +<TGConnectingPoint num="19" id="1500" /> +<TGConnectingPoint num="20" id="1501" /> +<TGConnectingPoint num="21" id="1502" /> +<TGConnectingPoint num="22" id="1503" /> +<TGConnectingPoint num="23" id="1504" /> +<TGConnectingPoint num="24" id="1505" /> +<TGConnectingPoint num="25" id="1506" /> +<TGConnectingPoint num="26" id="1507" /> +<TGConnectingPoint num="27" id="1508" /> +<TGConnectingPoint num="28" id="1509" /> +<TGConnectingPoint num="29" id="1510" /> +<TGConnectingPoint num="30" id="1511" /> +<TGConnectingPoint num="31" id="1512" /> +<TGConnectingPoint num="32" id="1513" /> +<TGConnectingPoint num="33" id="1514" /> +<TGConnectingPoint num="34" id="1515" /> +<TGConnectingPoint num="35" id="1516" /> +<TGConnectingPoint num="36" id="1517" /> +<TGConnectingPoint num="37" id="1518" /> +<TGConnectingPoint num="38" id="1519" /> +<TGConnectingPoint num="39" id="1520" /> +<extraparam> +</extraparam> +</COMPONENT> + +<COMPONENT type="5100" id="1523" > +<cdparam x="355" y="81" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="start state" value="null" /> -<TGConnectingPoint num="0" id="1518" /> -</COMPONENT> - -<COMPONENT type="5106" id="1573" > -<cdparam x="264" y="174" /> -<sizeparam width="184" height="130" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="state0" value="state0" /> -<TGConnectingPoint num="0" id="1533" /> -<TGConnectingPoint num="1" id="1534" /> -<TGConnectingPoint num="2" id="1535" /> -<TGConnectingPoint num="3" id="1536" /> -<TGConnectingPoint num="4" id="1537" /> -<TGConnectingPoint num="5" id="1538" /> -<TGConnectingPoint num="6" id="1539" /> -<TGConnectingPoint num="7" id="1540" /> -<TGConnectingPoint num="8" id="1541" /> -<TGConnectingPoint num="9" id="1542" /> -<TGConnectingPoint num="10" id="1543" /> -<TGConnectingPoint num="11" id="1544" /> -<TGConnectingPoint num="12" id="1545" /> -<TGConnectingPoint num="13" id="1546" /> -<TGConnectingPoint num="14" id="1547" /> -<TGConnectingPoint num="15" id="1548" /> -<TGConnectingPoint num="16" id="1549" /> -<TGConnectingPoint num="17" id="1550" /> -<TGConnectingPoint num="18" id="1551" /> -<TGConnectingPoint num="19" id="1552" /> -<TGConnectingPoint num="20" id="1553" /> -<TGConnectingPoint num="21" id="1554" /> -<TGConnectingPoint num="22" id="1555" /> -<TGConnectingPoint num="23" id="1556" /> -<TGConnectingPoint num="24" id="1557" /> -<TGConnectingPoint num="25" id="1558" /> -<TGConnectingPoint num="26" id="1559" /> -<TGConnectingPoint num="27" id="1560" /> -<TGConnectingPoint num="28" id="1561" /> -<TGConnectingPoint num="29" id="1562" /> -<TGConnectingPoint num="30" id="1563" /> -<TGConnectingPoint num="31" id="1564" /> -<TGConnectingPoint num="32" id="1565" /> -<TGConnectingPoint num="33" id="1566" /> -<TGConnectingPoint num="34" id="1567" /> -<TGConnectingPoint num="35" id="1568" /> -<TGConnectingPoint num="36" id="1569" /> -<TGConnectingPoint num="37" id="1570" /> -<TGConnectingPoint num="38" id="1571" /> -<TGConnectingPoint num="39" id="1572" /> -<extraparam> -</extraparam> -</COMPONENT> -<SUBCOMPONENT type="5100" id="1521" > -<father id="1573" num="0" /> -<cdparam x="333" y="213" /> -<sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="0" maxX="169" minY="0" maxY="115" /> -<infoparam name="start state" value="null" /> -<TGConnectingPoint num="0" id="1520" /> -</SUBCOMPONENT> -<SUBCOMPONENT type="5103" id="1532" > -<father id="1573" num="1" /> -<cdparam x="328" y="257" /> -<sizeparam width="51" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="0" maxX="138" minY="0" maxY="110" /> -<infoparam name="Send signal" value="push()" /> <TGConnectingPoint num="0" id="1522" /> -<TGConnectingPoint num="1" id="1523" /> -<TGConnectingPoint num="2" id="1524" /> -<TGConnectingPoint num="3" id="1525" /> -<TGConnectingPoint num="4" id="1526" /> -<TGConnectingPoint num="5" id="1527" /> -<TGConnectingPoint num="6" id="1528" /> -<TGConnectingPoint num="7" id="1529" /> -<TGConnectingPoint num="8" id="1530" /> -<TGConnectingPoint num="9" id="1531" /> -</SUBCOMPONENT> +</COMPONENT> </AVATARStateMachineDiagramPanel> -<AVATARStateMachineDiagramPanel name="TeaButton" minX="10" maxX="1400" minY="10" maxY="900" > -<CONNECTOR type="5102" id="1580" > -<cdparam x="363" y="193" /> +<AVATARStateMachineDiagramPanel name="CoffeeButton" minX="10" maxX="1400" minY="10" maxY="900" > +<CONNECTOR type="5102" id="1530" > +<cdparam x="177" y="199" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector from Send signal to state0" value="null" /> -<TGConnectingPoint num="0" id="1579" /> -<P1 x="363" y="204" id="1596" /> -<P2 x="362" y="257" id="1607" /> +<infoparam name="connector from start state to Send signal" value="null" /> +<TGConnectingPoint num="0" id="1529" /> +<P1 x="340" y="233" id="1647" /> +<P2 x="353" y="252" id="1636" /> <AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="1578" > -<father id="1580" num="0" /> -<cdparam x="380" y="228" /> -<sizeparam width="149" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="1528" > +<father id="1530" num="0" /> +<cdparam x="177" y="239" /> +<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="1574" /> -<TGConnectingPoint num="1" id="1575" /> -<TGConnectingPoint num="2" id="1576" /> -<TGConnectingPoint num="3" id="1577" /> +<TGConnectingPoint num="0" id="1524" /> +<TGConnectingPoint num="1" id="1525" /> +<TGConnectingPoint num="2" id="1526" /> +<TGConnectingPoint num="3" id="1527" /> <extraparam> <guard value="[ ]" /> -<afterMin value="mechanicalDelay" /> +<afterMin value="" /> <afterMax value="" /> <computeMin value="" /> <computeMax value="" /> +<probability value="" /> </extraparam> </SUBCOMPONENT> -<CONNECTOR type="5102" id="1587" > -<cdparam x="363" y="150" /> +<CONNECTOR type="5102" id="1537" > +<cdparam x="322" y="69" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector from state0 to Send signal" value="null" /> -<TGConnectingPoint num="0" id="1586" /> -<P1 x="363" y="150" id="1653" /> -<P2 x="363" y="174" id="1595" /> +<infoparam name="connector from start state to state0" value="null" /> +<TGConnectingPoint num="0" id="1536" /> +<P1 x="322" y="69" id="1634" /> +<P2 x="323" y="88" id="1594" /> <AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="1585" > -<father id="1587" num="0" /> -<cdparam x="363" y="190" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="1535" > +<father id="1537" num="0" /> +<cdparam x="322" y="109" /> <sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="1581" /> -<TGConnectingPoint num="1" id="1582" /> -<TGConnectingPoint num="2" id="1583" /> -<TGConnectingPoint num="3" id="1584" /> +<TGConnectingPoint num="0" id="1531" /> +<TGConnectingPoint num="1" id="1532" /> +<TGConnectingPoint num="2" id="1533" /> +<TGConnectingPoint num="3" id="1534" /> <extraparam> <guard value="[ ]" /> <afterMin value="" /> <afterMax value="" /> <computeMin value="" /> <computeMax value="" /> +<probability value="" /> </extraparam> </SUBCOMPONENT> -<CONNECTOR type="5102" id="1594" > -<cdparam x="362" y="101" /> +<CONNECTOR type="5102" id="1544" > +<cdparam x="377" y="144" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector from start state to state0" value="null" /> -<TGConnectingPoint num="0" id="1593" /> -<P1 x="362" y="101" id="1688" /> -<P2 x="363" y="120" id="1648" /> +<infoparam name="connector from state0 to Send signal" value="null" /> +<TGConnectingPoint num="0" id="1543" /> +<P1 x="323" y="118" id="1599" /> +<P2 x="356" y="174" id="1650" /> <AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="1592" > -<father id="1594" num="0" /> -<cdparam x="362" y="141" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="1542" > +<father id="1544" num="0" /> +<cdparam x="377" y="184" /> <sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="1588" /> -<TGConnectingPoint num="1" id="1589" /> -<TGConnectingPoint num="2" id="1590" /> -<TGConnectingPoint num="3" id="1591" /> +<TGConnectingPoint num="0" id="1538" /> +<TGConnectingPoint num="1" id="1539" /> +<TGConnectingPoint num="2" id="1540" /> +<TGConnectingPoint num="3" id="1541" /> <extraparam> <guard value="[ ]" /> <afterMin value="" /> <afterMax value="" /> <computeMin value="" /> <computeMax value="" /> +<probability value="" /> </extraparam> </SUBCOMPONENT> -<COMPONENT type="5103" id="1605" > -<cdparam x="338" y="179" /> -<sizeparam width="51" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<CONNECTOR type="5102" id="1551" > +<cdparam x="377" y="187" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from Send signal to state0" value="null" /> +<TGConnectingPoint num="0" id="1550" /> +<P1 x="353" y="282" id="1637" /> +<P2 x="399" y="352" id="1553" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="1549" > +<father id="1551" num="0" /> +<cdparam x="417" y="335" /> +<sizeparam width="135" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="Send signal" value="push()" /> -<TGConnectingPoint num="0" id="1595" /> -<TGConnectingPoint num="1" id="1596" /> -<TGConnectingPoint num="2" id="1597" /> -<TGConnectingPoint num="3" id="1598" /> -<TGConnectingPoint num="4" id="1599" /> -<TGConnectingPoint num="5" id="1600" /> -<TGConnectingPoint num="6" id="1601" /> -<TGConnectingPoint num="7" id="1602" /> -<TGConnectingPoint num="8" id="1603" /> -<TGConnectingPoint num="9" id="1604" /> -</COMPONENT> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="1545" /> +<TGConnectingPoint num="1" id="1546" /> +<TGConnectingPoint num="2" id="1547" /> +<TGConnectingPoint num="3" id="1548" /> +<extraparam> +<guard value="[ ]" /> +<afterMin value="mechanicalDelay" /> +<afterMax value="" /> +<computeMin value="" /> +<computeMax value="" /> +<probability value="" /> +</extraparam> +</SUBCOMPONENT> -<COMPONENT type="5106" id="1646" > -<cdparam x="337" y="257" /> +<COMPONENT type="5106" id="1592" > +<cdparam x="374" y="352" /> <sizeparam width="50" height="30" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="state0" value="main" /> -<TGConnectingPoint num="0" id="1606" /> -<TGConnectingPoint num="1" id="1607" /> -<TGConnectingPoint num="2" id="1608" /> -<TGConnectingPoint num="3" id="1609" /> -<TGConnectingPoint num="4" id="1610" /> -<TGConnectingPoint num="5" id="1611" /> -<TGConnectingPoint num="6" id="1612" /> -<TGConnectingPoint num="7" id="1613" /> -<TGConnectingPoint num="8" id="1614" /> -<TGConnectingPoint num="9" id="1615" /> -<TGConnectingPoint num="10" id="1616" /> -<TGConnectingPoint num="11" id="1617" /> -<TGConnectingPoint num="12" id="1618" /> -<TGConnectingPoint num="13" id="1619" /> -<TGConnectingPoint num="14" id="1620" /> -<TGConnectingPoint num="15" id="1621" /> -<TGConnectingPoint num="16" id="1622" /> -<TGConnectingPoint num="17" id="1623" /> -<TGConnectingPoint num="18" id="1624" /> -<TGConnectingPoint num="19" id="1625" /> -<TGConnectingPoint num="20" id="1626" /> -<TGConnectingPoint num="21" id="1627" /> -<TGConnectingPoint num="22" id="1628" /> -<TGConnectingPoint num="23" id="1629" /> -<TGConnectingPoint num="24" id="1630" /> -<TGConnectingPoint num="25" id="1631" /> -<TGConnectingPoint num="26" id="1632" /> -<TGConnectingPoint num="27" id="1633" /> -<TGConnectingPoint num="28" id="1634" /> -<TGConnectingPoint num="29" id="1635" /> -<TGConnectingPoint num="30" id="1636" /> -<TGConnectingPoint num="31" id="1637" /> -<TGConnectingPoint num="32" id="1638" /> -<TGConnectingPoint num="33" id="1639" /> -<TGConnectingPoint num="34" id="1640" /> -<TGConnectingPoint num="35" id="1641" /> -<TGConnectingPoint num="36" id="1642" /> -<TGConnectingPoint num="37" id="1643" /> -<TGConnectingPoint num="38" id="1644" /> -<TGConnectingPoint num="39" id="1645" /> -<extraparam> -</extraparam> -</COMPONENT> - -<COMPONENT type="5106" id="1687" > -<cdparam x="338" y="120" /> +<TGConnectingPoint num="0" id="1552" /> +<TGConnectingPoint num="1" id="1553" /> +<TGConnectingPoint num="2" id="1554" /> +<TGConnectingPoint num="3" id="1555" /> +<TGConnectingPoint num="4" id="1556" /> +<TGConnectingPoint num="5" id="1557" /> +<TGConnectingPoint num="6" id="1558" /> +<TGConnectingPoint num="7" id="1559" /> +<TGConnectingPoint num="8" id="1560" /> +<TGConnectingPoint num="9" id="1561" /> +<TGConnectingPoint num="10" id="1562" /> +<TGConnectingPoint num="11" id="1563" /> +<TGConnectingPoint num="12" id="1564" /> +<TGConnectingPoint num="13" id="1565" /> +<TGConnectingPoint num="14" id="1566" /> +<TGConnectingPoint num="15" id="1567" /> +<TGConnectingPoint num="16" id="1568" /> +<TGConnectingPoint num="17" id="1569" /> +<TGConnectingPoint num="18" id="1570" /> +<TGConnectingPoint num="19" id="1571" /> +<TGConnectingPoint num="20" id="1572" /> +<TGConnectingPoint num="21" id="1573" /> +<TGConnectingPoint num="22" id="1574" /> +<TGConnectingPoint num="23" id="1575" /> +<TGConnectingPoint num="24" id="1576" /> +<TGConnectingPoint num="25" id="1577" /> +<TGConnectingPoint num="26" id="1578" /> +<TGConnectingPoint num="27" id="1579" /> +<TGConnectingPoint num="28" id="1580" /> +<TGConnectingPoint num="29" id="1581" /> +<TGConnectingPoint num="30" id="1582" /> +<TGConnectingPoint num="31" id="1583" /> +<TGConnectingPoint num="32" id="1584" /> +<TGConnectingPoint num="33" id="1585" /> +<TGConnectingPoint num="34" id="1586" /> +<TGConnectingPoint num="35" id="1587" /> +<TGConnectingPoint num="36" id="1588" /> +<TGConnectingPoint num="37" id="1589" /> +<TGConnectingPoint num="38" id="1590" /> +<TGConnectingPoint num="39" id="1591" /> +<extraparam> +</extraparam> +</COMPONENT> + +<COMPONENT type="5106" id="1633" > +<cdparam x="298" y="88" /> <sizeparam width="50" height="30" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="state0" value="main" /> -<TGConnectingPoint num="0" id="1647" /> -<TGConnectingPoint num="1" id="1648" /> -<TGConnectingPoint num="2" id="1649" /> -<TGConnectingPoint num="3" id="1650" /> -<TGConnectingPoint num="4" id="1651" /> -<TGConnectingPoint num="5" id="1652" /> -<TGConnectingPoint num="6" id="1653" /> -<TGConnectingPoint num="7" id="1654" /> -<TGConnectingPoint num="8" id="1655" /> -<TGConnectingPoint num="9" id="1656" /> -<TGConnectingPoint num="10" id="1657" /> -<TGConnectingPoint num="11" id="1658" /> -<TGConnectingPoint num="12" id="1659" /> -<TGConnectingPoint num="13" id="1660" /> -<TGConnectingPoint num="14" id="1661" /> -<TGConnectingPoint num="15" id="1662" /> -<TGConnectingPoint num="16" id="1663" /> -<TGConnectingPoint num="17" id="1664" /> -<TGConnectingPoint num="18" id="1665" /> -<TGConnectingPoint num="19" id="1666" /> -<TGConnectingPoint num="20" id="1667" /> -<TGConnectingPoint num="21" id="1668" /> -<TGConnectingPoint num="22" id="1669" /> -<TGConnectingPoint num="23" id="1670" /> -<TGConnectingPoint num="24" id="1671" /> -<TGConnectingPoint num="25" id="1672" /> -<TGConnectingPoint num="26" id="1673" /> -<TGConnectingPoint num="27" id="1674" /> -<TGConnectingPoint num="28" id="1675" /> -<TGConnectingPoint num="29" id="1676" /> -<TGConnectingPoint num="30" id="1677" /> -<TGConnectingPoint num="31" id="1678" /> -<TGConnectingPoint num="32" id="1679" /> -<TGConnectingPoint num="33" id="1680" /> -<TGConnectingPoint num="34" id="1681" /> -<TGConnectingPoint num="35" id="1682" /> -<TGConnectingPoint num="36" id="1683" /> -<TGConnectingPoint num="37" id="1684" /> -<TGConnectingPoint num="38" id="1685" /> -<TGConnectingPoint num="39" id="1686" /> -<extraparam> -</extraparam> -</COMPONENT> - -<COMPONENT type="5100" id="1689" > -<cdparam x="355" y="81" /> +<TGConnectingPoint num="0" id="1593" /> +<TGConnectingPoint num="1" id="1594" /> +<TGConnectingPoint num="2" id="1595" /> +<TGConnectingPoint num="3" id="1596" /> +<TGConnectingPoint num="4" id="1597" /> +<TGConnectingPoint num="5" id="1598" /> +<TGConnectingPoint num="6" id="1599" /> +<TGConnectingPoint num="7" id="1600" /> +<TGConnectingPoint num="8" id="1601" /> +<TGConnectingPoint num="9" id="1602" /> +<TGConnectingPoint num="10" id="1603" /> +<TGConnectingPoint num="11" id="1604" /> +<TGConnectingPoint num="12" id="1605" /> +<TGConnectingPoint num="13" id="1606" /> +<TGConnectingPoint num="14" id="1607" /> +<TGConnectingPoint num="15" id="1608" /> +<TGConnectingPoint num="16" id="1609" /> +<TGConnectingPoint num="17" id="1610" /> +<TGConnectingPoint num="18" id="1611" /> +<TGConnectingPoint num="19" id="1612" /> +<TGConnectingPoint num="20" id="1613" /> +<TGConnectingPoint num="21" id="1614" /> +<TGConnectingPoint num="22" id="1615" /> +<TGConnectingPoint num="23" id="1616" /> +<TGConnectingPoint num="24" id="1617" /> +<TGConnectingPoint num="25" id="1618" /> +<TGConnectingPoint num="26" id="1619" /> +<TGConnectingPoint num="27" id="1620" /> +<TGConnectingPoint num="28" id="1621" /> +<TGConnectingPoint num="29" id="1622" /> +<TGConnectingPoint num="30" id="1623" /> +<TGConnectingPoint num="31" id="1624" /> +<TGConnectingPoint num="32" id="1625" /> +<TGConnectingPoint num="33" id="1626" /> +<TGConnectingPoint num="34" id="1627" /> +<TGConnectingPoint num="35" id="1628" /> +<TGConnectingPoint num="36" id="1629" /> +<TGConnectingPoint num="37" id="1630" /> +<TGConnectingPoint num="38" id="1631" /> +<TGConnectingPoint num="39" id="1632" /> +<extraparam> +</extraparam> +</COMPONENT> + +<COMPONENT type="5100" id="1635" > +<cdparam x="315" y="49" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="start state" value="null" /> -<TGConnectingPoint num="0" id="1688" /> +<TGConnectingPoint num="0" id="1634" /> </COMPONENT> - -</AVATARStateMachineDiagramPanel> - -</Modeling> - - - - -<Modeling type="AVATAR Design" nameTab="DesignWithNoCompositeState" > -<AVATARBlockDiagramPanel name="Block Diagram" minX="10" maxX="1400" minY="10" maxY="900" > -<MainCode value="void __user_init() {"/> -<MainCode value="}"/> -<Optimized value="true" /> -<Validated value="Wallet;CoffeeMachine;TeaButton;CoffeeButton;" /> -<Ignored value="" /> - -<CONNECTOR type="5002" id="1691" > -<cdparam x="321" y="567" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector from Block1 to Block0" value="" /> -<TGConnectingPoint num="0" id="1690" /> -<P1 x="559" y="330" id="1744" /> -<P2 x="560" y="377" id="1802" /> -<AutomaticDrawing data="true" /> -<extraparam> -<isd value="in pushCoffeeButton()" /> -<oso value="out push()" /> -<FIFOType asynchronous="false" size="1024" blocking="false" private="true" broadcast="false" lossy="false" /> -</extraparam> -</CONNECTOR> -<CONNECTOR type="5002" id="1693" > -<cdparam x="275" y="114" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector from Block0 to Block0" value="" /> -<TGConnectingPoint num="0" id="1692" /> -<P1 x="306" y="109" id="1724" /> -<P2 x="445" y="108" id="1798" /> -<AutomaticDrawing data="true" /> -<extraparam> -<iso value="in getCoin(int nbOfCoins)" /> -<osd value="out ejectCoin(int nbOfCoins)" /> -<isd value="in getCoin(int nbOfCoins)" /> -<oso value="out putCoin(int nbOfCoins)" /> -<FIFOType asynchronous="false" size="1024" blocking="false" private="true" broadcast="false" lossy="false" /> -</extraparam> -</CONNECTOR> -<CONNECTOR type="5002" id="1695" > -<cdparam x="623" y="565" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector from Block1 to Block0" value="" /> -<TGConnectingPoint num="0" id="1694" /> -<P1 x="789" y="326" id="1769" /> -<P2 x="790" y="377" id="1803" /> -<AutomaticDrawing data="true" /> -<extraparam> -<isd value="in pushTeaButton()" /> -<oso value="out push()" /> -<FIFOType asynchronous="false" size="1024" blocking="false" private="true" broadcast="false" lossy="false" /> -</extraparam> -</CONNECTOR> -<COMPONENT type="303" id="1712" > -<cdparam x="92" y="385" /> -<sizeparam width="334" height="84" minWidth="80" minHeight="10" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="UPPAAL Pragma" value="A[] Wallet.nbOfCoins<3 -A[] CoffeeButton.main -A<> CoffeeMachine.WaitingForSelection -E<> CoffeeMachine.WaitingForSelection -" /> -<TGConnectingPoint num="0" id="1696" /> -<TGConnectingPoint num="1" id="1697" /> -<TGConnectingPoint num="2" id="1698" /> -<TGConnectingPoint num="3" id="1699" /> -<TGConnectingPoint num="4" id="1700" /> -<TGConnectingPoint num="5" id="1701" /> -<TGConnectingPoint num="6" id="1702" /> -<TGConnectingPoint num="7" id="1703" /> -<TGConnectingPoint num="8" id="1704" /> -<TGConnectingPoint num="9" id="1705" /> -<TGConnectingPoint num="10" id="1706" /> -<TGConnectingPoint num="11" id="1707" /> -<TGConnectingPoint num="12" id="1708" /> -<TGConnectingPoint num="13" id="1709" /> -<TGConnectingPoint num="14" id="1710" /> -<TGConnectingPoint num="15" id="1711" /> -<extraparam> -<Line value="A[] Wallet.nbOfCoins<3" /> -<Line value="A[] CoffeeButton.main" /> -<Line value="A<> CoffeeMachine.WaitingForSelection" /> -<Line value="E<> CoffeeMachine.WaitingForSelection" /> -</extraparam> -</COMPONENT> - -<COMPONENT type="5000" id="1737" > -<cdparam x="106" y="55" /> -<sizeparam width="200" height="218" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="Block0" value="Wallet" /> -<TGConnectingPoint num="0" id="1713" /> -<TGConnectingPoint num="1" id="1714" /> -<TGConnectingPoint num="2" id="1715" /> -<TGConnectingPoint num="3" id="1716" /> -<TGConnectingPoint num="4" id="1717" /> -<TGConnectingPoint num="5" id="1718" /> -<TGConnectingPoint num="6" id="1719" /> -<TGConnectingPoint num="7" id="1720" /> -<TGConnectingPoint num="8" id="1721" /> -<TGConnectingPoint num="9" id="1722" /> -<TGConnectingPoint num="10" id="1723" /> -<TGConnectingPoint num="11" id="1724" /> -<TGConnectingPoint num="12" id="1725" /> -<TGConnectingPoint num="13" id="1726" /> -<TGConnectingPoint num="14" id="1727" /> -<TGConnectingPoint num="15" id="1728" /> -<TGConnectingPoint num="16" id="1729" /> -<TGConnectingPoint num="17" id="1730" /> -<TGConnectingPoint num="18" id="1731" /> -<TGConnectingPoint num="19" id="1732" /> -<TGConnectingPoint num="20" id="1733" /> -<TGConnectingPoint num="21" id="1734" /> -<TGConnectingPoint num="22" id="1735" /> -<TGConnectingPoint num="23" id="1736" /> -<extraparam> -<CryptoBlock value="false" /> -<Attribute access="0" id="nbOfCoins" value="2" type="8" typeOther="" /> -<Attribute access="0" id="x" value="1" type="8" typeOther="" /> -<Attribute access="0" id="minUserDelay" value="50" type="8" typeOther="" /> -<Attribute access="0" id="maxUserDelay" value="70" type="8" typeOther="" /> -<Method value="contentOfWallet(int nbOfCoins)" /> -<Signal value="in getCoin(int nbOfCoins)" attached="true" /> -<Signal value="out putCoin(int nbOfCoins)" attached="true" /> -</extraparam> -</COMPONENT> - -<COMPONENT type="5000" id="1812" > -<cdparam x="445" y="19" /> -<sizeparam width="461" height="358" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="Block0" value="CoffeeMachine" /> -<TGConnectingPoint num="0" id="1788" /> -<TGConnectingPoint num="1" id="1789" /> -<TGConnectingPoint num="2" id="1790" /> -<TGConnectingPoint num="3" id="1791" /> -<TGConnectingPoint num="4" id="1792" /> -<TGConnectingPoint num="5" id="1793" /> -<TGConnectingPoint num="6" id="1794" /> -<TGConnectingPoint num="7" id="1795" /> -<TGConnectingPoint num="8" id="1796" /> -<TGConnectingPoint num="9" id="1797" /> -<TGConnectingPoint num="10" id="1798" /> -<TGConnectingPoint num="11" id="1799" /> -<TGConnectingPoint num="12" id="1800" /> -<TGConnectingPoint num="13" id="1801" /> -<TGConnectingPoint num="14" id="1802" /> -<TGConnectingPoint num="15" id="1803" /> -<TGConnectingPoint num="16" id="1804" /> -<TGConnectingPoint num="17" id="1805" /> -<TGConnectingPoint num="18" id="1806" /> -<TGConnectingPoint num="19" id="1807" /> -<TGConnectingPoint num="20" id="1808" /> -<TGConnectingPoint num="21" id="1809" /> -<TGConnectingPoint num="22" id="1810" /> -<TGConnectingPoint num="23" id="1811" /> -<extraparam> -<CryptoBlock value="false" /> -<Attribute access="0" id="teaMinDelay" value="3" type="8" typeOther="" /> -<Attribute access="0" id="teaMaxDelay" value="8" type="8" typeOther="" /> -<Attribute access="0" id="coffeeMinDelay" value="5" type="8" typeOther="" /> -<Attribute access="0" id="coffeeMaxDelay" value="10" type="8" typeOther="" /> -<Attribute access="0" id="coinDelay" value="50" type="8" typeOther="" /> -<Attribute access="0" id="x" value="0" type="8" typeOther="" /> -<Attribute access="0" id="nbOfCoins" value="0" type="8" typeOther="" /> -<Method value="beverageReady()" /> -<Signal value="in pushCoffeeButton()" attached="true" /> -<Signal value="in pushTeaButton()" attached="true" /> -<Signal value="in getCoin(int nbOfCoins)" attached="true" /> -<Signal value="out ejectCoin(int nbOfCoins)" attached="true" /> -</extraparam> -</COMPONENT> -<SUBCOMPONENT type="5000" id="1762" > -<father id="1812" num="0" /> -<cdparam x="464" y="228" /> -<sizeparam width="190" height="102" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="0" maxX="271" minY="0" maxY="256" /> -<infoparam name="Block1" value="CoffeeButton" /> -<TGConnectingPoint num="0" id="1738" /> -<TGConnectingPoint num="1" id="1739" /> -<TGConnectingPoint num="2" id="1740" /> -<TGConnectingPoint num="3" id="1741" /> -<TGConnectingPoint num="4" id="1742" /> -<TGConnectingPoint num="5" id="1743" /> -<TGConnectingPoint num="6" id="1744" /> -<TGConnectingPoint num="7" id="1745" /> -<TGConnectingPoint num="8" id="1746" /> -<TGConnectingPoint num="9" id="1747" /> -<TGConnectingPoint num="10" id="1748" /> -<TGConnectingPoint num="11" id="1749" /> -<TGConnectingPoint num="12" id="1750" /> -<TGConnectingPoint num="13" id="1751" /> -<TGConnectingPoint num="14" id="1752" /> -<TGConnectingPoint num="15" id="1753" /> -<TGConnectingPoint num="16" id="1754" /> -<TGConnectingPoint num="17" id="1755" /> -<TGConnectingPoint num="18" id="1756" /> -<TGConnectingPoint num="19" id="1757" /> -<TGConnectingPoint num="20" id="1758" /> -<TGConnectingPoint num="21" id="1759" /> -<TGConnectingPoint num="22" id="1760" /> -<TGConnectingPoint num="23" id="1761" /> -<extraparam> -<CryptoBlock value="false" /> -<Attribute access="0" id="mechanicalDelay" value="80" type="8" typeOther="" /> -<Signal value="out push()" attached="true" /> -</extraparam> -</SUBCOMPONENT> -<SUBCOMPONENT type="5000" id="1787" > -<father id="1812" num="1" /> -<cdparam x="695" y="224" /> -<sizeparam width="189" height="102" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="0" maxX="272" minY="0" maxY="256" /> -<infoparam name="Block1" value="TeaButton" /> -<TGConnectingPoint num="0" id="1763" /> -<TGConnectingPoint num="1" id="1764" /> -<TGConnectingPoint num="2" id="1765" /> -<TGConnectingPoint num="3" id="1766" /> -<TGConnectingPoint num="4" id="1767" /> -<TGConnectingPoint num="5" id="1768" /> -<TGConnectingPoint num="6" id="1769" /> -<TGConnectingPoint num="7" id="1770" /> -<TGConnectingPoint num="8" id="1771" /> -<TGConnectingPoint num="9" id="1772" /> -<TGConnectingPoint num="10" id="1773" /> -<TGConnectingPoint num="11" id="1774" /> -<TGConnectingPoint num="12" id="1775" /> -<TGConnectingPoint num="13" id="1776" /> -<TGConnectingPoint num="14" id="1777" /> -<TGConnectingPoint num="15" id="1778" /> -<TGConnectingPoint num="16" id="1779" /> -<TGConnectingPoint num="17" id="1780" /> -<TGConnectingPoint num="18" id="1781" /> -<TGConnectingPoint num="19" id="1782" /> -<TGConnectingPoint num="20" id="1783" /> -<TGConnectingPoint num="21" id="1784" /> -<TGConnectingPoint num="22" id="1785" /> -<TGConnectingPoint num="23" id="1786" /> -<extraparam> -<CryptoBlock value="false" /> -<Attribute access="0" id="mechanicalDelay" value="10" type="8" typeOther="" /> -<Signal value="out push()" attached="true" /> -</extraparam> -</SUBCOMPONENT> - - -</AVATARBlockDiagramPanel> - -<AVATARStateMachineDiagramPanel name="Wallet" minX="10" maxX="1400" minY="10" maxY="900" > -<CONNECTOR type="5102" id="1819" > -<cdparam x="516" y="264" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector from Send signal to state0" value="null" /> -<TGConnectingPoint num="0" id="1818" /> -<P1 x="485" y="219" id="1860" /> -<P2 x="485" y="274" id="1871" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="1817" > -<father id="1819" num="0" /> -<cdparam x="493" y="251" /> -<sizeparam width="173" height="30" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="1813" /> -<TGConnectingPoint num="1" id="1814" /> -<TGConnectingPoint num="2" id="1815" /> -<TGConnectingPoint num="3" id="1816" /> -<extraparam> -<guard value="[ ]" /> -<afterMin value="" /> -<afterMax value="" /> -<computeMin value="" /> -<computeMax value="" /> -<actions value="nbOfCoins = nbOfCoins + x" /> -<actions value="contentOfWallet(nbOfCoins)" /> -</extraparam> -</SUBCOMPONENT> - -<CONNECTOR type="5102" id="1826" > -<cdparam x="382" y="165" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector from state0 to Send signal" value="null" /> -<TGConnectingPoint num="0" id="1825" /> -<P1 x="382" y="165" id="1967" /> -<P2 x="485" y="189" id="1859" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="1824" > -<father id="1826" num="0" /> -<cdparam x="382" y="205" /> -<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="1820" /> -<TGConnectingPoint num="1" id="1821" /> -<TGConnectingPoint num="2" id="1822" /> -<TGConnectingPoint num="3" id="1823" /> -<extraparam> -<guard value="[ ]" /> -<afterMin value="" /> -<afterMax value="" /> -<computeMin value="" /> -<computeMax value="" /> -</extraparam> -</SUBCOMPONENT> - -<CONNECTOR type="5102" id="1833" > -<cdparam x="223" y="260" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector from Send signal to state0" value="null" /> -<TGConnectingPoint num="0" id="1832" /> -<P1 x="251" y="231" id="1849" /> -<P2 x="252" y="300" id="1912" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="1831" > -<father id="1833" num="0" /> -<cdparam x="163" y="252" /> -<sizeparam width="221" height="45" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="1827" /> -<TGConnectingPoint num="1" id="1828" /> -<TGConnectingPoint num="2" id="1829" /> -<TGConnectingPoint num="3" id="1830" /> -<extraparam> -<guard value="[ ]" /> -<afterMin value="minUserDelay" /> -<afterMax value="maxUserDelay" /> -<computeMin value="" /> -<computeMax value="" /> -<actions value="nbOfCoins = nbOfCoins - x" /> -<actions value="contentOfWallet(nbOfCoins)" /> -</extraparam> -</SUBCOMPONENT> - -<CONNECTOR type="5102" id="1840" > -<cdparam x="357" y="165" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector from state0 to Send signal" value="null" /> -<TGConnectingPoint num="0" id="1839" /> -<P1 x="357" y="165" id="1966" /> -<P2 x="251" y="201" id="1848" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="1838" > -<father id="1840" num="0" /> -<cdparam x="220" y="174" /> -<sizeparam width="99" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="1834" /> -<TGConnectingPoint num="1" id="1835" /> -<TGConnectingPoint num="2" id="1836" /> -<TGConnectingPoint num="3" id="1837" /> -<extraparam> -<guard value="[nbOfCoins > 0]" /> -<afterMin value="" /> -<afterMax value="" /> -<computeMin value="" /> -<computeMax value="" /> -</extraparam> -</SUBCOMPONENT> - -<CONNECTOR type="5102" id="1847" > -<cdparam x="369" y="115" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector from start state to state0" value="null" /> -<TGConnectingPoint num="0" id="1846" /> -<P1 x="370" y="64" id="1993" /> -<P2 x="370" y="135" id="1953" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="1845" > -<father id="1847" num="0" /> -<cdparam x="376" y="105" /> -<sizeparam width="173" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="1841" /> -<TGConnectingPoint num="1" id="1842" /> -<TGConnectingPoint num="2" id="1843" /> -<TGConnectingPoint num="3" id="1844" /> -<extraparam> -<guard value="[ ]" /> -<afterMin value="" /> -<afterMax value="" /> -<computeMin value="" /> -<computeMax value="" /> -<actions value="contentOfWallet(nbOfCoins)" /> -</extraparam> -</SUBCOMPONENT> - -<COMPONENT type="5103" id="1858" > -<cdparam x="214" y="206" /> -<sizeparam width="74" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="Send signal" value="putCoin(x)" /> -<TGConnectingPoint num="0" id="1848" /> -<TGConnectingPoint num="1" id="1849" /> -<TGConnectingPoint num="2" id="1850" /> -<TGConnectingPoint num="3" id="1851" /> -<TGConnectingPoint num="4" id="1852" /> -<TGConnectingPoint num="5" id="1853" /> -<TGConnectingPoint num="6" id="1854" /> -<TGConnectingPoint num="7" id="1855" /> -<TGConnectingPoint num="8" id="1856" /> -<TGConnectingPoint num="9" id="1857" /> -</COMPONENT> - -<COMPONENT type="5104" id="1869" > -<cdparam x="444" y="194" /> -<sizeparam width="82" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="Receive signal" value="getCoin(x)" /> -<TGConnectingPoint num="0" id="1859" /> -<TGConnectingPoint num="1" id="1860" /> -<TGConnectingPoint num="2" id="1861" /> -<TGConnectingPoint num="3" id="1862" /> -<TGConnectingPoint num="4" id="1863" /> -<TGConnectingPoint num="5" id="1864" /> -<TGConnectingPoint num="6" id="1865" /> -<TGConnectingPoint num="7" id="1866" /> -<TGConnectingPoint num="8" id="1867" /> -<TGConnectingPoint num="9" id="1868" /> -</COMPONENT> - -<COMPONENT type="5106" id="1910" > -<cdparam x="460" y="274" /> -<sizeparam width="50" height="40" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="state0" value="main" /> -<TGConnectingPoint num="0" id="1870" /> -<TGConnectingPoint num="1" id="1871" /> -<TGConnectingPoint num="2" id="1872" /> -<TGConnectingPoint num="3" id="1873" /> -<TGConnectingPoint num="4" id="1874" /> -<TGConnectingPoint num="5" id="1875" /> -<TGConnectingPoint num="6" id="1876" /> -<TGConnectingPoint num="7" id="1877" /> -<TGConnectingPoint num="8" id="1878" /> -<TGConnectingPoint num="9" id="1879" /> -<TGConnectingPoint num="10" id="1880" /> -<TGConnectingPoint num="11" id="1881" /> -<TGConnectingPoint num="12" id="1882" /> -<TGConnectingPoint num="13" id="1883" /> -<TGConnectingPoint num="14" id="1884" /> -<TGConnectingPoint num="15" id="1885" /> -<TGConnectingPoint num="16" id="1886" /> -<TGConnectingPoint num="17" id="1887" /> -<TGConnectingPoint num="18" id="1888" /> -<TGConnectingPoint num="19" id="1889" /> -<TGConnectingPoint num="20" id="1890" /> -<TGConnectingPoint num="21" id="1891" /> -<TGConnectingPoint num="22" id="1892" /> -<TGConnectingPoint num="23" id="1893" /> -<TGConnectingPoint num="24" id="1894" /> -<TGConnectingPoint num="25" id="1895" /> -<TGConnectingPoint num="26" id="1896" /> -<TGConnectingPoint num="27" id="1897" /> -<TGConnectingPoint num="28" id="1898" /> -<TGConnectingPoint num="29" id="1899" /> -<TGConnectingPoint num="30" id="1900" /> -<TGConnectingPoint num="31" id="1901" /> -<TGConnectingPoint num="32" id="1902" /> -<TGConnectingPoint num="33" id="1903" /> -<TGConnectingPoint num="34" id="1904" /> -<TGConnectingPoint num="35" id="1905" /> -<TGConnectingPoint num="36" id="1906" /> -<TGConnectingPoint num="37" id="1907" /> -<TGConnectingPoint num="38" id="1908" /> -<TGConnectingPoint num="39" id="1909" /> -<extraparam> -</extraparam> -</COMPONENT> - -<COMPONENT type="5106" id="1951" > -<cdparam x="227" y="300" /> -<sizeparam width="50" height="40" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="state0" value="main" /> -<TGConnectingPoint num="0" id="1911" /> -<TGConnectingPoint num="1" id="1912" /> -<TGConnectingPoint num="2" id="1913" /> -<TGConnectingPoint num="3" id="1914" /> -<TGConnectingPoint num="4" id="1915" /> -<TGConnectingPoint num="5" id="1916" /> -<TGConnectingPoint num="6" id="1917" /> -<TGConnectingPoint num="7" id="1918" /> -<TGConnectingPoint num="8" id="1919" /> -<TGConnectingPoint num="9" id="1920" /> -<TGConnectingPoint num="10" id="1921" /> -<TGConnectingPoint num="11" id="1922" /> -<TGConnectingPoint num="12" id="1923" /> -<TGConnectingPoint num="13" id="1924" /> -<TGConnectingPoint num="14" id="1925" /> -<TGConnectingPoint num="15" id="1926" /> -<TGConnectingPoint num="16" id="1927" /> -<TGConnectingPoint num="17" id="1928" /> -<TGConnectingPoint num="18" id="1929" /> -<TGConnectingPoint num="19" id="1930" /> -<TGConnectingPoint num="20" id="1931" /> -<TGConnectingPoint num="21" id="1932" /> -<TGConnectingPoint num="22" id="1933" /> -<TGConnectingPoint num="23" id="1934" /> -<TGConnectingPoint num="24" id="1935" /> -<TGConnectingPoint num="25" id="1936" /> -<TGConnectingPoint num="26" id="1937" /> -<TGConnectingPoint num="27" id="1938" /> -<TGConnectingPoint num="28" id="1939" /> -<TGConnectingPoint num="29" id="1940" /> -<TGConnectingPoint num="30" id="1941" /> -<TGConnectingPoint num="31" id="1942" /> -<TGConnectingPoint num="32" id="1943" /> -<TGConnectingPoint num="33" id="1944" /> -<TGConnectingPoint num="34" id="1945" /> -<TGConnectingPoint num="35" id="1946" /> -<TGConnectingPoint num="36" id="1947" /> -<TGConnectingPoint num="37" id="1948" /> -<TGConnectingPoint num="38" id="1949" /> -<TGConnectingPoint num="39" id="1950" /> -<extraparam> -</extraparam> -</COMPONENT> - -<COMPONENT type="5106" id="1992" > -<cdparam x="345" y="135" /> -<sizeparam width="50" height="30" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="state0" value="main" /> -<TGConnectingPoint num="0" id="1952" /> -<TGConnectingPoint num="1" id="1953" /> -<TGConnectingPoint num="2" id="1954" /> -<TGConnectingPoint num="3" id="1955" /> -<TGConnectingPoint num="4" id="1956" /> -<TGConnectingPoint num="5" id="1957" /> -<TGConnectingPoint num="6" id="1958" /> -<TGConnectingPoint num="7" id="1959" /> -<TGConnectingPoint num="8" id="1960" /> -<TGConnectingPoint num="9" id="1961" /> -<TGConnectingPoint num="10" id="1962" /> -<TGConnectingPoint num="11" id="1963" /> -<TGConnectingPoint num="12" id="1964" /> -<TGConnectingPoint num="13" id="1965" /> -<TGConnectingPoint num="14" id="1966" /> -<TGConnectingPoint num="15" id="1967" /> -<TGConnectingPoint num="16" id="1968" /> -<TGConnectingPoint num="17" id="1969" /> -<TGConnectingPoint num="18" id="1970" /> -<TGConnectingPoint num="19" id="1971" /> -<TGConnectingPoint num="20" id="1972" /> -<TGConnectingPoint num="21" id="1973" /> -<TGConnectingPoint num="22" id="1974" /> -<TGConnectingPoint num="23" id="1975" /> -<TGConnectingPoint num="24" id="1976" /> -<TGConnectingPoint num="25" id="1977" /> -<TGConnectingPoint num="26" id="1978" /> -<TGConnectingPoint num="27" id="1979" /> -<TGConnectingPoint num="28" id="1980" /> -<TGConnectingPoint num="29" id="1981" /> -<TGConnectingPoint num="30" id="1982" /> -<TGConnectingPoint num="31" id="1983" /> -<TGConnectingPoint num="32" id="1984" /> -<TGConnectingPoint num="33" id="1985" /> -<TGConnectingPoint num="34" id="1986" /> -<TGConnectingPoint num="35" id="1987" /> -<TGConnectingPoint num="36" id="1988" /> -<TGConnectingPoint num="37" id="1989" /> -<TGConnectingPoint num="38" id="1990" /> -<TGConnectingPoint num="39" id="1991" /> -<extraparam> -</extraparam> -</COMPONENT> - -<COMPONENT type="5100" id="1994" > -<cdparam x="363" y="44" /> -<sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="start state" value="null" /> -<TGConnectingPoint num="0" id="1993" /> -</COMPONENT> - - -</AVATARStateMachineDiagramPanel> - -<AVATARStateMachineDiagramPanel name="CoffeeMachine" minX="10" maxX="1400" minY="10" maxY="1400" > -<CONNECTOR type="5102" id="2001" > -<cdparam x="691" y="288" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector from state0 to Send signal" value="null" /> -<TGConnectingPoint num="0" id="2000" /> -<P1 x="699" y="289" id="2206" /> -<P2 x="699" y="316" id="2178" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="1999" > -<father id="2001" num="0" /> -<cdparam x="691" y="328" /> -<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="1995" /> -<TGConnectingPoint num="1" id="1996" /> -<TGConnectingPoint num="2" id="1997" /> -<TGConnectingPoint num="3" id="1998" /> -<extraparam> -<guard value="[ ]" /> -<afterMin value="" /> -<afterMax value="" /> -<computeMin value="" /> -<computeMax value="" /> -</extraparam> -</SUBCOMPONENT> - -<CONNECTOR type="5102" id="2008" > -<cdparam x="481" y="501" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector from Send signal to stop state" value="null" /> -<TGConnectingPoint num="0" id="2007" /> -<P1 x="433" y="526" id="2105" /> -<P2 x="323" y="748" id="2334" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="2006" > -<father id="2008" num="0" /> -<cdparam x="420" y="552" /> -<sizeparam width="89" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="2002" /> -<TGConnectingPoint num="1" id="2003" /> -<TGConnectingPoint num="2" id="2004" /> -<TGConnectingPoint num="3" id="2005" /> -<extraparam> -<guard value="[ ]" /> -<afterMin value="" /> -<afterMax value="" /> -<computeMin value="" /> -<computeMax value="" /> -<actions value="nbOfCoins = 0" /> -</extraparam> -</SUBCOMPONENT> - -<CONNECTOR type="5102" id="2015" > -<cdparam x="555" y="559" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector from state0 to Send signal" value="null" /> -<TGConnectingPoint num="0" id="2014" /> -<P1 x="317" y="456" id="2130" /> -<P2 x="433" y="496" id="2104" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="2013" > -<father id="2015" num="0" /> -<cdparam x="395" y="448" /> -<sizeparam width="104" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="2009" /> -<TGConnectingPoint num="1" id="2010" /> -<TGConnectingPoint num="2" id="2011" /> -<TGConnectingPoint num="3" id="2012" /> -<extraparam> -<guard value="[ ]" /> -<afterMin value="coinDelay" /> -<afterMax value="" /> -<computeMin value="" /> -<computeMax value="" /> -</extraparam> -</SUBCOMPONENT> - -<CONNECTOR type="5102" id="2022" > -<cdparam x="355" y="545" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector from Send signal to stop state" value="null" /> -<TGConnectingPoint num="0" id="2021" /> -<P1 x="289" y="553" id="2116" /> -<P2 x="289" y="748" id="2326" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="2020" > -<father id="2022" num="0" /> -<cdparam x="284" y="594" /> -<sizeparam width="248" height="45" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="2016" /> -<TGConnectingPoint num="1" id="2017" /> -<TGConnectingPoint num="2" id="2018" /> -<TGConnectingPoint num="3" id="2019" /> -<extraparam> -<guard value="[ ]" /> -<afterMin value="" /> -<afterMax value="" /> -<computeMin value="teaMinDelay" /> -<computeMax value="teaMaxDelay" /> -<actions value="nbOfCoins = 0" /> -<actions value="beverageReady()" /> -</extraparam> -</SUBCOMPONENT> - -<CONNECTOR type="5102" id="2029" > -<cdparam x="295" y="465" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector from state0 to Send signal" value="null" /> -<TGConnectingPoint num="0" id="2028" /> -<P1 x="284" y="476" id="2141" /> -<P2 x="289" y="523" id="2115" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="2027" > -<father id="2029" num="0" /> -<cdparam x="295" y="505" /> -<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="2023" /> -<TGConnectingPoint num="1" id="2024" /> -<TGConnectingPoint num="2" id="2025" /> -<TGConnectingPoint num="3" id="2026" /> -<extraparam> -<guard value="[ ]" /> -<afterMin value="" /> -<afterMax value="" /> -<computeMin value="" /> -<computeMax value="" /> -</extraparam> -</SUBCOMPONENT> - -<CONNECTOR type="5102" id="2036" > -<cdparam x="148" y="549" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector from Send signal to stop state" value="null" /> -<TGConnectingPoint num="0" id="2035" /> -<P1 x="117" y="553" id="2094" /> -<P2 x="255" y="748" id="2333" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="2034" > -<father id="2036" num="0" /> -<cdparam x="32" y="587" /> -<sizeparam width="284" height="45" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="2030" /> -<TGConnectingPoint num="1" id="2031" /> -<TGConnectingPoint num="2" id="2032" /> -<TGConnectingPoint num="3" id="2033" /> -<extraparam> -<guard value="[ ]" /> -<afterMin value="" /> -<afterMax value="" /> -<computeMin value="coffeeMinDelay" /> -<computeMax value="coffeeMaxDelay" /> -<actions value="nbOfCoins = 0" /> -<actions value="beverageReady()" /> -</extraparam> -</SUBCOMPONENT> - -<CONNECTOR type="5102" id="2043" > -<cdparam x="229" y="465" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector from state0 to Send signal" value="null" /> -<TGConnectingPoint num="0" id="2042" /> -<P1 x="218" y="476" id="2140" /> -<P2 x="117" y="523" id="2093" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="2041" > -<father id="2043" num="0" /> -<cdparam x="229" y="505" /> -<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="2037" /> -<TGConnectingPoint num="1" id="2038" /> -<TGConnectingPoint num="2" id="2039" /> -<TGConnectingPoint num="3" id="2040" /> -<extraparam> -<guard value="[ ]" /> -<afterMin value="" /> -<afterMax value="" /> -<computeMin value="" /> -<computeMax value="" /> -</extraparam> -</SUBCOMPONENT> - -<CONNECTOR type="5102" id="2050" > -<cdparam x="667" y="346" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector from Send signal to state0" value="null" /> -<TGConnectingPoint num="0" id="2049" /> -<P1 x="699" y="346" id="2179" /> -<P2 x="699" y="381" id="2367" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="2048" > -<father id="2050" num="0" /> -<cdparam x="707" y="368" /> -<sizeparam width="89" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="2044" /> -<TGConnectingPoint num="1" id="2045" /> -<TGConnectingPoint num="2" id="2046" /> -<TGConnectingPoint num="3" id="2047" /> -<extraparam> -<guard value="[ ]" /> -<afterMin value="" /> -<afterMax value="" /> -<computeMin value="" /> -<computeMax value="" /> -<actions value="nbOfCoins = 0" /> -</extraparam> -</SUBCOMPONENT> - -<CONNECTOR type="5102" id="2057" > -<cdparam x="348" y="228" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector from state0 to Send signal" value="null" /> -<TGConnectingPoint num="0" id="2056" /> -<P1 x="388" y="208" id="2245" /> -<P2 x="649" y="264" id="2203" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="2055" > -<father id="2057" num="0" /> -<cdparam x="411" y="206" /> -<sizeparam width="104" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="2051" /> -<TGConnectingPoint num="1" id="2052" /> -<TGConnectingPoint num="2" id="2053" /> -<TGConnectingPoint num="3" id="2054" /> -<extraparam> -<guard value="[ ]" /> -<afterMin value="coinDelay" /> -<afterMax value="" /> -<computeMin value="" /> -<computeMax value="" /> -</extraparam> -</SUBCOMPONENT> - -<CONNECTOR type="5102" id="2064" > -<cdparam x="243" y="319" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector from Send signal to state0" value="null" /> -<TGConnectingPoint num="0" id="2063" /> -<P1 x="277" y="305" id="2190" /> -<P2 x="251" y="436" id="2127" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="2062" > -<father id="2064" num="0" /> -<cdparam x="243" y="359" /> -<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="2058" /> -<TGConnectingPoint num="1" id="2059" /> -<TGConnectingPoint num="2" id="2060" /> -<TGConnectingPoint num="3" id="2061" /> -<extraparam> -<guard value="[ ]" /> -<afterMin value="" /> -<afterMax value="" /> -<computeMin value="" /> -<computeMax value="" /> -</extraparam> -</SUBCOMPONENT> - -<CONNECTOR type="5102" id="2071" > -<cdparam x="270" y="224" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector from state0 to Send signal" value="null" /> -<TGConnectingPoint num="0" id="2070" /> -<P1 x="270" y="228" id="2255" /> -<P2 x="277" y="275" id="2189" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="2069" > -<father id="2071" num="0" /> -<cdparam x="270" y="264" /> -<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="2065" /> -<TGConnectingPoint num="1" id="2066" /> -<TGConnectingPoint num="2" id="2067" /> -<TGConnectingPoint num="3" id="2068" /> -<extraparam> -<guard value="[ ]" /> -<afterMin value="" /> -<afterMax value="" /> -<computeMin value="" /> -<computeMax value="" /> -</extraparam> -</SUBCOMPONENT> - -<CONNECTOR type="5102" id="2078" > -<cdparam x="309" y="160" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector from Send signal to state0" value="null" /> -<TGConnectingPoint num="0" id="2077" /> -<P1 x="306" y="166" id="2168" /> -<P2 x="309" y="188" id="2242" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="2076" > -<father id="2078" num="0" /> -<cdparam x="328" y="178" /> -<sizeparam width="168" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="2072" /> -<TGConnectingPoint num="1" id="2073" /> -<TGConnectingPoint num="2" id="2074" /> -<TGConnectingPoint num="3" id="2075" /> -<extraparam> -<guard value="[ ]" /> -<afterMin value="" /> -<afterMax value="" /> -<computeMin value="" /> -<computeMax value="" /> -<actions value="nbOfCoins = nbOfCoins + x" /> -</extraparam> -</SUBCOMPONENT> - -<CONNECTOR type="5102" id="2085" > -<cdparam x="303" y="103" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector from state0 to Send signal" value="null" /> -<TGConnectingPoint num="0" id="2084" /> -<P1 x="303" y="103" id="2290" /> -<P2 x="306" y="136" id="2167" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="2083" > -<father id="2085" num="0" /> -<cdparam x="303" y="143" /> -<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="2079" /> -<TGConnectingPoint num="1" id="2080" /> -<TGConnectingPoint num="2" id="2081" /> -<TGConnectingPoint num="3" id="2082" /> -<extraparam> -<guard value="[ ]" /> -<afterMin value="" /> -<afterMax value="" /> -<computeMin value="" /> -<computeMax value="" /> -</extraparam> -</SUBCOMPONENT> - -<CONNECTOR type="5102" id="2092" > -<cdparam x="303" y="40" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector from start state to state0" value="null" /> -<TGConnectingPoint num="0" id="2091" /> -<P1 x="303" y="40" id="2282" /> -<P2 x="303" y="63" id="2285" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="2090" > -<father id="2092" num="0" /> -<cdparam x="303" y="80" /> -<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="2086" /> -<TGConnectingPoint num="1" id="2087" /> -<TGConnectingPoint num="2" id="2088" /> -<TGConnectingPoint num="3" id="2089" /> -<extraparam> -<guard value="[ ]" /> -<afterMin value="" /> -<afterMax value="" /> -<computeMin value="" /> -<computeMax value="" /> -</extraparam> -</SUBCOMPONENT> - -<COMPONENT type="5104" id="2103" > -<cdparam x="47" y="528" /> -<sizeparam width="141" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> -<infoparam name="Send signal" value="pushCoffeeButton()" /> -<TGConnectingPoint num="0" id="2093" /> -<TGConnectingPoint num="1" id="2094" /> -<TGConnectingPoint num="2" id="2095" /> -<TGConnectingPoint num="3" id="2096" /> -<TGConnectingPoint num="4" id="2097" /> -<TGConnectingPoint num="5" id="2098" /> -<TGConnectingPoint num="6" id="2099" /> -<TGConnectingPoint num="7" id="2100" /> -<TGConnectingPoint num="8" id="2101" /> -<TGConnectingPoint num="9" id="2102" /> -<accessibility /> -</COMPONENT> - -<COMPONENT type="5103" id="2114" > -<cdparam x="363" y="501" /> -<sizeparam width="141" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> -<infoparam name="Send signal" value="ejectCoin(nbOfCoins)" /> -<TGConnectingPoint num="0" id="2104" /> -<TGConnectingPoint num="1" id="2105" /> -<TGConnectingPoint num="2" id="2106" /> -<TGConnectingPoint num="3" id="2107" /> -<TGConnectingPoint num="4" id="2108" /> -<TGConnectingPoint num="5" id="2109" /> -<TGConnectingPoint num="6" id="2110" /> -<TGConnectingPoint num="7" id="2111" /> -<TGConnectingPoint num="8" id="2112" /> -<TGConnectingPoint num="9" id="2113" /> -<accessibility /> -</COMPONENT> - -<COMPONENT type="5104" id="2125" > -<cdparam x="227" y="528" /> -<sizeparam width="124" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> -<infoparam name="Send signal" value="pushTeaButton()" /> -<TGConnectingPoint num="0" id="2115" /> -<TGConnectingPoint num="1" id="2116" /> -<TGConnectingPoint num="2" id="2117" /> -<TGConnectingPoint num="3" id="2118" /> -<TGConnectingPoint num="4" id="2119" /> -<TGConnectingPoint num="5" id="2120" /> -<TGConnectingPoint num="6" id="2121" /> -<TGConnectingPoint num="7" id="2122" /> -<TGConnectingPoint num="8" id="2123" /> -<TGConnectingPoint num="9" id="2124" /> -<accessibility /> -</COMPONENT> - -<COMPONENT type="5106" id="2166" > -<cdparam x="185" y="436" /> -<sizeparam width="132" height="40" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> -<infoparam name="state0" value="WaitingForSelection" /> -<TGConnectingPoint num="0" id="2126" /> -<TGConnectingPoint num="1" id="2127" /> -<TGConnectingPoint num="2" id="2128" /> -<TGConnectingPoint num="3" id="2129" /> -<TGConnectingPoint num="4" id="2130" /> -<TGConnectingPoint num="5" id="2131" /> -<TGConnectingPoint num="6" id="2132" /> -<TGConnectingPoint num="7" id="2133" /> -<TGConnectingPoint num="8" id="2134" /> -<TGConnectingPoint num="9" id="2135" /> -<TGConnectingPoint num="10" id="2136" /> -<TGConnectingPoint num="11" id="2137" /> -<TGConnectingPoint num="12" id="2138" /> -<TGConnectingPoint num="13" id="2139" /> -<TGConnectingPoint num="14" id="2140" /> -<TGConnectingPoint num="15" id="2141" /> -<TGConnectingPoint num="16" id="2142" /> -<TGConnectingPoint num="17" id="2143" /> -<TGConnectingPoint num="18" id="2144" /> -<TGConnectingPoint num="19" id="2145" /> -<TGConnectingPoint num="20" id="2146" /> -<TGConnectingPoint num="21" id="2147" /> -<TGConnectingPoint num="22" id="2148" /> -<TGConnectingPoint num="23" id="2149" /> -<TGConnectingPoint num="24" id="2150" /> -<TGConnectingPoint num="25" id="2151" /> -<TGConnectingPoint num="26" id="2152" /> -<TGConnectingPoint num="27" id="2153" /> -<TGConnectingPoint num="28" id="2154" /> -<TGConnectingPoint num="29" id="2155" /> -<TGConnectingPoint num="30" id="2156" /> -<TGConnectingPoint num="31" id="2157" /> -<TGConnectingPoint num="32" id="2158" /> -<TGConnectingPoint num="33" id="2159" /> -<TGConnectingPoint num="34" id="2160" /> -<TGConnectingPoint num="35" id="2161" /> -<TGConnectingPoint num="36" id="2162" /> -<TGConnectingPoint num="37" id="2163" /> -<TGConnectingPoint num="38" id="2164" /> -<TGConnectingPoint num="39" id="2165" /> -<extraparam> -</extraparam> -</COMPONENT> - -<COMPONENT type="5104" id="2177" > -<cdparam x="265" y="141" /> -<sizeparam width="82" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> -<infoparam name="Receive signal" value="getCoin(x)" /> -<TGConnectingPoint num="0" id="2167" /> -<TGConnectingPoint num="1" id="2168" /> -<TGConnectingPoint num="2" id="2169" /> -<TGConnectingPoint num="3" id="2170" /> -<TGConnectingPoint num="4" id="2171" /> -<TGConnectingPoint num="5" id="2172" /> -<TGConnectingPoint num="6" id="2173" /> -<TGConnectingPoint num="7" id="2174" /> -<TGConnectingPoint num="8" id="2175" /> -<TGConnectingPoint num="9" id="2176" /> -</COMPONENT> - -<COMPONENT type="5103" id="2188" > -<cdparam x="629" y="321" /> -<sizeparam width="141" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> -<infoparam name="Send signal" value="ejectCoin(nbOfCoins)" /> -<TGConnectingPoint num="0" id="2178" /> -<TGConnectingPoint num="1" id="2179" /> -<TGConnectingPoint num="2" id="2180" /> -<TGConnectingPoint num="3" id="2181" /> -<TGConnectingPoint num="4" id="2182" /> -<TGConnectingPoint num="5" id="2183" /> -<TGConnectingPoint num="6" id="2184" /> -<TGConnectingPoint num="7" id="2185" /> -<TGConnectingPoint num="8" id="2186" /> -<TGConnectingPoint num="9" id="2187" /> -</COMPONENT> - -<COMPONENT type="5104" id="2199" > -<cdparam x="236" y="280" /> -<sizeparam width="82" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> -<infoparam name="Receive signal" value="getCoin(x)" /> -<TGConnectingPoint num="0" id="2189" /> -<TGConnectingPoint num="1" id="2190" /> -<TGConnectingPoint num="2" id="2191" /> -<TGConnectingPoint num="3" id="2192" /> -<TGConnectingPoint num="4" id="2193" /> -<TGConnectingPoint num="5" id="2194" /> -<TGConnectingPoint num="6" id="2195" /> -<TGConnectingPoint num="7" id="2196" /> -<TGConnectingPoint num="8" id="2197" /> -<TGConnectingPoint num="9" id="2198" /> -<accessibility /> -</COMPONENT> - -<COMPONENT type="5106" id="2240" > -<cdparam x="649" y="239" /> -<sizeparam width="100" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> -<infoparam name="state0" value="ejectState" /> -<TGConnectingPoint num="0" id="2200" /> -<TGConnectingPoint num="1" id="2201" /> -<TGConnectingPoint num="2" id="2202" /> -<TGConnectingPoint num="3" id="2203" /> -<TGConnectingPoint num="4" id="2204" /> -<TGConnectingPoint num="5" id="2205" /> -<TGConnectingPoint num="6" id="2206" /> -<TGConnectingPoint num="7" id="2207" /> -<TGConnectingPoint num="8" id="2208" /> -<TGConnectingPoint num="9" id="2209" /> -<TGConnectingPoint num="10" id="2210" /> -<TGConnectingPoint num="11" id="2211" /> -<TGConnectingPoint num="12" id="2212" /> -<TGConnectingPoint num="13" id="2213" /> -<TGConnectingPoint num="14" id="2214" /> -<TGConnectingPoint num="15" id="2215" /> -<TGConnectingPoint num="16" id="2216" /> -<TGConnectingPoint num="17" id="2217" /> -<TGConnectingPoint num="18" id="2218" /> -<TGConnectingPoint num="19" id="2219" /> -<TGConnectingPoint num="20" id="2220" /> -<TGConnectingPoint num="21" id="2221" /> -<TGConnectingPoint num="22" id="2222" /> -<TGConnectingPoint num="23" id="2223" /> -<TGConnectingPoint num="24" id="2224" /> -<TGConnectingPoint num="25" id="2225" /> -<TGConnectingPoint num="26" id="2226" /> -<TGConnectingPoint num="27" id="2227" /> -<TGConnectingPoint num="28" id="2228" /> -<TGConnectingPoint num="29" id="2229" /> -<TGConnectingPoint num="30" id="2230" /> -<TGConnectingPoint num="31" id="2231" /> -<TGConnectingPoint num="32" id="2232" /> -<TGConnectingPoint num="33" id="2233" /> -<TGConnectingPoint num="34" id="2234" /> -<TGConnectingPoint num="35" id="2235" /> -<TGConnectingPoint num="36" id="2236" /> -<TGConnectingPoint num="37" id="2237" /> -<TGConnectingPoint num="38" id="2238" /> -<TGConnectingPoint num="39" id="2239" /> -<extraparam> -</extraparam> -</COMPONENT> - -<COMPONENT type="5106" id="2281" > -<cdparam x="231" y="188" /> -<sizeparam width="157" height="40" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> -<infoparam name="state0" value="WaitingForSecondCoin" /> -<TGConnectingPoint num="0" id="2241" /> -<TGConnectingPoint num="1" id="2242" /> -<TGConnectingPoint num="2" id="2243" /> -<TGConnectingPoint num="3" id="2244" /> -<TGConnectingPoint num="4" id="2245" /> -<TGConnectingPoint num="5" id="2246" /> -<TGConnectingPoint num="6" id="2247" /> -<TGConnectingPoint num="7" id="2248" /> -<TGConnectingPoint num="8" id="2249" /> -<TGConnectingPoint num="9" id="2250" /> -<TGConnectingPoint num="10" id="2251" /> -<TGConnectingPoint num="11" id="2252" /> -<TGConnectingPoint num="12" id="2253" /> -<TGConnectingPoint num="13" id="2254" /> -<TGConnectingPoint num="14" id="2255" /> -<TGConnectingPoint num="15" id="2256" /> -<TGConnectingPoint num="16" id="2257" /> -<TGConnectingPoint num="17" id="2258" /> -<TGConnectingPoint num="18" id="2259" /> -<TGConnectingPoint num="19" id="2260" /> -<TGConnectingPoint num="20" id="2261" /> -<TGConnectingPoint num="21" id="2262" /> -<TGConnectingPoint num="22" id="2263" /> -<TGConnectingPoint num="23" id="2264" /> -<TGConnectingPoint num="24" id="2265" /> -<TGConnectingPoint num="25" id="2266" /> -<TGConnectingPoint num="26" id="2267" /> -<TGConnectingPoint num="27" id="2268" /> -<TGConnectingPoint num="28" id="2269" /> -<TGConnectingPoint num="29" id="2270" /> -<TGConnectingPoint num="30" id="2271" /> -<TGConnectingPoint num="31" id="2272" /> -<TGConnectingPoint num="32" id="2273" /> -<TGConnectingPoint num="33" id="2274" /> -<TGConnectingPoint num="34" id="2275" /> -<TGConnectingPoint num="35" id="2276" /> -<TGConnectingPoint num="36" id="2277" /> -<TGConnectingPoint num="37" id="2278" /> -<TGConnectingPoint num="38" id="2279" /> -<TGConnectingPoint num="39" id="2280" /> -<extraparam> -</extraparam> -</COMPONENT> - -<COMPONENT type="5100" id="2283" > -<cdparam x="296" y="20" /> -<sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> -<infoparam name="start state" value="null" /> -<TGConnectingPoint num="0" id="2282" /> -</COMPONENT> - -<COMPONENT type="5106" id="2324" > -<cdparam x="235" y="63" /> -<sizeparam width="137" height="40" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> -<infoparam name="state0" value="WaitingForFirstCoin" /> -<TGConnectingPoint num="0" id="2284" /> -<TGConnectingPoint num="1" id="2285" /> -<TGConnectingPoint num="2" id="2286" /> -<TGConnectingPoint num="3" id="2287" /> -<TGConnectingPoint num="4" id="2288" /> -<TGConnectingPoint num="5" id="2289" /> -<TGConnectingPoint num="6" id="2290" /> -<TGConnectingPoint num="7" id="2291" /> -<TGConnectingPoint num="8" id="2292" /> -<TGConnectingPoint num="9" id="2293" /> -<TGConnectingPoint num="10" id="2294" /> -<TGConnectingPoint num="11" id="2295" /> -<TGConnectingPoint num="12" id="2296" /> -<TGConnectingPoint num="13" id="2297" /> -<TGConnectingPoint num="14" id="2298" /> -<TGConnectingPoint num="15" id="2299" /> -<TGConnectingPoint num="16" id="2300" /> -<TGConnectingPoint num="17" id="2301" /> -<TGConnectingPoint num="18" id="2302" /> -<TGConnectingPoint num="19" id="2303" /> -<TGConnectingPoint num="20" id="2304" /> -<TGConnectingPoint num="21" id="2305" /> -<TGConnectingPoint num="22" id="2306" /> -<TGConnectingPoint num="23" id="2307" /> -<TGConnectingPoint num="24" id="2308" /> -<TGConnectingPoint num="25" id="2309" /> -<TGConnectingPoint num="26" id="2310" /> -<TGConnectingPoint num="27" id="2311" /> -<TGConnectingPoint num="28" id="2312" /> -<TGConnectingPoint num="29" id="2313" /> -<TGConnectingPoint num="30" id="2314" /> -<TGConnectingPoint num="31" id="2315" /> -<TGConnectingPoint num="32" id="2316" /> -<TGConnectingPoint num="33" id="2317" /> -<TGConnectingPoint num="34" id="2318" /> -<TGConnectingPoint num="35" id="2319" /> -<TGConnectingPoint num="36" id="2320" /> -<TGConnectingPoint num="37" id="2321" /> -<TGConnectingPoint num="38" id="2322" /> -<TGConnectingPoint num="39" id="2323" /> -<extraparam> -</extraparam> -</COMPONENT> - -<COMPONENT type="5106" id="2365" > -<cdparam x="221" y="748" /> -<sizeparam width="137" height="40" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> -<infoparam name="state0" value="WaitingForFirstCoin" /> -<TGConnectingPoint num="0" id="2325" /> -<TGConnectingPoint num="1" id="2326" /> -<TGConnectingPoint num="2" id="2327" /> -<TGConnectingPoint num="3" id="2328" /> -<TGConnectingPoint num="4" id="2329" /> -<TGConnectingPoint num="5" id="2330" /> -<TGConnectingPoint num="6" id="2331" /> -<TGConnectingPoint num="7" id="2332" /> -<TGConnectingPoint num="8" id="2333" /> -<TGConnectingPoint num="9" id="2334" /> -<TGConnectingPoint num="10" id="2335" /> -<TGConnectingPoint num="11" id="2336" /> -<TGConnectingPoint num="12" id="2337" /> -<TGConnectingPoint num="13" id="2338" /> -<TGConnectingPoint num="14" id="2339" /> -<TGConnectingPoint num="15" id="2340" /> -<TGConnectingPoint num="16" id="2341" /> -<TGConnectingPoint num="17" id="2342" /> -<TGConnectingPoint num="18" id="2343" /> -<TGConnectingPoint num="19" id="2344" /> -<TGConnectingPoint num="20" id="2345" /> -<TGConnectingPoint num="21" id="2346" /> -<TGConnectingPoint num="22" id="2347" /> -<TGConnectingPoint num="23" id="2348" /> -<TGConnectingPoint num="24" id="2349" /> -<TGConnectingPoint num="25" id="2350" /> -<TGConnectingPoint num="26" id="2351" /> -<TGConnectingPoint num="27" id="2352" /> -<TGConnectingPoint num="28" id="2353" /> -<TGConnectingPoint num="29" id="2354" /> -<TGConnectingPoint num="30" id="2355" /> -<TGConnectingPoint num="31" id="2356" /> -<TGConnectingPoint num="32" id="2357" /> -<TGConnectingPoint num="33" id="2358" /> -<TGConnectingPoint num="34" id="2359" /> -<TGConnectingPoint num="35" id="2360" /> -<TGConnectingPoint num="36" id="2361" /> -<TGConnectingPoint num="37" id="2362" /> -<TGConnectingPoint num="38" id="2363" /> -<TGConnectingPoint num="39" id="2364" /> -<extraparam> -</extraparam> -</COMPONENT> - -<COMPONENT type="5106" id="2406" > -<cdparam x="631" y="381" /> -<sizeparam width="137" height="40" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> -<infoparam name="state0" value="WaitingForFirstCoin" /> -<TGConnectingPoint num="0" id="2366" /> -<TGConnectingPoint num="1" id="2367" /> -<TGConnectingPoint num="2" id="2368" /> -<TGConnectingPoint num="3" id="2369" /> -<TGConnectingPoint num="4" id="2370" /> -<TGConnectingPoint num="5" id="2371" /> -<TGConnectingPoint num="6" id="2372" /> -<TGConnectingPoint num="7" id="2373" /> -<TGConnectingPoint num="8" id="2374" /> -<TGConnectingPoint num="9" id="2375" /> -<TGConnectingPoint num="10" id="2376" /> -<TGConnectingPoint num="11" id="2377" /> -<TGConnectingPoint num="12" id="2378" /> -<TGConnectingPoint num="13" id="2379" /> -<TGConnectingPoint num="14" id="2380" /> -<TGConnectingPoint num="15" id="2381" /> -<TGConnectingPoint num="16" id="2382" /> -<TGConnectingPoint num="17" id="2383" /> -<TGConnectingPoint num="18" id="2384" /> -<TGConnectingPoint num="19" id="2385" /> -<TGConnectingPoint num="20" id="2386" /> -<TGConnectingPoint num="21" id="2387" /> -<TGConnectingPoint num="22" id="2388" /> -<TGConnectingPoint num="23" id="2389" /> -<TGConnectingPoint num="24" id="2390" /> -<TGConnectingPoint num="25" id="2391" /> -<TGConnectingPoint num="26" id="2392" /> -<TGConnectingPoint num="27" id="2393" /> -<TGConnectingPoint num="28" id="2394" /> -<TGConnectingPoint num="29" id="2395" /> -<TGConnectingPoint num="30" id="2396" /> -<TGConnectingPoint num="31" id="2397" /> -<TGConnectingPoint num="32" id="2398" /> -<TGConnectingPoint num="33" id="2399" /> -<TGConnectingPoint num="34" id="2400" /> -<TGConnectingPoint num="35" id="2401" /> -<TGConnectingPoint num="36" id="2402" /> -<TGConnectingPoint num="37" id="2403" /> -<TGConnectingPoint num="38" id="2404" /> -<TGConnectingPoint num="39" id="2405" /> -<extraparam> -</extraparam> -</COMPONENT> - - -</AVATARStateMachineDiagramPanel> - -<AVATARStateMachineDiagramPanel name="TeaButton" minX="10" maxX="1400" minY="10" maxY="900" > -<CONNECTOR type="5102" id="2413" > -<cdparam x="363" y="193" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector from Send signal to state0" value="null" /> -<TGConnectingPoint num="0" id="2412" /> -<P1 x="363" y="204" id="2429" /> -<P2 x="362" y="257" id="2440" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="2411" > -<father id="2413" num="0" /> -<cdparam x="380" y="228" /> -<sizeparam width="149" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="2407" /> -<TGConnectingPoint num="1" id="2408" /> -<TGConnectingPoint num="2" id="2409" /> -<TGConnectingPoint num="3" id="2410" /> -<extraparam> -<guard value="[ ]" /> -<afterMin value="mechanicalDelay" /> -<afterMax value="" /> -<computeMin value="" /> -<computeMax value="" /> -</extraparam> -</SUBCOMPONENT> - -<CONNECTOR type="5102" id="2420" > -<cdparam x="363" y="150" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector from state0 to Send signal" value="null" /> -<TGConnectingPoint num="0" id="2419" /> -<P1 x="363" y="150" id="2486" /> -<P2 x="363" y="174" id="2428" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="2418" > -<father id="2420" num="0" /> -<cdparam x="363" y="190" /> -<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="2414" /> -<TGConnectingPoint num="1" id="2415" /> -<TGConnectingPoint num="2" id="2416" /> -<TGConnectingPoint num="3" id="2417" /> -<extraparam> -<guard value="[ ]" /> -<afterMin value="" /> -<afterMax value="" /> -<computeMin value="" /> -<computeMax value="" /> -</extraparam> -</SUBCOMPONENT> - -<CONNECTOR type="5102" id="2427" > -<cdparam x="362" y="101" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector from start state to state0" value="null" /> -<TGConnectingPoint num="0" id="2426" /> -<P1 x="362" y="101" id="2521" /> -<P2 x="363" y="120" id="2481" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="2425" > -<father id="2427" num="0" /> -<cdparam x="362" y="141" /> -<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<COMPONENT type="5106" id="1689" > +<cdparam x="264" y="174" /> +<sizeparam width="184" height="130" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="2421" /> -<TGConnectingPoint num="1" id="2422" /> -<TGConnectingPoint num="2" id="2423" /> -<TGConnectingPoint num="3" id="2424" /> -<extraparam> -<guard value="[ ]" /> -<afterMin value="" /> -<afterMax value="" /> -<computeMin value="" /> -<computeMax value="" /> -</extraparam> -</SUBCOMPONENT> - -<COMPONENT type="5103" id="2438" > -<cdparam x="338" y="179" /> -<sizeparam width="51" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="state0" value="state0" /> +<TGConnectingPoint num="0" id="1649" /> +<TGConnectingPoint num="1" id="1650" /> +<TGConnectingPoint num="2" id="1651" /> +<TGConnectingPoint num="3" id="1652" /> +<TGConnectingPoint num="4" id="1653" /> +<TGConnectingPoint num="5" id="1654" /> +<TGConnectingPoint num="6" id="1655" /> +<TGConnectingPoint num="7" id="1656" /> +<TGConnectingPoint num="8" id="1657" /> +<TGConnectingPoint num="9" id="1658" /> +<TGConnectingPoint num="10" id="1659" /> +<TGConnectingPoint num="11" id="1660" /> +<TGConnectingPoint num="12" id="1661" /> +<TGConnectingPoint num="13" id="1662" /> +<TGConnectingPoint num="14" id="1663" /> +<TGConnectingPoint num="15" id="1664" /> +<TGConnectingPoint num="16" id="1665" /> +<TGConnectingPoint num="17" id="1666" /> +<TGConnectingPoint num="18" id="1667" /> +<TGConnectingPoint num="19" id="1668" /> +<TGConnectingPoint num="20" id="1669" /> +<TGConnectingPoint num="21" id="1670" /> +<TGConnectingPoint num="22" id="1671" /> +<TGConnectingPoint num="23" id="1672" /> +<TGConnectingPoint num="24" id="1673" /> +<TGConnectingPoint num="25" id="1674" /> +<TGConnectingPoint num="26" id="1675" /> +<TGConnectingPoint num="27" id="1676" /> +<TGConnectingPoint num="28" id="1677" /> +<TGConnectingPoint num="29" id="1678" /> +<TGConnectingPoint num="30" id="1679" /> +<TGConnectingPoint num="31" id="1680" /> +<TGConnectingPoint num="32" id="1681" /> +<TGConnectingPoint num="33" id="1682" /> +<TGConnectingPoint num="34" id="1683" /> +<TGConnectingPoint num="35" id="1684" /> +<TGConnectingPoint num="36" id="1685" /> +<TGConnectingPoint num="37" id="1686" /> +<TGConnectingPoint num="38" id="1687" /> +<TGConnectingPoint num="39" id="1688" /> +<extraparam> +</extraparam> +</COMPONENT> +<SUBCOMPONENT type="5103" id="1646" > +<father id="1689" num="0" /> +<cdparam x="330" y="257" /> +<sizeparam width="46" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<cdrectangleparam minX="0" maxX="138" minY="0" maxY="110" /> <infoparam name="Send signal" value="push()" /> -<TGConnectingPoint num="0" id="2428" /> -<TGConnectingPoint num="1" id="2429" /> -<TGConnectingPoint num="2" id="2430" /> -<TGConnectingPoint num="3" id="2431" /> -<TGConnectingPoint num="4" id="2432" /> -<TGConnectingPoint num="5" id="2433" /> -<TGConnectingPoint num="6" id="2434" /> -<TGConnectingPoint num="7" id="2435" /> -<TGConnectingPoint num="8" id="2436" /> -<TGConnectingPoint num="9" id="2437" /> -</COMPONENT> - -<COMPONENT type="5106" id="2479" > -<cdparam x="337" y="257" /> -<sizeparam width="50" height="30" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="state0" value="main" /> -<TGConnectingPoint num="0" id="2439" /> -<TGConnectingPoint num="1" id="2440" /> -<TGConnectingPoint num="2" id="2441" /> -<TGConnectingPoint num="3" id="2442" /> -<TGConnectingPoint num="4" id="2443" /> -<TGConnectingPoint num="5" id="2444" /> -<TGConnectingPoint num="6" id="2445" /> -<TGConnectingPoint num="7" id="2446" /> -<TGConnectingPoint num="8" id="2447" /> -<TGConnectingPoint num="9" id="2448" /> -<TGConnectingPoint num="10" id="2449" /> -<TGConnectingPoint num="11" id="2450" /> -<TGConnectingPoint num="12" id="2451" /> -<TGConnectingPoint num="13" id="2452" /> -<TGConnectingPoint num="14" id="2453" /> -<TGConnectingPoint num="15" id="2454" /> -<TGConnectingPoint num="16" id="2455" /> -<TGConnectingPoint num="17" id="2456" /> -<TGConnectingPoint num="18" id="2457" /> -<TGConnectingPoint num="19" id="2458" /> -<TGConnectingPoint num="20" id="2459" /> -<TGConnectingPoint num="21" id="2460" /> -<TGConnectingPoint num="22" id="2461" /> -<TGConnectingPoint num="23" id="2462" /> -<TGConnectingPoint num="24" id="2463" /> -<TGConnectingPoint num="25" id="2464" /> -<TGConnectingPoint num="26" id="2465" /> -<TGConnectingPoint num="27" id="2466" /> -<TGConnectingPoint num="28" id="2467" /> -<TGConnectingPoint num="29" id="2468" /> -<TGConnectingPoint num="30" id="2469" /> -<TGConnectingPoint num="31" id="2470" /> -<TGConnectingPoint num="32" id="2471" /> -<TGConnectingPoint num="33" id="2472" /> -<TGConnectingPoint num="34" id="2473" /> -<TGConnectingPoint num="35" id="2474" /> -<TGConnectingPoint num="36" id="2475" /> -<TGConnectingPoint num="37" id="2476" /> -<TGConnectingPoint num="38" id="2477" /> -<TGConnectingPoint num="39" id="2478" /> -<extraparam> -</extraparam> -</COMPONENT> - -<COMPONENT type="5106" id="2520" > -<cdparam x="338" y="120" /> -<sizeparam width="50" height="30" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="state0" value="main" /> -<TGConnectingPoint num="0" id="2480" /> -<TGConnectingPoint num="1" id="2481" /> -<TGConnectingPoint num="2" id="2482" /> -<TGConnectingPoint num="3" id="2483" /> -<TGConnectingPoint num="4" id="2484" /> -<TGConnectingPoint num="5" id="2485" /> -<TGConnectingPoint num="6" id="2486" /> -<TGConnectingPoint num="7" id="2487" /> -<TGConnectingPoint num="8" id="2488" /> -<TGConnectingPoint num="9" id="2489" /> -<TGConnectingPoint num="10" id="2490" /> -<TGConnectingPoint num="11" id="2491" /> -<TGConnectingPoint num="12" id="2492" /> -<TGConnectingPoint num="13" id="2493" /> -<TGConnectingPoint num="14" id="2494" /> -<TGConnectingPoint num="15" id="2495" /> -<TGConnectingPoint num="16" id="2496" /> -<TGConnectingPoint num="17" id="2497" /> -<TGConnectingPoint num="18" id="2498" /> -<TGConnectingPoint num="19" id="2499" /> -<TGConnectingPoint num="20" id="2500" /> -<TGConnectingPoint num="21" id="2501" /> -<TGConnectingPoint num="22" id="2502" /> -<TGConnectingPoint num="23" id="2503" /> -<TGConnectingPoint num="24" id="2504" /> -<TGConnectingPoint num="25" id="2505" /> -<TGConnectingPoint num="26" id="2506" /> -<TGConnectingPoint num="27" id="2507" /> -<TGConnectingPoint num="28" id="2508" /> -<TGConnectingPoint num="29" id="2509" /> -<TGConnectingPoint num="30" id="2510" /> -<TGConnectingPoint num="31" id="2511" /> -<TGConnectingPoint num="32" id="2512" /> -<TGConnectingPoint num="33" id="2513" /> -<TGConnectingPoint num="34" id="2514" /> -<TGConnectingPoint num="35" id="2515" /> -<TGConnectingPoint num="36" id="2516" /> -<TGConnectingPoint num="37" id="2517" /> -<TGConnectingPoint num="38" id="2518" /> -<TGConnectingPoint num="39" id="2519" /> -<extraparam> -</extraparam> -</COMPONENT> - -<COMPONENT type="5100" id="2522" > -<cdparam x="355" y="81" /> +<TGConnectingPoint num="0" id="1636" /> +<TGConnectingPoint num="1" id="1637" /> +<TGConnectingPoint num="2" id="1638" /> +<TGConnectingPoint num="3" id="1639" /> +<TGConnectingPoint num="4" id="1640" /> +<TGConnectingPoint num="5" id="1641" /> +<TGConnectingPoint num="6" id="1642" /> +<TGConnectingPoint num="7" id="1643" /> +<TGConnectingPoint num="8" id="1644" /> +<TGConnectingPoint num="9" id="1645" /> +</SUBCOMPONENT> +<SUBCOMPONENT type="5100" id="1648" > +<father id="1689" num="1" /> +<cdparam x="333" y="213" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<cdrectangleparam minX="0" maxX="169" minY="0" maxY="115" /> <infoparam name="start state" value="null" /> -<TGConnectingPoint num="0" id="2521" /> -</COMPONENT> - - -</AVATARStateMachineDiagramPanel> - -<AVATARStateMachineDiagramPanel name="CoffeeButton" minX="10" maxX="1400" minY="10" maxY="900" > -<CONNECTOR type="5102" id="2529" > -<cdparam x="323" y="118" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector" value="null" /> -<TGConnectingPoint num="0" id="2528" /> -<P1 x="323" y="118" id="2602" /> -<P2 x="341" y="200" id="2544" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="2527" > -<father id="2529" num="0" /> -<cdparam x="323" y="158" /> -<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="2523" /> -<TGConnectingPoint num="1" id="2524" /> -<TGConnectingPoint num="2" id="2525" /> -<TGConnectingPoint num="3" id="2526" /> -<extraparam> -<guard value="[ ]" /> -<afterMin value="" /> -<afterMax value="" /> -<computeMin value="" /> -<computeMax value="" /> -</extraparam> -</SUBCOMPONENT> - -<CONNECTOR type="5102" id="2536" > -<cdparam x="322" y="69" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector from start state to state0" value="null" /> -<TGConnectingPoint num="0" id="2535" /> -<P1 x="322" y="69" id="2637" /> -<P2 x="323" y="88" id="2597" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="2534" > -<father id="2536" num="0" /> -<cdparam x="322" y="109" /> -<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="2530" /> -<TGConnectingPoint num="1" id="2531" /> -<TGConnectingPoint num="2" id="2532" /> -<TGConnectingPoint num="3" id="2533" /> -<extraparam> -<guard value="[ ]" /> -<afterMin value="" /> -<afterMax value="" /> -<computeMin value="" /> -<computeMax value="" /> -</extraparam> -</SUBCOMPONENT> - -<CONNECTOR type="5102" id="2543" > -<cdparam x="365" y="135" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector from Send signal to state0" value="null" /> -<TGConnectingPoint num="0" id="2542" /> -<P1 x="341" y="230" id="2545" /> -<P2 x="387" y="300" id="2556" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="2541" > -<father id="2543" num="0" /> -<cdparam x="405" y="283" /> -<sizeparam width="149" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="2537" /> -<TGConnectingPoint num="1" id="2538" /> -<TGConnectingPoint num="2" id="2539" /> -<TGConnectingPoint num="3" id="2540" /> -<extraparam> -<guard value="[ ]" /> -<afterMin value="mechanicalDelay" /> -<afterMax value="" /> -<computeMin value="" /> -<computeMax value="" /> -</extraparam> +<TGConnectingPoint num="0" id="1647" /> </SUBCOMPONENT> -<COMPONENT type="5103" id="2554" > -<cdparam x="316" y="205" /> -<sizeparam width="51" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="Send signal" value="push()" /> -<TGConnectingPoint num="0" id="2544" /> -<TGConnectingPoint num="1" id="2545" /> -<TGConnectingPoint num="2" id="2546" /> -<TGConnectingPoint num="3" id="2547" /> -<TGConnectingPoint num="4" id="2548" /> -<TGConnectingPoint num="5" id="2549" /> -<TGConnectingPoint num="6" id="2550" /> -<TGConnectingPoint num="7" id="2551" /> -<TGConnectingPoint num="8" id="2552" /> -<TGConnectingPoint num="9" id="2553" /> -</COMPONENT> - -<COMPONENT type="5106" id="2595" > -<cdparam x="362" y="300" /> -<sizeparam width="50" height="30" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="state0" value="main" /> -<TGConnectingPoint num="0" id="2555" /> -<TGConnectingPoint num="1" id="2556" /> -<TGConnectingPoint num="2" id="2557" /> -<TGConnectingPoint num="3" id="2558" /> -<TGConnectingPoint num="4" id="2559" /> -<TGConnectingPoint num="5" id="2560" /> -<TGConnectingPoint num="6" id="2561" /> -<TGConnectingPoint num="7" id="2562" /> -<TGConnectingPoint num="8" id="2563" /> -<TGConnectingPoint num="9" id="2564" /> -<TGConnectingPoint num="10" id="2565" /> -<TGConnectingPoint num="11" id="2566" /> -<TGConnectingPoint num="12" id="2567" /> -<TGConnectingPoint num="13" id="2568" /> -<TGConnectingPoint num="14" id="2569" /> -<TGConnectingPoint num="15" id="2570" /> -<TGConnectingPoint num="16" id="2571" /> -<TGConnectingPoint num="17" id="2572" /> -<TGConnectingPoint num="18" id="2573" /> -<TGConnectingPoint num="19" id="2574" /> -<TGConnectingPoint num="20" id="2575" /> -<TGConnectingPoint num="21" id="2576" /> -<TGConnectingPoint num="22" id="2577" /> -<TGConnectingPoint num="23" id="2578" /> -<TGConnectingPoint num="24" id="2579" /> -<TGConnectingPoint num="25" id="2580" /> -<TGConnectingPoint num="26" id="2581" /> -<TGConnectingPoint num="27" id="2582" /> -<TGConnectingPoint num="28" id="2583" /> -<TGConnectingPoint num="29" id="2584" /> -<TGConnectingPoint num="30" id="2585" /> -<TGConnectingPoint num="31" id="2586" /> -<TGConnectingPoint num="32" id="2587" /> -<TGConnectingPoint num="33" id="2588" /> -<TGConnectingPoint num="34" id="2589" /> -<TGConnectingPoint num="35" id="2590" /> -<TGConnectingPoint num="36" id="2591" /> -<TGConnectingPoint num="37" id="2592" /> -<TGConnectingPoint num="38" id="2593" /> -<TGConnectingPoint num="39" id="2594" /> -<extraparam> -</extraparam> -</COMPONENT> - -<COMPONENT type="5106" id="2636" > -<cdparam x="298" y="88" /> -<sizeparam width="50" height="30" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="state0" value="main" /> -<TGConnectingPoint num="0" id="2596" /> -<TGConnectingPoint num="1" id="2597" /> -<TGConnectingPoint num="2" id="2598" /> -<TGConnectingPoint num="3" id="2599" /> -<TGConnectingPoint num="4" id="2600" /> -<TGConnectingPoint num="5" id="2601" /> -<TGConnectingPoint num="6" id="2602" /> -<TGConnectingPoint num="7" id="2603" /> -<TGConnectingPoint num="8" id="2604" /> -<TGConnectingPoint num="9" id="2605" /> -<TGConnectingPoint num="10" id="2606" /> -<TGConnectingPoint num="11" id="2607" /> -<TGConnectingPoint num="12" id="2608" /> -<TGConnectingPoint num="13" id="2609" /> -<TGConnectingPoint num="14" id="2610" /> -<TGConnectingPoint num="15" id="2611" /> -<TGConnectingPoint num="16" id="2612" /> -<TGConnectingPoint num="17" id="2613" /> -<TGConnectingPoint num="18" id="2614" /> -<TGConnectingPoint num="19" id="2615" /> -<TGConnectingPoint num="20" id="2616" /> -<TGConnectingPoint num="21" id="2617" /> -<TGConnectingPoint num="22" id="2618" /> -<TGConnectingPoint num="23" id="2619" /> -<TGConnectingPoint num="24" id="2620" /> -<TGConnectingPoint num="25" id="2621" /> -<TGConnectingPoint num="26" id="2622" /> -<TGConnectingPoint num="27" id="2623" /> -<TGConnectingPoint num="28" id="2624" /> -<TGConnectingPoint num="29" id="2625" /> -<TGConnectingPoint num="30" id="2626" /> -<TGConnectingPoint num="31" id="2627" /> -<TGConnectingPoint num="32" id="2628" /> -<TGConnectingPoint num="33" id="2629" /> -<TGConnectingPoint num="34" id="2630" /> -<TGConnectingPoint num="35" id="2631" /> -<TGConnectingPoint num="36" id="2632" /> -<TGConnectingPoint num="37" id="2633" /> -<TGConnectingPoint num="38" id="2634" /> -<TGConnectingPoint num="39" id="2635" /> -<extraparam> -</extraparam> -</COMPONENT> - -<COMPONENT type="5100" id="2638" > -<cdparam x="315" y="49" /> -<sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="start state" value="null" /> -<TGConnectingPoint num="0" id="2637" /> -</COMPONENT> - </AVATARStateMachineDiagramPanel> diff --git a/src/main/java/avatartranslator/AvatarSyntaxChecker.java b/src/main/java/avatartranslator/AvatarSyntaxChecker.java index ae23b52d26..9e9cbd253a 100644 --- a/src/main/java/avatartranslator/AvatarSyntaxChecker.java +++ b/src/main/java/avatartranslator/AvatarSyntaxChecker.java @@ -126,6 +126,28 @@ public class AvatarSyntaxChecker { } + public static int isAValidProbabilityExpr(AvatarSpecification _as, AvatarStateMachineOwner _ab, String _expr) { + if (_expr.trim().length() == 0) { + return 0; + } + + String tmp = _expr.replaceAll(" ", "").trim(); + double prob = 0.5; + + try { + prob = new Double(tmp).doubleValue(); + } catch (Exception e) { + return -1; + } + + if ((prob <0) || (prob > 1)) { + return -1; + } + + return 0; + + } + public static int isAValidBoolExpr(AvatarSpecification _as, AvatarStateMachineOwner _ab, String _expr) { if (_expr.trim().length() == 0) { return 0; diff --git a/src/main/java/avatartranslator/AvatarTransition.java b/src/main/java/avatartranslator/AvatarTransition.java index 910050a314..864ea18609 100644 --- a/src/main/java/avatartranslator/AvatarTransition.java +++ b/src/main/java/avatartranslator/AvatarTransition.java @@ -98,6 +98,10 @@ public class AvatarTransition extends AvatarStateMachineElement { public void setProbability(double _probability) { probability = _probability; } + public double getProbability() { + return probability; + } + public void addGuard(String _g) { AvatarGuard guard = AvatarGuard.createFromString(this.block, _g); @@ -300,6 +304,7 @@ public class AvatarTransition extends AvatarStateMachineElement { at.setComputes(getMinCompute(), getMaxCompute()); at.setDelays(getMinDelay(), getMaxDelay()); + at.setProbability(getProbability()); return at; } diff --git a/src/main/java/avatartranslator/directsimulation/AvatarSimulationBlock.java b/src/main/java/avatartranslator/directsimulation/AvatarSimulationBlock.java index 740b5f77a4..92355fe0d2 100644 --- a/src/main/java/avatartranslator/directsimulation/AvatarSimulationBlock.java +++ b/src/main/java/avatartranslator/directsimulation/AvatarSimulationBlock.java @@ -1,26 +1,26 @@ /* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille - * + * * ludovic.apvrille AT enst.fr - * + * * This software is a computer program whose purpose is to allow the * edition of TURTLE analysis, design and deployment diagrams, to * allow the generation of RT-LOTOS or Java code from this diagram, * and at last to allow the analysis of formal validation traces * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP * from INRIA Rhone-Alpes. - * + * * This software is governed by the CeCILL license under French law and * abiding by the rules of distribution of free software. You can use, * modify and/ or redistribute the software under the terms of the CeCILL * license as circulated by CEA, CNRS and INRIA at the following URL * "http://www.cecill.info". - * + * * As a counterpart to the access to the source code and rights to copy, * modify and redistribute granted by the license, users are provided only * with a limited warranty and the software's author, the holder of the * economic rights, and the successive licensors have only limited * liability. - * + * * In this respect, the user's attention is drawn to the risks associated * with loading, using, modifying and/or developing or reproducing the * software by the user in light of its specific status of free software, @@ -31,15 +31,12 @@ * requirements in conditions enabling the security of their systems and/or * data to be ensured and, more generally, to use and operate it in the * same conditions as regards security. - * + * * The fact that you are presently reading this means that you have had * knowledge of the CeCILL license and that you accept its terms. */ - - - package avatartranslator.directsimulation; import avatartranslator.*; @@ -51,20 +48,21 @@ import myutil.TraceManager; import java.util.Vector; /** - * Class AvatarSimulationBlock - * Avatar: notion of block in simulation - * Creation: 14/12/2010 - * @version 1.0 14/12/2010 - * @author Ludovic APVRILLE + * Class AvatarSimulationBlock + * Avatar: notion of block in simulation + * Creation: 14/12/2010 + * + * @author Ludovic APVRILLE + * @version 1.0 14/12/2010 */ -public class AvatarSimulationBlock { +public class AvatarSimulationBlock { public final static int NOT_STARTED = 0; public final static int STARTED = 1; public final static int COMPLETED = 2; private AvatarBlock block; private AvatarSimulationTransaction lastTransaction; - private Vector <AvatarSimulationTransaction> transactions; + private Vector<AvatarSimulationTransaction> transactions; private boolean completed; public boolean selected; // Free use for graphic purpose private int forcedRandom = -1; @@ -107,7 +105,7 @@ public class AvatarSimulationBlock { } public String toString() { - return "AvatarSimulationBlock:" + getName(); + return "AvatarSimulationBlock:" + getName(); } public int getID() { @@ -171,7 +169,7 @@ public class AvatarSimulationBlock { AvatarSimulationPendingTransaction aspt; AvatarStateMachineElement asme; boolean guardOk; - for(int i=0; i<lastTransaction.executedElement.nbOfNexts(); i++) { + for (int i = 0; i < lastTransaction.executedElement.nbOfNexts(); i++) { asme = lastTransaction.executedElement.getNext(i); if (asme == null) { @@ -180,10 +178,10 @@ public class AvatarSimulationBlock { guardOk = true; // Guard on transition ? -> must evaluate the guard! if (asme instanceof AvatarTransition) { - AvatarTransition at = (AvatarTransition)(asme); + AvatarTransition at = (AvatarTransition) (asme); if (at.isGuarded()) { // Must evaluate the guard - String guard = at.getGuard().toString (); + String guard = at.getGuard().toString(); String s = Conversion.replaceAllString(guard, "[", "").trim(); s = Conversion.replaceAllString(s, "]", "").trim(); guardOk = evaluateBoolExpression(s, lastTransaction.attributeValues); @@ -191,29 +189,29 @@ public class AvatarSimulationBlock { } } - if(guardOk) { + if (guardOk) { aspt = new AvatarSimulationPendingTransaction(); aspt.asb = this; aspt.elementToExecute = lastTransaction.executedElement.getNext(i); aspt.previouslyExecutedElement = lastTransaction.executedElement; if ((aspt.elementToExecute instanceof AvatarTransition) && (lastTransaction.executedElement instanceof AvatarState)) { - AvatarTransition trans = (AvatarTransition)(aspt.elementToExecute); - if (trans.getNbOfAction() == 0){ + AvatarTransition trans = (AvatarTransition) (aspt.elementToExecute); + if (trans.getNbOfAction() == 0) { // empty transition, "empty" is the meaning of actions -> look for an action after - if(trans.getNext(0) != null) { + if (trans.getNext(0) != null) { if (trans.getNext(0) instanceof AvatarActionOnSignal) { aspt.involvedElement = trans; aspt.elementToExecute = trans.getNext(0); } else if (trans.getNext(0) instanceof AvatarRandom) { - aspt.involvedElement = trans; + aspt.involvedElement = trans; aspt.elementToExecute = trans.getNext(0); - } + } } } } if (aspt.elementToExecute instanceof AvatarTransition) { - AvatarTransition trans = (AvatarTransition)(aspt.elementToExecute); + AvatarTransition trans = (AvatarTransition) (aspt.elementToExecute); if (trans.hasDelay()) { aspt.myMinDelay = evaluateIntExpression(trans.getMinDelay(), lastTransaction.attributeValues); aspt.myMaxDelay = evaluateIntExpression(trans.getMaxDelay(), lastTransaction.attributeValues); @@ -221,12 +219,13 @@ public class AvatarSimulationBlock { if (lastTransaction != null) { if (lastTransaction.clockValueWhenFinished < _clockValue) { aspt.hasElapsedTime = true; - aspt.elapsedTime = (int)(_clockValue - lastTransaction.clockValueWhenFinished); + aspt.elapsedTime = (int) (_clockValue - lastTransaction.clockValueWhenFinished); } } + aspt.probability = trans.getProbability(); } } else if (aspt.involvedElement instanceof AvatarTransition) { - AvatarTransition trans = (AvatarTransition)(aspt.involvedElement); + AvatarTransition trans = (AvatarTransition) (aspt.involvedElement); if (trans.hasDelay()) { aspt.myMinDelay = evaluateIntExpression(trans.getMinDelay(), lastTransaction.attributeValues); aspt.myMaxDelay = evaluateIntExpression(trans.getMaxDelay(), lastTransaction.attributeValues); @@ -237,7 +236,7 @@ public class AvatarSimulationBlock { if (lastTransaction != null) { if (lastTransaction.clockValueWhenFinished < _clockValue) { aspt.hasElapsedTime = true; - aspt.elapsedTime = (int)(_clockValue - lastTransaction.clockValueWhenFinished); + aspt.elapsedTime = (int) (_clockValue - lastTransaction.clockValueWhenFinished); } } } @@ -245,8 +244,8 @@ public class AvatarSimulationBlock { aspt.clockValue = _clockValue; if (aspt.hasElapsedTime) { - aspt.myMinDelay = aspt.myMinDelay -aspt.elapsedTime; - aspt.myMaxDelay = aspt.myMaxDelay -aspt.elapsedTime; + aspt.myMinDelay = aspt.myMinDelay - aspt.elapsedTime; + aspt.myMaxDelay = aspt.myMaxDelay - aspt.elapsedTime; } if (aspt.hasDelay) { @@ -276,7 +275,7 @@ public class AvatarSimulationBlock { } - public void executeElement(Vector<AvatarSimulationTransaction>_allTransactions, AvatarStateMachineElement _elt, long _clockValue, AvatarSimulationPendingTransaction _aspt, long _bunchid) { + public void executeElement(Vector<AvatarSimulationTransaction> _allTransactions, AvatarStateMachineElement _elt, long _clockValue, AvatarSimulationPendingTransaction _aspt, long _bunchid) { // Stop state if (_elt instanceof AvatarStopState) { makeExecutedTransaction(_allTransactions, _elt, _clockValue, _aspt, _bunchid); @@ -330,12 +329,12 @@ public class AvatarSimulationBlock { if (_aspt != null) { _aspt.clockValueAtEnd = _clockValue; if (_aspt.hasClock) { - if(_aspt.hasElapsedTime) { + if (_aspt.hasElapsedTime) { ast.duration = _aspt.elapsedTime + _aspt.selectedDuration; } else { ast.duration = _aspt.selectedDuration; - ast.duration = Math.min(_aspt.myMaxDuration+_aspt.elapsedTime, ast.duration); - ast.duration = Math.max(_aspt.myMinDuration+_aspt.elapsedTime, ast.duration); + ast.duration = Math.min(_aspt.myMaxDuration + _aspt.elapsedTime, ast.duration); + ast.duration = Math.max(_aspt.myMinDuration + _aspt.elapsedTime, ast.duration); } ast.clockValueWhenFinished = _aspt.selectedDuration + _clockValue; _aspt.clockValueAtEnd = ast.clockValueWhenFinished; @@ -348,23 +347,23 @@ public class AvatarSimulationBlock { Vector<String> attributeValues = new Vector<String>(); String s; if (lastTransaction == null) { - for(AvatarAttribute aa: block.getAttributes()) { + for (AvatarAttribute aa : block.getAttributes()) { s = new String(aa.getInitialValue()); attributeValues.add(s); } } else { // Recopy of previous values - for(String ss: lastTransaction.attributeValues) { - attributeValues.add(""+ss); + for (String ss : lastTransaction.attributeValues) { + attributeValues.add("" + ss); } // Transition? if (_elt instanceof AvatarTransition) { - at = (AvatarTransition)(_elt); + at = (AvatarTransition) (_elt); // Must compute new values of attributes if (at.hasActions()) { actions = new Vector<String>(); - for(i=0; i<at.getNbOfAction(); i++) { - action = at.getAction(i).toString (); + for (i = 0; i < at.getNbOfAction(); i++) { + action = at.getAction(i).toString(); //TraceManager.addDev("action #" + i + " = " + action); makeAction(action, attributeValues, actions); } @@ -374,18 +373,18 @@ public class AvatarSimulationBlock { // Random? if (_elt instanceof AvatarRandom) { - AvatarRandom random = (AvatarRandom)(_elt); + AvatarRandom random = (AvatarRandom) (_elt); index = block.getIndexOfAvatarAttributeWithName(random.getVariable()); - if (index >-1) { + if (index > -1) { int valMin = evaluateIntExpression(random.getMinValue(), attributeValues); int valMax = evaluateIntExpression(random.getMaxValue(), attributeValues); - if ((forcedRandom > -1) && (forcedRandom >= valMin) && (forcedRandom <= valMax)){ + if ((forcedRandom > -1) && (forcedRandom >= valMin) && (forcedRandom <= valMax)) { // Use provided value as random value valMin = forcedRandom; } else { // randomnly select a value - valMin = (int)(Math.floor((Math.random()) * (valMax - valMin + 1))) + valMin; + valMin = (int) (Math.floor((Math.random()) * (valMax - valMin + 1))) + valMin; } attributeValues.remove(index); attributeValues.add(index, "" + valMin); @@ -396,17 +395,17 @@ public class AvatarSimulationBlock { // Action on signal? if (_elt instanceof AvatarActionOnSignal) { - AvatarActionOnSignal aaos = (AvatarActionOnSignal)_elt; + AvatarActionOnSignal aaos = (AvatarActionOnSignal) _elt; if (_aspt != null) { // Must put the right parameters if (_aspt.isSynchronous) { // Synchronous call - if ((_aspt.isSending) && ((_aspt.linkedTransaction != null ) || (_aspt.linkedTransactions != null))){ + if ((_aspt.isSending) && ((_aspt.linkedTransaction != null) || (_aspt.linkedTransactions != null))) { // Synchronous Sending! // Must be in the receiving transaction the right parameters Vector<String> parameters = new Vector<String>(); //TraceManager.addDev("Adding value in :" + aaos); - for(i=0; i<aaos.getNbOfValues(); i++) { + for (i = 0; i < aaos.getNbOfValues(); i++) { value = aaos.getValue(i); // Must get the type of the value //TraceManager.addDev("Sending aaos: " + aaos + " block=" + block.getName()); @@ -432,16 +431,16 @@ public class AvatarSimulationBlock { } if (_aspt.linkedTransactions != null) { - for(AvatarSimulationPendingTransaction aspt0: _aspt.linkedTransactions) { + for (AvatarSimulationPendingTransaction aspt0 : _aspt.linkedTransactions) { aspt0.parameters = parameters; } } //} - } else if ((!(_aspt.isSending)) && (_aspt.parameters != null)){ + } else if ((!(_aspt.isSending)) && (_aspt.parameters != null)) { //TraceManager.addDev("Reading value " + aaos); // Synchronous Receiving String myAction = ""; - for(i=0; i<aaos.getNbOfValues(); i++) { + for (i = 0; i < aaos.getNbOfValues(); i++) { //TraceManager.addDev("Reading value #" + i); param = _aspt.parameters.get(i); name = aaos.getValue(i); @@ -467,13 +466,13 @@ public class AvatarSimulationBlock { } else { // Asynchronous call - if ((_aspt.isSending) && (_aspt.linkedAsynchronousMessage != null)){ + if ((_aspt.isSending) && (_aspt.linkedAsynchronousMessage != null)) { // Asynchronous Sending String myAction = ""; _aspt.linkedAsynchronousMessage.firstTransaction = ast; ast.sentMessage = _aspt.linkedAsynchronousMessage; - for(i=0; i<aaos.getNbOfValues(); i++) { + for (i = 0; i < aaos.getNbOfValues(); i++) { value = aaos.getValue(i); // Must get the type of the value avat = aaos.getSignal().getListOfAttributes().get(i); @@ -507,7 +506,7 @@ public class AvatarSimulationBlock { if (_aspt.linkedAsynchronousMessage.firstTransaction == null) { TraceManager.addDev("NULL FIRST TRANSACTION !!!"); } - for(i=0; i<aaos.getNbOfValues(); i++) { + for (i = 0; i < aaos.getNbOfValues(); i++) { param = _aspt.linkedAsynchronousMessage.getParameters().get(i); name = aaos.getValue(i); index = block.getIndexOfAvatarAttributeWithName(name); @@ -547,9 +546,9 @@ public class AvatarSimulationBlock { String nameOfMethod; int ind; - AvatarAction action = AvatarTerm.createActionFromString (block, _action); + AvatarAction action = AvatarTerm.createActionFromString(block, _action); // TODO: use the new AvatarAction class instead of re-parsing - if (action.isAMethodCall ()) { + if (action.isAMethodCall()) { // Evaluate all elements of the method call! ind = _action.indexOf("("); if (ind == -1) { @@ -557,17 +556,17 @@ public class AvatarSimulationBlock { } nameOfVar = _action.substring(0, ind).trim(); - act = _action.substring(ind+1, _action.length()).trim(); + act = _action.substring(ind + 1, _action.length()).trim(); ind = act.lastIndexOf(")"); - if(ind == -1) { + if (ind == -1) { return; } act = act.substring(0, ind); ind = nameOfVar.indexOf("="); if (ind != -1) { - nameOfMethod = nameOfVar.substring(ind+1, nameOfVar.length()); + nameOfMethod = nameOfVar.substring(ind + 1, nameOfVar.length()); } else { nameOfMethod = nameOfVar; } @@ -577,13 +576,13 @@ public class AvatarSimulationBlock { String s; int indexAtt; int cpt = 0; - for(int i=0; i<params.length; i++) { + for (int i = 0; i < params.length; i++) { s = params[i].trim(); if (s.length() > 0) { indexAtt = block.getIndexOfAvatarAttributeWithName(s); //TraceManager.addDev("indexAtt=" + indexAtt + " s=" + s); if (indexAtt > -1) { - if (cpt>0) { + if (cpt > 0) { parameters += ", "; } parameters += _attributeValues.get(indexAtt); @@ -602,13 +601,12 @@ public class AvatarSimulationBlock { return; } - nameOfVar= _action.substring(0, ind).trim(); - act = _action.substring(ind+1, _action.length()); + nameOfVar = _action.substring(0, ind).trim(); + act = _action.substring(ind + 1, _action.length()); //TraceManager.addDev("1- Working on attribute =" + nameOfVar + " action=" + _action); - // Variable //TraceManager.addDev("2- Working on attribute =" + nameOfVar); int indexVar = block.getIndexOfAvatarAttributeWithName(nameOfVar); @@ -619,12 +617,12 @@ public class AvatarSimulationBlock { int result = evaluateIntExpression(act, _attributeValues); _actions.add(nameOfVar + " = " + result); _attributeValues.remove(indexVar); - _attributeValues.add(indexVar, ""+result); + _attributeValues.add(indexVar, "" + result); } else if (type == AvatarType.BOOLEAN) { boolean bool = evaluateBoolExpression(act, _attributeValues); _actions.add(nameOfVar + " = " + bool); _attributeValues.remove(indexVar); - _attributeValues.add(indexVar, ""+bool); + _attributeValues.add(indexVar, "" + bool); } } @@ -633,7 +631,6 @@ public class AvatarSimulationBlock { } - public void addExecutedTransaction(Vector<AvatarSimulationTransaction> _allTransactions, AvatarSimulationTransaction _ast) { transactions.add(_ast); lastTransaction = _ast; @@ -642,9 +639,9 @@ public class AvatarSimulationBlock { public void removeLastTransaction(AvatarSimulationTransaction _ast) { if (lastTransaction == _ast) { - transactions.removeElementAt(transactions.size()-1); + transactions.removeElementAt(transactions.size() - 1); if (transactions.size() > 0) { - lastTransaction = transactions.get(transactions.size()-1); + lastTransaction = transactions.get(transactions.size() - 1); } else { lastTransaction = null; } @@ -666,28 +663,28 @@ public class AvatarSimulationBlock { public int evaluateIntExpression(String _expr, Vector<String> _attributeValues) { String act = _expr; int cpt = 0; - for(String attrValue: _attributeValues) { + for (String attrValue : _attributeValues) { if (attrValue.trim().startsWith("-")) { attrValue = "(0" + attrValue + ")"; } act = Conversion.putVariableValueInString(AvatarSpecification.ops, act, getAttributeName(cpt), attrValue); - cpt ++; + cpt++; } //TraceManager.addDev("Evaluating expression: " + act); - return (int)(new IntExpressionEvaluator().getResultOf(act)); + return (int) (new IntExpressionEvaluator().getResultOf(act)); } public boolean evaluateBoolExpression(String _expr, Vector<String> _attributeValues) { String act = _expr; int cpt = 0; - for(String attrValue: _attributeValues) { + for (String attrValue : _attributeValues) { if (attrValue.trim().startsWith("-")) { attrValue = "(0" + attrValue + ")"; } act = Conversion.putVariableValueInString(AvatarSpecification.ops, act, getAttributeName(cpt), attrValue); - cpt ++; + cpt++; } BoolExpressionEvaluator bee = new BoolExpressionEvaluator(); diff --git a/src/main/java/avatartranslator/directsimulation/AvatarSimulationPendingTransaction.java b/src/main/java/avatartranslator/directsimulation/AvatarSimulationPendingTransaction.java index bb29dd5e5e..2aa88a425b 100644 --- a/src/main/java/avatartranslator/directsimulation/AvatarSimulationPendingTransaction.java +++ b/src/main/java/avatartranslator/directsimulation/AvatarSimulationPendingTransaction.java @@ -100,6 +100,9 @@ public class AvatarSimulationPendingTransaction { // Lost public boolean isLost; + // Probability of this transaction + public double probability = 0.5; + public AvatarSimulationPendingTransaction() { diff --git a/src/main/java/avatartranslator/directsimulation/AvatarSpecificationSimulation.java b/src/main/java/avatartranslator/directsimulation/AvatarSpecificationSimulation.java index 41a1989731..31ac604f55 100644 --- a/src/main/java/avatartranslator/directsimulation/AvatarSpecificationSimulation.java +++ b/src/main/java/avatartranslator/directsimulation/AvatarSpecificationSimulation.java @@ -1,26 +1,26 @@ /* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille - * + * * ludovic.apvrille AT enst.fr - * + * * This software is a computer program whose purpose is to allow the * edition of TURTLE analysis, design and deployment diagrams, to * allow the generation of RT-LOTOS or Java code from this diagram, * and at last to allow the analysis of formal validation traces * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP * from INRIA Rhone-Alpes. - * + * * This software is governed by the CeCILL license under French law and * abiding by the rules of distribution of free software. You can use, * modify and/ or redistribute the software under the terms of the CeCILL * license as circulated by CEA, CNRS and INRIA at the following URL * "http://www.cecill.info". - * + * * As a counterpart to the access to the source code and rights to copy, * modify and redistribute granted by the license, users are provided only * with a limited warranty and the software's author, the holder of the * economic rights, and the successive licensors have only limited * liability. - * + * * In this respect, the user's attention is drawn to the risks associated * with loading, using, modifying and/or developing or reproducing the * software by the user in light of its specific status of free software, @@ -31,15 +31,12 @@ * requirements in conditions enabling the security of their systems and/or * data to be ensured and, more generally, to use and operate it in the * same conditions as regards security. - * + * * The fact that you are presently reading this means that you have had * knowledge of the CeCILL license and that you accept its terms. */ - - - package avatartranslator.directsimulation; import avatartranslator.*; @@ -51,13 +48,14 @@ import java.util.Vector; /** - * Class AvatarSpecification - * Avatar specification - * Creation: 13/12/2010 - * @version 1.0 13/12/2010 - * @author Ludovic APVRILLE + * Class AvatarSpecification + * Avatar specification + * Creation: 13/12/2010 + * + * @author Ludovic APVRILLE + * @version 1.0 13/12/2010 */ -public class AvatarSpecificationSimulation { +public class AvatarSpecificationSimulation { public static int MAX_TRANSACTION_IN_A_ROW = 1000; public static int MAX_TRANSACTIONS = 100000; @@ -128,7 +126,7 @@ public class AvatarSpecificationSimulation { public void computeSelectedSimulationBlocks() { selectedBlocks = new Vector<AvatarSimulationBlock>(); - for (AvatarSimulationBlock block: blocks) { + for (AvatarSimulationBlock block : blocks) { if (block.selected) { selectedBlocks.add(block); } @@ -156,9 +154,9 @@ public class AvatarSpecificationSimulation { // Remove composite states avspec.removeCompositeStates(); - + // Remove library function calls - avspec.removeLibraryFunctionCalls (); + avspec.removeLibraryFunctionCalls(); // Remove timers avspec.removeTimers(); @@ -166,8 +164,8 @@ public class AvatarSpecificationSimulation { // Robustness avspec.makeRobustness(); - // remove FIFOs - //avspec.removeFIFOs(2); + // remove FIFOs + //avspec.removeFIFOs(2); TraceManager.addDev("-------Spec:" + avspec.toString() + "--------"); } @@ -191,14 +189,14 @@ public class AvatarSpecificationSimulation { int cpt = 0; Vector<AvatarSimulationBlock> tmpblocks = blocks; blocks = new Vector<AvatarSimulationBlock>(); - for(AvatarBlock block: avspec.getListOfBlocks()) { + for (AvatarBlock block : avspec.getListOfBlocks()) { if (block.hasARealBehaviour()) { AvatarSimulationBlock asb = new AvatarSimulationBlock(block); blocks.add(asb); if (tmpblocks != null) { asb.selected = tmpblocks.get(cpt).selected; } - cpt ++; + cpt++; } } //TraceManager.addDev("Nb of simulated blocks :" + blocks.size() + "\n"); @@ -233,135 +231,134 @@ public class AvatarSpecificationSimulation { //boolean executeNextState; - while(true) { + while (true) { //TraceManager.addDev("State=" + state); - switch(state) { - case INITIALIZE: - //TraceManager.addDev("-> -> INITIALIZE"); - initialize(); - setState(RESET); - break; + switch (state) { + case INITIALIZE: + //TraceManager.addDev("-> -> INITIALIZE"); + initialize(); + setState(RESET); + break; - case RESET: - //TraceManager.addDev("-> -> RESET"); - reset(); - // Execute silent transactions if necessary - setState(FIRST); - break; + case RESET: + //TraceManager.addDev("-> -> RESET"); + reset(); + // Execute silent transactions if necessary + setState(FIRST); + break; - case FIRST: - //TraceManager.addDev("-> -> FIRST"); - //stopped = false; - AvatarSimulationPendingTransaction silent; - int maxNb = 0; - while(maxNb < 50) { - gatherPendingTransactions(); - //TraceManager.addDev("Gather done"); - silent = getSilentTransactionToExecute(pendingTransactions); - if (silent == null) { - setState(GATHER); - break; + case FIRST: + //TraceManager.addDev("-> -> FIRST"); + //stopped = false; + AvatarSimulationPendingTransaction silent; + int maxNb = 0; + while (maxNb < 50) { + gatherPendingTransactions(); + //TraceManager.addDev("Gather done"); + silent = getSilentTransactionToExecute(pendingTransactions); + if (silent == null) { + setState(GATHER); + break; - } else { - //TraceManager.addDev("Second option"); - maxNb ++; - // Must execute the silent pending transactions until none available - Vector<AvatarSimulationPendingTransaction> vect=new Vector<AvatarSimulationPendingTransaction>(); - vect.add(silent); - performSelectedTransactions(vect); - //nbOfCommands = 1; - //nbOfCommandsActivated = true; - //TraceManager.addDev("Second option done"); - setState(EXECUTE); + } else { + //TraceManager.addDev("Second option"); + maxNb++; + // Must execute the silent pending transactions until none available + Vector<AvatarSimulationPendingTransaction> vect = new Vector<AvatarSimulationPendingTransaction>(); + vect.add(silent); + performSelectedTransactions(vect); + //nbOfCommands = 1; + //nbOfCommandsActivated = true; + //TraceManager.addDev("Second option done"); + setState(EXECUTE); + } } - } - break; - + break; - case GATHER: - //TraceManager.addDev("-> -> GATHER"); - gatherPendingTransactions(); - if (pendingTransactions.size() == 0) { - setState(TERMINATED); - //TraceManager.addDev("No more pending transactions"); - } else { - //TraceManager.addDev("pending transactions"); - if ((nbOfCommandsActivated) && (nbOfCommands < 1)) { - //TraceManager.addDev("1. pending transactions"); - if (getSilentTransactionToExecute(pendingTransactions) == null) { - //TraceManager.addDev("Dont execute"); - setState(DONT_EXECUTE); + case GATHER: + //TraceManager.addDev("-> -> GATHER"); + gatherPendingTransactions(); + if (pendingTransactions.size() == 0) { + setState(TERMINATED); + //TraceManager.addDev("No more pending transactions"); + } else { + //TraceManager.addDev("pending transactions"); + if ((nbOfCommandsActivated) && (nbOfCommands < 1)) { + //TraceManager.addDev("1. pending transactions"); + if (getSilentTransactionToExecute(pendingTransactions) == null) { + //TraceManager.addDev("Dont execute"); + setState(DONT_EXECUTE); + } else { + //TraceManager.addDev("Execute"); + setState(EXECUTE); + stopped = false; + } } else { - //TraceManager.addDev("Execute"); + //TraceManager.addDev("2. pending transactions"); setState(EXECUTE); - stopped = false; } - } else { - //TraceManager.addDev("2. pending transactions"); - setState(EXECUTE); } - } - break; + break; - case EXECUTE: - //TraceManager.addDev("-> -> EXECUTE"); - silentTransactionExecuted = false; - selectedTransactions = selectTransactions(pendingTransactions); + case EXECUTE: + //TraceManager.addDev("-> -> EXECUTE"); + silentTransactionExecuted = false; + selectedTransactions = selectTransactions(pendingTransactions); - if (selectedTransactions.size() == 0) { - setState(TERMINATED); - TraceManager.addDev("Deadlock: no transaction can be selected"); - } else { - //TraceManager.addDev("performSelectedTrans?"); - if (performSelectedTransactions(selectedTransactions)) { - if (!silentTransactionExecuted) { - if (nbOfCommandsActivated) { - nbOfCommands --; + if (selectedTransactions.size() == 0) { + setState(TERMINATED); + TraceManager.addDev("Deadlock: no transaction can be selected"); + } else { + //TraceManager.addDev("performSelectedTrans?"); + if (performSelectedTransactions(selectedTransactions)) { + if (!silentTransactionExecuted) { + if (nbOfCommandsActivated) { + nbOfCommands--; + } } - } - // If breakpoint at the end of selectTransactions -> set the nb of commands to 0 - for (AvatarSimulationPendingTransaction tr: selectedTransactions) { - AvatarStateMachineElement elt = tr.elementToExecute.getNext(0); - if (elt != null) { - if (elt.hasBreakpoint()) { - nbOfCommands = 0; - TraceManager.addDev("Brk reached"); + // If breakpoint at the end of selectTransactions -> set the nb of commands to 0 + for (AvatarSimulationPendingTransaction tr : selectedTransactions) { + AvatarStateMachineElement elt = tr.elementToExecute.getNext(0); + if (elt != null) { + if (elt.hasBreakpoint()) { + nbOfCommands = 0; + TraceManager.addDev("Brk reached"); + } } } - } - if (asi != null) { - asi.updateTransactionAndTime(allTransactions.size(), clockValue); + if (asi != null) { + asi.updateTransactionAndTime(allTransactions.size(), clockValue); + } + setState(GATHER); + } else { + setState(TERMINATED); + TraceManager.addDev("Error when executing transaction"); } - setState(GATHER); - } else { - setState(TERMINATED); - TraceManager.addDev("Error when executing transaction"); } - } - break; + break; - case DONT_EXECUTE: - //TraceManager.addDev("-> -> WAIT FOR EXECUTE"); - waitForExecute(); - break; + case DONT_EXECUTE: + //TraceManager.addDev("-> -> WAIT FOR EXECUTE"); + waitForExecute(); + break; - case TERMINATED: - TraceManager.addDev("-> -> TERMINATED"); - waitForResetOrNewState(); - break; + case TERMINATED: + TraceManager.addDev("-> -> TERMINATED"); + waitForResetOrNewState(); + break; - case KILLED: - TraceManager.addDev("-> -> KILLED"); - TraceManager.addDev("Simulation killed"); - return; + case KILLED: + TraceManager.addDev("-> -> KILLED"); + TraceManager.addDev("Simulation killed"); + return; - default: - TraceManager.addDev("-> -> UNKNOWN"); - TraceManager.addDev("Unknown state"); - setState(KILLED); + default: + TraceManager.addDev("-> -> UNKNOWN"); + TraceManager.addDev("Unknown state"); + setState(KILLED); } computeExternalCommands(); @@ -371,22 +368,24 @@ public class AvatarSpecificationSimulation { } public synchronized void waitForExecute() { - while(!reset && !newState && !killed && !go) { + while (!reset && !newState && !killed && !go) { try { wait(); - } catch(Exception e){} + } catch (Exception e) { + } } } public synchronized void waitForResetOrNewState() { - while(!reset && !newState && !killed) { + while (!reset && !newState && !killed) { try { wait(); - } catch(Exception e){} + } catch (Exception e) { + } } } - public synchronized void computeExternalCommands() { + public synchronized void computeExternalCommands() { //TraceManager.addDev("Computing external command"); if (state == KILLED) { @@ -426,7 +425,7 @@ public class AvatarSpecificationSimulation { setState(DONT_EXECUTE); } - if (go && (state == DONT_EXECUTE)) { + if (go && (state == DONT_EXECUTE)) { go = false; setState(EXECUTE); } @@ -498,7 +497,7 @@ public class AvatarSpecificationSimulation { pendingTransactions.clear(); // Gather all pending transactions from blocks - for(AvatarSimulationBlock asb: blocks) { + for (AvatarSimulationBlock asb : blocks) { pendingTransactions.addAll(asb.getPendingTransactions(allTransactions, clockValue, MAX_TRANSACTION_IN_A_ROW, bunchid)); } @@ -516,7 +515,7 @@ public class AvatarSpecificationSimulation { String res; AvatarBlock ab; int i; - for(AvatarSimulationPendingTransaction aspt: pendingTransactions) { + for (AvatarSimulationPendingTransaction aspt : pendingTransactions) { if (aspt.hasDelay) { aspt.myMinDuration = aspt.myMinDelay; aspt.myMaxDuration = aspt.myMaxDelay; @@ -531,9 +530,9 @@ public class AvatarSpecificationSimulation { } // Work on signals - for(AvatarSimulationPendingTransaction aspt: pendingTransactions) { + for (AvatarSimulationPendingTransaction aspt : pendingTransactions) { if (aspt.elementToExecute instanceof AvatarActionOnSignal) { - workOnAvatarActionOnSignalTransaction(ll, aspt, (AvatarActionOnSignal)(aspt.elementToExecute)); + workOnAvatarActionOnSignalTransaction(ll, aspt, (AvatarActionOnSignal) (aspt.elementToExecute)); } else { ll.add(aspt); } @@ -550,9 +549,9 @@ public class AvatarSpecificationSimulation { ll = new Vector<AvatarSimulationPendingTransaction>(); int nbOfPureLogicalTransitions = 0; - for(AvatarSimulationPendingTransaction aspt: pendingTransactions) { + for (AvatarSimulationPendingTransaction aspt : pendingTransactions) { if (!(aspt.hasDelay)) { - nbOfPureLogicalTransitions ++; + nbOfPureLogicalTransitions++; } } @@ -563,9 +562,9 @@ public class AvatarSpecificationSimulation { }*/ boolean hasSilentTransaction = false; - if (nbOfPureLogicalTransitions >0) { + if (nbOfPureLogicalTransitions > 0) { //TraceManager.addDev("Pure logical transaction"); - for(AvatarSimulationPendingTransaction aspt: pendingTransactions) { + for (AvatarSimulationPendingTransaction aspt : pendingTransactions) { if (!aspt.hasDelay) { if (isASilentTransaction(aspt, pendingTransactions)) { hasSilentTransaction = true; @@ -580,7 +579,7 @@ public class AvatarSpecificationSimulation { // Must keep only silent transactions //TraceManager.addDev("has silent logical transaction"); ll = new Vector<AvatarSimulationPendingTransaction>(); - for(AvatarSimulationPendingTransaction aspt: pendingTransactions) { + for (AvatarSimulationPendingTransaction aspt : pendingTransactions) { if (isASilentTransaction(aspt, pendingTransactions)) { ll.add(aspt); } @@ -598,7 +597,7 @@ public class AvatarSpecificationSimulation { int maxDuration = Integer.MAX_VALUE; int min, max; - for(AvatarSimulationPendingTransaction aspt: pendingTransactions) { + for (AvatarSimulationPendingTransaction aspt : pendingTransactions) { if (aspt.hasDelay) { if (aspt.myMinDuration < minMin) { minMin = aspt.myMinDuration; @@ -623,7 +622,7 @@ public class AvatarSpecificationSimulation { // Must compute the min index, and the max duration // We put in ll all transactions that are between the min and the max of the selected index AvatarSimulationPendingTransaction aspt_tmp = pendingTransactions.get(indexMin); - for(AvatarSimulationPendingTransaction aspt1: pendingTransactions) { + for (AvatarSimulationPendingTransaction aspt1 : pendingTransactions) { //TraceManager.addDev("aspt1 min=" + aspt1.myMinDuration + " max autre=" + aspt_tmp.myMaxDuration); if (aspt1.myMinDuration <= aspt_tmp.myMaxDuration) { ll.add(aspt1); @@ -646,8 +645,8 @@ public class AvatarSpecificationSimulation { public boolean isASilentTransaction(AvatarSimulationPendingTransaction aspt, Vector<AvatarSimulationPendingTransaction> _pendingTransactions) { if (aspt.elementToExecute instanceof AvatarTransition) { - AvatarTransition atr = (AvatarTransition)(aspt.elementToExecute); - if (!(atr.hasDelay()) && !(atr.hasCompute()) && !(atr.hasActions())){ + AvatarTransition atr = (AvatarTransition) (aspt.elementToExecute); + if (!(atr.hasDelay()) && !(atr.hasCompute()) && !(atr.hasActions())) { if ((aspt.previouslyExecutedElement != null) && (aspt.previouslyExecutedElement.nbOfNexts() < 2)) { //TraceManager.addDev("Stage 1"); if (nbOfTransactions(aspt.asb, _pendingTransactions) < 2) { @@ -657,7 +656,7 @@ public class AvatarSpecificationSimulation { } } // State entering? - } else if (((aspt.elementToExecute instanceof AvatarState) || (aspt.elementToExecute instanceof AvatarStopState))) { + } else if (((aspt.elementToExecute instanceof AvatarState) || (aspt.elementToExecute instanceof AvatarStopState))) { if (nbOfTransactions(aspt.asb, _pendingTransactions) < 2) { return true; } @@ -704,9 +703,9 @@ public class AvatarSpecificationSimulation { //TraceManager.addDev("Found a synchronous signal"); transactions.add(_aspt); _aspt.isBroadcast = true; - for(AvatarSimulationPendingTransaction otherTransaction: pendingTransactions) { - if ((otherTransaction != _aspt) && (otherTransaction.elementToExecute instanceof AvatarActionOnSignal)){ - AvatarSignal sig = ((AvatarActionOnSignal)(otherTransaction.elementToExecute)).getSignal(); + for (AvatarSimulationPendingTransaction otherTransaction : pendingTransactions) { + if ((otherTransaction != _aspt) && (otherTransaction.elementToExecute instanceof AvatarActionOnSignal)) { + AvatarSignal sig = ((AvatarActionOnSignal) (otherTransaction.elementToExecute)).getSignal(); AvatarRelation rel = avspec.getAvatarRelationWithSignal(sig); if (rel == ar) { int index1 = rel.getIndexOfSignal(sig); @@ -730,11 +729,11 @@ public class AvatarSpecificationSimulation { // Synchronous -> must find a corresponding synchronous one // Each time one is found, a new pending transaction is added, linked with the receiving action //TraceManager.addDev("Found a synchronous signal"); - for(AvatarSimulationPendingTransaction otherTransaction: pendingTransactions) { + for (AvatarSimulationPendingTransaction otherTransaction : pendingTransactions) { if (otherTransaction != _aspt) { if (otherTransaction.elementToExecute instanceof AvatarActionOnSignal) { //TraceManager.addDev("step 2"); - AvatarSignal sig = ((AvatarActionOnSignal)(otherTransaction.elementToExecute)).getSignal(); + AvatarSignal sig = ((AvatarActionOnSignal) (otherTransaction.elementToExecute)).getSignal(); AvatarRelation rel = avspec.getAvatarRelationWithSignal(sig); if (rel == ar) { int index1 = rel.getIndexOfSignal(sig); @@ -787,7 +786,7 @@ public class AvatarSpecificationSimulation { } public synchronized AvatarSimulationAsynchronousTransaction getAsynchronousMessage(AvatarRelation _ar, AvatarSignal _as) { - for(AvatarSimulationAsynchronousTransaction asat: asynchronousMessages) { + for (AvatarSimulationAsynchronousTransaction asat : asynchronousMessages) { if (asat.getRelation() == _ar) { if (_ar.getIndexOfSignal(_as) == asat.getIndex()) { return asat; @@ -799,9 +798,9 @@ public class AvatarSpecificationSimulation { public synchronized int getNbOfAsynchronousMessages(AvatarRelation _ar) { int cpt = 0; - for(AvatarSimulationAsynchronousTransaction asat: asynchronousMessages) { + for (AvatarSimulationAsynchronousTransaction asat : asynchronousMessages) { if (asat.getRelation() == _ar) { - cpt ++; + cpt++; } } return cpt; @@ -809,7 +808,7 @@ public class AvatarSpecificationSimulation { public AvatarSimulationPendingTransaction getSilentTransactionToExecute(Vector<AvatarSimulationPendingTransaction> _pendingTransactions) { //TraceManager.addDev("executeEmptyTransition=" + executeEmptyTransition + " executeStateEntering=" + executeStateEntering); - if(!executeEmptyTransition && !executeStateEntering) { + if (!executeEmptyTransition && !executeStateEntering) { return null; } @@ -818,12 +817,12 @@ public class AvatarSpecificationSimulation { return null; } - for(AvatarSimulationPendingTransaction tr: _pendingTransactions) { + for (AvatarSimulationPendingTransaction tr : _pendingTransactions) { // Empty transition? if ((tr.elementToExecute instanceof AvatarTransition) && (executeEmptyTransition)) { - AvatarTransition atr = (AvatarTransition)(tr.elementToExecute); - if (!(atr.hasDelay()) && !(atr.hasCompute()) && !(atr.hasActions())){ + AvatarTransition atr = (AvatarTransition) (tr.elementToExecute); + if (!(atr.hasDelay()) && !(atr.hasCompute()) && !(atr.hasActions())) { if (nbOfTransactions(tr.asb, _pendingTransactions) < 2) { //TraceManager.addDev("Setting to silent: " + tr); tr.isSilent = true; @@ -834,7 +833,7 @@ public class AvatarSpecificationSimulation { return tr; } // State entering? - } else if (((tr.elementToExecute instanceof AvatarState) || (tr.elementToExecute instanceof AvatarStopState)) && (executeStateEntering)) { + } else if (((tr.elementToExecute instanceof AvatarState) || (tr.elementToExecute instanceof AvatarStopState)) && (executeStateEntering)) { if (nbOfTransactions(tr.asb, _pendingTransactions) < 2) { //TraceManager.addDev("Setting to silent"); tr.isSilent = true; @@ -850,7 +849,7 @@ public class AvatarSpecificationSimulation { } public AvatarSimulationPendingTransaction getRandomSilentTransactionToExecute(Vector<AvatarSimulationPendingTransaction> _pendingTransactions) { - if(!executeEmptyTransition && !executeStateEntering) { + if (!executeEmptyTransition && !executeStateEntering) { return null; } @@ -858,15 +857,15 @@ public class AvatarSpecificationSimulation { return null; } - int index = (int)(Math.floor(Math.random()*_pendingTransactions.size())); + int index = (int) (Math.floor(Math.random() * _pendingTransactions.size())); AvatarSimulationPendingTransaction tr; - for(int i=0; i<_pendingTransactions.size(); i++) { - tr = _pendingTransactions.get((i+index)%pendingTransactions.size()); + for (int i = 0; i < _pendingTransactions.size(); i++) { + tr = _pendingTransactions.get((i + index) % pendingTransactions.size()); // Empty transition? if ((tr.elementToExecute instanceof AvatarTransition) && (executeEmptyTransition)) { - AvatarTransition atr = (AvatarTransition)(tr.elementToExecute); - if (!(atr.hasDelay()) && !(atr.hasCompute()) && !(atr.hasActions())){ + AvatarTransition atr = (AvatarTransition) (tr.elementToExecute); + if (!(atr.hasDelay()) && !(atr.hasCompute()) && !(atr.hasActions())) { //TraceManager.addDev("Empty transition?"); if (nbOfTransactions(tr.asb, _pendingTransactions) < 2) { tr.isSilent = true; @@ -875,7 +874,7 @@ public class AvatarSpecificationSimulation { } } // State entering? - } else if (((tr.elementToExecute instanceof AvatarState) || (tr.elementToExecute instanceof AvatarStopState)) && (executeStateEntering)) { + } else if (((tr.elementToExecute instanceof AvatarState) || (tr.elementToExecute instanceof AvatarStopState)) && (executeStateEntering)) { //TraceManager.addDev("Empty state enter?"); if (nbOfTransactions(tr.asb, _pendingTransactions) < 2) { tr.isSilent = true; @@ -891,10 +890,10 @@ public class AvatarSpecificationSimulation { public int nbOfTransactions(AvatarSimulationBlock _asb, Vector<AvatarSimulationPendingTransaction> _pendingTransactions) { int cpt = 0; //TraceManager.addDev("Nb of pending transactions:" + _pendingTransactions.size()); - for(AvatarSimulationPendingTransaction tr: _pendingTransactions) { + for (AvatarSimulationPendingTransaction tr : _pendingTransactions) { //TraceManager.addDev("tr=" + tr + " _asb=" + _asb + " tr.asb=" + tr.asb); if (tr.hasBlock(_asb)) { - cpt ++; + cpt++; //TraceManager.addDev("cpt++"); } } @@ -903,8 +902,6 @@ public class AvatarSpecificationSimulation { } - - public Vector<AvatarSimulationPendingTransaction> selectTransactions(Vector<AvatarSimulationPendingTransaction> _pendingTransactions) { Vector<AvatarSimulationPendingTransaction> ll = new Vector<AvatarSimulationPendingTransaction>(); @@ -921,7 +918,7 @@ public class AvatarSpecificationSimulation { // Random select the first index if none has been selected if (indexSelectedTransaction == -1) { //TraceManager.addDev("No transition selected"); - indexSelectedTransaction = (int)(Math.floor(Math.random()*_pendingTransactions.size())); + indexSelectedTransaction = (int) (Math.floor(Math.random() * _pendingTransactions.size())); } AvatarSimulationPendingTransaction currentTransaction = _pendingTransactions.get(indexSelectedTransaction); @@ -958,7 +955,7 @@ public class AvatarSpecificationSimulation { if (_pendingTransactions.get(0).linkedTransactions != null) { //TraceManager.addDev("BROADCAST"); tempo_clock_Value = clockValue; - for(AvatarSimulationPendingTransaction aspt: _pendingTransactions.get(0).linkedTransactions) { + for (AvatarSimulationPendingTransaction aspt : _pendingTransactions.get(0).linkedTransactions) { TraceManager.addDev("Executing broadcast transactions"); preExecutedTransaction(aspt); aspt.asb.runSoloPendingTransaction(aspt, allTransactions, tempo_clock_Value, MAX_TRANSACTION_IN_A_ROW, bunchid); @@ -982,7 +979,7 @@ public class AvatarSpecificationSimulation { public void preExecutedTransaction(AvatarSimulationPendingTransaction _aspt) { if (_aspt.elementToExecute instanceof AvatarActionOnSignal) { - AvatarSignal sig = ((AvatarActionOnSignal)(_aspt.elementToExecute)).getSignal(); + AvatarSignal sig = ((AvatarActionOnSignal) (_aspt.elementToExecute)).getSignal(); AvatarRelation rel = avspec.getAvatarRelationWithSignal(sig); _aspt.isSending = sig.isOut(); if (rel.isAsynchronous()) { @@ -994,7 +991,7 @@ public class AvatarSpecificationSimulation { _aspt.linkedAsynchronousMessage = asat; // Testing whether the message can be lost or not if (rel.isLossy()) { - int ra = ((int)(Math.random()*100))%2; + int ra = ((int) (Math.random() * 100)) % 2; if (ra == 0) { _aspt.isLost = true; } else { @@ -1047,7 +1044,7 @@ public class AvatarSpecificationSimulation { // Must select a value for the duration! if (_aspt.linkedTransaction != null) { if (_aspt.durationOnCurrent) { - _aspt.selectedDuration = _aspt.myMinDuration + (int)(Math.floor(Math.random()*(_aspt.maxDuration-_aspt.myMinDuration))); + _aspt.selectedDuration = _aspt.myMinDuration + (int) (Math.floor(Math.random() * (_aspt.maxDuration - _aspt.myMinDuration))); //TraceManager.addDev("Selected duration:" + _aspt.selectedDuration + " myMinDuration=" + _aspt.myMinDuration + " maxDuration=" + _aspt.maxDuration); if (_aspt.durationOnOther) { _aspt.linkedTransaction.durationSelected = true; @@ -1057,7 +1054,7 @@ public class AvatarSpecificationSimulation { } } } else { - _aspt.selectedDuration = _aspt.myMinDuration + (int)(Math.floor(Math.random()*(_aspt.maxDuration-_aspt.myMinDuration))); + _aspt.selectedDuration = _aspt.myMinDuration + (int) (Math.floor(Math.random() * (_aspt.maxDuration - _aspt.myMinDuration))); //TraceManager.addDev("Selected duration:" + _aspt.selectedDuration + " myMinDuration=" + _aspt.myMinDuration + " maxDuration=" + _aspt.maxDuration); } } @@ -1072,7 +1069,7 @@ public class AvatarSpecificationSimulation { } public synchronized void backOneTransactionBunch(boolean _rec) { - if ( (state != DONT_EXECUTE) && (state != TERMINATED)) { + if ((state != DONT_EXECUTE) && (state != TERMINATED)) { return; } @@ -1085,13 +1082,13 @@ public class AvatarSpecificationSimulation { // Remove one transaction // Getting last transaction - AvatarSimulationTransaction ast = allTransactions.get(allTransactions.size()-1); + AvatarSimulationTransaction ast = allTransactions.get(allTransactions.size() - 1); long bunchid_tmp = ast.bunchid; boolean isAllSilent = true; - while((ast != null) && (ast.bunchid == bunchid_tmp)) { - allTransactions.removeElementAt(allTransactions.size()-1); + while ((ast != null) && (ast.bunchid == bunchid_tmp)) { + allTransactions.removeElementAt(allTransactions.size() - 1); AvatarSimulationTransaction.removeExecutedElement(ast.executedElement); if (ast.asb != null) { ast.asb.removeLastTransaction(ast); @@ -1111,7 +1108,7 @@ public class AvatarSpecificationSimulation { } if (allTransactions.size() > 0) { - ast = allTransactions.get(allTransactions.size()-1); + ast = allTransactions.get(allTransactions.size() - 1); } else { ast = null; } @@ -1128,11 +1125,11 @@ public class AvatarSpecificationSimulation { //TraceManager.addDev("Backward size="+ allTransactions.size()); if (allTransactions.size() > 0) { - bunchid = (allTransactions.get(allTransactions.size()-1).bunchid) + 1; - clockValue = (allTransactions.get(allTransactions.size()-1)).clockValueWhenFinished; + bunchid = (allTransactions.get(allTransactions.size() - 1).bunchid) + 1; + clockValue = (allTransactions.get(allTransactions.size() - 1)).clockValueWhenFinished; } else { bunchid = 0; - clockValue = 0; + clockValue = 0; } AvatarSimulationTransaction.setID(allTransactions.size()); @@ -1145,14 +1142,14 @@ public class AvatarSpecificationSimulation { } public void printExecutedTransactions() { - for(AvatarSimulationTransaction ast: allTransactions) { + for (AvatarSimulationTransaction ast : allTransactions) { //TraceManager.addDev(ast.toString() + "\n"); } } public String getStringExecutedTransactions() { StringBuffer sb = new StringBuffer(""); - for(AvatarSimulationTransaction ast: allTransactions) { + for (AvatarSimulationTransaction ast : allTransactions) { sb.append(ast.toString() + "\n"); } return sb.toString(); @@ -1166,10 +1163,10 @@ public class AvatarSpecificationSimulation { AvatarSimulationPendingTransaction asptfound, newaspt; Point p; - while(true) { + while (true) { asptfound = null; p = null; - for(AvatarSimulationPendingTransaction aspt: _transactions) { + for (AvatarSimulationPendingTransaction aspt : _transactions) { if ((aspt.isBroadcast) && (aspt.linkedTransactions != null)) { if ((p = aspt.hasDuplicatedBlockTransaction()) != null) { TraceManager.addDev("FOUND DUPLICATED BLOCK"); @@ -1191,7 +1188,7 @@ public class AvatarSpecificationSimulation { private void workOnABroadcastTransaction(Vector<AvatarSimulationPendingTransaction> _oldTransactions, Vector<AvatarSimulationPendingTransaction> _newTransactions, AvatarSimulationPendingTransaction _aspt) { boolean isMet = false; // Other transactions? - for (AvatarSimulationPendingTransaction aspt: _oldTransactions) { + for (AvatarSimulationPendingTransaction aspt : _oldTransactions) { if ((aspt.elementToExecute == _aspt.elementToExecute) && (aspt != _aspt)) { isMet = true; break; @@ -1207,7 +1204,7 @@ public class AvatarSpecificationSimulation { // Searching for a timed broadcast transaction isMet = false; AvatarSimulationPendingTransaction untimedTransaction = null; - for (AvatarSimulationPendingTransaction aspt: _oldTransactions) { + for (AvatarSimulationPendingTransaction aspt : _oldTransactions) { if (aspt.elementToExecute == _aspt.elementToExecute) { if (aspt.hasConfiguredDurationMoreThan0()) { isMet = true; @@ -1221,7 +1218,7 @@ public class AvatarSpecificationSimulation { if (!isMet) { // At least one untimed transaction: We only aggregate all untimed transactions to untimedTransaction untimedTransaction.linkedTransactions = new Vector<AvatarSimulationPendingTransaction>(); - for (AvatarSimulationPendingTransaction aspt: _oldTransactions) { + for (AvatarSimulationPendingTransaction aspt : _oldTransactions) { if ((aspt != untimedTransaction) && (aspt.elementToExecute == untimedTransaction.elementToExecute)) { if (!(aspt.hasConfiguredDurationMoreThan0())) { untimedTransaction.linkedTransactions.add(aspt); @@ -1244,7 +1241,7 @@ public class AvatarSpecificationSimulation { // higher than this max are removed int max = Integer.MAX_VALUE; Vector<AvatarSimulationPendingTransaction> ll = new Vector<AvatarSimulationPendingTransaction>(); - for (AvatarSimulationPendingTransaction aspt: _oldTransactions) { + for (AvatarSimulationPendingTransaction aspt : _oldTransactions) { if (aspt.myMaxDuration < max) { max = aspt.myMaxDuration; } @@ -1254,7 +1251,7 @@ public class AvatarSpecificationSimulation { return; } - for (AvatarSimulationPendingTransaction aspt: _oldTransactions) { + for (AvatarSimulationPendingTransaction aspt : _oldTransactions) { if (aspt.myMinDuration <= max) { ll.add(aspt); } @@ -1277,7 +1274,7 @@ public class AvatarSpecificationSimulation { AvatarSimulationPendingTransaction a0; AvatarSimulationPendingTransaction tmp; - for(int i=0; i<ll.size(); i++) { + for (int i = 0; i < ll.size(); i++) { a0 = ll.get(i); // We compute all possible sets of transactions that are before a0 // a0 is then cloned with all possibilities @@ -1296,7 +1293,7 @@ public class AvatarSpecificationSimulation { } // Dont add the current one to the list - makeRandom(mainTransaction, index+1, indexMax, _transactions, _newTransactions); + makeRandom(mainTransaction, index + 1, indexMax, _transactions, _newTransactions); // Add the current one to the list AvatarSimulationPendingTransaction aspt = _transactions.get(index); @@ -1308,7 +1305,7 @@ public class AvatarSpecificationSimulation { asptnew.linkedTransactions.add(aspt); _newTransactions.add(asptnew); - makeRandom(asptnew, index+1, indexMax, _transactions, _newTransactions); + makeRandom(asptnew, index + 1, indexMax, _transactions, _newTransactions); } @@ -1327,16 +1324,16 @@ public class AvatarSpecificationSimulation { int cpt = 0; - while(_vector.size() >0) { + while (_vector.size() > 0) { min = Integer.MAX_VALUE; index = 0; cpt = 0; - for(AvatarSimulationPendingTransaction aspt: _vector) { - if(aspt.myMinDuration < min) { + for (AvatarSimulationPendingTransaction aspt : _vector) { + if (aspt.myMinDuration < min) { index = cpt; min = aspt.myMinDuration; } - cpt ++; + cpt++; } ll.add(_vector.get(index)); @@ -1440,7 +1437,7 @@ public class AvatarSpecificationSimulation { // value: -1 -> not forcing // other value: random is forced to that value public void forceRandom(int value) { - for(AvatarSimulationBlock block: blocks) { + for (AvatarSimulationBlock block : blocks) { block.forceRandom(value); } } @@ -1459,21 +1456,21 @@ public class AvatarSpecificationSimulation { // Asynchronous messages manipulation public synchronized boolean removeAsyncMessage(AvatarRelation ar, int index) { - if ((ar != null) && (index >-1)) { + if ((ar != null) && (index > -1)) { int realIndex = 0; boolean found = false; AvatarSimulationAsynchronousTransaction mesg = null; - for(AvatarSimulationAsynchronousTransaction msg: asynchronousMessages) { + for (AvatarSimulationAsynchronousTransaction msg : asynchronousMessages) { if (msg.getRelation() == ar) { if (index == 0) { found = true; mesg = msg; break; } else { - index --; + index--; } } - realIndex ++; + realIndex++; } if (found) { //TraceManager.addDev("Removing at index: " + realIndex); @@ -1489,27 +1486,27 @@ public class AvatarSpecificationSimulation { //TraceManager.addDev("Moving from index: " + oldIndex + " to: " + newIndex); /*int back1 = oldIndex; int back2 = newIndex;*/ - if ((ar != null) && (oldIndex >-1) && (newIndex >-1) && (oldIndex != newIndex)) { + if ((ar != null) && (oldIndex > -1) && (newIndex > -1) && (oldIndex != newIndex)) { int oldRealIndex = -1; int newRealIndex = -1; int realIndex = 0; boolean found = false; AvatarSimulationAsynchronousTransaction mesg = null; - for(AvatarSimulationAsynchronousTransaction msg: asynchronousMessages) { + for (AvatarSimulationAsynchronousTransaction msg : asynchronousMessages) { if (msg.getRelation() == ar) { - if ((oldIndex == 0) && (oldRealIndex == -1)){ + if ((oldIndex == 0) && (oldRealIndex == -1)) { oldRealIndex = realIndex; mesg = msg; } else { - oldIndex --; + oldIndex--; } if ((newIndex == 0) && (newRealIndex == -1)) { newRealIndex = realIndex; } else { - newIndex --; + newIndex--; } } - realIndex ++; + realIndex++; } if ((newRealIndex != -1) && (mesg != null)) { //TraceManager.addDev("Moving from: " + oldRealIndex + " to: "+ newRealIndex); @@ -1531,8 +1528,7 @@ public class AvatarSpecificationSimulation { } - - public synchronized boolean removeAsyncMsgFromPendingTransactions(AvatarSimulationAsynchronousTransaction msg) { + public synchronized boolean removeAsyncMsgFromPendingTransactions(AvatarSimulationAsynchronousTransaction msg) { if (msg == null) { return false; } @@ -1540,7 +1536,7 @@ public class AvatarSpecificationSimulation { boolean found = false; Vector<AvatarSimulationPendingTransaction> vect = new Vector<AvatarSimulationPendingTransaction>(); if ((pendingTransactions != null) && (pendingTransactions.size() > 0)) { - for(AvatarSimulationPendingTransaction tr: pendingTransactions) { + for (AvatarSimulationPendingTransaction tr : pendingTransactions) { if (tr.linkedAsynchronousMessage == msg) { //TraceManager.addDev("Msg to remove from pending transaction"); vect.add(tr); @@ -1549,8 +1545,8 @@ public class AvatarSpecificationSimulation { } } - if (vect.size()>0) { - for(AvatarSimulationPendingTransaction toRem: vect) { + if (vect.size() > 0) { + for (AvatarSimulationPendingTransaction toRem : vect) { //TraceManager.addDev("Removing pending transaction"); pendingTransactions.remove(toRem); } diff --git a/src/main/java/avatartranslator/toexecutable/AVATAR2CPOSIX.java b/src/main/java/avatartranslator/toexecutable/AVATAR2CPOSIX.java index db6eebf158..45765f9643 100755 --- a/src/main/java/avatartranslator/toexecutable/AVATAR2CPOSIX.java +++ b/src/main/java/avatartranslator/toexecutable/AVATAR2CPOSIX.java @@ -37,8 +37,6 @@ */ - - package avatartranslator.toexecutable; import avatartranslator.*; @@ -52,8 +50,9 @@ import java.util.Vector; /** * Class AVATAR2CPOSIX * Creation: 29/03/2011 - * @version 1.2 24/03/2016 + * * @author Ludovic APVRILLE + * @version 1.2 24/03/2016 */ public class AVATAR2CPOSIX { @@ -104,24 +103,32 @@ public class AVATAR2CPOSIX { public void saveInFiles(String path) throws FileException { - TraceManager.addDev("Generating files"); - if (!SpecConfigTTool.checkAndCreateAVATARCodeDir(path)) - throw new FileException("ERROR: Executable code directory cannot be created."); + //TraceManager.addDev("save In Files AVATAR2CPOSIX"); + if (!SpecConfigTTool.checkAndCreateAVATARCodeDir(path)) { + TraceManager.addDev("Directory cannot be created: " + path); + throw new FileException("ERROR: Executable code directory cannot be created."); + } + //TraceManager.addDev("Creating dir for saving generated code"); File src_dir = new File(path + GENERATED_PATH); if (!src_dir.exists()) { - src_dir.mkdir(); + TraceManager.addDev("Creating: " + src_dir.getAbsolutePath()); + src_dir.mkdir(); } + + //TraceManager.addDev("Generating main file"); if (mainFile != null) { TraceManager.addDev("Generating main files in " + path + mainFile.getName() + ".h"); FileUtils.saveFile(path + GENERATED_PATH + mainFile.getName() + ".h", Conversion.indentString(mainFile.getHeaderCode(), 2)); FileUtils.saveFile(path + GENERATED_PATH + mainFile.getName() + ".c", Conversion.indentString(mainFile.getMainCode(), 2)); } - for(TaskFile taskFile: taskFiles) { + //TraceManager.addDev("Generating task files"); + for (TaskFile taskFile : taskFiles) { FileUtils.saveFile(path + GENERATED_PATH + taskFile.getName() + ".h", Conversion.indentString(taskFile.getFullHeaderCode(), 2)); FileUtils.saveFile(path + GENERATED_PATH + taskFile.getName() + ".c", Conversion.indentString(taskFile.getMainCode(), 2)); } + //TraceManager.addDev("Making Makefiles"); // Standard Makefile makeMakefileSrc(GENERATED_PATH); FileUtils.saveFile(path + "Makefile.src", makefile_src); @@ -137,16 +144,15 @@ public class AVATAR2CPOSIX { } - public void generateCPOSIX(boolean _debug, boolean _tracing) { debug = _debug; tracing = _tracing; - + mainFile = new MainFile("main", plugin); taskFiles = new Vector<TaskFile>(); avspec.removeCompositeStates(); - avspec.removeLibraryFunctionCalls (); + avspec.removeLibraryFunctionCalls(); avspec.removeTimers(); @@ -185,10 +191,10 @@ public class AVATAR2CPOSIX { mainFile.appendToHCode("/* Synchronous channels */" + CR); mainFile.appendToBeforeMainCode("/* Synchronous channels */" + CR); mainFile.appendToMainCode("/* Synchronous channels */" + CR); - for(AvatarRelation ar: avspec.getRelations()) { + for (AvatarRelation ar : avspec.getRelations()) { if (!ar.isAsynchronous()) { - for(int i=0; i<ar.nbOfSignals(); i++) { - mainFile.appendToHCode("extern syncchannel __" + getChannelName(ar, i) + ";" + CR); + for (int i = 0; i < ar.nbOfSignals(); i++) { + mainFile.appendToHCode("extern syncchannel __" + getChannelName(ar, i) + ";" + CR); mainFile.appendToBeforeMainCode("syncchannel __" + getChannelName(ar, i) + ";" + CR); mainFile.appendToMainCode("__" + getChannelName(ar, i) + ".inname =\"" + ar.getInSignal(i).getName() + "\";" + CR); mainFile.appendToMainCode("__" + getChannelName(ar, i) + ".outname =\"" + ar.getOutSignal(i).getName() + "\";" + CR); @@ -209,10 +215,10 @@ public class AVATAR2CPOSIX { mainFile.appendToHCode("/* Asynchronous channels */" + CR); mainFile.appendToBeforeMainCode("/* Asynchronous channels */" + CR); mainFile.appendToMainCode("/* Asynchronous channels */" + CR); - for(AvatarRelation ar: avspec.getRelations()) { + for (AvatarRelation ar : avspec.getRelations()) { if (ar.isAsynchronous()) { - for(int i=0; i<ar.nbOfSignals(); i++) { - mainFile.appendToHCode("extern asyncchannel __" + getChannelName(ar, i) + ";" + CR); + for (int i = 0; i < ar.nbOfSignals(); i++) { + mainFile.appendToHCode("extern asyncchannel __" + getChannelName(ar, i) + ";" + CR); mainFile.appendToBeforeMainCode("asyncchannel __" + getChannelName(ar, i) + ";" + CR); mainFile.appendToMainCode("__" + getChannelName(ar, i) + ".inname =\"" + ar.getInSignal(i).getName() + "\";" + CR); mainFile.appendToMainCode("__" + getChannelName(ar, i) + ".outname =\"" + ar.getOutSignal(i).getName() + "\";" + CR); @@ -231,7 +237,7 @@ public class AVATAR2CPOSIX { } public void makeTasks() { - for(AvatarBlock block: avspec.getListOfBlocks()) { + for (AvatarBlock block : avspec.getListOfBlocks()) { makeTask(block); } } @@ -264,10 +270,10 @@ public class AVATAR2CPOSIX { _taskFile.addToMainCode("#define STATE__START__STATE 0" + CR); - for (AvatarStateMachineElement asme: _block.getStateMachine().getListOfElements()) { + for (AvatarStateMachineElement asme : _block.getStateMachine().getListOfElements()) { if (asme instanceof AvatarState) { _taskFile.addToMainCode("#define STATE__" + asme.getName() + " " + id + CR); - id ++; + id++; } } _taskFile.addToMainCode("#define STATE__STOP__STATE " + id + CR); @@ -276,7 +282,7 @@ public class AVATAR2CPOSIX { public void defineAllMethods(AvatarBlock _block, TaskFile _taskFile) { Vector<String> allNames = new Vector<String>(); - for (AvatarMethod am: _block.getMethods()) { + for (AvatarMethod am : _block.getMethods()) { makeMethod(_block, am, allNames, _taskFile); } @@ -289,7 +295,7 @@ public class AVATAR2CPOSIX { return; } - for (AvatarMethod am: _currentBlock.getFather().getMethods()) { + for (AvatarMethod am : _currentBlock.getFather().getMethods()) { makeMethod(_originBlock, am, _allNames, _taskFile); } @@ -302,9 +308,9 @@ public class AVATAR2CPOSIX { LinkedList<AvatarAttribute> list; LinkedList<AvatarAttribute> listA; - String nameMethod = _block.getName() + "__" +_am.getName(); + String nameMethod = _block.getName() + "__" + _am.getName(); - for(String s: _allNames) { + for (String s : _allNames) { if (s.compareTo(nameMethod) == 0) { return; } @@ -320,12 +326,12 @@ public class AVATAR2CPOSIX { ret += " " + nameMethod + "("; list = _am.getListOfAttributes(); int cpt = 0; - for(AvatarAttribute aa: list) { + for (AvatarAttribute aa : list) { if (cpt != 0) { ret += ", "; } ret += getCTypeOf(aa) + " " + aa.getName(); - cpt ++; + cpt++; } ret += ") {" + CR; @@ -336,18 +342,18 @@ public class AVATAR2CPOSIX { if (list.size() > 0) { ret += "char my__attr[CHAR_ALLOC_SIZE];" + CR; ret += "sprintf(my__attr, \""; - for(AvatarAttribute aa: list) { + for (AvatarAttribute aa : list) { if (cpt != 0) { tr += ","; ret += ","; } tr += aa.getName(); ret += "%d"; - cpt ++; + cpt++; } ret += "\"," + tr + ");" + CR; ret += traceFunctionCall(_block.getName(), _am.getName(), "my__attr"); - } else { + } else { ret += traceFunctionCall(_block.getName(), _am.getName(), null); } } @@ -357,7 +363,7 @@ public class AVATAR2CPOSIX { list = _am.getListOfAttributes(); cpt = 0; - for(AvatarAttribute aa: list) { + for (AvatarAttribute aa : list) { ret += "debugInt(\"Attribute " + aa.getName() + " = \"," + aa.getName() + ");" + CR; } } @@ -371,19 +377,19 @@ public class AVATAR2CPOSIX { if (_am.isImplementationProvided()) { ret += "return __userImplemented__" + nameMethod + "("; cpt = 0; - for(AvatarAttribute aaa: listA) { + for (AvatarAttribute aaa : listA) { if (cpt != 0) { ret += ", "; } ret += aaa.getName(); - cpt ++; + cpt++; } - ret+= ");" + CR; + ret += ");" + CR; //TraceManager.addDev("Adding a call to the method"); } else { - if (listA.size() >0) { + if (listA.size() > 0) { ret += "return " + listA.get(0).getName() + ";" + CR; } else { ret += "return 0;" + CR; @@ -393,14 +399,14 @@ public class AVATAR2CPOSIX { if (_am.isImplementationProvided()) { ret += "__userImplemented__" + nameMethod + "("; cpt = 0; - for(AvatarAttribute aaa: listA) { + for (AvatarAttribute aaa : listA) { if (cpt != 0) { ret += ", "; } ret += aaa.getName(); - cpt ++; + cpt++; } - ret+= ");" + CR; + ret += ");" + CR; } } @@ -411,7 +417,7 @@ public class AVATAR2CPOSIX { public void makeMainHeader() { mainFile.appendToBeforeMainCode(CR); - for(TaskFile taskFile: taskFiles) { + for (TaskFile taskFile : taskFiles) { mainFile.appendToBeforeMainCode("#include \"" + taskFile.getName() + ".h\"" + CR); } mainFile.appendToBeforeMainCode(CR); @@ -423,37 +429,37 @@ public class AVATAR2CPOSIX { String s = "void *mainFunc__" + _block.getName() + "(void *arg)"; String sh = "extern " + s + ";" + CR; - s+= "{" + CR; + s += "{" + CR; s += makeAttributesDeclaration(_block, _taskFile); - s+= CR + "int __currentState = STATE__START__STATE;" + CR; + s += CR + "int __currentState = STATE__START__STATE;" + CR; int nbOfMaxParams = _block.getMaxNbOfParams(); //s+= "request *__req;" + CR; - for(i=0; i<_block.getMaxNbOfMultipleBranches(); i++) { - s+= UNUSED_ATTR + " request __req" + i + ";" + CR; - s+= UNUSED_ATTR + "int *__params" + i + "[" + nbOfMaxParams + "];" + CR; + for (i = 0; i < _block.getMaxNbOfMultipleBranches(); i++) { + s += UNUSED_ATTR + " request __req" + i + ";" + CR; + s += UNUSED_ATTR + "int *__params" + i + "[" + nbOfMaxParams + "];" + CR; } - s+= UNUSED_ATTR + "setOfRequests __list;" + CR; + s += UNUSED_ATTR + "setOfRequests __list;" + CR; - s+= UNUSED_ATTR + "pthread_cond_t __myCond;" + CR; - s+= UNUSED_ATTR + "request *__returnRequest;" + CR; + s += UNUSED_ATTR + "pthread_cond_t __myCond;" + CR; + s += UNUSED_ATTR + "request *__returnRequest;" + CR; - s+= CR + "char * __myname = (char *)arg;" + CR; + s += CR + "char * __myname = (char *)arg;" + CR; /*if (tracing) { s+= CR + "char __value[CHAR_ALLOC_SIZE];" + CR; }*/ - s+= CR + "pthread_cond_init(&__myCond, NULL);" + CR; + s += CR + "pthread_cond_init(&__myCond, NULL);" + CR; - s+= CR + "fillListOfRequests(&__list, __myname, &__myCond, &__mainMutex);" + CR; + s += CR + "fillListOfRequests(&__list, __myname, &__myCond, &__mainMutex);" + CR; - s+= "//printf(\"my name = %s\\n\", __myname);" + CR; + s += "//printf(\"my name = %s\\n\", __myname);" + CR; - s+= CR + "/* Main loop on states */" + CR; - s+= "while(__currentState != STATE__STOP__STATE) {" + CR; + s += CR + "/* Main loop on states */" + CR; + s += "while(__currentState != STATE__STOP__STATE) {" + CR; s += "switch(__currentState) {" + CR; @@ -466,13 +472,13 @@ public class AVATAR2CPOSIX { String tmp; // Making other states - for(AvatarStateMachineElement asme: asm.getListOfElements()) { + for (AvatarStateMachineElement asme : asm.getListOfElements()) { if (asme instanceof AvatarState) { s += "case STATE__" + asme.getName() + ": " + CR; s += traceStateEntering("__myname", asme.getName()); if (includeUserCode) { - tmp = ((AvatarState)asme).getEntryCode(); + tmp = ((AvatarState) asme).getEntryCode(); if (tmp != null) { if (tmp.trim().length() > 0) { s += "/* Entry code */\n" + tmp + "\n/* End of entry code */\n\n"; @@ -489,8 +495,8 @@ public class AVATAR2CPOSIX { s += "}" + CR; - s+= "//printf(\"Exiting = %s\\n\", __myname);" + CR; - s+= "return NULL;" + CR; + s += "//printf(\"Exiting = %s\\n\", __myname);" + CR; + s += "return NULL;" + CR; s += "}" + CR; _taskFile.addToMainCode(s + CR); _taskFile.addToHeaderCode(sh + CR); @@ -512,10 +518,10 @@ public class AVATAR2CPOSIX { } if (_asme instanceof AvatarTransition) { - AvatarTransition at = (AvatarTransition)_asme; + AvatarTransition at = (AvatarTransition) _asme; if (at.isGuarded()) { - String g = modifyGuard(at.getGuard().toString ()); + String g = modifyGuard(at.getGuard().toString()); ret += "if (!" + g + ") {" + CR; if (debug) { @@ -527,7 +533,7 @@ public class AVATAR2CPOSIX { } if (at.hasDelay()) { - ret+= "waitFor(" + reworkDelay(at.getMinDelay()) + ", " + reworkDelay(at.getMaxDelay()) + ");" + CR; + ret += "waitFor(" + reworkDelay(at.getMinDelay()) + ", " + reworkDelay(at.getMaxDelay()) + ");" + CR; } String act; @@ -566,9 +572,9 @@ public class AVATAR2CPOSIX { // 1) Only immediatly executable transitions - for(i=0; i<_asme.nbOfNexts(); i++) { + for (i = 0; i < _asme.nbOfNexts(); i++) { if (_asme.getNext(i) instanceof AvatarTransition) { - AvatarTransition at = (AvatarTransition)(_asme.getNext(i)); + AvatarTransition at = (AvatarTransition) (_asme.getNext(i)); if (at.hasActions()) { ret += makeImmediateAction(at, i); @@ -592,15 +598,15 @@ public class AVATAR2CPOSIX { ret += "}" + CR; ret += "__returnRequest = executeListOfRequests(&__list);" + CR; - ret += "clearListOfRequests(&__list);" + CR ; + ret += "clearListOfRequests(&__list);" + CR; ret += traceRequest(); // Resulting requests - for(i=0; i<_asme.nbOfNexts(); i++) { + for (i = 0; i < _asme.nbOfNexts(); i++) { if (i != 0) { ret += "else "; } - AvatarTransition at = (AvatarTransition)(_asme.getNext(i)); + AvatarTransition at = (AvatarTransition) (_asme.getNext(i)); if (at.hasActions()) { ret += " if (__returnRequest == &__req" + i + ") {" + CR; ret += makeActionsOfTransaction(_block, at); @@ -614,7 +620,7 @@ public class AVATAR2CPOSIX { }*/ ret += makeBehaviourFromElement(_block, at.getNext(0), false) + CR + "}"; - } else { + } else { if (at.getNext(0) instanceof AvatarActionOnSignal) { ret += " if (__returnRequest == &__req" + i + ") {" + CR + makeBehaviourFromElement(_block, at.getNext(0).getNext(0), false) + CR + "}"; } else { @@ -634,13 +640,13 @@ public class AVATAR2CPOSIX { } if (_asme instanceof AvatarRandom) { - AvatarRandom ar = (AvatarRandom)_asme; + AvatarRandom ar = (AvatarRandom) _asme; ret += ar.getVariable() + " = computeRandom(" + ar.getMinValue() + ", " + ar.getMaxValue() + ");" + CR; return ret + makeBehaviourFromElement(_block, _asme.getNext(0), false); } if (_asme instanceof AvatarActionOnSignal) { - AvatarActionOnSignal aaos = (AvatarActionOnSignal)_asme; + AvatarActionOnSignal aaos = (AvatarActionOnSignal) _asme; ret += makeSignalAction(aaos, 0, false, "", ""); AvatarSignal as = aaos.getSignal(); AvatarRelation ar = avspec.getAvatarRelationWithSignal(as); @@ -660,10 +666,10 @@ public class AVATAR2CPOSIX { return ""; } - aaos = (AvatarActionOnSignal)(_at.getNext(0)); + aaos = (AvatarActionOnSignal) (_at.getNext(0)); if (_at.isGuarded()) { - String g = modifyGuard(_at.getGuard().toString ()); + String g = modifyGuard(_at.getGuard().toString()); ret += "if (" + g + ") {" + CR; } @@ -701,26 +707,26 @@ public class AVATAR2CPOSIX { // Sending if (_aaos.isSending()) { // Putting params - for(i=0; i<_aaos.getNbOfValues() ;i++) { - ret += "__params" + _index + "[" + i + "] = &" + _aaos.getValue(i) + ";" + CR; + for (i = 0; i < _aaos.getNbOfValues(); i++) { + ret += "__params" + _index + "[" + i + "] = &" + _aaos.getValue(i) + ";" + CR; } if (ar.isAsynchronous()) { ret += "makeNewRequest(&__req" + _index + ", " + _aaos.getID() + ", SEND_ASYNC_REQUEST, " + delay + ", " + _aaos.getNbOfValues() + ", __params" + _index + ");" + CR; ret += "__req" + _index + ".asyncChannel = &__" + getChannelName(ar, as) + ";" + CR; } else { if (ar.isBroadcast()) { - ret += "makeNewRequest(&__req" + _index + ", " + _aaos.getID()+ ", SEND_BROADCAST_REQUEST, " + delay + ", " + _aaos.getNbOfValues() + ", __params" + _index + ");" + CR; + ret += "makeNewRequest(&__req" + _index + ", " + _aaos.getID() + ", SEND_BROADCAST_REQUEST, " + delay + ", " + _aaos.getNbOfValues() + ", __params" + _index + ");" + CR; ret += "__req" + _index + ".syncChannel = &__" + getChannelName(ar, as) + ";" + CR; } else { - ret += "makeNewRequest(&__req" + _index + ", " + _aaos.getID()+ ", SEND_SYNC_REQUEST, " + delay + ", " + _aaos.getNbOfValues() + ", __params" + _index + ");" + CR; + ret += "makeNewRequest(&__req" + _index + ", " + _aaos.getID() + ", SEND_SYNC_REQUEST, " + delay + ", " + _aaos.getNbOfValues() + ", __params" + _index + ");" + CR; ret += "__req" + _index + ".syncChannel = &__" + getChannelName(ar, as) + ";" + CR; } } // Receiving } else { - for(i=0; i<_aaos.getNbOfValues() ;i++) { - ret += "__params" + _index + "[" + i + "] = &" + _aaos.getValue(i) + ";" + CR; + for (i = 0; i < _aaos.getNbOfValues(); i++) { + ret += "__params" + _index + "[" + i + "] = &" + _aaos.getValue(i) + ";" + CR; } if (ar.isAsynchronous()) { ret += "makeNewRequest(&__req" + _index + ", " + _aaos.getID() + ", RECEIVE_ASYNC_REQUEST, " + delay + ", " + _aaos.getNbOfValues() + ", __params" + _index + ");" + CR; @@ -743,7 +749,7 @@ public class AVATAR2CPOSIX { private String makeImmediateAction(AvatarTransition _at, int _index) { String ret = ""; if (_at.isGuarded()) { - String g = modifyGuard(_at.getGuard().toString ()); + String g = modifyGuard(_at.getGuard().toString()); ret += "if (" + g + ") {" + CR; } @@ -770,7 +776,7 @@ public class AVATAR2CPOSIX { public String makeAttributesDeclaration(AvatarBlock _block, TaskFile _taskFile) { String ret = ""; - for(AvatarAttribute aa: _block.getAttributes()) { + for (AvatarAttribute aa : _block.getAttributes()) { ret += getCTypeOf(aa) + " " + aa.getName() + " = " + aa.getInitialValue() + ";" + CR; } return ret; @@ -778,7 +784,7 @@ public class AVATAR2CPOSIX { public void makeThreadsInMain(boolean _debug) { mainFile.appendToMainCode(CR + "/* Threads of tasks */" + CR); - for(TaskFile taskFile: taskFiles) { + for (TaskFile taskFile : taskFiles) { mainFile.appendToMainCode("pthread_t thread__" + taskFile.getName() + ";" + CR); } @@ -790,7 +796,6 @@ public class AVATAR2CPOSIX { } - mainFile.appendToMainCode("/* Activating randomness */" + CR); mainFile.appendToMainCode("initRandom();" + CR); @@ -801,19 +806,19 @@ public class AVATAR2CPOSIX { mainFile.appendToMainCode("initMessages();" + CR); - if (avspec.hasApplicationCode()&& includeUserCode) { + if (avspec.hasApplicationCode() && includeUserCode) { mainFile.appendToMainCode("/* User initialization */" + CR); mainFile.appendToMainCode("__user_init();" + CR); } mainFile.appendToMainCode(CR + CR + mainDebugMsg("Starting tasks")); - for(TaskFile taskFile: taskFiles) { + for (TaskFile taskFile : taskFiles) { mainFile.appendToMainCode("pthread_create(&thread__" + taskFile.getName() + ", NULL, mainFunc__" + taskFile.getName() + ", (void *)\"" + taskFile.getName() + "\");" + CR); } mainFile.appendToMainCode(CR + CR + mainDebugMsg("Joining tasks")); - for(TaskFile taskFile: taskFiles) { + for (TaskFile taskFile : taskFiles) { mainFile.appendToMainCode("pthread_join(thread__" + taskFile.getName() + ", NULL);" + CR); } @@ -834,7 +839,7 @@ public class AVATAR2CPOSIX { public void makeMakefileSrc(String _path) { makefile_src = "SRCS = "; makefile_src += _path + "main.c "; - for(TaskFile taskFile: taskFiles) { + for (TaskFile taskFile : taskFiles) { makefile_src += _path + taskFile.getName() + ".c "; } @@ -843,7 +848,7 @@ public class AVATAR2CPOSIX { public void makeMakefileSocLib() { makefile_SocLib = "objs = "; makefile_SocLib += "main.o "; - for(TaskFile taskFile: taskFiles) { + for (TaskFile taskFile : taskFiles) { makefile_SocLib += taskFile.getName() + ".o "; } @@ -879,13 +884,13 @@ public class AVATAR2CPOSIX { public String reworkDelay(String _delay) { - switch(timeUnit) { - case USEC: - return _delay; - case MSEC: - return "(" + _delay + ")*1000"; - case SEC: - return "(" + _delay + ")*1000000"; + switch (timeUnit) { + case USEC: + return _delay; + case MSEC: + return "(" + _delay + ")*1000"; + case SEC: + return "(" + _delay + ")*1000000"; } return _delay; @@ -893,33 +898,33 @@ public class AVATAR2CPOSIX { private String modifyMethodName(AvatarBlock _ab, AvatarTerm term) { if (term instanceof AvatarAttribute) - return term.getName (); + return term.getName(); if (term instanceof AvatarConstant) - return term.getName (); + return term.getName(); if (term instanceof AvatarTermRaw) - return term.getName (); + return term.getName(); if (term instanceof AvatarArithmeticOp) { AvatarArithmeticOp aop = (AvatarArithmeticOp) term; - return this.modifyMethodName (_ab, aop.getTerm1 ()) - + aop.getOperator () - + this.modifyMethodName (_ab, aop.getTerm2 ()); + return this.modifyMethodName(_ab, aop.getTerm1()) + + aop.getOperator() + + this.modifyMethodName(_ab, aop.getTerm2()); } if (term instanceof AvatarTuple) { boolean first = true; String res = "("; - for (AvatarTerm tterm: ((AvatarTuple) term).getComponents ()) { + for (AvatarTerm tterm : ((AvatarTuple) term).getComponents()) { if (first) first = false; else res += ", "; - res += this.modifyMethodName (_ab, tterm); + res += this.modifyMethodName(_ab, tterm); } return res + ")"; } if (term instanceof AvatarTermFunction) - return _ab.getName () + "__" + ((AvatarTermFunction) term).getMethod ().getName () - + this.modifyMethodName (_ab, ((AvatarTermFunction) term).getArgs ()); + return _ab.getName() + "__" + ((AvatarTermFunction) term).getMethod().getName() + + this.modifyMethodName(_ab, ((AvatarTermFunction) term).getArgs()); return ""; } @@ -974,20 +979,20 @@ public class AVATAR2CPOSIX { public String makeActionsOfTransaction(AvatarBlock _block, AvatarTransition _at) { String ret = ""; String type; - for(int i=0; i<_at.getNbOfAction(); i++) { + for (int i = 0; i < _at.getNbOfAction(); i++) { // Must know whether this is an action or a method call AvatarAction act = _at.getAction(i); TraceManager.addDev("Action=" + act); if (act.isAMethodCall()) { TraceManager.addDev("Method call"); - String actModified = modifyMethodName (_block, (AvatarTermFunction) act); - ret += actModified + ";" + CR; + String actModified = modifyMethodName(_block, (AvatarTermFunction) act); + ret += actModified + ";" + CR; } else { TraceManager.addDev("Else"); - String actModified = modifyMethodName (_block, ((AvatarActionAssignment) act).getLeftHand ()) - + " = " + modifyMethodName (_block, ((AvatarActionAssignment) act).getRightHand ()); - AvatarLeftHand leftHand = ((AvatarActionAssignment) act).getLeftHand (); + String actModified = modifyMethodName(_block, ((AvatarActionAssignment) act).getLeftHand()) + + " = " + modifyMethodName(_block, ((AvatarActionAssignment) act).getRightHand()); + AvatarLeftHand leftHand = ((AvatarActionAssignment) act).getLeftHand(); ret += actModified + ";" + CR; if (leftHand instanceof AvatarAttribute) { if (((AvatarAttribute) leftHand).isInt()) { @@ -995,7 +1000,7 @@ public class AVATAR2CPOSIX { } else { type = "1"; } - ret += traceVariableModification(_block.getName(), leftHand.getName (), type); + ret += traceVariableModification(_block.getName(), leftHand.getName(), type); } } diff --git a/src/main/java/common/SpecConfigTTool.java b/src/main/java/common/SpecConfigTTool.java index e46d7b61b0..f4662d107b 100644 --- a/src/main/java/common/SpecConfigTTool.java +++ b/src/main/java/common/SpecConfigTTool.java @@ -405,11 +405,15 @@ public class SpecConfigTTool { * @author Fabien Tessier */ public static boolean checkAndCreateAVATARCodeDir(String s) throws FileException { + //TraceManager.addDev("Trying to create the dir:" + s); File f = new File(s); try { - if (!f.exists()) - if (!f.mkdir()) + if (!f.exists()) { + //TraceManager.addDev("Does not exist"); + if (!f.mkdir()) { return false; + } + } if (!s.equals(ConfigurationTTool.AVATARExecutableCodeDirectory)) { File make = new File(ConfigurationTTool.AVATARExecutableCodeDirectory + "Makefile"); File defs = new File(ConfigurationTTool.AVATARExecutableCodeDirectory + "Makefile.defs"); diff --git a/src/main/java/ui/AvatarDesignPanelTranslator.java b/src/main/java/ui/AvatarDesignPanelTranslator.java index fff47053c0..879587c337 100644 --- a/src/main/java/ui/AvatarDesignPanelTranslator.java +++ b/src/main/java/ui/AvatarDesignPanelTranslator.java @@ -1902,6 +1902,19 @@ public class AvatarDesignPanelTranslator { if (tmp1 != null && tmp2 != null) at.setComputes(tmp1, tmp2); + // Probability + tmp1 = asmdco.getProbability (); + if ((tmp1 != null) && (tmp1.length()>0)) { + error = AvatarSyntaxChecker.isAValidProbabilityExpr(_as, _ab, tmp1); + if (error < 0) { + this.makeError(error, tdp, _ab, tgc, "probability ", tmp1); + tmp1 = null; + } + if (tmp1 != null) { + at.setProbability(new Double(tmp1).doubleValue()); + } + } + // Actions for(String s: asmdco.getActions()) if (s.trim().length() > 0) { diff --git a/src/main/java/ui/avatarinteractivesimulation/AvatarInteractiveSimulationActions.java b/src/main/java/ui/avatarinteractivesimulation/AvatarInteractiveSimulationActions.java index 7df2e86fc1..379bc3dc96 100755 --- a/src/main/java/ui/avatarinteractivesimulation/AvatarInteractiveSimulationActions.java +++ b/src/main/java/ui/avatarinteractivesimulation/AvatarInteractiveSimulationActions.java @@ -1,26 +1,26 @@ /* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille - * + * * ludovic.apvrille AT enst.fr - * + * * This software is a computer program whose purpose is to allow the * edition of TURTLE analysis, design and deployment diagrams, to * allow the generation of RT-LOTOS or Java code from this diagram, * and at last to allow the analysis of formal validation traces * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP * from INRIA Rhone-Alpes. - * + * * This software is governed by the CeCILL license under French law and * abiding by the rules of distribution of free software. You can use, * modify and/ or redistribute the software under the terms of the CeCILL * license as circulated by CEA, CNRS and INRIA at the following URL * "http://www.cecill.info". - * + * * As a counterpart to the access to the source code and rights to copy, * modify and redistribute granted by the license, users are provided only * with a limited warranty and the software's author, the holder of the * economic rights, and the successive licensors have only limited * liability. - * + * * In this respect, the user's attention is drawn to the risks associated * with loading, using, modifying and/or developing or reproducing the * software by the user in light of its specific status of free software, @@ -31,14 +31,12 @@ * requirements in conditions enabling the security of their systems and/or * data to be ensured and, more generally, to use and operate it in the * same conditions as regards security. - * + * * The fact that you are presently reading this means that you have had * knowledge of the CeCILL license and that you accept its terms. */ - - package ui.avatarinteractivesimulation; import ui.util.IconManager; @@ -50,12 +48,13 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; /** - * Class AvatarInteractiveSimulationActions - * - * Creation: 21/01/2011 - * @version 1.0 21/01/2011 - * @author Ludovic APVRILLE - * @see ui.TGComponent + * Class AvatarInteractiveSimulationActions + * <p> + * Creation: 21/01/2011 + * + * @author Ludovic APVRILLE + * @version 1.0 21/01/2011 + * @see ui.TGComponent */ public class AvatarInteractiveSimulationActions extends AbstractAction { // Actions @@ -107,7 +106,7 @@ public class AvatarInteractiveSimulationActions extends AbstractAction { public static final int NB_ACTION = 36; - private static final TAction [] actions = new TAction[NB_ACTION]; + private static final TAction[] actions = new TAction[NB_ACTION]; private EventListenerList listeners; @@ -116,13 +115,12 @@ public class AvatarInteractiveSimulationActions extends AbstractAction { public static final String LARGE_ICON = "LargeIcon"; - public AvatarInteractiveSimulationActions(int id) { if (actions[0] == null) { init(); } if (actions[id] == null) { - return ; + return; } putValue(Action.NAME, actions[id].NAME); @@ -193,40 +191,40 @@ public class AvatarInteractiveSimulationActions extends AbstractAction { actions[ACT_ADD_LATENCY] = new TAction("add-latency-command", "Add latency", IconManager.imgic75, IconManager.imgic75, "Add latency", "Add latency checkpoint", '0'); } - public String getActionCommand() { - return (String)getValue(Action.ACTION_COMMAND_KEY); + public String getActionCommand() { + return (String) getValue(Action.ACTION_COMMAND_KEY); } - public String getShortDescription() { - return (String)getValue(Action.SHORT_DESCRIPTION); + public String getShortDescription() { + return (String) getValue(Action.SHORT_DESCRIPTION); } - public String getLongDescription() { - return (String)getValue(Action.LONG_DESCRIPTION); + public String getLongDescription() { + return (String) getValue(Action.LONG_DESCRIPTION); } - public void actionPerformed(ActionEvent evt) { + public void actionPerformed(ActionEvent evt) { //System.out.println("Action performed"); if (listeners != null) { Object[] listenerList = listeners.getListenerList(); // Recreate the ActionEvent and stuff the value of the ACTION_COMMAND_KEY ActionEvent e = new ActionEvent(evt.getSource(), evt.getID(), - (String)getValue(Action.ACTION_COMMAND_KEY)); - for (int i = 0; i <= listenerList.length-2; i += 2) { - ((ActionListener)listenerList[i+1]).actionPerformed(e); + (String) getValue(Action.ACTION_COMMAND_KEY)); + for (int i = 0; i <= listenerList.length - 2; i += 2) { + ((ActionListener) listenerList[i + 1]).actionPerformed(e); } } } - public void addActionListener(ActionListener l) { + public void addActionListener(ActionListener l) { if (listeners == null) { listeners = new EventListenerList(); } listeners.add(ActionListener.class, l); } - public void removeActionListener(ActionListener l) { + public void removeActionListener(ActionListener l) { if (listeners == null) { return; } diff --git a/src/main/java/ui/avatarinteractivesimulation/JFrameAvatarInteractiveSimulation.java b/src/main/java/ui/avatarinteractivesimulation/JFrameAvatarInteractiveSimulation.java index 75dbfd19ae..8e7424cc8a 100755 --- a/src/main/java/ui/avatarinteractivesimulation/JFrameAvatarInteractiveSimulation.java +++ b/src/main/java/ui/avatarinteractivesimulation/JFrameAvatarInteractiveSimulation.java @@ -326,8 +326,36 @@ public class JFrameAvatarInteractiveSimulation extends JFrame implements Avatar selectedComponentForTransaction2 = null; if (ll != null) { listPendingTransactions.setListData(ll); - int random = (int)(Math.floor((Math.random()*ll.size()))); - listPendingTransactions.setSelectedIndex(random); + + //int random = (int)(Math.floor((Math.random()*ll.size()))); + //listPendingTransactions.setSelectedIndex(random); + + // Use probabilities + double sumProb = 0.0; + for (AvatarSimulationPendingTransaction pt: ll) { + sumProb += pt.probability; + } + + + + double rand2 = Math.random() * sumProb; + TraceManager.addDev("Nb of pending:" + ll.size() + " total prob=" + sumProb + " rand=" + rand2); + + + double prob = 0.0; + int index = 0; + for (AvatarSimulationPendingTransaction pt: ll) { + prob += pt.probability; + TraceManager.addDev("rand=" + rand2 + " prob=" + prob + " pt.probability=" + pt.probability); + if (rand2 < prob) { + listPendingTransactions.setSelectedIndex(index); + break; + } + index ++; + } + + + } else { listPendingTransactions.setListData(new Vector<AvatarSimulationPendingTransaction>()); } diff --git a/src/main/java/ui/avatarsmd/AvatarSMDConnector.java b/src/main/java/ui/avatarsmd/AvatarSMDConnector.java index 21306248ba..f5cb21a8f5 100644 --- a/src/main/java/ui/avatarsmd/AvatarSMDConnector.java +++ b/src/main/java/ui/avatarsmd/AvatarSMDConnector.java @@ -1,26 +1,26 @@ /* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille - * + * * ludovic.apvrille AT enst.fr - * + * * This software is a computer program whose purpose is to allow the * edition of TURTLE analysis, design and deployment diagrams, to * allow the generation of RT-LOTOS or Java code from this diagram, * and at last to allow the analysis of formal validation traces * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP * from INRIA Rhone-Alpes. - * + * * This software is governed by the CeCILL license under French law and * abiding by the rules of distribution of free software. You can use, * modify and/ or redistribute the software under the terms of the CeCILL * license as circulated by CEA, CNRS and INRIA at the following URL * "http://www.cecill.info". - * + * * As a counterpart to the access to the source code and rights to copy, * modify and redistribute granted by the license, users are provided only * with a limited warranty and the software's author, the holder of the * economic rights, and the successive licensors have only limited * liability. - * + * * In this respect, the user's attention is drawn to the risks associated * with loading, using, modifying and/or developing or reproducing the * software by the user in light of its specific status of free software, @@ -31,14 +31,12 @@ * requirements in conditions enabling the security of their systems and/or * data to be ensured and, more generally, to use and operate it in the * same conditions as regards security. - * + * * The fact that you are presently reading this means that you have had * knowledge of the CeCILL license and that you accept its terms. */ - - package ui.avatarsmd; import myutil.GraphicLib; @@ -51,23 +49,24 @@ import java.awt.geom.Point2D; import java.util.Vector; /** - * Class AvatarSMDConnector - * Basic connector with a full arrow at the end. Used in state machine - * Creation: 06/04/2010 - * @version 1.0 06/04/2010 - * @author Ludovic APVRILLE + * Class AvatarSMDConnector + * Basic connector with a full arrow at the end. Used in state machine + * Creation: 06/04/2010 + * + * @author Ludovic APVRILLE + * @version 1.0 06/04/2010 */ -public class AvatarSMDConnector extends TGConnectorWithCommentConnectionPoints { +public class AvatarSMDConnector extends TGConnectorWithCommentConnectionPoints { protected int arrowLength = 10; //protected AvatarSMDTransitionInfo myTransitionInfo; public AvatarSMDConnector(int _x, int _y, int _minX, int _minY, int _maxX, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp, TGConnectingPoint _p1, TGConnectingPoint _p2, Vector<Point> _listPoint) { - super(_x, _y, _minX, _minY, _maxX, _maxY, _pos, _father, _tdp, _p1, _p2, _listPoint); + super(_x, _y, _minX, _minY, _maxX, _maxY, _pos, _father, _tdp, _p1, _p2, _listPoint); //nbInternalTGComponent = 1; //tgcomponent = new TGComponent[nbInternalTGComponent]; - - AvatarSMDTransitionInfo tgc = new AvatarSMDTransitionInfo((_p1.getX()+_p2.getX())/2, (_p1.getY()+_p2.getY())/2, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, this, _tdp); + + AvatarSMDTransitionInfo tgc = new AvatarSMDTransitionInfo((_p1.getX() + _p2.getX()) / 2, (_p1.getY() + _p2.getY()) / 2, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, this, _tdp); tgc.setValue(""); tgc.setName("List of all parameters of an Avatar SMD transition"); tgc.setMoveWithFather(false); @@ -111,20 +110,22 @@ public class AvatarSMDConnector extends TGConnectorWithCommentConnectionPoints }*/ - public void setTransitionInfo(String guard, String action){ - AvatarSMDTransitionInfo tgc = (AvatarSMDTransitionInfo) getInternalTGComponent(0); - if (!guard.isEmpty()){ - tgc.setGuard(guard); - } - if (!action.isEmpty()){ - tgc.addAction(action); - } - } - public void setTransitionTime(String minDelay, String maxDelay, String minCompute, String maxCompute){ - AvatarSMDTransitionInfo tgc = (AvatarSMDTransitionInfo) getInternalTGComponent(0); - tgc.setTimes(minDelay, maxDelay, minCompute, maxCompute); - } - protected void drawLastSegment(Graphics g, int x1, int y1, int x2, int y2){ + public void setTransitionInfo(String guard, String action) { + AvatarSMDTransitionInfo tgc = (AvatarSMDTransitionInfo) getInternalTGComponent(0); + if (!guard.isEmpty()) { + tgc.setGuard(guard); + } + if (!action.isEmpty()) { + tgc.addAction(action); + } + } + + public void setTransitionTime(String minDelay, String maxDelay, String minCompute, String maxCompute) { + AvatarSMDTransitionInfo tgc = (AvatarSMDTransitionInfo) getInternalTGComponent(0); + tgc.setTimes(minDelay, maxDelay, minCompute, maxCompute); + } + + protected void drawLastSegment(Graphics g, int x1, int y1, int x2, int y2) { if (Point2D.distance(x1, y1, x2, y2) < GraphicLib.longueur * 1.5) { g.drawLine(x1, y1, x2, y2); } else { @@ -133,10 +134,10 @@ public class AvatarSMDConnector extends TGConnectorWithCommentConnectionPoints } public boolean editOndoubleClick(JFrame frame) { - AvatarSMDTransitionInfo info = getAvatarSMDTransitionInfo(); - if (info == null) { - return false; - } + AvatarSMDTransitionInfo info = getAvatarSMDTransitionInfo(); + if (info == null) { + return false; + } return info.editOndoubleClick(frame); } @@ -145,9 +146,9 @@ public class AvatarSMDConnector extends TGConnectorWithCommentConnectionPoints } public AvatarSMDTransitionInfo getAvatarSMDTransitionInfo() { - for(int i=0; i<tgcomponent.length; i++) { + for (int i = 0; i < tgcomponent.length; i++) { if (tgcomponent[i] instanceof AvatarSMDTransitionInfo) { - return (AvatarSMDTransitionInfo)(tgcomponent[i]); + return (AvatarSMDTransitionInfo) (tgcomponent[i]); } } return null; @@ -201,6 +202,12 @@ public class AvatarSMDConnector extends TGConnectorWithCommentConnectionPoints return getAvatarSMDTransitionInfo().getComputeMaxDelay(); } + public String getProbability() { + return getAvatarSMDTransitionInfo().getProbability(); + } + + + public String getFilesToInclude() { return getAvatarSMDTransitionInfo().getFilesToInclude(); diff --git a/src/main/java/ui/avatarsmd/AvatarSMDTransitionInfo.java b/src/main/java/ui/avatarsmd/AvatarSMDTransitionInfo.java index c01ae1c574..8e4ea4b0b0 100755 --- a/src/main/java/ui/avatarsmd/AvatarSMDTransitionInfo.java +++ b/src/main/java/ui/avatarsmd/AvatarSMDTransitionInfo.java @@ -1,26 +1,26 @@ /* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille - * + * * ludovic.apvrille AT enst.fr - * + * * This software is a computer program whose purpose is to allow the * edition of TURTLE analysis, design and deployment diagrams, to * allow the generation of RT-LOTOS or Java code from this diagram, * and at last to allow the analysis of formal validation traces * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP * from INRIA Rhone-Alpes. - * + * * This software is governed by the CeCILL license under French law and * abiding by the rules of distribution of free software. You can use, * modify and/ or redistribute the software under the terms of the CeCILL * license as circulated by CEA, CNRS and INRIA at the following URL * "http://www.cecill.info". - * + * * As a counterpart to the access to the source code and rights to copy, * modify and redistribute granted by the license, users are provided only * with a limited warranty and the software's author, the holder of the * economic rights, and the successive licensors have only limited * liability. - * + * * In this respect, the user's attention is drawn to the risks associated * with loading, using, modifying and/or developing or reproducing the * software by the user in light of its specific status of free software, @@ -31,14 +31,12 @@ * requirements in conditions enabling the security of their systems and/or * data to be ensured and, more generally, to use and operate it in the * same conditions as regards security. - * + * * The fact that you are presently reading this means that you have had * knowledge of the CeCILL license and that you accept its terms. */ - - package ui.avatarsmd; import myutil.Conversion; @@ -58,17 +56,18 @@ import java.util.Vector; //import java.awt.geom.*; /** - * Class AvatarSMDTransitionInfo - * Internal component that represents a set of parameter for a transition - * e.g., guard, after, compute, set of actions - * Creation: 12/04/2010 - * @version 1.0 12/04/2010 - * @author Ludovic APVRILLE + * Class AvatarSMDTransitionInfo + * Internal component that represents a set of parameter for a transition + * e.g., guard, after, compute, set of actions + * Creation: 12/04/2010 + * + * @author Ludovic APVRILLE + * @version 1.0 12/04/2010 */ public class AvatarSMDTransitionInfo extends TGCWithoutInternalComponent { // private static String FILE_INFO = "(user files specified)"; - // private static String CODE_INFO = "(user code specified)"; + // private static String CODE_INFO = "(user code specified)"; protected String guard; @@ -76,10 +75,11 @@ public class AvatarSMDTransitionInfo extends TGCWithoutInternalComponent { protected String afterMax; protected String computeMin; protected String computeMax; + protected String probability = ""; protected Vector<String> listOfActions; - protected String [] filesToInclude; - protected String [] codeToInclude; + protected String[] filesToInclude; + protected String[] codeToInclude; protected int minWidth = 10; protected int minHeight = 15; @@ -88,7 +88,7 @@ public class AvatarSMDTransitionInfo extends TGCWithoutInternalComponent { protected String defaultValue; public AvatarSMDTransitionInfo(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) { - super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp); + super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp); moveable = true; editable = true; @@ -118,18 +118,25 @@ public class AvatarSMDTransitionInfo extends TGCWithoutInternalComponent { public Vector<String> getListOfActions() { return listOfActions; } - public void setGuard(String s){ - guard=s; + + public void setGuard(String s) { + guard = s; } - public void addAction(String s){ - listOfActions.add(s); + + public void setProbability(String s) { + probability = s; } + + public void addAction(String s) { + listOfActions.add(s); + } + public void internalDrawing(Graphics g) { int step = 0; String s; - h = g.getFontMetrics().getHeight(); - for (int j=0; j<nbConnectingPoint; j++) { - connectingPoint[j].setCdY(-h+1); + h = g.getFontMetrics().getHeight(); + for (int j = 0; j < nbConnectingPoint; j++) { + connectingPoint[j].setCdY(-h + 1); } ColorManager.setColor(g, getState(), 0); @@ -139,9 +146,9 @@ public class AvatarSMDTransitionInfo extends TGCWithoutInternalComponent { g.setColor(ColorManager.AVATAR_GUARD); - if (tdp.isDrawingMain()) { - width = minWidth; - } + if (tdp.isDrawingMain()) { + width = minWidth; + } if (guard.length() > 0) { if (guard.replaceAll("\\s+", "").compareTo("[]") != 0) { @@ -201,9 +208,20 @@ public class AvatarSMDTransitionInfo extends TGCWithoutInternalComponent { } } + if ((probability != null) && (probability.length() > 0)) { + s = "p=" + probability; + g.drawString(s, x, y + step); + atLeastOneThing = true; + if (tdp.isDrawingMain()) { + width = Math.max(g.getFontMetrics().stringWidth(s), width); + width = Math.max(minWidth, width); + } + step += inc; + } + g.setColor(ColorManager.AVATAR_ACTION); - for(int i=0; i<listOfActions.size(); i++) { + for (int i = 0; i < listOfActions.size(); i++) { s = listOfActions.get(i); if (s.length() > 0) { g.drawString(s, x, y + step); @@ -239,24 +257,21 @@ public class AvatarSMDTransitionInfo extends TGCWithoutInternalComponent { }*/ - - if (tdp.isDrawingMain()) { height = Math.max(step, minHeight); } if (!atLeastOneThing) { - width=minWidth; + width = minWidth; } ColorManager.setColor(g, state, 0); - if ((getState() == TGState.POINTER_ON_ME) || (getState() == TGState.POINTED)|| (getState() == TGState.MOVING)){ - g.drawRoundRect(x-1, y-h+2, width+2, height+2, 5, 5); + if ((getState() == TGState.POINTER_ON_ME) || (getState() == TGState.POINTED) || (getState() == TGState.MOVING)) { + g.drawRoundRect(x - 1, y - h + 2, width + 2, height + 2, 5, 5); } } - public TGComponent isOnMe(int _x, int _y) { if (GraphicLib.isInRectangle(_x, _y, x, y - h + 2, width, height)) { return this; @@ -271,10 +286,10 @@ public class AvatarSMDTransitionInfo extends TGCWithoutInternalComponent { public boolean editOndoubleClick(JFrame frame) { LinkedList<TAttribute> attributes = tdp.getMGUI().getAllAttributes(); LinkedList<AvatarMethod> methods = tdp.getMGUI().getAllMethods(); - JDialogAvatarTransition jdat = new JDialogAvatarTransition(frame, "Setting transition parameters", guard, afterMin, afterMax, computeMin, computeMax, listOfActions, attributes, methods, filesToInclude, codeToInclude); - // jdat.setSize(600, 550); + JDialogAvatarTransition jdat = new JDialogAvatarTransition(frame, "Setting transition parameters", guard, afterMin, afterMax, computeMin, computeMax, listOfActions, attributes, methods, filesToInclude, codeToInclude, probability); + // jdat.setSize(600, 550); GraphicLib.centerOnParent(jdat, 600, 550); - jdat.setVisible( true ); // blocked until dialog has been closed + jdat.setVisible(true); // blocked until dialog has been closed if (jdat.hasBeenCancelled()) { @@ -293,7 +308,8 @@ public class AvatarSMDTransitionInfo extends TGCWithoutInternalComponent { computeMin = jdat.getComputeMin().trim(); computeMax = jdat.getComputeMax().trim(); filesToInclude = jdat.getFilesToInclude(); - codeToInclude = jdat.getCodeToInclude(); + codeToInclude = jdat.getCodeToInclude(); + probability = jdat.getProbability(); return true; } @@ -319,14 +335,18 @@ public class AvatarSMDTransitionInfo extends TGCWithoutInternalComponent { sb.append(GTURTLEModeling.transformString(computeMax)); sb.append("\" />\n"); - for(int i=0; i<listOfActions.size(); i++) { + sb.append("<probability value=\""); + sb.append(GTURTLEModeling.transformString(probability)); + sb.append("\" />\n"); + + for (int i = 0; i < listOfActions.size(); i++) { sb.append("<actions value=\""); sb.append(GTURTLEModeling.transformString(listOfActions.get(i))); sb.append("\" />\n"); } if (filesToInclude != null) { - for(int i=0; i<filesToInclude.length; i++) { + for (int i = 0; i < filesToInclude.length; i++) { sb.append("<filesToIncludeLine value=\""); sb.append(GTURTLEModeling.transformString(filesToInclude[i])); sb.append("\" />\n"); @@ -334,7 +354,7 @@ public class AvatarSMDTransitionInfo extends TGCWithoutInternalComponent { } if (codeToInclude != null) { - for(int i=0; i<codeToInclude.length; i++) { + for (int i = 0; i < codeToInclude.length; i++) { sb.append("<codeToIncludeLine value=\""); sb.append(GTURTLEModeling.transformString(codeToInclude[i])); sb.append("\" />\n"); @@ -346,7 +366,7 @@ public class AvatarSMDTransitionInfo extends TGCWithoutInternalComponent { } @Override - public void loadExtraParam(NodeList nl, int decX, int decY, int decId) throws MalformedModelingException{ + public void loadExtraParam(NodeList nl, int decX, int decY, int decId) throws MalformedModelingException { //System.out.println("*** load extra synchro *** " + getId()); String tmpFilesToInclude = ""; String tmpCodeToInclude = ""; @@ -358,18 +378,18 @@ public class AvatarSMDTransitionInfo extends TGCWithoutInternalComponent { Node n1, n2; Element elt; String s; - for(int i=0; i<nl.getLength(); i++) { + for (int i = 0; i < nl.getLength(); i++) { n1 = nl.item(i); //System.out.println(n1); if (n1.getNodeType() == Node.ELEMENT_NODE) { nli = n1.getChildNodes(); // Issue #17 copy-paste error on j index - for(int j=0; j<nli.getLength(); j++) { + for (int j = 0; j < nli.getLength(); j++) { n2 = nli.item(j); //System.out.println(n2); if (n2.getNodeType() == Node.ELEMENT_NODE) { - elt = (Element)n2; + elt = (Element) n2; if (elt.getTagName().equals("guard")) { s = elt.getAttribute("value"); if (s != null) { @@ -400,6 +420,12 @@ public class AvatarSMDTransitionInfo extends TGCWithoutInternalComponent { computeMax = s; } } + if (elt.getTagName().equals("probability")) { + s = elt.getAttribute("value"); + if (s != null) { + probability = s; + } + } if (elt.getTagName().equals("actions")) { s = elt.getAttribute("value"); if (s != null) { @@ -465,12 +491,17 @@ public class AvatarSMDTransitionInfo extends TGCWithoutInternalComponent { public String getComputeMaxDelay() { return computeMax; } - public void setTimes(String minDelay, String maxDelay, String minCompute, String maxCompute){ - computeMin= minCompute; - computeMax = maxCompute; - afterMin= minDelay; - afterMax=maxDelay; - } + + public String getProbability() { + return probability; + } + + public void setTimes(String minDelay, String maxDelay, String minCompute, String maxCompute) { + computeMin = minCompute; + computeMax = maxCompute; + afterMin = minDelay; + afterMax = maxDelay; + } public Vector<String> getActions() { return listOfActions; @@ -489,17 +520,18 @@ public class AvatarSMDTransitionInfo extends TGCWithoutInternalComponent { return null; } String ret = ""; - for(int i=0; i<filesToInclude.length; i++) { + for (int i = 0; i < filesToInclude.length; i++) { ret += filesToInclude[i] + "\n"; } return ret; } + public String getCodeToInclude() { if (codeToInclude == null) { return null; } String ret = ""; - for(int i=0; i<codeToInclude.length; i++) { + for (int i = 0; i < codeToInclude.length; i++) { ret += codeToInclude[i] + "\n"; } return ret; diff --git a/src/main/java/ui/window/JDialogAvatarExecutableCodeGeneration.java b/src/main/java/ui/window/JDialogAvatarExecutableCodeGeneration.java index e359d086bd..3cde2ea73d 100644 --- a/src/main/java/ui/window/JDialogAvatarExecutableCodeGeneration.java +++ b/src/main/java/ui/window/JDialogAvatarExecutableCodeGeneration.java @@ -1,26 +1,26 @@ /* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille - * + * * ludovic.apvrille AT enst.fr - * + * * This software is a computer program whose purpose is to allow the * edition of TURTLE analysis, design and deployment diagrams, to * allow the generation of RT-LOTOS or Java code from this diagram, * and at last to allow the analysis of formal validation traces * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP * from INRIA Rhone-Alpes. - * + * * This software is governed by the CeCILL license under French law and * abiding by the rules of distribution of free software. You can use, * modify and/ or redistribute the software under the terms of the CeCILL * license as circulated by CEA, CNRS and INRIA at the following URL * "http://www.cecill.info". - * + * * As a counterpart to the access to the source code and rights to copy, * modify and redistribute granted by the license, users are provided only * with a limited warranty and the software's author, the holder of the * economic rights, and the successive licensors have only limited * liability. - * + * * In this respect, the user's attention is drawn to the risks associated * with loading, using, modifying and/or developing or reproducing the * software by the user in light of its specific status of free software, @@ -31,14 +31,12 @@ * requirements in conditions enabling the security of their systems and/or * data to be ensured and, more generally, to use and operate it in the * same conditions as regards security. - * + * * The fact that you are presently reading this means that you have had * knowledge of the CeCILL license and that you accept its terms. */ - - package ui.window; import avatartranslator.AvatarSpecification; @@ -62,11 +60,12 @@ import java.io.File; * Class JDialogAvatarExecutableCodeGeneration * Dialog for managing the generation and compilation of AVATAR executable code * Creation: 29/03/2011 - * @version 1.1 29/03/2011 + * * @author Ludovic APVRILLE * @author (added deployment diagrams) Julien Henon, Daniela GENIUS + * @version 1.1 29/03/2011 */ -public class JDialogAvatarExecutableCodeGeneration extends javax.swing.JFrame implements ActionListener, Runnable, MasterProcessInterface { +public class JDialogAvatarExecutableCodeGeneration extends javax.swing.JFrame implements ActionListener, Runnable, MasterProcessInterface { private static String[] unitTab = {"usec", "msec", "sec"}; @@ -145,7 +144,9 @@ public class JDialogAvatarExecutableCodeGeneration extends javax.swing.JFrame im protected RshClient rshc; - /** Creates new form */ + /** + * Creates new form + */ public JDialogAvatarExecutableCodeGeneration(Frame _f, MainGUI _mgui, String title, String _hostExecute, String _pathCode, String _pathCompiler, String _pathExecute, String _pathCompilerSoclib, String _pathExecuteSoclib, String _pathSoclibTraceFile) { @@ -156,7 +157,7 @@ public class JDialogAvatarExecutableCodeGeneration extends javax.swing.JFrame im pathCode = _pathCode; - + pathCompiler = _pathCompiler; pathExecute = _pathExecute; @@ -169,7 +170,7 @@ public class JDialogAvatarExecutableCodeGeneration extends javax.swing.JFrame im pathExecuteSoclib = _pathExecuteSoclib; } - if (pathSoclibTraceFile == null){ + if (pathSoclibTraceFile == null) { pathSoclibTraceFile = _pathSoclibTraceFile; } @@ -196,9 +197,9 @@ public class JDialogAvatarExecutableCodeGeneration extends javax.swing.JFrame im protected void initComponents() { - if (PluginManager.pluginManager.getPluginAvatarCodeGenerator() != null) { - codes[0] = "AVATAR CPOSIX (with Plugin)"; - } + if (PluginManager.pluginManager.getPluginAvatarCodeGenerator() != null) { + codes[0] = "AVATAR CPOSIX (with Plugin)"; + } Container c = getContentPane(); setFont(new Font("Helvetica", Font.PLAIN, 14)); @@ -308,7 +309,7 @@ public class JDialogAvatarExecutableCodeGeneration extends javax.swing.JFrame im c02.fill = GridBagConstraints.BOTH; c02.gridheight = 1; - compilegroup = new ButtonGroup(); + compilegroup = new ButtonGroup(); compile = new JRadioButton(textSysC2, false); jp02.add(compile, c02); @@ -417,7 +418,6 @@ public class JDialogAvatarExecutableCodeGeneration extends javax.swing.JFrame im jp1.add("Results", jp04); - c.add(jp1, BorderLayout.NORTH); jta = new ScrolledJTextArea(); @@ -427,7 +427,7 @@ public class JDialogAvatarExecutableCodeGeneration extends javax.swing.JFrame im jta.append("Select options and then, click on 'start' to launch code generation / compilation / execution\n"); Font f = new Font("Courrier", Font.BOLD, 12); jta.setFont(f); - textAreaWriter = new JTextAreaWriter( jta ); + textAreaWriter = new JTextAreaWriter(jta); jsp = new JScrollPane(jta, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); @@ -454,11 +454,11 @@ public class JDialogAvatarExecutableCodeGeneration extends javax.swing.JFrame im } - public void actionPerformed(ActionEvent evt) { + public void actionPerformed(ActionEvent evt) { String command = evt.getActionCommand(); // Compare the action command to the known actions. - if (command.equals("Start")) { + if (command.equals("Start")) { startProcess(); } else if (command.equals("Stop")) { stopProcess(); @@ -470,7 +470,7 @@ public class JDialogAvatarExecutableCodeGeneration extends javax.swing.JFrame im selectedUnit = units.getSelectedIndex(); } else if (evt.getSource() == showSimulationTrace) { showSimulationTrace(); - } else if ((evt.getSource() == exe) || (evt.getSource() == exetrace)|| (evt.getSource() == exesoclib)) { + } else if ((evt.getSource() == exe) || (evt.getSource() == exetrace) || (evt.getSource() == exesoclib)) { makeSelectionExecute(); } else if ((evt.getSource() == compile) || (evt.getSource() == compilesoclib)) { makeSelectionCompile(); @@ -542,7 +542,7 @@ public class JDialogAvatarExecutableCodeGeneration extends javax.swing.JFrame im } rshc = null; - mode = STOPPED; + mode = STOPPED; setButtons(); go = false; } @@ -578,14 +578,14 @@ public class JDialogAvatarExecutableCodeGeneration extends javax.swing.JFrame im if (removeCFiles.isSelected()) { jta.append("Removing all .h files\n"); - list = FileUtils.deleteFiles(code1.getText() + AVATAR2CPOSIX.getGeneratedPath(), ".h"); + list = FileUtils.deleteFiles(code1.getText() + AVATAR2CPOSIX.getGeneratedPath(), ".h"); if (list.length() == 0) { jta.append("No files were deleted\n"); } else { jta.append("Files deleted:\n" + list + "\n"); } jta.append("Removing all .c files\n"); - list = FileUtils.deleteFiles(code1.getText() + AVATAR2CPOSIX.getGeneratedPath(), ".c"); + list = FileUtils.deleteFiles(code1.getText() + AVATAR2CPOSIX.getGeneratedPath(), ".c"); if (list.length() == 0) { jta.append("No files were deleted\n"); } else { @@ -595,7 +595,7 @@ public class JDialogAvatarExecutableCodeGeneration extends javax.swing.JFrame im if (removeXFiles.isSelected()) { jta.append("Removing all .x files\n"); - list = FileUtils.deleteFiles(code1.getText() , ".x"); + list = FileUtils.deleteFiles(code1.getText(), ".x"); if (list.length() == 0) { jta.append("No files were deleted\n"); } else { @@ -607,7 +607,7 @@ public class JDialogAvatarExecutableCodeGeneration extends javax.swing.JFrame im if (removeOFiles.isSelected()) { String pathTmp = code1.getText() + "/lib/generated_src/"; jta.append("Removing all .o files in " + pathTmp + "\n"); - list = FileUtils.deleteFiles(pathTmp , ".o"); + list = FileUtils.deleteFiles(pathTmp, ".o"); if (list.length() == 0) { jta.append("No files were deleted\n"); } else { @@ -616,7 +616,7 @@ public class JDialogAvatarExecutableCodeGeneration extends javax.swing.JFrame im pathTmp = code1.getText() + "/lib/src/"; jta.append("Removing all .o files in " + pathTmp + "\n"); - list = FileUtils.deleteFiles(pathTmp , ".o"); + list = FileUtils.deleteFiles(pathTmp, ".o"); if (list.length() == 0) { jta.append("No files were deleted\n"); @@ -635,12 +635,12 @@ public class JDialogAvatarExecutableCodeGeneration extends javax.swing.JFrame im if (avspec == null) { jta.append("Error: No AVATAR specification\n"); } else { - if (PluginManager.pluginManager.getPluginAvatarCodeGenerator() != null) { - TraceManager.addDev("Using customize Avatar code generator"); - } - + if (PluginManager.pluginManager.getPluginAvatarCodeGenerator() != null) { + TraceManager.addDev("Using customize Avatar code generator"); + } + AVATAR2CPOSIX avatartocposix = new AVATAR2CPOSIX(avspec, PluginManager.pluginManager.getPluginAvatarCodeGenerator()); - + avatartocposix.includeUserCode(putUserCode.isSelected()); avatartocposix.setTimeUnit(selectedUnit); avatartocposix.generateCPOSIX(debugmode.isSelected(), tracemode.isSelected()); @@ -651,11 +651,12 @@ public class JDialogAvatarExecutableCodeGeneration extends javax.swing.JFrame im jta.append("Saving code in files\n"); pathCode = code1.getText(); //gene.avatartocposix.saveInFiles(pathCode);//DG 27.11. + TraceManager.addDev("Generating files in " + pathCode); avatartocposix.saveInFiles(pathCode); //tml2systc.saveFile(pathCode, "appmodel"); jta.append("Code saved\n"); } catch (Exception e) { - jta.append("Could not generate files\n"); + jta.append("Could not generate files:\n" + e.getMessage()); } } } @@ -684,11 +685,11 @@ public class JDialogAvatarExecutableCodeGeneration extends javax.swing.JFrame im jta.append("Compilation done\n"); } catch (LauncherException le) { jta.append("Error: " + le.getMessage() + "\n"); - mode = STOPPED; + mode = STOPPED; setButtons(); return; } catch (Exception e) { - mode = STOPPED; + mode = STOPPED; setButtons(); return; } @@ -717,11 +718,11 @@ public class JDialogAvatarExecutableCodeGeneration extends javax.swing.JFrame im jta.append("Execution done\n"); } catch (LauncherException le) { jta.append("Error: " + le.getMessage() + "\n"); - mode = STOPPED; + mode = STOPPED; setButtons(); return; } catch (Exception e) { - mode = STOPPED; + mode = STOPPED; setButtons(); return; } @@ -898,7 +899,7 @@ public class JDialogAvatarExecutableCodeGeneration extends javax.swing.JFrame im protected void processCmd(String cmd, JTextArea _jta) throws LauncherException { rshc.setCmd(cmd); rshc.sendExecuteCommandRequest(); - rshc.writeCommandMessages( textAreaWriter ); + rshc.writeCommandMessages(textAreaWriter); return; } @@ -908,28 +909,28 @@ public class JDialogAvatarExecutableCodeGeneration extends javax.swing.JFrame im } protected void setButtons() { - switch(mode) { - case NOT_STARTED: - start.setEnabled(true); - stop.setEnabled(false); - close.setEnabled(true); - //setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - getGlassPane().setVisible(false); - break; - case STARTED: - start.setEnabled(false); - stop.setEnabled(true); - close.setEnabled(false); - getGlassPane().setVisible(true); - //setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - break; - case STOPPED: - default: - start.setEnabled(false); - stop.setEnabled(false); - close.setEnabled(true); - getGlassPane().setVisible(false); - break; + switch (mode) { + case NOT_STARTED: + start.setEnabled(true); + stop.setEnabled(false); + close.setEnabled(true); + //setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + getGlassPane().setVisible(false); + break; + case STARTED: + start.setEnabled(false); + stop.setEnabled(true); + close.setEnabled(false); + getGlassPane().setVisible(true); + //setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); + break; + case STOPPED: + default: + start.setEnabled(false); + stop.setEnabled(false); + close.setEnabled(true); + getGlassPane().setVisible(false); + break; } } diff --git a/src/main/java/ui/window/JDialogAvatarTransition.java b/src/main/java/ui/window/JDialogAvatarTransition.java index aa3fc6e068..9002233656 100755 --- a/src/main/java/ui/window/JDialogAvatarTransition.java +++ b/src/main/java/ui/window/JDialogAvatarTransition.java @@ -64,7 +64,7 @@ import java.util.Vector; public class JDialogAvatarTransition extends JDialogBase implements ActionListener { private Vector<String> actions; - private String guard, afterMin, afterMax, computeMin, computeMax; + private String guard, afterMin, afterMax, computeMin, computeMax, probability; private LinkedList<TAttribute> myAttributes; private LinkedList<AvatarMethod> myMethods; private Vector<String> allElements, insertElements; @@ -78,7 +78,7 @@ public class JDialogAvatarTransition extends JDialogBase implements ActionListen private JPanel panel2; // Panel1 - private JTextField guardT, afterMinT, afterMaxT, computeMinT, computeMaxT; + private JTextField guardT, afterMinT, afterMaxT, computeMinT, computeMaxT, probabilityT; private JTextArea actionsT; private JComboBox<String> elements; private JButton insertElement; @@ -89,7 +89,10 @@ public class JDialogAvatarTransition extends JDialogBase implements ActionListen /** Creates new form */ // arrayDelay: [0] -> minDelay ; [1] -> maxDelay - public JDialogAvatarTransition(Frame _f, String _title, String _guard, String _afterMin, String _afterMax, String _computeMin, String _computeMax, Vector<String> _actions, LinkedList<TAttribute> _myAttributes, LinkedList<AvatarMethod> _myMethods, String[] _filesToInclude, String[] _codeToInclude) { + public JDialogAvatarTransition(Frame _f, String _title, String _guard, String _afterMin, String _afterMax, + String _computeMin, String _computeMax, Vector<String> _actions, + LinkedList<TAttribute> _myAttributes, LinkedList<AvatarMethod> _myMethods, + String[] _filesToInclude, String[] _codeToInclude, String _probability) { super(_f, _title, true); @@ -99,6 +102,7 @@ public class JDialogAvatarTransition extends JDialogBase implements ActionListen computeMin = _computeMin; computeMax = _computeMax; actions = _actions; + probability = _probability; myAttributes = _myAttributes; myMethods = _myMethods; @@ -185,7 +189,7 @@ public class JDialogAvatarTransition extends JDialogBase implements ActionListen panel1.add(new JLabel(")"), c1); // Compute - c1.gridwidth = 1; + /*c1.gridwidth = 1; c1.gridheight = 1; c1.weighty = 1.0; c1.weightx = 1.0; @@ -196,8 +200,19 @@ public class JDialogAvatarTransition extends JDialogBase implements ActionListen computeMaxT = new JTextField(computeMax, 10); panel1.add(computeMaxT, c1); c1.gridwidth = GridBagConstraints.REMAINDER; //end row - panel1.add(new JLabel(")"), c1); - + panel1.add(new JLabel(")"), c1);*/ + + // probability + c1.weighty = 1.0; + c1.weightx = 1.0; + c1.gridwidth = 1; + c1.gridheight = 1; + c1.fill = GridBagConstraints.BOTH; + c1.gridheight = 1; + panel1.add(new JLabel("probability in [0...1] = "), c1); + c1.gridwidth = GridBagConstraints.REMAINDER; //end row + probabilityT = new JTextField(probability); + panel1.add(probabilityT, c1); // actions @@ -359,13 +374,24 @@ public class JDialogAvatarTransition extends JDialogBase implements ActionListen } public String getComputeMin() { - return computeMinT.getText(); + if (computeMinT == null) { + return ""; + } + + return computeMinT.getText(); } public String getComputeMax() { - return computeMaxT.getText(); + if (computeMaxT == null) { + return ""; + } + return computeMaxT.getText(); } + public String getProbability() { + return probabilityT.getText(); + } + public boolean hasBeenCancelled() { return cancelled; } diff --git a/src/main/java/ui/window/JDialogAvatarddExecutableCodeGeneration.java b/src/main/java/ui/window/JDialogAvatarddExecutableCodeGeneration.java index 9698af3939..db7714e04f 100755 --- a/src/main/java/ui/window/JDialogAvatarddExecutableCodeGeneration.java +++ b/src/main/java/ui/window/JDialogAvatarddExecutableCodeGeneration.java @@ -1,26 +1,26 @@ /* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille - * + * * ludovic.apvrille AT enst.fr - * + * * This software is a computer program whose purpose is to allow the * edition of TURTLE analysis, design and deployment diagrams, to * allow the generation of RT-LOTOS or Java code from this diagram, * and at last to allow the analysis of formal validation traces * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP * from INRIA Rhone-Alpes. - * + * * This software is governed by the CeCILL license under French law and * abiding by the rules of distribution of free software. You can use, * modify and/ or redistribute the software under the terms of the CeCILL * license as circulated by CEA, CNRS and INRIA at the following URL * "http://www.cecill.info". - * + * * As a counterpart to the access to the source code and rights to copy, * modify and redistribute granted by the license, users are provided only * with a limited warranty and the software's author, the holder of the * economic rights, and the successive licensors have only limited * liability. - * + * * In this respect, the user's attention is drawn to the risks associated * with loading, using, modifying and/or developing or reproducing the * software by the user in light of its specific status of free software, @@ -31,14 +31,12 @@ * requirements in conditions enabling the security of their systems and/or * data to be ensured and, more generally, to use and operate it in the * same conditions as regards security. - * + * * The fact that you are presently reading this means that you have had * knowledge of the CeCILL license and that you accept its terms. */ - - package ui.window; import avatartranslator.AvatarSpecification; @@ -67,12 +65,12 @@ import java.io.Writer; * Class JDialogAvatarddExecutableCodeGeneration * Dialog for managing the generation and compilation of AVATAR executable code * Creation: june 2014 - * @version 1.1 + * * @author Ludovic APVRILLE - * @version 2.0 (march 2016) * @author (adapted to code generation from deployment diagrams) Julien Henon, Daniela GENIUS 2015-2016 + * @version 2.0 (march 2016) */ -public class JDialogAvatarddExecutableCodeGeneration extends javax.swing.JFrame implements ActionListener, Runnable, MasterProcessInterface { +public class JDialogAvatarddExecutableCodeGeneration extends javax.swing.JFrame implements ActionListener, Runnable, MasterProcessInterface { private static String[] unitTab = {"usec", "msec", "sec"}; @@ -80,7 +78,7 @@ public class JDialogAvatarddExecutableCodeGeneration extends javax.swing.JFrame protected MainGUI mgui; private String textSysC1 = "Base directory of code generation:"; - private String textSysC2 = "Compile soclib executable with"; + private String textSysC2 = "Compile soclib executable with"; //private String textSysC3 = "Run code and trace traffic on interconnect :"; private String textSysC4 = "Run code in soclib / mutekh:"; private String textSysC5 = "Show AVATAR trace from file w/o hardware:"; @@ -88,14 +86,14 @@ public class JDialogAvatarddExecutableCodeGeneration extends javax.swing.JFrame private String textSysC7 = "Base directory of topcell generation:"; //private static String unitCycle = "1"; - + private static String[] codes = {"AVATAR SOCLIB"}; - + private static int selectedRun = 1; private static int selectedCompile = 0; private static int selectedViewTrace = 0; private static boolean static_putUserCode = true; - + protected static String pathCode; protected static String pathSoclibTraceFile; protected static String pathCompileMPSoC; @@ -108,7 +106,7 @@ public class JDialogAvatarddExecutableCodeGeneration extends javax.swing.JFrame private static - int mode; + int mode; //components protected JTextArea jta; @@ -124,7 +122,7 @@ public class JDialogAvatarddExecutableCodeGeneration extends javax.swing.JFrame protected JScrollPane jsp; protected JCheckBox removeCFiles, removeXFiles, debugmode, tracemode, optimizemode, putUserCode; protected JComboBox<String> versionCodeGenerator, units; - protected JButton showSimulationTrace,showOverflowStatus; + protected JButton showSimulationTrace, showOverflowStatus; private static int selectedUnit = 2; private static boolean removeCFilesValue = true; @@ -138,28 +136,31 @@ public class JDialogAvatarddExecutableCodeGeneration extends javax.swing.JFrame private boolean hasError = false; protected boolean startProcess = false; - // private AvatarRelation FIFO; + // private AvatarRelation FIFO; private String hostExecute; protected RshClient rshc; - /** Creates new form */ + /** + * Creates new form + */ - public JDialogAvatarddExecutableCodeGeneration(Frame _f, MainGUI _mgui, String title, - String _hostExecute, - String _pathCode, - String _pathCompileMPSoC, - String _pathExecuteMPSoC) { + public JDialogAvatarddExecutableCodeGeneration(Frame _f, MainGUI _mgui, String title, + String _hostExecute, + String _pathCode, + String _pathCompileMPSoC, + String _pathExecuteMPSoC) { - super(title);; + super(title); + ; f = _f; mgui = _mgui; if (pathCode == null) { pathCode = _pathCode; - } - + } + if (pathCompileMPSoC == null) { pathCompileMPSoC = _pathCompileMPSoC; } @@ -235,14 +236,14 @@ public class JDialogAvatarddExecutableCodeGeneration extends javax.swing.JFrame code1 = new JTextField(pathCode, 100); jp01.add(code1, c01); - + gen = new JLabel(textSysC7); //genJava.addActionListener(this); jp01.add(gen, c01); - code2 = new JTextField(pathCode, 100); + code2 = new JTextField(pathCode, 100); jp01.add(code2, c01); - + jp01.add(new JLabel(" "), c01); c01.gridwidth = GridBagConstraints.REMAINDER; //end row @@ -280,10 +281,10 @@ public class JDialogAvatarddExecutableCodeGeneration extends javax.swing.JFrame jp01.add(new JLabel("Code generator used:"), c01); versionCodeGenerator = new JComboBox<String>(codes); - // versionCodeGenerator.setSelectedIndex(selectedItem); + // versionCodeGenerator.setSelectedIndex(selectedItem); versionCodeGenerator.addActionListener(this); jp01.add(versionCodeGenerator, c01); - + jp01.add(new JLabel(" "), c01); jp1.add("Generate code", jp01); @@ -295,7 +296,7 @@ public class JDialogAvatarddExecutableCodeGeneration extends javax.swing.JFrame c02.fill = GridBagConstraints.BOTH; c02.gridheight = 1; - compilegroup = new ButtonGroup(); + compilegroup = new ButtonGroup(); compilesoclib = new JRadioButton(textSysC2, false); compilesoclib.addActionListener(this); @@ -317,7 +318,7 @@ public class JDialogAvatarddExecutableCodeGeneration extends javax.swing.JFrame c03.fill = GridBagConstraints.BOTH; c03.gridheight = 1; - exegroup = new ButtonGroup(); + exegroup = new ButtonGroup(); /*exetrace = new JRadioButton(textSysC3, false); exetrace.addActionListener(this); @@ -335,7 +336,7 @@ public class JDialogAvatarddExecutableCodeGeneration extends javax.swing.JFrame //exe.setSelected(selectedRun == 0); //exetrace.setSelected(selectedRun == 1); - exesoclib.setSelected(selectedRun == 2); + exesoclib.setSelected(selectedRun == 2); jp03.add(new JLabel(" "), c03); @@ -359,21 +360,21 @@ public class JDialogAvatarddExecutableCodeGeneration extends javax.swing.JFrame viewtracesoclib = new JRadioButton(textSysC6, false); viewgroup.add(viewtracesoclib); viewtracesoclib.addActionListener(this); - jp04.add(viewtracesoclib, c04); - simulationsoclibTraceFile = new JTextField(pathSoclibTraceFile, 100); + jp04.add(viewtracesoclib, c04); + simulationsoclibTraceFile = new JTextField(pathSoclibTraceFile, 100); jp04.add(simulationsoclibTraceFile, c04); showSimulationTrace = new JButton("Show simulation trace"); showSimulationTrace.addActionListener(this); jp04.add(showSimulationTrace, c04); - //-------------Ajout C.Demarigny--------------- + //-------------Ajout C.Demarigny--------------- - showOverflowStatus = new JButton("Show overflow status"); + showOverflowStatus = new JButton("Show overflow status"); showOverflowStatus.addActionListener(this); jp04.add(showOverflowStatus, c04); - //----------------Fin ajout-------------------- + //----------------Fin ajout-------------------- viewtrace.setSelected(selectedViewTrace == 0); viewtracesoclib.setSelected(selectedViewTrace == 1); @@ -381,7 +382,6 @@ public class JDialogAvatarddExecutableCodeGeneration extends javax.swing.JFrame jp1.add("Results", jp04); - c.add(jp1, BorderLayout.NORTH); jta = new ScrolledJTextArea(); @@ -416,34 +416,34 @@ public class JDialogAvatarddExecutableCodeGeneration extends javax.swing.JFrame } - public void actionPerformed(ActionEvent evt) { + public void actionPerformed(ActionEvent evt) { String command = evt.getActionCommand(); // Compare the action command to the known actions. - if (command.equals("Start")) { + if (command.equals("Start")) { startProcess(); } else if (command.equals("Stop")) { stopProcess(); } else if (command.equals("Close")) { closeDialog(); } else if (evt.getSource() == versionCodeGenerator) { - // selectedItem = versionCodeGenerator.getSelectedIndex(); + // selectedItem = versionCodeGenerator.getSelectedIndex(); } else if (evt.getSource() == units) { selectedUnit = units.getSelectedIndex(); } else if (evt.getSource() == showSimulationTrace) { showSimulationTrace(); } //else if ((evt.getSource() == exe) || (evt.getSource() == exetrace)|| (evt.getSource() == exesoclib)) { - else if ((evt.getSource() == exetrace)|| (evt.getSource() == exesoclib)) { + else if ((evt.getSource() == exetrace) || (evt.getSource() == exesoclib)) { makeSelectionExecute(); - // } else if ((evt.getSource() == compile) || (evt.getSource() == compilesoclib)) { - } else if ( (evt.getSource() == compilesoclib)) { + // } else if ((evt.getSource() == compile) || (evt.getSource() == compilesoclib)) { + } else if ((evt.getSource() == compilesoclib)) { makeSelectionCompile(); } else if ((evt.getSource() == viewtrace) || (evt.getSource() == viewtracesoclib)) { makeSelectionViewTrace(); - } else if ((evt.getSource() == showOverflowStatus) ){ //ajout CD - showOverflowStatus(); - }//fin ajout CD - } + } else if ((evt.getSource() == showOverflowStatus)) { //ajout CD + showOverflowStatus(); + }//fin ajout CD + } public void closeDialog() { if (mode == STARTED) { @@ -459,21 +459,21 @@ public class JDialogAvatarddExecutableCodeGeneration extends javax.swing.JFrame } public void makeSelectionExecute() { - - //if (exetrace.isSelected()) { - // selectedRun = 1; - //} else { - selectedRun = 2; - //} - - // exe2.setEnabled(selectedRun == 0); + + //if (exetrace.isSelected()) { + // selectedRun = 1; + //} else { + selectedRun = 2; + //} + + // exe2.setEnabled(selectedRun == 0); //exe3.setEnabled(selectedRun == 1); exe4.setEnabled(selectedRun == 2); } public void makeSelectionCompile() { - selectedCompile = 1; + selectedCompile = 1; compiler.setEnabled(selectedCompile == 1); } @@ -485,7 +485,7 @@ public class JDialogAvatarddExecutableCodeGeneration extends javax.swing.JFrame selectedViewTrace = 1; } simulationTraceFile.setEnabled(selectedViewTrace == 0); - // simulationsoclibTraceFile.setEnabled(selectedViewTrace == 1); + // simulationsoclibTraceFile.setEnabled(selectedViewTrace == 1); } public void stopProcess() { @@ -495,7 +495,7 @@ public class JDialogAvatarddExecutableCodeGeneration extends javax.swing.JFrame } rshc = null; - mode = STOPPED; + mode = STOPPED; setButtons(); go = false; } @@ -518,199 +518,198 @@ public class JDialogAvatarddExecutableCodeGeneration extends javax.swing.JFrame public void run() { String cmd; String list;//, data; - // int cycle = 0; + // int cycle = 0; hasError = false; - try { - - - - if (jp1.getSelectedIndex() == 0) { - jta.append("Generating executable code (SOCLIB version)\n"); - //selectedUnit = 1; - - ADDDiagramPanel deploymentDiagramPanel = mgui.getFirstAvatarDeploymentPanelFound(); - AvatarDeploymentPanelTranslator avdeploymenttranslator = new AvatarDeploymentPanelTranslator(deploymentDiagramPanel); - AvatarddSpecification avddspec = avdeploymenttranslator.getAvatarddSpecification(); - AvatarSpecification avspec = mgui.gtm.getAvatarSpecification(); - - // Generating code - if ( avddspec == null) { - jta.append("Error: No AVATAR Deployemnt specification\n"); - } else { - System.err.println("**AVATAR TOPCELL found"); - - TopCellGenerator topCellGenerator = new TopCellGenerator(avddspec, tracemode.isSelected(),avspec); - testGo(); - jta.append("Generation of TopCell executable code: done\n"); - - try { - jta.append("Saving MPSoC code in files\n"); - System.err.println("Saving MPSoC code in files\n"); - pathCode = code2.getText(); - - System.err.println("AVATAR TOPCELL saved in "+code2.getText()); - topCellGenerator.saveFile(pathCode); - - jta.append("Code saved\n"); - } catch (Exception e) { - jta.append("Could not generate files\n"); - System.err.println("Could not generate MPSoC files\n"); - e.printStackTrace(); - } - } - - - testGo(); - - - if (removeCFiles.isSelected()) { - - jta.append("Removing all .h files\n"); - - list = FileUtils.deleteFiles(code1.getText() + TasksAndMainGenerator.getGeneratedPath(), ".h"); - if (list.length() == 0) { - jta.append("No files were deleted\n"); - } else { - jta.append("Files deleted:\n" + list + "\n"); - } - jta.append("Removing all .c files\n"); - list = FileUtils.deleteFiles(code1.getText() + TasksAndMainGenerator.getGeneratedPath(), ".c"); - //list = FileUtils.deleteFiles(code1.getText() + AVATAR2SOCLIB.getGeneratedPath(), ".c"); - if (list.length() == 0) { - jta.append("No files were deleted\n"); - } else { - jta.append("Files deleted:\n" + list + "\n"); - } - } - - if (removeXFiles.isSelected()) { - jta.append("Removing all .x files\n"); - list = FileUtils.deleteFiles(code1.getText() , ".x"); - if (list.length() == 0) { - jta.append("No files were deleted\n"); - } else { - jta.append("Files deleted:\n" + list + "\n"); - } - } - - testGo(); - - selectedUnit = units.getSelectedIndex(); - //System.out.println("Selected item=" + selectedItem); - //AvatarSpecification avspec = mgui.gtm.getAvatarSpecification(); - - // Generating code - if (avspec == null) { - jta.append("Error: No AVATAR specification\n"); - } else { - - TasksAndMainGenerator gene = new TasksAndMainGenerator(avddspec,avspec); - gene.includeUserCode(putUserCode.isSelected()); - gene.setTimeUnit(selectedUnit); - gene.generateSoclib(debugmode.isSelected(), tracemode.isSelected()); - - if ( avddspec == null) { - jta.append("Error: No AVATAR Deployment specification\n"); - } else { - System.err.println("AVATAR TOPCELL found"); - } - - TopCellGenerator topCellGenerator = new TopCellGenerator(avddspec, tracemode.isSelected(),avspec); - testGo(); - jta.append("Generation of TopCell executable code: done\n"); - - try { - jta.append("Saving code in files\n"); - pathCode = code2.getText(); - topCellGenerator.saveFile(pathCode); - - jta.append("Code saved\n"); - } catch (Exception e) { - jta.append("Could not generate files\n"); - } - - testGo(); - jta.append("Generation of C-SOCLIB executable code: done\n"); - //t2j.printJavaClasses(); - try { - jta.append("Saving code in files\n"); - pathCode = code1.getText(); - gene.saveInFiles(pathCode); - - jta.append("Code saved\n"); - } catch (Exception e) { - jta.append("Could not generate files\n"); - } - } - } - - testGo(); - - // Compilation - if (jp1.getSelectedIndex() == 1) { - cmd = compiler.getText(); - jta.append("Compiling executable code with command: \n" + cmd + "\n"); - - rshc = new RshClient(hostExecute); - // AssumE data are on the remote host - // Command - try { - processCmd(cmd, jta); - //data = processCmd(cmd); - //jta.append(data); - jta.append("Compilation done\n"); - } catch (LauncherException le) { - jta.append("Error: " + le.getMessage() + "\n"); - mode = STOPPED; - setButtons(); - return; - } catch (Exception e) { - mode = STOPPED; - setButtons(); - return; - } - } - - if (jp1.getSelectedIndex() == 2) { - try { - // if (selectedRun == 1) { - //cmd = exe3.getText(); - //} else { - cmd = exe4.getText(); - // } - - jta.append("Executing code with command: \n" + cmd + "\n"); - - rshc = new RshClient(hostExecute); - // Assume data are on the remote host - // Command - - processCmd(cmd, jta); - //jta.append(data); - jta.append("Execution done\n"); - } catch (LauncherException le) { - jta.append("Error: " + le.getMessage() + "\n"); - mode = STOPPED; - setButtons(); - return; - } catch (Exception e) { - mode = STOPPED; - setButtons(); - return; - } - } - - if ((hasError == false) && (jp1.getSelectedIndex() < 2)) { - jp1.setSelectedIndex(jp1.getSelectedIndex() + 1); - } - //} + try { + + + if (jp1.getSelectedIndex() == 0) { + jta.append("Generating executable code (SOCLIB version)\n"); + //selectedUnit = 1; + + ADDDiagramPanel deploymentDiagramPanel = mgui.getFirstAvatarDeploymentPanelFound(); + AvatarDeploymentPanelTranslator avdeploymenttranslator = new AvatarDeploymentPanelTranslator(deploymentDiagramPanel); + AvatarddSpecification avddspec = avdeploymenttranslator.getAvatarddSpecification(); + AvatarSpecification avspec = mgui.gtm.getAvatarSpecification(); + + // Generating code + if (avddspec == null) { + jta.append("Error: No AVATAR Deployemnt specification\n"); + } else { + System.err.println("**AVATAR TOPCELL found"); + + TopCellGenerator topCellGenerator = new TopCellGenerator(avddspec, tracemode.isSelected(), avspec); + testGo(); + jta.append("Generation of TopCell executable code: done\n"); + + try { + jta.append("Saving MPSoC code in files\n"); + System.err.println("Saving MPSoC code in files\n"); + pathCode = code2.getText(); + + System.err.println("AVATAR TOPCELL saved in " + code2.getText()); + topCellGenerator.saveFile(pathCode); + + jta.append("Code saved\n"); + } catch (Exception e) { + jta.append("Could not generate files\n"); + System.err.println("Could not generate MPSoC files\n"); + e.printStackTrace(); + } + } + + + testGo(); + + + if (removeCFiles.isSelected()) { + + jta.append("Removing all .h files\n"); + + list = FileUtils.deleteFiles(code1.getText() + TasksAndMainGenerator.getGeneratedPath(), ".h"); + if (list.length() == 0) { + jta.append("No files were deleted\n"); + } else { + jta.append("Files deleted:\n" + list + "\n"); + } + jta.append("Removing all .c files\n"); + list = FileUtils.deleteFiles(code1.getText() + TasksAndMainGenerator.getGeneratedPath(), ".c"); + //list = FileUtils.deleteFiles(code1.getText() + AVATAR2SOCLIB.getGeneratedPath(), ".c"); + if (list.length() == 0) { + jta.append("No files were deleted\n"); + } else { + jta.append("Files deleted:\n" + list + "\n"); + } + } + + if (removeXFiles.isSelected()) { + jta.append("Removing all .x files\n"); + list = FileUtils.deleteFiles(code1.getText(), ".x"); + if (list.length() == 0) { + jta.append("No files were deleted\n"); + } else { + jta.append("Files deleted:\n" + list + "\n"); + } + } + + testGo(); + + selectedUnit = units.getSelectedIndex(); + //System.out.println("Selected item=" + selectedItem); + //AvatarSpecification avspec = mgui.gtm.getAvatarSpecification(); + + // Generating code + if (avspec == null) { + jta.append("Error: No AVATAR specification\n"); + } else { + + TasksAndMainGenerator gene = new TasksAndMainGenerator(avddspec, avspec); + gene.includeUserCode(putUserCode.isSelected()); + gene.setTimeUnit(selectedUnit); + gene.generateSoclib(debugmode.isSelected(), tracemode.isSelected()); + + if (avddspec == null) { + jta.append("Error: No AVATAR Deployment specification\n"); + } else { + System.err.println("AVATAR TOPCELL found"); + } + + TopCellGenerator topCellGenerator = new TopCellGenerator(avddspec, tracemode.isSelected(), avspec); + testGo(); + jta.append("Generation of TopCell executable code: done\n"); + + try { + jta.append("Saving code in files\n"); + pathCode = code2.getText(); + topCellGenerator.saveFile(pathCode); + + jta.append("Code saved\n"); + } catch (Exception e) { + jta.append("Could not generate files\n"); + } + + testGo(); + jta.append("Generation of C-SOCLIB executable code: done\n"); + //t2j.printJavaClasses(); + try { + jta.append("Saving code in files\n"); + pathCode = code1.getText(); + gene.saveInFiles(pathCode); + + jta.append("Code saved\n"); + } catch (Exception e) { + jta.append("Could not generate files\n"); + } + } + } + + testGo(); + + // Compilation + if (jp1.getSelectedIndex() == 1) { + cmd = compiler.getText(); + jta.append("Compiling executable code with command: \n" + cmd + "\n"); + + rshc = new RshClient(hostExecute); + // AssumE data are on the remote host + // Command + try { + processCmd(cmd, jta); + //data = processCmd(cmd); + //jta.append(data); + jta.append("Compilation done\n"); + } catch (LauncherException le) { + jta.append("Error: " + le.getMessage() + "\n"); + mode = STOPPED; + setButtons(); + return; + } catch (Exception e) { + mode = STOPPED; + setButtons(); + return; + } + } + + if (jp1.getSelectedIndex() == 2) { + try { + // if (selectedRun == 1) { + //cmd = exe3.getText(); + //} else { + cmd = exe4.getText(); + // } + + jta.append("Executing code with command: \n" + cmd + "\n"); + + rshc = new RshClient(hostExecute); + // Assume data are on the remote host + // Command + + processCmd(cmd, jta); + //jta.append(data); + jta.append("Execution done\n"); + } catch (LauncherException le) { + jta.append("Error: " + le.getMessage() + "\n"); + mode = STOPPED; + setButtons(); + return; + } catch (Exception e) { + mode = STOPPED; + setButtons(); + return; + } + } + + if ((hasError == false) && (jp1.getSelectedIndex() < 2)) { + jp1.setSelectedIndex(jp1.getSelectedIndex() + 1); + } + //} //fin ajout DG - } catch (InterruptedException ie) { + } catch (InterruptedException ie) { jta.append("Interrupted\n"); } @@ -726,8 +725,8 @@ public class JDialogAvatarddExecutableCodeGeneration extends javax.swing.JFrame rshc.setCmd(cmd); rshc.sendExecuteCommandRequest(); final Writer output = new StringWriter(); - rshc.writeCommandMessages( output ); - _jta.append( output.toString() ); + rshc.writeCommandMessages(output); + _jta.append(output.toString()); return; } @@ -737,28 +736,28 @@ public class JDialogAvatarddExecutableCodeGeneration extends javax.swing.JFrame } protected void setButtons() { - switch(mode) { - case NOT_STARTED: - start.setEnabled(true); - stop.setEnabled(false); - close.setEnabled(true); - //setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - getGlassPane().setVisible(false); - break; - case STARTED: - start.setEnabled(false); - stop.setEnabled(true); - close.setEnabled(false); - getGlassPane().setVisible(true); - //setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - break; - case STOPPED: - default: - start.setEnabled(false); - stop.setEnabled(false); - close.setEnabled(true); - getGlassPane().setVisible(false); - break; + switch (mode) { + case NOT_STARTED: + start.setEnabled(true); + stop.setEnabled(false); + close.setEnabled(true); + //setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + getGlassPane().setVisible(false); + break; + case STARTED: + start.setEnabled(false); + stop.setEnabled(true); + close.setEnabled(false); + getGlassPane().setVisible(true); + //setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); + break; + case STOPPED: + default: + start.setEnabled(false); + stop.setEnabled(false); + close.setEnabled(true); + getGlassPane().setVisible(false); + break; } } @@ -777,7 +776,7 @@ public class JDialogAvatarddExecutableCodeGeneration extends javax.swing.JFrame public void showSimulationTrace() { JFrameSimulationSDPanel jfssdp = new JFrameSimulationSDPanel(f, mgui, "Simulation trace of " + simulationTraceFile.getText()); jfssdp.setIconImage(IconManager.img8); - // jfssdp.setSize(600, 600); + // jfssdp.setSize(600, 600); GraphicLib.centerOnParent(jfssdp, 600, 600); if (selectedViewTrace == 0) { jfssdp.setFileReference(simulationTraceFile.getText()); @@ -790,35 +789,35 @@ public class JDialogAvatarddExecutableCodeGeneration extends javax.swing.JFrame //----------Ajout CD------------ public void showOverflowStatus() { - try{ - //String chemin = "~/TTool/MPSoC/soclib/soclib/platform/topcells/caba-vgmn-mutekh_kernel_tutorial/"; //ajouter le chemin relatif - String path = ConfigurationTTool.AVATARMPSoCPerformanceEvaluationDirectory; - //tentative d'instanciation de AvatarRelation afin d'utiliser getSizeOfFIFO() - // AvatarRelation ar = new AvatarRelation(); - - //int fifo = ar.getSizeOfFIFO(); //ajouter dynamiquement la taille du FIFO - //String taille = ""+fifo; - String taille = "0"; - - String log = "mwmr0.log"; //ajouter dynamiquement le nom du log généré - - String[] commande = {"sh", path+"callingOverflow.sh", taille, path, log}; + try { + //String chemin = "~/TTool/MPSoC/soclib/soclib/platform/topcells/caba-vgmn-mutekh_kernel_tutorial/"; //ajouter le chemin relatif + String path = ConfigurationTTool.AVATARMPSoCPerformanceEvaluationDirectory; + //tentative d'instanciation de AvatarRelation afin d'utiliser getSizeOfFIFO() + // AvatarRelation ar = new AvatarRelation(); + + //int fifo = ar.getSizeOfFIFO(); //ajouter dynamiquement la taille du FIFO + //String taille = ""+fifo; + String taille = "0"; + + String log = "mwmr0.log"; //ajouter dynamiquement le nom du log généré + + String[] commande = {"sh", path + "callingOverflow.sh", taille, path, log}; /*idealement il faudrait inclure un moyen de detecter l'OS sur lequel l'application est lancé car le script utilise la commande "acroread" qui ne fonctionne que sur linux. Ainsi ajouter un paramètre avec l'OS permetterais de générer la commande appropriée sur windows ou mac*/ - // Use System.getProperty( "os.name" ); - ProcessBuilder pb = new ProcessBuilder(commande);//Letitia Runtime.runtimexec() - pb.redirectError(ProcessBuilder.Redirect.INHERIT); - Process p = pb.start(); - - // FIXME: Should the return code be tested? - int exitStatus = p.waitFor(); - - } catch (InterruptedException e) { - e.printStackTrace(); - } catch (Exception e) { - e.printStackTrace(); - } + // Use System.getProperty( "os.name" ); + ProcessBuilder pb = new ProcessBuilder(commande);//Letitia Runtime.runtimexec() + pb.redirectError(ProcessBuilder.Redirect.INHERIT); + Process p = pb.start(); + + // FIXME: Should the return code be tested? + int exitStatus = p.waitFor(); + + } catch (InterruptedException e) { + e.printStackTrace(); + } catch (Exception e) { + e.printStackTrace(); + } } //-------------fin ajout CD----------- -- GitLab