diff --git a/.DS_Store b/.DS_Store
index 8be5da250d8737b2526b12f2b82e57332073ac2f..49142a76da8924b6b8bbe7843a801b753aa9ad34 100644
Binary files a/.DS_Store and b/.DS_Store differ
diff --git a/executablecode/.DS_Store b/executablecode/.DS_Store
index 20d7e9e3d1b63a41bb22c2e36e369812703b1f88..3e1592b66d1676dd14d5acddf549dcd1b18e56c4 100644
Binary files a/executablecode/.DS_Store and b/executablecode/.DS_Store differ
diff --git a/executablecode/src_MBED/asyncchannel.cpp b/executablecode/src_MBED/asyncchannel.cpp
index 34df37e2bb137f41b623a607e0a539eeffdad3fe..40c52ac0f1d127c8ac5e1ef4b39d7d58d2400130 100644
--- a/executablecode/src_MBED/asyncchannel.cpp
+++ b/executablecode/src_MBED/asyncchannel.cpp
@@ -1,7 +1,7 @@
 #include "message.h"
 #include "asyncchannel.h"
 #include "myerrors.h"
-#include <mbed.h>
+#include "mbed.h"
 
 asyncchannel *getNewAsyncchannel(char *outname, char *inname, int isBlocking, int maxNbOfMessages) {
   asyncchannel * asyncch = (asyncchannel *)(malloc(sizeof(struct asyncchannel)));
diff --git a/executablecode/src_MBED/mytimelib.cpp b/executablecode/src_MBED/mytimelib.cpp
index 51430f8bb92d716ffbf60ca6b69415b2d5a6e802..f24986a16ca60213cd251d498ec65656bee275ca 100644
--- a/executablecode/src_MBED/mytimelib.cpp
+++ b/executablecode/src_MBED/mytimelib.cpp
@@ -21,8 +21,24 @@ int my_clock_gettime(struct timespec *tp) {
 
 #else
 
+int clock_gettime(struct timespec *ts) {
+  //struct timeval tv;
+  //time(NULL);time since epoch in seconds
+  //people also use the variable localtime
+  //Dont understand the difference between this function and the other one
+  ts->tv_sec = time(NULL);
+  ts->tv_nsec = 0;
+  return 0;
+}
+
 int my_clock_gettime(struct timespec *tp) {
-  return clock_gettime(CLOCK_REALTIME, tp);
+  
+  return clock_gettime(tp);
+  //this functions justs gives back the real time since epoch,
+  //is it the same as time()???
+  //return clock_gettime(CLOCK_REALTIME, tp);
+  //printf("Led1 encendido, led2 apagado, %d\n",seconds);
+
 }
 
 #endif
@@ -102,7 +118,11 @@ void waitFor(long minDelay, long maxDelay) {
   delayToTimeSpec(&tssrc, delay);
 
   debugLong("............. waiting For", delay);
-  nanosleep(&tssrc, &tsret);
+  if(tssrc.tv_nsec > tsret.tv_nsec){
+    wait_us(tsret.tv_nsec/1000);
+  }else{
+    wait_us(tssrc.tv_nsec/1000);
+  }
   debugLong("............. waiting Done for: ", delay);
 }
 
diff --git a/executablecode/src_MBED/mytimelib.h b/executablecode/src_MBED/mytimelib.h
index 76ed5d22fcd7cf9a2750cf2a9726f5cdb89e48f2..f22f60028a8890fef19d51fc6269db03a069a436 100644
--- a/executablecode/src_MBED/mytimelib.h
+++ b/executablecode/src_MBED/mytimelib.h
@@ -3,6 +3,7 @@
 
 #include <time.h>
 #include <sys/time.h>
+#include "mbed.h"
 
 
 
diff --git a/executablecode/src_MBED/random.cpp b/executablecode/src_MBED/random.cpp
index 67ceed377f3689876e2200f1fc82b54091bb6777..4a5df9dd59e1b3dfa0cbf8c9fa924ca094b1e243 100644
--- a/executablecode/src_MBED/random.cpp
+++ b/executablecode/src_MBED/random.cpp
@@ -7,7 +7,6 @@
 #include "random.h"
 #include <mbed.h>
 #include "debug.h"
-#include <math.h>
 
 #include "mytimelib.h"
 
diff --git a/executablecode/src_MBED/request_manager.cpp b/executablecode/src_MBED/request_manager.cpp
index f6ae01521c37df65029085f788f9134802543bd4..76b27cf68d513c10ba70e8b22dd420dfa9fa4537 100644
--- a/executablecode/src_MBED/request_manager.cpp
+++ b/executablecode/src_MBED/request_manager.cpp
@@ -54,7 +54,7 @@ void executeSendSyncTransaction(request *req) {
 
 	debugMsg("Signaling");
   
-	pthread_cond_signal(selectedReq->listOfRequests->wakeupCondition);
+	rtos::Thread::signal_wait(selectedReq->listOfRequests->wakeupCondition);
 
 	traceSynchroRequest(req, selectedReq);
 }
@@ -96,8 +96,8 @@ void executeReceiveSyncTransaction(request *req) {
   copyParameters(selectedReq, req);
 
   debugMsg("Signaling");
-  pthread_cond_signal(selectedReq->listOfRequests->wakeupCondition);
-
+  //pthread_cond_signal(selectedReq->listOfRequests->wakeupCondition);
+  rtos::Thread::signal_wait(selectedReq->listOfRequests->wakeupCondition);
   traceSynchroRequest(selectedReq, req);
 }
 
@@ -116,7 +116,8 @@ void executeSendAsyncTransaction(request *req) {
   debugMsg("Signaling async write to all requests waiting ");
   selectedReq = req->asyncChannel->inWaitQueue;
   while (selectedReq != NULL) {
-    pthread_cond_signal(selectedReq->listOfRequests->wakeupCondition);
+    //pthread_cond_signal(selectedReq->listOfRequests->wakeupCondition);
+    rtos::Thread::signal_wait(selectedReq->listOfRequests->wakeupCondition);
     selectedReq = selectedReq->next;
   }
   debugMsg("Signaling done");
@@ -144,7 +145,8 @@ void executeReceiveAsyncTransaction(request *req) {
 
   debugMsg("Signaling async read to all requests waiting ");
   while (selectedReq != NULL) {
-    pthread_cond_signal(selectedReq->listOfRequests->wakeupCondition);
+    //pthread_cond_signal(selectedReq->listOfRequests->wakeupCondition);
+    rtos::Thread::signal_wait(selectedReq->listOfRequests->wakeupCondition);
     selectedReq = selectedReq->next;
   }
   debugMsg("Signaling done");
@@ -201,7 +203,8 @@ void executeSendBroadcastTransaction(request *req) {
   cpt = 0;
   while(currentReq != NULL) {
     cpt ++;
-    pthread_cond_signal(currentReq->listOfRequests->wakeupCondition);
+    //pthread_cond_signal(currentReq->listOfRequests->wakeupCondition);
+    rtos::Thread::signal_wait(currentReq->listOfRequests->wakeupCondition);
     traceSynchroRequest(req, currentReq);
     currentReq = currentReq->relatedRequest;
   }
diff --git a/modeling/.DS_Store b/modeling/.DS_Store
index 61539b4720ebb7ffb11f925e196b4077cf7877b4..241074f8b7bbebdcc36c6248bc38e899647a2aad 100644
Binary files a/modeling/.DS_Store and b/modeling/.DS_Store differ
diff --git a/modeling/AVATAR/.DS_Store b/modeling/AVATAR/.DS_Store
new file mode 100644
index 0000000000000000000000000000000000000000..29d02f89f82140378d3212250e592b20c37a57f6
Binary files /dev/null and b/modeling/AVATAR/.DS_Store differ
diff --git a/modeling/Blinking.ttool/.DS_Store b/modeling/Blinking.ttool/.DS_Store
new file mode 100644
index 0000000000000000000000000000000000000000..3d80fdc18f9bbdda3d4204f0c2fb3cf1184ac822
Binary files /dev/null and b/modeling/Blinking.ttool/.DS_Store differ
diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/.DS_Store b/modeling/Blinking.ttool/AVATAR_executablecode/.DS_Store
new file mode 100644
index 0000000000000000000000000000000000000000..d815fae9a2c44ac21c8a818d607cd57d404b3dda
Binary files /dev/null and b/modeling/Blinking.ttool/AVATAR_executablecode/.DS_Store differ
diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/LICENSE b/modeling/Blinking.ttool/AVATAR_executablecode/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..80a6487e0e38fde802e5fa47fd63578fdacb6262
--- /dev/null
+++ b/modeling/Blinking.ttool/AVATAR_executablecode/LICENSE
@@ -0,0 +1,39 @@
+/**Copyright or (C) or Copr. Intitut Telecom, Telecom ParisTech, 
+Ludovic Apvrille, Renaud Pacalet
+ *
+ * ludovic.apvrille AT telecom-paristech.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,
+ * that may mean  that it is complicated to manipulate,  and  that  also
+ * therefore means  that it is reserved for developers  and  experienced
+ * professionals having in-depth computer knowledge. Users are therefore
+ * encouraged to load and test the software's suitability as regards their
+ * 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.
+ *
+ * /**
diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/LICENSE_CECILL_ENG b/modeling/Blinking.ttool/AVATAR_executablecode/LICENSE_CECILL_ENG
new file mode 100644
index 0000000000000000000000000000000000000000..2813867170ada86df401c9e49d9f69a02bbeaa9e
--- /dev/null
+++ b/modeling/Blinking.ttool/AVATAR_executablecode/LICENSE_CECILL_ENG
@@ -0,0 +1,504 @@
+CeCILL FREE SOFTWARE LICENSE AGREEMENT
+
+
+    Notice
+
+This Agreement is a Free Software license agreement that is the result
+of discussions between its authors in order to ensure compliance with
+the two main principles guiding its drafting:
+
+    * firstly, compliance with the principles governing the distribution
+      of Free Software: access to source code, broad rights granted to
+      users,
+    * secondly, the election of a governing law, French law, with which
+      it is conformant, both as regards the law of torts and
+      intellectual property law, and the protection that it offers to
+      both authors and holders of the economic rights over software.
+
+The authors of the CeCILL (for Ce[a] C[nrs] I[nria] L[logiciel] L[ibre])
+license are:
+
+Commissariat � l'Energie Atomique - CEA, a public scientific, technical
+and industrial establishment, having its principal place of business at
+31-33 rue de la F�d�ration, 75752 Paris cedex 15, France.
+
+Centre National de la Recherche Scientifique - CNRS, a public scientific
+and technological establishment, having its principal place of business
+at 3 rue Michel-Ange 75794 Paris cedex 16, France.
+
+Institut National de Recherche en Informatique et en Automatique -
+INRIA, a public scientific and technological establishment, having its
+principal place of business at Domaine de Voluceau, Rocquencourt, BP
+105, 78153 Le Chesnay cedex, France.
+
+
+    Preamble
+
+The purpose of this Free Software license agreement is to grant users
+the right to modify and redistribute the software governed by this
+license within the framework of an open source distribution model.
+
+The exercising of these rights is conditional upon certain obligations
+for users so as to preserve this status for all subsequent redistributions.
+
+In consideration of access to the source code and the 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 only have limited liability.
+
+In this respect, the risks associated with loading, using, modifying
+and/or developing or reproducing the software by the user are brought to
+the user's attention, given its Free Software status, which may make it
+complicated to use, with the result that its use is reserved for
+developers and experienced professionals having in-depth computer
+knowledge. Users are therefore encouraged to load and test the
+Software's suitability as regards their 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 of
+security. This Agreement may be freely reproduced and published,
+provided it is not altered, and that no provisions are either added or
+removed herefrom.
+
+This Agreement may apply to any or all software for which the holder of
+the economic rights decides to submit the use thereof to its provisions.
+
+
+    Article 1 - DEFINITIONS
+
+For the purpose of this Agreement, when the following expressions
+commence with a capital letter, they shall have the following meaning:
+
+Agreement: means this license agreement, and its possible subsequent
+versions and annexes.
+
+Software: means the software in its Object Code and/or Source Code form
+and, where applicable, its documentation, "as is" when the Licensee
+accepts the Agreement.
+
+Initial Software: means the Software in its Source Code and possibly its
+Object Code form and, where applicable, its documentation, "as is" when
+it is first distributed under the terms and conditions of the Agreement.
+
+Modified Software: means the Software modified by at least one
+Contribution.
+
+Source Code: means all the Software's instructions and program lines to
+which access is required so as to modify the Software.
+
+Object Code: means the binary files originating from the compilation of
+the Source Code.
+
+Holder: means the holder(s) of the economic rights over the Initial
+Software.
+
+Licensee: means the Software user(s) having accepted the Agreement.
+
+Contributor: means a Licensee having made at least one Contribution.
+
+Licensor: means the Holder, or any other individual or legal entity, who
+distributes the Software under the Agreement.
+
+Contribution: means any or all modifications, corrections, translations,
+adaptations and/or new functions integrated into the Software by any or
+all Contributors, as well as any or all Internal Modules.
+
+Module: means a set of sources files including their documentation that
+enables supplementary functions or services in addition to those offered
+by the Software.
+
+External Module: means any or all Modules, not derived from the
+Software, so that this Module and the Software run in separate address
+spaces, with one calling the other when they are run.
+
+Internal Module: means any or all Module, connected to the Software so
+that they both execute in the same address space.
+
+GNU GPL: means the GNU General Public License version 2 or any
+subsequent version, as published by the Free Software Foundation Inc.
+
+Parties: mean both the Licensee and the Licensor.
+
+These expressions may be used both in singular and plural form.
+
+
+    Article 2 - PURPOSE
+
+The purpose of the Agreement is the grant by the Licensor to the
+Licensee of a non-exclusive, transferable and worldwide license for the
+Software as set forth in Article 5 hereinafter for the whole term of the 
+protection granted by the rights over said Software.
+
+
+    Article 3 - ACCEPTANCE
+
+3.1 The Licensee shall be deemed as having accepted the terms and
+conditions of this Agreement upon the occurrence of the first of the
+following events:
+
+    * (i) loading the Software by any or all means, notably, by
+      downloading from a remote server, or by loading from a physical
+      medium;
+    * (ii) the first time the Licensee exercises any of the rights
+      granted hereunder.
+
+3.2 One copy of the Agreement, containing a notice relating to the
+characteristics of the Software, to the limited warranty, and to the
+fact that its use is restricted to experienced users has been provided
+to the Licensee prior to its acceptance as set forth in Article 3.1
+hereinabove, and the Licensee hereby acknowledges that it has read and 
+understood it.
+
+
+    Article 4 - EFFECTIVE DATE AND TERM
+
+
+      4.1 EFFECTIVE DATE
+
+The Agreement shall become effective on the date when it is accepted by
+the Licensee as set forth in Article 3.1.
+
+
+      4.2 TERM
+
+The Agreement shall remain in force for the entire legal term of
+protection of the economic rights over the Software.
+
+
+    Article 5 - SCOPE OF RIGHTS GRANTED
+
+The Licensor hereby grants to the Licensee, who accepts, the following
+rights over the Software for any or all use, and for the term of the
+Agreement, on the basis of the terms and conditions set forth hereinafter.
+
+Besides, if the Licensor owns or comes to own one or more patents
+protecting all or part of the functions of the Software or of its
+components, the Licensor undertakes not to enforce the rights granted by
+these patents against successive Licensees using, exploiting or
+modifying the Software. If these patents are transferred, the Licensor
+undertakes to have the transferees subscribe to the obligations set
+forth in this paragraph.
+
+
+      5.1 RIGHT OF USE
+
+The Licensee is authorized to use the Software, without any limitation
+as to its fields of application, with it being hereinafter specified
+that this comprises:
+
+   1. permanent or temporary reproduction of all or part of the Software
+      by any or all means and in any or all form.
+
+   2. loading, displaying, running, or storing the Software on any or
+      all medium.
+
+   3. entitlement to observe, study or test its operation so as to
+      determine the ideas and principles behind any or all constituent
+      elements of said Software. This shall apply when the Licensee
+      carries out any or all loading, displaying, running, transmission
+      or storage operation as regards the Software, that it is entitled
+      to carry out hereunder.
+
+
+      5.2 ENTITLEMENT TO MAKE CONTRIBUTIONS
+
+The right to make Contributions includes the right to translate, adapt,
+arrange, or make any or all modifications to the Software, and the right
+to reproduce the resulting Software.
+
+The Licensee is authorized to make any or all Contributions to the
+Software provided that it includes an explicit notice that it is the
+author of said Contribution and indicates the date of the creation thereof.
+
+
+      5.3 RIGHT OF DISTRIBUTION
+
+In particular, the right of distribution includes the right to publish,
+transmit and communicate the Software to the general public on any or
+all medium, and by any or all means, and the right to market, either in
+consideration of a fee, or free of charge, one or more copies of the
+Software by any means.
+
+The Licensee is further authorized to distribute copies of the modified
+or unmodified Software to third parties according to the terms and
+conditions set forth hereinafter.
+
+
+        5.3.1 DISTRIBUTION OF SOFTWARE WITHOUT MODIFICATION
+
+The Licensee is authorized to distribute true copies of the Software in
+Source Code or Object Code form, provided that said distribution
+complies with all the provisions of the Agreement and is accompanied by:
+
+   1. a copy of the Agreement,
+
+   2. a notice relating to the limitation of both the Licensor's
+      warranty and liability as set forth in Articles 8 and 9,
+
+and that, in the event that only the Object Code of the Software is
+redistributed, the Licensee allows future Licensees unhindered access to
+the full Source Code of the Software by indicating how to access it, it
+being understood that the additional cost of acquiring the Source Code
+shall not exceed the cost of transferring the data.
+
+
+        5.3.2 DISTRIBUTION OF MODIFIED SOFTWARE
+
+When the Licensee makes a Contribution to the Software, the terms and
+conditions for the distribution of the Modified Software become subject
+to all the provisions of this Agreement.
+
+The Licensee is authorized to distribute the Modified Software, in
+Source Code or Object Code form, provided that said distribution
+complies with all the provisions of the Agreement and is accompanied by:
+
+   1. a copy of the Agreement,
+
+   2. a notice relating to the limitation of both the Licensor's
+      warranty and liability as set forth in Articles 8 and 9,
+
+and that, in the event that only the Object Code of the Modified
+Software is redistributed, the Licensee allows future Licensees
+unhindered access to the full Source Code of the Modified Software by
+indicating how to access it, it being understood that the additional
+cost of acquiring the Source Code shall not exceed the cost of
+transferring the data.
+
+
+        5.3.3 DISTRIBUTION OF EXTERNAL MODULES
+
+When the Licensee has developed an External Module, the terms and
+conditions of this Agreement do not apply to said External Module, that
+may be distributed under a separate license agreement.
+
+
+        5.3.4 COMPATIBILITY WITH THE GNU GPL
+
+The Licensee can include a code that is subject to the provisions of one
+of the versions of the GNU GPL in the Modified or unmodified Software,
+and distribute that entire code under the terms of the same version of
+the GNU GPL.
+
+The Licensee can include the Modified or unmodified Software in a code
+that is subject to the provisions of one of the versions of the GNU GPL,
+and distribute that entire code under the terms of the same version of
+the GNU GPL.
+
+
+    Article 6 - INTELLECTUAL PROPERTY
+
+
+      6.1 OVER THE INITIAL SOFTWARE
+
+The Holder owns the economic rights over the Initial Software. Any or
+all use of the Initial Software is subject to compliance with the terms
+and conditions under which the Holder has elected to distribute its work
+and no one shall be entitled to modify the terms and conditions for the
+distribution of said Initial Software.
+
+The Holder undertakes that the Initial Software will remain ruled at
+least by the current license, for the duration set forth in article 4.2.
+
+
+      6.2 OVER THE CONTRIBUTIONS
+
+A Licensee who develops a Contribution is the owner of the intellectual
+property rights over this Contribution as defined by applicable law.
+
+
+      6.3 OVER THE EXTERNAL MODULES
+
+A Licensee who develops an External Module is the owner of the
+intellectual property rights over this External Module as defined by
+applicable law and is free to choose the type of agreement that shall
+govern its distribution.
+
+
+      6.4 JOINT PROVISIONS
+
+The Licensee expressly undertakes:
+
+   1. not to remove, or modify, in any manner, the intellectual property
+      notices attached to the Software;
+
+   2. to reproduce said notices, in an identical manner, in the copies
+      of the Software modified or not.
+
+The Licensee undertakes not to directly or indirectly infringe the
+intellectual property rights of the Holder and/or Contributors on the
+Software and to take, where applicable, vis-�-vis its staff, any and all
+measures required to ensure respect of said intellectual property rights
+of the Holder and/or Contributors.
+
+
+    Article 7 - RELATED SERVICES
+
+7.1 Under no circumstances shall the Agreement oblige the Licensor to
+provide technical assistance or maintenance services for the Software.
+
+However, the Licensor is entitled to offer this type of services. The
+terms and conditions of such technical assistance, and/or such
+maintenance, shall be set forth in a separate instrument. Only the
+Licensor offering said maintenance and/or technical assistance services
+shall incur liability therefor.
+
+7.2 Similarly, any Licensor is entitled to offer to its licensees, under
+its sole responsibility, a warranty, that shall only be binding upon
+itself, for the redistribution of the Software and/or the Modified
+Software, under terms and conditions that it is free to decide. Said
+warranty, and the financial terms and conditions of its application,
+shall be subject of a separate instrument executed between the Licensor
+and the Licensee.
+
+
+    Article 8 - LIABILITY
+
+8.1 Subject to the provisions of Article 8.2, the Licensee shall be
+entitled to claim compensation for any direct loss it may have suffered
+from the Software as a result of a fault on the part of the relevant
+Licensor, subject to providing evidence thereof.
+
+8.2 The Licensor's liability is limited to the commitments made under
+this Agreement and shall not be incurred as a result of in particular:
+(i) loss due the Licensee's total or partial failure to fulfill its
+obligations, (ii) direct or consequential loss that is suffered by the
+Licensee due to the use or performance of the Software, and (iii) more
+generally, any consequential loss. In particular the Parties expressly
+agree that any or all pecuniary or business loss (i.e. loss of data,
+loss of profits, operating loss, loss of customers or orders,
+opportunity cost, any disturbance to business activities) or any or all
+legal proceedings instituted against the Licensee by a third party,
+shall constitute consequential loss and shall not provide entitlement to
+any or all compensation from the Licensor.
+
+
+    Article 9 - WARRANTY
+
+9.1 The Licensee acknowledges that the scientific and technical
+state-of-the-art when the Software was distributed did not enable all
+possible uses to be tested and verified, nor for the presence of
+possible defects to be detected. In this respect, the Licensee's
+attention has been drawn to the risks associated with loading, using,
+modifying and/or developing and reproducing the Software which are
+reserved for experienced users.
+
+The Licensee shall be responsible for verifying, by any or all means,
+the product's suitability for its requirements, its good working order,
+and for ensuring that it shall not cause damage to either persons or
+properties.
+
+9.2 The Licensor hereby represents, in good faith, that it is entitled
+to grant all the rights over the Software (including in particular the
+rights set forth in Article 5).
+
+9.3 The Licensee acknowledges that the Software is supplied "as is" by
+the Licensor without any other express or tacit warranty, other than
+that provided for in Article 9.2 and, in particular, without any warranty
+as to its commercial value, its secured, safe, innovative or relevant 
+nature.
+
+Specifically, the Licensor does not warrant that the Software is free
+from any error, that it will operate without interruption, that it will
+be compatible with the Licensee's own equipment and software
+configuration, nor that it will meet the Licensee's requirements.
+
+9.4 The Licensor does not either expressly or tacitly warrant that the
+Software does not infringe any third party intellectual property right
+relating to a patent, software or any other property right. Therefore,
+the Licensor disclaims any and all liability towards the Licensee
+arising out of any or all proceedings for infringement that may be
+instituted in respect of the use, modification and redistribution of the
+Software. Nevertheless, should such proceedings be instituted against
+the Licensee, the Licensor shall provide it with technical and legal
+assistance for its defense. Such technical and legal assistance shall be
+decided on a case-by-case basis between the relevant Licensor and the
+Licensee pursuant to a memorandum of understanding. The Licensor
+disclaims any and all liability as regards the Licensee's use of the
+name of the Software. No warranty is given as regards the existence of
+prior rights over the name of the Software or as regards the existence
+of a trademark.
+
+
+    Article 10 - TERMINATION
+
+10.1 In the event of a breach by the Licensee of its obligations
+hereunder, the Licensor may automatically terminate this Agreement
+thirty (30) days after notice has been sent to the Licensee and has
+remained ineffective.
+
+10.2 A Licensee whose Agreement is terminated shall no longer be
+authorized to use, modify or distribute the Software. However, any
+licenses that it may have granted prior to termination of the Agreement
+shall remain valid subject to their having been granted in compliance
+with the terms and conditions hereof.
+
+
+    Article 11 - MISCELLANEOUS
+
+
+      11.1 EXCUSABLE EVENTS
+
+Neither Party shall be liable for any or all delay, or failure to
+perform the Agreement, that may be attributable to an event of force
+majeure, an act of God or an outside cause, such as defective
+functioning or interruptions of the electricity or telecommunications
+networks, network paralysis following a virus attack, intervention by
+government authorities, natural disasters, water damage, earthquakes,
+fire, explosions, strikes and labor unrest, war, etc.
+
+11.2 Any Failure by either Party, on one or more occasions, to invoke
+one or more of the provisions hereof, shall under no circumstances be
+interpreted as being a waiver by the interested Party of its right to
+invoke said provision(s) subsequently.
+
+11.3 The Agreement cancels and replaces any or all previous agreements,
+whether written or oral, between the Parties and having the same
+purpose, and constitutes the entirety of the agreement between said
+Parties concerning said purpose. No supplement or modification to the
+terms and conditions hereof shall be effective as between the Parties
+unless it is made in writing and signed by their duly authorized
+representatives.
+
+11.4 In the event that one or more of the provisions hereof were to
+conflict with a current or future applicable act or legislative text,
+said act or legislative text shall prevail, and the Parties shall make
+the necessary amendments so as to comply with said act or legislative
+text. All other provisions shall remain effective. Similarly, invalidity
+of a provision of the Agreement, for any reason whatsoever, shall not
+cause the Agreement as a whole to be invalid.
+
+
+      11.5 LANGUAGE
+
+The Agreement is drafted in both French and English and both versions
+are deemed authentic.
+
+
+    Article 12 - NEW VERSIONS OF THE AGREEMENT
+
+12.1 Any person is authorized to duplicate and distribute copies of this
+Agreement.
+
+12.2 So as to ensure coherence, the wording of this Agreement is
+protected and may only be modified by the authors of the License, who
+reserve the right to periodically publish updates or new versions of the
+Agreement, each with a separate number. These subsequent versions may
+address new issues encountered by Free Software.
+
+12.3 Any Software distributed under a given version of the Agreement may
+only be subsequently distributed under the same version of the Agreement
+or a subsequent version, subject to the provisions of Article 5.3.4.
+
+
+    Article 13 - GOVERNING LAW AND JURISDICTION
+
+13.1 The Agreement is governed by French law. The Parties agree to
+endeavor to seek an amicable solution to any disagreements or disputes
+that may arise during the performance of the Agreement.
+
+13.2 Failing an amicable solution within two (2) months as from their
+occurrence, and unless emergency proceedings are necessary, the
+disagreements or disputes shall be referred to the Paris Courts having
+jurisdiction, by the more diligent Party.
+
+
+Version 2.0 dated 2005-05-21.
\ No newline at end of file
diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/LICENSE_CECILL_FR b/modeling/Blinking.ttool/AVATAR_executablecode/LICENSE_CECILL_FR
new file mode 100644
index 0000000000000000000000000000000000000000..32ac7d2182f825f627e5f5409415f869dc1b02d0
--- /dev/null
+++ b/modeling/Blinking.ttool/AVATAR_executablecode/LICENSE_CECILL_FR
@@ -0,0 +1,511 @@
+CONTRAT DE LICENCE DE LOGICIEL LIBRE CeCILL
+
+
+    Avertissement
+
+Ce contrat est une licence de logiciel libre issue d'une concertation
+entre ses auteurs afin que le respect de deux grands principes pr�side �
+sa r�daction:
+
+    * d'une part, le respect des principes de diffusion des logiciels
+      libres: acc�s au code source, droits �tendus conf�r�s aux
+      utilisateurs,
+    * d'autre part, la d�signation d'un droit applicable, le droit
+      fran�ais, auquel elle est conforme, tant au regard du droit de la
+      responsabilit� civile que du droit de la propri�t� intellectuelle
+      et de la protection qu'il offre aux auteurs et titulaires des
+      droits patrimoniaux sur un logiciel.
+
+Les auteurs de la licence CeCILL (pour Ce[a] C[nrs] I[nria] L[ogiciel]
+L[ibre]) sont: 
+
+Commissariat � l'Energie Atomique - CEA, �tablissement public de
+caract�re scientifique technique et industriel, dont le si�ge est situ�
+31-33 rue de la F�d�ration, 75752 Paris cedex 15.
+
+Centre National de la Recherche Scientifique - CNRS, �tablissement
+public � caract�re scientifique et technologique, dont le si�ge est
+situ� 3 rue Michel-Ange 75794 Paris cedex 16.
+
+Institut National de Recherche en Informatique et en Automatique -
+INRIA, �tablissement public � caract�re scientifique et technologique,
+dont le si�ge est situ� Domaine de Voluceau, Rocquencourt, BP 105, 78153
+Le Chesnay cedex.
+
+
+    Pr�ambule
+
+Ce contrat est une licence de logiciel libre dont l'objectif est de
+conf�rer aux utilisateurs la libert� de modification et de
+redistribution du logiciel r�gi par cette licence dans le cadre d'un
+mod�le de diffusion en logiciel libre.
+
+L'exercice de ces libert�s est assorti de certains devoirs � la charge
+des utilisateurs afin de pr�server ce statut au cours des
+redistributions ult�rieures.
+
+L'accessibilit� au code source et les droits de copie, de modification
+et de redistribution qui en d�coulent ont pour contrepartie de n'offrir
+aux utilisateurs qu'une garantie limit�e et de ne faire peser sur
+l'auteur du logiciel, le titulaire des droits patrimoniaux et les
+conc�dants successifs qu'une responsabilit� restreinte.
+
+A cet �gard l'attention de l'utilisateur est attir�e sur les risques
+associ�s au chargement, � l'utilisation, � la modification et/ou au
+d�veloppement et � la reproduction du logiciel par l'utilisateur �tant
+donn� sa sp�cificit� de logiciel libre, qui peut le rendre complexe �
+manipuler et qui le r�serve donc � des d�veloppeurs ou des
+professionnels avertis poss�dant des connaissances informatiques
+approfondies. Les utilisateurs sont donc invit�s � charger et tester
+l'ad�quation du Logiciel � leurs besoins dans des conditions permettant
+d'assurer la s�curit� de leurs syst�mes et/ou de leurs donn�es et, plus
+g�n�ralement, � l'utiliser et l'exploiter dans les m�me conditions de
+s�curit�. Ce contrat peut �tre reproduit et diffus� librement, sous
+r�serve de le conserver en l'�tat, sans ajout ni suppression de clauses.
+
+Ce contrat est susceptible de s'appliquer � tout logiciel dont le
+titulaire des droits patrimoniaux d�cide de soumettre l'exploitation aux
+dispositions qu'il contient.
+
+
+    Article 1 - DEFINITIONS
+
+Dans ce contrat, les termes suivants, lorsqu'ils seront �crits avec une
+lettre capitale, auront la signification suivante:
+
+Contrat: d�signe le pr�sent contrat de licence, ses �ventuelles versions
+post�rieures et annexes.
+
+Logiciel: d�signe le logiciel sous sa forme de Code Objet et/ou de Code
+Source et le cas �ch�ant sa documentation, dans leur �tat au moment de
+l'acceptation du Contrat par le Licenci�.
+
+Logiciel Initial: d�signe le Logiciel sous sa forme de Code Source et
+�ventuellement de Code Objet et le cas �ch�ant sa documentation, dans
+leur �tat au moment de leur premi�re diffusion sous les termes du Contrat.
+
+Logiciel Modifi�: d�signe le Logiciel modifi� par au moins une
+Contribution.
+
+Code Source: d�signe l'ensemble des instructions et des lignes de
+programme du Logiciel et auquel l'acc�s est n�cessaire en vue de
+modifier le Logiciel.
+
+Code Objet: d�signe les fichiers binaires issus de la compilation du
+Code Source.
+
+Titulaire: d�signe le ou les d�tenteurs des droits patrimoniaux d'auteur
+sur le Logiciel Initial
+
+Licenci�: d�signe le ou les utilisateurs du Logiciel ayant accept� le
+Contrat.
+
+Contributeur: d�signe le Licenci� auteur d'au moins une Contribution.
+
+Conc�dant: d�signe le Titulaire ou toute personne physique ou morale
+distribuant le Logiciel sous le Contrat.
+
+Contribution: d�signe l'ensemble des modifications, corrections,
+traductions, adaptations et/ou nouvelles fonctionnalit�s int�gr�es dans
+le Logiciel par tout Contributeur, ainsi que tout Module Interne.
+
+Module: d�signe un ensemble de fichiers sources y compris leur
+documentation qui permet de r�aliser des fonctionnalit�s ou services
+suppl�mentaires � ceux fournis par le Logiciel.
+
+Module Externe: d�signe tout Module, non d�riv� du Logiciel, tel que ce
+Module et le Logiciel s'ex�cutent dans des espaces d'adressages
+diff�rents, l'un appelant l'autre au moment de leur ex�cution.
+
+Module Interne: d�signe tout Module li� au Logiciel de telle sorte
+qu'ils s'ex�cutent dans le m�me espace d'adressage.
+
+GNU GPL: d�signe la GNU General Public License dans sa version 2 ou
+toute version ult�rieure, telle que publi�e par Free Software Foundation
+Inc.
+
+Parties: d�signe collectivement le Licenci� et le Conc�dant.
+
+Ces termes s'entendent au singulier comme au pluriel.
+
+
+    Article 2 - OBJET
+
+Le Contrat a pour objet la concession par le Conc�dant au Licenci� d'une
+licence non exclusive, cessible et mondiale du Logiciel telle que
+d�finie ci-apr�s � l'article 5 pour toute la dur�e de protection des 
+droits portant sur ce Logiciel.
+
+
+    Article 3 - ACCEPTATION
+
+3.1 L'acceptation par le Licenci� des termes du Contrat est r�put�e
+acquise du fait du premier des faits suivants:
+
+    * (i) le chargement du Logiciel par tout moyen notamment par
+      t�l�chargement � partir d'un serveur distant ou par chargement �
+      partir d'un support physique;
+    * (ii) le premier exercice par le Licenci� de l'un quelconque des
+      droits conc�d�s par le Contrat.
+
+3.2 Un exemplaire du Contrat, contenant notamment un avertissement
+relatif aux sp�cificit�s du Logiciel, � la restriction de garantie et �
+la limitation � un usage par des utilisateurs exp�riment�s a �t� mis �
+disposition du Licenci� pr�alablement � son acceptation telle que
+d�finie � l'article 3.1 ci dessus et le Licenci�
+reconna�t en avoir pris connaissance.
+
+
+    Article 4 - ENTREE EN VIGUEUR ET DUREE
+
+
+      4.1 ENTREE EN VIGUEUR
+
+Le Contrat entre en vigueur � la date de son acceptation par le Licenci�
+telle que d�finie en 3.1.
+
+
+      4.2 DUREE
+
+Le Contrat produira ses effets pendant toute la dur�e l�gale de
+protection des droits patrimoniaux portant sur le Logiciel.
+
+
+    Article 5 - ETENDUE DES DROITS CONCEDES
+
+Le Conc�dant conc�de au Licenci�, qui accepte, les droits suivants sur
+le Logiciel pour toutes destinations et pour la dur�e du Contrat dans
+les conditions ci-apr�s d�taill�es.
+
+Par ailleurs, si le Conc�dant d�tient ou venait � d�tenir un ou
+plusieurs brevets d'invention prot�geant tout ou partie des
+fonctionnalit�s du Logiciel ou de ses composants, il s'engage � ne pas
+opposer les �ventuels droits conf�r�s par ces brevets aux Licenci�s
+successifs qui utiliseraient, exploiteraient ou modifieraient le
+Logiciel. En cas de cession de ces brevets, le Conc�dant s'engage �
+faire reprendre les obligations du pr�sent alin�a aux cessionnaires.
+
+
+      5.1 DROIT D'UTILISATION
+
+Le Licenci� est autoris� � utiliser le Logiciel, sans restriction quant
+aux domaines d'application, �tant ci-apr�s pr�cis� que cela comporte:
+
+   1. la reproduction permanente ou provisoire du Logiciel en tout ou
+      partie par tout moyen et sous toute forme.
+
+   2. le chargement, l'affichage, l'ex�cution, ou le stockage du
+      Logiciel sur tout support.
+
+   3. la possibilit� d'en observer, d'en �tudier, ou d'en tester le
+      fonctionnement afin de d�terminer les id�es et principes qui sont
+      � la base de n'importe quel �l�ment de ce Logiciel; et ceci,
+      lorsque le Licenci� effectue toute op�ration de chargement,
+      d'affichage, d'ex�cution, de transmission ou de stockage du
+      Logiciel qu'il est en droit d'effectuer en vertu du Contrat.
+
+
+      5.2 DROIT D'APPORTER DES CONTRIBUTIONS
+
+Le droit d'apporter des Contributions comporte le droit de traduire,
+d'adapter, d'arranger ou d'apporter toute autre modification au Logiciel
+et le droit de reproduire le Logiciel en r�sultant.
+
+Le Licenci� est autoris� � apporter toute Contribution au Logiciel sous
+r�serve de mentionner, de fa�on explicite, son nom en tant qu'auteur de
+cette Contribution et la date de cr�ation de celle-ci.
+
+
+      5.3 DROIT DE DISTRIBUTION
+
+Le droit de distribution comporte notamment le droit de diffuser, de
+transmettre et de communiquer le Logiciel au public sur tout support et
+par tout moyen ainsi que le droit de mettre sur le march� � titre
+on�reux ou gratuit, un ou des exemplaires du Logiciel par tout proc�d�.
+
+Le Licenci� est autoris� � distribuer des copies du Logiciel, modifi� ou
+non, � des tiers dans les conditions ci-apr�s d�taill�es.
+
+
+        5.3.1 DISTRIBUTION DU LOGICIEL SANS MODIFICATION
+
+Le Licenci� est autoris� � distribuer des copies conformes du Logiciel,
+sous forme de Code Source ou de Code Objet, � condition que cette
+distribution respecte les dispositions du Contrat dans leur totalit� et
+soit accompagn�e:
+
+   1. d'un exemplaire du Contrat,
+
+   2. d'un avertissement relatif � la restriction de garantie et de
+      responsabilit� du Conc�dant telle que pr�vue aux articles 8
+      et 9,
+
+et que, dans le cas o� seul le Code Objet du Logiciel est redistribu�,
+le Licenci� permette aux futurs Licenci�s d'acc�der facilement au Code
+Source complet du Logiciel en indiquant les modalit�s d'acc�s, �tant
+entendu que le co�t additionnel d'acquisition du Code Source ne devra
+pas exc�der le simple co�t de transfert des donn�es.
+
+
+        5.3.2 DISTRIBUTION DU LOGICIEL MODIFIE
+
+Lorsque le Licenci� apporte une Contribution au Logiciel, les conditions
+de distribution du Logiciel Modifi� sont alors soumises � l'int�gralit�
+des dispositions du Contrat.
+
+Le Licenci� est autoris� � distribuer le Logiciel Modifi�, sous forme de
+Code Source ou de Code Objet, � condition que cette distribution
+respecte les dispositions du Contrat dans leur totalit� et soit
+accompagn�e:
+
+   1. d'un exemplaire du Contrat,
+
+   2. d'un avertissement relatif � la restriction de garantie et de
+      responsabilit� du Conc�dant telle que pr�vue aux articles 8
+      et 9,
+
+et que, dans le cas o� seul le Code Objet du Logiciel Modifi� est
+redistribu�, le Licenci� permette aux futurs Licenci�s d'acc�der
+facilement au Code Source complet du Logiciel Modifi� en indiquant les
+modalit�s d'acc�s, �tant entendu que le co�t additionnel d'acquisition
+du Code Source ne devra pas exc�der le simple co�t de transfert des donn�es.
+
+
+        5.3.3 DISTRIBUTION DES MODULES EXTERNES
+
+Lorsque le Licenci� a d�velopp� un Module Externe les conditions du
+Contrat ne s'appliquent pas � ce Module Externe, qui peut �tre distribu�
+sous un contrat de licence diff�rent.
+
+
+        5.3.4 COMPATIBILITE AVEC LA LICENCE GNU GPL
+
+Le Licenci� peut inclure un code soumis aux dispositions d'une des
+versions de la licence GNU GPL dans le Logiciel modifi� ou non et
+distribuer l'ensemble sous les conditions de la m�me version de la
+licence GNU GPL.
+
+Le Licenci� peut inclure le Logiciel modifi� ou non dans un code soumis
+aux dispositions d'une des versions de la licence GNU GPL et distribuer
+l'ensemble sous les conditions de la m�me version de la licence GNU GPL.
+
+
+    Article 6 - PROPRIETE INTELLECTUELLE
+
+
+      6.1 SUR LE LOGICIEL INITIAL
+
+Le Titulaire est d�tenteur des droits patrimoniaux sur le Logiciel
+Initial. Toute utilisation du Logiciel Initial est soumise au respect
+des conditions dans lesquelles le Titulaire a choisi de diffuser son
+oeuvre et nul autre n'a la facult� de modifier les conditions de
+diffusion de ce Logiciel Initial.
+
+Le Titulaire s'engage � ce que le Logiciel Initial reste au moins r�gi
+par la pr�sente licence et ce, pour la dur�e vis�e � l'article 4.2.
+
+
+      6.2 SUR LES CONTRIBUTIONS
+
+Le Licenci� qui a d�velopp� une Contribution est titulaire sur celle-ci
+des droits de propri�t� intellectuelle dans les conditions d�finies par
+la l�gislation applicable.
+
+
+      6.3 SUR LES MODULES EXTERNES
+
+Le Licenci� qui a d�velopp� un Module Externe est titulaire sur celui-ci
+des droits de propri�t� intellectuelle dans les conditions d�finies par
+la l�gislation applicable et reste libre du choix du contrat r�gissant
+sa diffusion.
+
+
+      6.4 DISPOSITIONS COMMUNES
+
+Le Licenci� s'engage express�ment:
+
+   1. � ne pas supprimer ou modifier de quelque mani�re que ce soit les
+      mentions de propri�t� intellectuelle appos�es sur le Logiciel;
+
+   2. � reproduire � l'identique lesdites mentions de propri�t�
+      intellectuelle sur les copies du Logiciel modifi� ou non.
+
+Le Licenci� s'engage � ne pas porter atteinte, directement ou
+indirectement, aux droits de propri�t� intellectuelle du Titulaire et/ou
+des Contributeurs sur le Logiciel et � prendre, le cas �ch�ant, �
+l'�gard de son personnel toutes les mesures n�cessaires pour assurer le
+respect des dits droits de propri�t� intellectuelle du Titulaire et/ou
+des Contributeurs.
+
+
+    Article 7 - SERVICES ASSOCIES
+
+7.1 Le Contrat n'oblige en aucun cas le Conc�dant � la r�alisation de
+prestations d'assistance technique ou de maintenance du Logiciel.
+
+Cependant le Conc�dant reste libre de proposer ce type de services. Les
+termes et conditions d'une telle assistance technique et/ou d'une telle
+maintenance seront alors d�termin�s dans un acte s�par�. Ces actes de
+maintenance et/ou assistance technique n'engageront que la seule
+responsabilit� du Conc�dant qui les propose.
+
+7.2 De m�me, tout Conc�dant est libre de proposer, sous sa seule
+responsabilit�, � ses licenci�s une garantie, qui n'engagera que lui,
+lors de la redistribution du Logiciel et/ou du Logiciel Modifi� et ce,
+dans les conditions qu'il souhaite. Cette garantie et les modalit�s
+financi�res de son application feront l'objet d'un acte s�par� entre le
+Conc�dant et le Licenci�.
+
+
+    Article 8 - RESPONSABILITE
+
+8.1 Sous r�serve des dispositions de l'article 8.2, le Licenci� a la 
+facult�, sous r�serve de prouver la faute du Conc�dant concern�, de
+solliciter la r�paration du pr�judice direct qu'il subirait du fait du
+logiciel et dont il apportera la preuve.
+
+8.2 La responsabilit� du Conc�dant est limit�e aux engagements pris en
+application du Contrat et ne saurait �tre engag�e en raison notamment:
+(i) des dommages dus � l'inex�cution, totale ou partielle, de ses
+obligations par le Licenci�, (ii) des dommages directs ou indirects
+d�coulant de l'utilisation ou des performances du Logiciel subis par le
+Licenci� et (iii) plus g�n�ralement d'un quelconque dommage indirect. En
+particulier, les Parties conviennent express�ment que tout pr�judice
+financier ou commercial (par exemple perte de donn�es, perte de
+b�n�fices, perte d'exploitation, perte de client�le ou de commandes,
+manque � gagner, trouble commercial quelconque) ou toute action dirig�e
+contre le Licenci� par un tiers, constitue un dommage indirect et
+n'ouvre pas droit � r�paration par le Conc�dant.
+
+
+    Article 9 - GARANTIE
+
+9.1 Le Licenci� reconna�t que l'�tat actuel des connaissances
+scientifiques et techniques au moment de la mise en circulation du
+Logiciel ne permet pas d'en tester et d'en v�rifier toutes les
+utilisations ni de d�tecter l'existence d'�ventuels d�fauts. L'attention
+du Licenci� a �t� attir�e sur ce point sur les risques associ�s au
+chargement, � l'utilisation, la modification et/ou au d�veloppement et �
+la reproduction du Logiciel qui sont r�serv�s � des utilisateurs avertis.
+
+Il rel�ve de la responsabilit� du Licenci� de contr�ler, par tous
+moyens, l'ad�quation du produit � ses besoins, son bon fonctionnement et
+de s'assurer qu'il ne causera pas de dommages aux personnes et aux biens.
+
+9.2 Le Conc�dant d�clare de bonne foi �tre en droit de conc�der
+l'ensemble des droits attach�s au Logiciel (comprenant notamment les
+droits vis�s � l'article 5).
+
+9.3 Le Licenci� reconna�t que le Logiciel est fourni "en l'�tat" par le
+Conc�dant sans autre garantie, expresse ou tacite, que celle pr�vue �
+l'article 9.2 et notamment sans aucune garantie sur sa valeur 
+commerciale, son caract�re s�curis�, innovant ou pertinent.
+
+En particulier, le Conc�dant ne garantit pas que le Logiciel est exempt
+d'erreur, qu'il fonctionnera sans interruption, qu'il sera compatible
+avec l'�quipement du Licenci� et sa configuration logicielle ni qu'il
+remplira les besoins du Licenci�.
+
+9.4 Le Conc�dant ne garantit pas, de mani�re expresse ou tacite, que le
+Logiciel ne porte pas atteinte � un quelconque droit de propri�t�
+intellectuelle d'un tiers portant sur un brevet, un logiciel ou sur tout
+autre droit de propri�t�. Ainsi, le Conc�dant exclut toute garantie au
+profit du Licenci� contre les actions en contrefa�on qui pourraient �tre
+diligent�es au titre de l'utilisation, de la modification, et de la
+redistribution du Logiciel. N�anmoins, si de telles actions sont
+exerc�es contre le Licenci�, le Conc�dant lui apportera son aide
+technique et juridique pour sa d�fense. Cette aide technique et
+juridique est d�termin�e au cas par cas entre le Conc�dant concern� et
+le Licenci� dans le cadre d'un protocole d'accord. Le Conc�dant d�gage
+toute responsabilit� quant � l'utilisation de la d�nomination du
+Logiciel par le Licenci�. Aucune garantie n'est apport�e quant �
+l'existence de droits ant�rieurs sur le nom du Logiciel et sur
+l'existence d'une marque.
+
+
+    Article 10 - RESILIATION
+
+10.1 En cas de manquement par le Licenci� aux obligations mises � sa
+charge par le Contrat, le Conc�dant pourra r�silier de plein droit le
+Contrat trente (30) jours apr�s notification adress�e au Licenci� et
+rest�e sans effet.
+
+10.2 Le Licenci� dont le Contrat est r�sili� n'est plus autoris� �
+utiliser, modifier ou distribuer le Logiciel. Cependant, toutes les
+licences qu'il aura conc�d�es ant�rieurement � la r�siliation du Contrat
+resteront valides sous r�serve qu'elles aient �t� effectu�es en
+conformit� avec le Contrat.
+
+
+    Article 11 - DISPOSITIONS DIVERSES
+
+
+      11.1 CAUSE EXTERIEURE
+
+Aucune des Parties ne sera responsable d'un retard ou d'une d�faillance
+d'ex�cution du Contrat qui serait d� � un cas de force majeure, un cas
+fortuit ou une cause ext�rieure, telle que, notamment, le mauvais
+fonctionnement ou les interruptions du r�seau �lectrique ou de
+t�l�communication, la paralysie du r�seau li�e � une attaque
+informatique, l'intervention des autorit�s gouvernementales, les
+catastrophes naturelles, les d�g�ts des eaux, les tremblements de terre,
+le feu, les explosions, les gr�ves et les conflits sociaux, l'�tat de
+guerre...
+
+11.2 Le fait, par l'une ou l'autre des Parties, d'omettre en une ou
+plusieurs occasions de se pr�valoir d'une ou plusieurs dispositions du
+Contrat, ne pourra en aucun cas impliquer renonciation par la Partie
+int�ress�e � s'en pr�valoir ult�rieurement.
+
+11.3 Le Contrat annule et remplace toute convention ant�rieure, �crite
+ou orale, entre les Parties sur le m�me objet et constitue l'accord
+entier entre les Parties sur cet objet. Aucune addition ou modification
+aux termes du Contrat n'aura d'effet � l'�gard des Parties � moins
+d'�tre faite par �crit et sign�e par leurs repr�sentants d�ment habilit�s.
+
+11.4 Dans l'hypoth�se o� une ou plusieurs des dispositions du Contrat
+s'av�rerait contraire � une loi ou � un texte applicable, existants ou
+futurs, cette loi ou ce texte pr�vaudrait, et les Parties feraient les
+amendements n�cessaires pour se conformer � cette loi ou � ce texte.
+Toutes les autres dispositions resteront en vigueur. De m�me, la
+nullit�, pour quelque raison que ce soit, d'une des dispositions du
+Contrat ne saurait entra�ner la nullit� de l'ensemble du Contrat.
+
+
+      11.5 LANGUE
+
+Le Contrat est r�dig� en langue fran�aise et en langue anglaise, ces
+deux versions faisant �galement foi.
+
+
+    Article 12 - NOUVELLES VERSIONS DU CONTRAT
+
+12.1 Toute personne est autoris�e � copier et distribuer des copies de
+ce Contrat.
+
+12.2 Afin d'en pr�server la coh�rence, le texte du Contrat est prot�g�
+et ne peut �tre modifi� que par les auteurs de la licence, lesquels se
+r�servent le droit de publier p�riodiquement des mises � jour ou de
+nouvelles versions du Contrat, qui poss�deront chacune un num�ro
+distinct. Ces versions ult�rieures seront susceptibles de prendre en
+compte de nouvelles probl�matiques rencontr�es par les logiciels libres.
+
+12.3 Tout Logiciel diffus� sous une version donn�e du Contrat ne pourra
+faire l'objet d'une diffusion ult�rieure que sous la m�me version du
+Contrat ou une version post�rieure, sous r�serve des dispositions de
+l'article 5.3.4.
+
+
+    Article 13 - LOI APPLICABLE ET COMPETENCE TERRITORIALE
+
+13.1 Le Contrat est r�gi par la loi fran�aise. Les Parties conviennent
+de tenter de r�gler � l'amiable les diff�rends ou litiges qui
+viendraient � se produire par suite ou � l'occasion du Contrat.
+
+13.2 A d�faut d'accord amiable dans un d�lai de deux (2) mois � compter
+de leur survenance et sauf situation relevant d'une proc�dure d'urgence,
+les diff�rends ou litiges seront port�s par la Partie la plus diligente
+devant les Tribunaux comp�tents de Paris.
+
+
+Version 2.0 du 2005-05-21.
\ No newline at end of file
diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/Makefile b/modeling/Blinking.ttool/AVATAR_executablecode/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..1678a90ea9235bc5e820653343b58edb7ac41fc0
--- /dev/null
+++ b/modeling/Blinking.ttool/AVATAR_executablecode/Makefile
@@ -0,0 +1,32 @@
+UNAME := $(shell uname -s)
+CC     = /usr/bin/gcc
+#CC     = test2.sh
+#CC = /packages/gcc_3.2.2/bin/g++32
+OPT    = -O1 -pthread
+# Solaris
+#LOPT   = -O1 -pthread -ldl -lnsl -lsocket
+#Linux
+LOPT_UNIX   = -O1 -pthread -ldl -lrt
+LOPT_MAC = -O1 -pthread -ldl
+
+DEBUG  = -g
+OTHER  = -Wall
+TRY    = 
+CFLAGS = $(OPT) $(OTHER) $(TRY)
+LFLAGS_MAC = $(LOPT_MAC) $(OTHER) $(TRY)
+LFLAGS_UNIX = $(LOPT_UNIX) $(OTHER) $(TRY)
+# CFLAGS = $(DEBUG) $(OTHER)
+OBJDIR = lib
+
+MODULE = run
+SRCS_generated_DIR = generated_src/
+include Makefile.src
+SRCS_base = src/request.c src/message.c src/myerrors.c src/debug.c src/syncchannel.c src/asyncchannel.c src/request_manager.c src/random.c src/mytimelib.c src/tracemanager.c
+SRCS_base_DIR = .
+SRCS_base_DIRSRC = src/ 
+OBJS_executor = $(SRCS_base:%.c=lib/%.o)
+OBJS = $(SRCS:%.c=lib/%.o)
+
+include Makefile.defs
+
+include Makefile.forsoclib
diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/Makefile.defs b/modeling/Blinking.ttool/AVATAR_executablecode/Makefile.defs
new file mode 100644
index 0000000000000000000000000000000000000000..fa9276ff99651594a42f44ddcb827ffefe68c4c2
--- /dev/null
+++ b/modeling/Blinking.ttool/AVATAR_executablecode/Makefile.defs
@@ -0,0 +1,36 @@
+## Variable that points to SystemC installation path
+
+
+INCDIR = -I. -I$(SRCS_base_DIR) -I$(SRCS_base_DIRSRC) -I$(SRCS_generated_DIR)
+LIBDIR = -L. -L.. 
+LIBS   =  -lm $(EXTRA_LIBS)
+
+EXE    = $(MODULE).x
+
+.SUFFIXES: .c .o .x
+
+
+$(EXE): makedir $(OBJS) $(OBJS_executor) 
+ifeq ($(UNAME),Darwin)
+	$(CC) $(LFLAGS_MAC) $(INCDIR) $(LIBDIR) -o $@ $(OBJS) $(OBJS_executor) $(LIBS) 2>&1 | c++filt
+endif
+ifneq ($(UNAME),Darwin)
+	$(CC) $(LFLAGS_UNIX) $(INCDIR) $(LIBDIR) -o $@ $(OBJS) $(OBJS_executor) $(LIBS) 2>&1 | c++filt
+endif
+
+makedir:
+	echo Making directories
+	mkdir -p ./lib
+	mkdir -p ./lib/$(SRCS_generated_DIR)
+	mkdir -p ./lib/$(SRCS_base_DIRSRC)
+
+$(OBJDIR)/%.o: $(SRCS_base_DIR)/%.c
+	$(CC) $(CFLAGS) $(INCDIR) -o $@ -c $<
+
+
+clean:
+	rm -f $(OBJS_simulator) $(OBJS_executor) $(OBJS) *~ $(EXE) core 
+
+ultraclean: clean
+	rm -f Makefile.deps
+
diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/Makefile.forsoclib b/modeling/Blinking.ttool/AVATAR_executablecode/Makefile.forsoclib
new file mode 100644
index 0000000000000000000000000000000000000000..9f685d88168abf74e444f54116858668b96e1f55
--- /dev/null
+++ b/modeling/Blinking.ttool/AVATAR_executablecode/Makefile.forsoclib
@@ -0,0 +1,23 @@
+SOCLIB_CPU=ppc
+MUTEKH_CPU=ppc
+
+PATH+=/opt/mutekh/bin
+export PATH
+
+updateruntime:
+	cp ~/TTool/executablecode/src/*.c ~/TTool/MPSoC/mutekh/libavatar/
+	cp ~/TTool/executablecode/src/*.h ~/TTool/MPSoC/mutekh/libavatar/include/  
+
+updategeneratedcode:
+	cp ~/TTool/executablecode/generated_src/*.h ~/TTool/MPSoC/mutekh/examples/avatar
+	cp ~/TTool/executablecode/generated_src/*.c ~/TTool/MPSoC/mutekh/examples/avatar	
+	cp ~/TTool/executablecode/Makefile.soclib ~/TTool/MPSoC/mutekh/examples/avatar/Makefile
+
+compilesoclib:
+	cd ~/TTool/MPSoC/mutekh; make CONF=examples/avatar/config BUILD=soclib-$(MUTEKH_CPU):pf-tutorial
+
+runsoclib:
+	echo "running soclib"
+	cd ~/TTool/MPSoC/soclib/soclib/platform/topcells/caba-vgmn-mutekh_kernel_tutorial; SOCLIB_GDB=S ./system.x $(SOCLIB_CPU):$(SOCLIB_CPU_COUNT) ~/TTool/MPSoC/mutekh/avatar-soclib-$(MUTEKH_CPU).out
+allsoclib: updateruntime updategeneratedcode compilesoclib runsoclib
+
diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/Makefile.soclib b/modeling/Blinking.ttool/AVATAR_executablecode/Makefile.soclib
new file mode 100644
index 0000000000000000000000000000000000000000..b2a6f0d8913ce4791dee7973b2ffbbe40ddb455b
--- /dev/null
+++ b/modeling/Blinking.ttool/AVATAR_executablecode/Makefile.soclib
@@ -0,0 +1 @@
+objs = main.o MainBlock.o 
\ No newline at end of file
diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/Makefile.src b/modeling/Blinking.ttool/AVATAR_executablecode/Makefile.src
new file mode 100644
index 0000000000000000000000000000000000000000..f7056e9b6293cd43780de9e63c2614df674f1fcb
--- /dev/null
+++ b/modeling/Blinking.ttool/AVATAR_executablecode/Makefile.src
@@ -0,0 +1 @@
+SRCS = generated_src/main.c generated_src/MainBlock.c 
\ No newline at end of file
diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/generated_src/MainBlock.c b/modeling/Blinking.ttool/AVATAR_executablecode/generated_src/MainBlock.c
new file mode 100644
index 0000000000000000000000000000000000000000..3f178c74f04814b3c7e6f112e7d33511d268f082
--- /dev/null
+++ b/modeling/Blinking.ttool/AVATAR_executablecode/generated_src/MainBlock.c
@@ -0,0 +1,109 @@
+#include "MainBlock.h"
+
+
+// Header code defined in the model
+DigitalOut myled1(LED1);
+
+void __userImplemented__MainBlock__LED1on() {
+   myled1 = 1;
+   printf("Led1 on.\n");
+}
+void __userImplemented__MainBlock__LED1off(int val){
+   myled1 = 0;
+   printf("Led1 off.\n");
+   printf("value of x=%d\n",val);
+}
+
+// End of header code defined in the model
+
+#define STATE__START__STATE 0
+#define STATE__Led1on 1
+#define STATE__Led1off 2
+#define STATE__STOP__STATE 3
+
+void MainBlock__LED1on() {
+  traceFunctionCall("MainBlock", "LED1on", "-");
+  __userImplemented__MainBlock__LED1on();
+}
+
+
+void MainBlock__LED1off(int x) {
+  char my__attr[CHAR_ALLOC_SIZE];
+  sprintf(my__attr, "%d",x);
+  traceFunctionCall("MainBlock", "LED1off", my__attr);
+  __userImplemented__MainBlock__LED1off(x);
+}
+
+
+void *mainFunc__MainBlock(void *arg){
+  int period = 2;
+  int x = 0;
+  
+  int __currentState = STATE__START__STATE;
+  __attribute__((unused)) request __req0;
+  __attribute__((unused))int *__params0[0];
+  __attribute__((unused)) request __req1;
+  __attribute__((unused))int *__params1[0];
+  __attribute__((unused))setOfRequests __list;
+  __attribute__((unused))pthread_cond_t __myCond;
+  __attribute__((unused))request *__returnRequest;
+  
+  char * __myname = (char *)arg;
+  
+  pthread_cond_init(&__myCond, NULL);
+  
+  fillListOfRequests(&__list, __myname, &__myCond, &__mainMutex);
+  //printf("my name = %s\n", __myname);
+  
+  /* Main loop on states */
+  while(__currentState != STATE__STOP__STATE) {
+    switch(__currentState) {
+      case STATE__START__STATE: 
+      traceStateEntering(__myname, "__StartState");
+      __currentState = STATE__Led1on;
+      break;
+      
+      case STATE__Led1on: 
+      traceStateEntering(__myname, "Led1on");
+      waitFor((period)*1000000, (period)*1000000);
+      x = x+1;
+      traceVariableModification("MainBlock", "x", x,0);
+      MainBlock__LED1off(x);
+      __currentState = STATE__Led1off;
+      break;
+      
+      case STATE__Led1off: 
+      traceStateEntering(__myname, "Led1off");
+      if (!(x > 10)) {
+        makeNewRequest(&__req0, 15, IMMEDIATE, 1, (period)*1000000, (period)*1000000, 0, __params0);
+        addRequestToList(&__list, &__req0);
+      }
+      if (x > 10) {
+        makeNewRequest(&__req1, 29, IMMEDIATE, 0, 0, 0, 0, __params1);
+        addRequestToList(&__list, &__req1);
+      }
+      if (nbOfRequests(&__list) == 0) {
+        debug2Msg(__myname, "No possible request");
+        __currentState = STATE__STOP__STATE;
+        break;
+      }
+      __returnRequest = executeListOfRequests(&__list);
+      clearListOfRequests(&__list);
+      traceRequest(__myname, __returnRequest);
+       if (__returnRequest == &__req0) {
+        MainBlock__LED1on();
+        __currentState = STATE__Led1on;
+        
+      }
+      else  if (__returnRequest == &__req1) {
+        __currentState = STATE__STOP__STATE;
+        
+      }
+      break;
+      
+    }
+  }
+  //printf("Exiting = %s\n", __myname);
+  return NULL;
+}
+
diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/generated_src/MainBlock.h b/modeling/Blinking.ttool/AVATAR_executablecode/generated_src/MainBlock.h
new file mode 100644
index 0000000000000000000000000000000000000000..07444898d21d3af927e8f9e1b14973c95676c1fe
--- /dev/null
+++ b/modeling/Blinking.ttool/AVATAR_executablecode/generated_src/MainBlock.h
@@ -0,0 +1,20 @@
+#ifndef MainBlock_H
+#define MainBlock_H
+#include <stdio.h>
+#include <pthread.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+#include "request.h"
+#include "syncchannel.h"
+#include "request_manager.h"
+#include "debug.h"
+#include "defs.h"
+#include "mytimelib.h"
+#include "random.h"
+#include "tracemanager.h"
+#include "main.h"
+
+extern void *mainFunc__MainBlock(void *arg);
+
+#endif
diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/generated_src/main.c b/modeling/Blinking.ttool/AVATAR_executablecode/generated_src/main.c
new file mode 100644
index 0000000000000000000000000000000000000000..8c57dc06ccb12c9affa30494b868b0e5c792081c
--- /dev/null
+++ b/modeling/Blinking.ttool/AVATAR_executablecode/generated_src/main.c
@@ -0,0 +1,63 @@
+#include <stdio.h>
+#include <pthread.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+#include "request.h"
+#include "syncchannel.h"
+#include "request_manager.h"
+#include "debug.h"
+#include "random.h"
+#include "tracemanager.h"
+
+/* User code */
+void __user_init() {
+}
+
+/* End of User code */
+
+/* Main mutex */
+pthread_mutex_t __mainMutex;
+
+/* Synchronous channels */
+/* Asynchronous channels */
+
+#include "MainBlock.h"
+
+
+int main(int argc, char *argv[]) {
+  
+  /* disable buffering on stdout */
+  setvbuf(stdout, NULL, _IONBF, 0);
+  
+  /* Synchronous channels */
+  /* Asynchronous channels */
+  
+  /* Threads of tasks */
+  pthread_t thread__MainBlock;
+  /* Activating tracing  */
+  if (argc>1){
+    activeTracingInFile(argv[1]);
+  } else {
+    activeTracingInConsole();
+  }
+  /* Activating randomness */
+  initRandom();
+  /* Initializing the main mutex */
+if (pthread_mutex_init(&__mainMutex, NULL) < 0) { exit(-1);}
+  
+  /* Initializing mutex of messages */
+  initMessages();
+  /* User initialization */
+  __user_init();
+  
+  
+  pthread_create(&thread__MainBlock, NULL, mainFunc__MainBlock, (void *)"MainBlock");
+  
+  
+  pthread_join(thread__MainBlock, NULL);
+  
+  
+  return 0;
+  
+}
diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/generated_src/main.h b/modeling/Blinking.ttool/AVATAR_executablecode/generated_src/main.h
new file mode 100644
index 0000000000000000000000000000000000000000..e96bd1901b8aca37e1aeefbb38eabfc1aea9de74
--- /dev/null
+++ b/modeling/Blinking.ttool/AVATAR_executablecode/generated_src/main.h
@@ -0,0 +1,8 @@
+#ifndef MAIN_H
+#define MAIN_H
+/* Main mutex */
+extern pthread_mutex_t __mainMutex;
+
+/* Synchronous channels */
+/* Asynchronous channels */
+#endif
diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/asyncchannel.c b/modeling/Blinking.ttool/AVATAR_executablecode/src/asyncchannel.c
new file mode 100644
index 0000000000000000000000000000000000000000..e2ce2ac48a62b888eedc7940c74b1ae1f3953013
--- /dev/null
+++ b/modeling/Blinking.ttool/AVATAR_executablecode/src/asyncchannel.c
@@ -0,0 +1,56 @@
+#include <stdlib.h>
+
+#include "message.h"
+#include "asyncchannel.h"
+#include "myerrors.h"
+
+
+asyncchannel *getNewAsyncchannel(char *outname, char *inname, int isBlocking, int maxNbOfMessages) {
+  asyncchannel * asyncch = (asyncchannel *)(malloc(sizeof(struct asyncchannel)));
+  if (asyncch == NULL) {
+    criticalError("Allocation of asyncchannel failed");
+  }
+  asyncch->inname = inname;
+  asyncch->outname = outname;
+  asyncch->isBlocking = isBlocking;
+  asyncch->maxNbOfMessages = maxNbOfMessages;
+  
+  return asyncch;
+}
+
+void destroyAsyncchannel(asyncchannel *asyncch) {
+  free(asyncch);
+}
+
+message* getAndRemoveOldestMessageFromAsyncChannel(asyncchannel *channel) {
+  message *msg;
+  message *previous;
+
+  if (channel->currentNbOfMessages == 0) {
+    return NULL;
+  }
+
+  if (channel->currentNbOfMessages == 1) {
+    channel->currentNbOfMessages = 0;
+    msg = channel->pendingMessages;
+    channel->pendingMessages = NULL;
+    return msg;
+  }
+
+  msg = channel->pendingMessages;
+  previous = msg;
+  while(msg->next != NULL) {
+    previous = msg;
+    msg = msg->next;
+  }
+
+  channel->currentNbOfMessages = channel->currentNbOfMessages -1;
+  previous->next = NULL;
+  return msg;
+}
+
+void addMessageToAsyncChannel(asyncchannel *channel, message *msg) {
+  msg->next = channel->pendingMessages;
+  channel->pendingMessages = msg;
+  channel->currentNbOfMessages = channel->currentNbOfMessages+1;
+}
diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/asyncchannel.h b/modeling/Blinking.ttool/AVATAR_executablecode/src/asyncchannel.h
new file mode 100644
index 0000000000000000000000000000000000000000..8f812359dbd67311f37391807b883890ee163f04
--- /dev/null
+++ b/modeling/Blinking.ttool/AVATAR_executablecode/src/asyncchannel.h
@@ -0,0 +1,28 @@
+#ifndef ASYNCCHANNEL_H
+#define ASYNCCHANNEL_H
+
+struct asyncchannel;
+
+#include "message.h"
+#include "request.h"
+
+
+struct asyncchannel {
+  char *outname;
+  char *inname;
+  int isBlocking; // In writing. Reading is always blocking
+  int maxNbOfMessages; //
+  struct request* outWaitQueue;
+  struct request* inWaitQueue;
+  message *pendingMessages;
+  int currentNbOfMessages;
+};
+
+typedef struct asyncchannel asyncchannel;
+
+asyncchannel *getNewAsyncchannel(char *inname, char *outname, int isBlocking, int maxNbOfMessages);
+void destroyAsyncchannel(asyncchannel *syncch);
+message* getAndRemoveOldestMessageFromAsyncChannel(asyncchannel *channel);
+void addMessageToAsyncChannel(asyncchannel *channel, message *msg);
+
+#endif
diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/debug.c b/modeling/Blinking.ttool/AVATAR_executablecode/src/debug.c
new file mode 100644
index 0000000000000000000000000000000000000000..067d0a8c17e3861ce60191884c13041d9e88431b
--- /dev/null
+++ b/modeling/Blinking.ttool/AVATAR_executablecode/src/debug.c
@@ -0,0 +1,86 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <time.h>
+
+#include "debug.h"
+
+
+#define DEBUG_ON 1
+#define DEBUG_OFF 2
+
+int debug = DEBUG_OFF;
+
+void activeDebug() {
+  debug = DEBUG_ON;
+}
+
+void unactiveDebug() {
+  debug = DEBUG_OFF;
+}
+
+void debugThreeInts(char *msg, int value1, int value2, int value3) {
+  if (debug == DEBUG_OFF) {
+    return;
+  }
+  
+  if (msg != NULL) {
+    printf("DT> %s: %d, %d, %d\n", msg, value1, value2, value3);
+  }
+}
+
+void debugTwoInts(char *msg, int value1, int value2) {
+  if (debug == DEBUG_OFF) {
+    return;
+  }
+  
+  if (msg != NULL) {
+    printf("DT> %s: %d, %d\n", msg, value1, value2);
+  }
+}
+
+void debugInt(char *msg, int value) {
+  if (debug == DEBUG_OFF) {
+    return;
+  }
+  
+  if (msg != NULL) {
+    printf("DT> %s: %d\n", msg, value);
+  }
+}
+
+void debugLong(char *msg, long value) {
+  if (debug == DEBUG_OFF) {
+    return;
+  }
+  
+  if (msg != NULL) {
+    printf("DT> %s: %ld\n", msg, value);
+  }
+}
+
+void debugMsg(char *msg) {
+  if (debug == DEBUG_OFF) {
+    return;
+  }
+
+  if (msg != NULL) {
+    printf("DT> %s\n", msg);
+  }
+}
+
+void debug2Msg(char *name, char *msg) {
+  if (debug == DEBUG_OFF) {
+    return;
+  }
+
+  if ((name != NULL) && (msg != NULL)) {
+    printf("DT - %s -> %s\n", name, msg);
+  }
+}
+
+void debugTime(char *msg, struct timespec *ts) {
+  if (debug == DEBUG_OFF) {
+    return;
+  }
+  printf("DT> (-------t------->) %s sec=%ld nsec=%ld\n", msg, ts->tv_sec, ts->tv_nsec);
+}
diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/debug.h b/modeling/Blinking.ttool/AVATAR_executablecode/src/debug.h
new file mode 100644
index 0000000000000000000000000000000000000000..7e73f3ce91684420195a07eb365184b0629e74f3
--- /dev/null
+++ b/modeling/Blinking.ttool/AVATAR_executablecode/src/debug.h
@@ -0,0 +1,19 @@
+
+
+#ifndef DEBUG_H
+#define DEBUG_H
+
+void activeDebug();
+void unactiveDebug();
+
+void debugThreeInts(char *msg, int value1, int value2, int value3);
+void debugTwoInts(char *msg, int value1, int value2);
+void debugLong(char *msg, long value);
+void debugInt(char *msg, int value);
+void debugMsg(char *msg);
+void debug2Msg(char *name, char* msg);
+void debugTime(char* msg, struct timespec *ts);
+
+#endif
+
+
diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/defs.h b/modeling/Blinking.ttool/AVATAR_executablecode/src/defs.h
new file mode 100644
index 0000000000000000000000000000000000000000..3b997bfdf885b560dc4fde8264e8b5026565de10
--- /dev/null
+++ b/modeling/Blinking.ttool/AVATAR_executablecode/src/defs.h
@@ -0,0 +1,9 @@
+#ifndef DEFS_H
+#define DEFS_H
+
+#define bool int
+#define true 1
+#define false 0
+
+
+#endif
diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/message.c b/modeling/Blinking.ttool/AVATAR_executablecode/src/message.c
new file mode 100644
index 0000000000000000000000000000000000000000..1153a882f51d93d8596621162f82278bc01d7158
--- /dev/null
+++ b/modeling/Blinking.ttool/AVATAR_executablecode/src/message.c
@@ -0,0 +1,59 @@
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <pthread.h>
+
+#include "message.h"
+#include "myerrors.h"
+
+long __id_message = 0;
+pthread_mutex_t __message_mutex;
+
+
+void initMessages() {
+  if (pthread_mutex_init(&__message_mutex, NULL) < 0) { exit(-1);}
+}
+
+long getMessageID() {
+  long tmp;
+  pthread_mutex_lock(&__message_mutex);
+  tmp = __id_message;
+  __id_message ++;
+  pthread_mutex_unlock(&__message_mutex);
+  return tmp;
+}
+
+message *getNewMessageWithParams(int nbOfParams) {
+	
+	message *msg = (message *)(malloc(sizeof(struct message)));
+	if (msg == NULL) {
+		criticalError("Allocation of request failed");
+	}
+	msg->nbOfParams = nbOfParams;
+	msg->params = (int *)(malloc(sizeof(int) * nbOfParams));
+	msg->id = getMessageID();
+	return msg;
+}
+
+message *getNewMessage(int nbOfParams, int *params) {
+
+  message *msg = (message *)(malloc(sizeof(struct message)));
+  if (msg == NULL) {
+    criticalError("Allocation of request failed");
+  }
+  msg->nbOfParams = nbOfParams;
+  msg->params = params;
+  msg->id = getMessageID();
+  return msg;
+}
+
+
+
+void destroyMessageWithParams(message *msg) {
+  free(msg->params);
+  free(msg);
+}
+
+void destroyMessage(message *msg) {
+  free(msg);
+}
diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/message.h b/modeling/Blinking.ttool/AVATAR_executablecode/src/message.h
new file mode 100644
index 0000000000000000000000000000000000000000..700ed07d97f6ae925ceeb6c172238a2f4bd37680
--- /dev/null
+++ b/modeling/Blinking.ttool/AVATAR_executablecode/src/message.h
@@ -0,0 +1,22 @@
+#ifndef MESSAGE_H
+#define MESSAGE_H
+
+
+struct message {
+  struct message *next;
+  int nbOfParams;
+  int *params;
+  long id;
+};
+
+typedef struct message message;
+
+void initMessages();
+message *getNewMessageWithParams(int nbOfParams);
+message *getNewMessage(int nbOfParams, int *params);
+void destroyMessageWithParams(message *msg);
+void destroyMessage(message *msg);
+
+
+
+#endif
diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/myerrors.c b/modeling/Blinking.ttool/AVATAR_executablecode/src/myerrors.c
new file mode 100644
index 0000000000000000000000000000000000000000..dfe16a1c469f6e11382dfae037b3d4ff89cf8c7b
--- /dev/null
+++ b/modeling/Blinking.ttool/AVATAR_executablecode/src/myerrors.c
@@ -0,0 +1,24 @@
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "myerrors.h"
+
+
+
+
+void criticalErrorInt(char *msg, int value) {
+  if (msg != NULL) {
+    printf("\nCritical error: %s, %d\n", msg, value);
+  }
+
+  exit(-1);
+}
+
+
+void criticalError(char *msg) {
+  if (msg != NULL) {
+    printf("\nCritical error: %s\n", msg);
+  }
+
+  exit(-1);
+}
diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/myerrors.h b/modeling/Blinking.ttool/AVATAR_executablecode/src/myerrors.h
new file mode 100644
index 0000000000000000000000000000000000000000..8300da3ccfd1b5f2efd2f3514a8f543409363003
--- /dev/null
+++ b/modeling/Blinking.ttool/AVATAR_executablecode/src/myerrors.h
@@ -0,0 +1,11 @@
+
+
+#ifndef MY_ERRORS_H
+#define MY_ERRORS_H
+
+void criticalErrorInt(char *msg, int value);
+void criticalError(char *msg);
+
+#endif
+
+
diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/mytimelib.c b/modeling/Blinking.ttool/AVATAR_executablecode/src/mytimelib.c
new file mode 100644
index 0000000000000000000000000000000000000000..d39c07ea85c258ce227365364163ce1761038663
--- /dev/null
+++ b/modeling/Blinking.ttool/AVATAR_executablecode/src/mytimelib.c
@@ -0,0 +1,108 @@
+#include<time.h>
+
+#include "mytimelib.h"
+#include "random.h"
+#include "debug.h"
+
+#ifndef CLOCK_REALTIME
+#define CLOCK_REALTIME
+
+int clock_gettime(struct timespec *ts) {
+  struct timeval tv;
+  gettimeofday(&tv, NULL);
+  ts->tv_sec = tv.tv_sec;
+  ts->tv_nsec = tv.tv_usec * 1000;
+  return 0;
+}
+
+int my_clock_gettime(struct timespec *tp) {
+  return clock_gettime(tp);
+}
+
+#else
+
+int my_clock_gettime(struct timespec *tp) {
+  return clock_gettime(CLOCK_REALTIME, tp);
+}
+
+#endif
+
+
+
+void addTime(struct timespec *src1, struct timespec *src2, struct timespec *dest) {
+  dest->tv_nsec = src1->tv_nsec + src2->tv_nsec;
+  dest->tv_sec = src1->tv_sec + src2->tv_sec;
+  if (dest->tv_nsec > 1000000000) {
+    dest->tv_sec = dest->tv_sec + (dest->tv_nsec / 1000000000);
+    dest->tv_nsec = dest->tv_nsec % 1000000000;
+  }
+}
+
+void diffTime(struct timespec *src1, struct timespec *src2, struct timespec *dest) {
+  int diff = 0;
+  if (src1->tv_nsec > src2->tv_nsec) {
+    diff ++;
+    dest->tv_nsec = src2->tv_nsec - src1->tv_nsec + 1000000000;
+  } else {
+    dest->tv_nsec = src2->tv_nsec - src1->tv_nsec;
+  }
+
+  dest->tv_sec = src2->tv_sec - src1->tv_sec - diff;
+}
+
+
+
+int isBefore(struct timespec *src1, struct timespec *src2) {
+  if (src1->tv_sec > src2->tv_sec) {
+    return 0;
+  }
+
+  if (src1->tv_sec < src2->tv_sec) {
+    return 1;
+  }
+
+  if (src1->tv_nsec < src2->tv_nsec) {
+    return 1;
+  }
+  return 0;
+}
+
+void minTime(struct timespec *src1, struct timespec *src2, struct timespec *dest) {
+  debugMsg("MIN TIME COMPUTATION");
+  if (isBefore(src1,src2)) {
+    dest->tv_nsec = src1->tv_nsec;
+    dest->tv_sec = src1->tv_sec;
+  } else {
+    dest->tv_nsec = src2->tv_nsec;
+    dest->tv_sec = src2->tv_sec;
+  }
+  
+}
+
+
+void delayToTimeSpec(struct timespec *ts, long delay) {
+  ts->tv_nsec = (delay % 1000000)*1000;
+  ts->tv_sec = (delay / 1000000);
+}
+
+void waitFor(long minDelay, long maxDelay) {
+  struct timespec tssrc;
+  struct timespec tsret;
+  int delay;
+
+
+  
+  debugMsg("Computing random delay");
+  //debugLong("Min delay", minDelay);
+  //debugLong("Max delay", maxDelay);
+  delay = computeLongRandom(minDelay, maxDelay);
+
+  debugLong("Random delay=", delay);
+
+  delayToTimeSpec(&tssrc, delay);
+
+  debugLong("............. waiting For", delay);
+  nanosleep(&tssrc, &tsret);
+  debugLong("............. waiting Done for: ", delay);
+}
+
diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/mytimelib.h b/modeling/Blinking.ttool/AVATAR_executablecode/src/mytimelib.h
new file mode 100644
index 0000000000000000000000000000000000000000..76ed5d22fcd7cf9a2750cf2a9726f5cdb89e48f2
--- /dev/null
+++ b/modeling/Blinking.ttool/AVATAR_executablecode/src/mytimelib.h
@@ -0,0 +1,19 @@
+#ifndef MYTIMELIB_H
+#define MYTIMELIB_H
+
+#include <time.h>
+#include <sys/time.h>
+
+
+
+// in usec
+
+int my_clock_gettime(struct timespec *tp);
+void addTime(struct timespec *src1, struct timespec *src2, struct timespec *dest);
+void diffTime(struct timespec *src1, struct timespec *src2, struct timespec *dest);
+int isBefore(struct timespec *src1, struct timespec *src2);
+void minTime(struct timespec *src1, struct timespec *src2, struct timespec *dest);
+void delayToTimeSpec(struct timespec *ts, long delay);
+extern void waitFor(long minDelay, long maxDelay);
+
+#endif
diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/random.c b/modeling/Blinking.ttool/AVATAR_executablecode/src/random.c
new file mode 100644
index 0000000000000000000000000000000000000000..b4bbddb19ac1e4a51bf5c0205aab571a7580dd32
--- /dev/null
+++ b/modeling/Blinking.ttool/AVATAR_executablecode/src/random.c
@@ -0,0 +1,43 @@
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <time.h>
+#include <limits.h>
+
+#include "random.h"
+#include "debug.h"
+#include <math.h>
+
+#include "mytimelib.h"
+
+int computeRandom(int min, int max) {
+  if (min == max) {
+    return min;
+  }
+  return (rand() % (max - min)) + min;
+}
+
+long computeLongRandom(long min, long max) {
+
+  if (min == max) {
+    return min;
+  }
+
+
+  long rand0 = (long)rand();
+  long rand1 = rand0 % (max - min);
+  //debugLong("min=", min);
+  //debugLong("max=", max);
+  //debugLong("rand0", rand0);
+ //debugLong("rand1", rand1);
+ //debugLong("Random long", rand1 + min);
+  return rand1 + min;
+}
+
+void initRandom() {
+  struct timespec ts;
+
+  my_clock_gettime(&ts);
+
+  srand((int)(ts.tv_nsec));
+}
diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/random.h b/modeling/Blinking.ttool/AVATAR_executablecode/src/random.h
new file mode 100644
index 0000000000000000000000000000000000000000..ecff7cb43cb9d3c38fd390243ad0cbd186fead97
--- /dev/null
+++ b/modeling/Blinking.ttool/AVATAR_executablecode/src/random.h
@@ -0,0 +1,7 @@
+#ifndef RANDOM_H
+#define RANDOM_H
+
+extern void initRandom();
+extern int computeRandom(int min, int max);
+extern long computeLongRandom(long min, long max);
+#endif
diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/request.c b/modeling/Blinking.ttool/AVATAR_executablecode/src/request.c
new file mode 100644
index 0000000000000000000000000000000000000000..af1231c61b71a7aab28063dfcf5eefc9faabf6b5
--- /dev/null
+++ b/modeling/Blinking.ttool/AVATAR_executablecode/src/request.c
@@ -0,0 +1,271 @@
+
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "request.h"
+#include "mytimelib.h"
+#include "myerrors.h"
+#include "random.h"
+#include "debug.h"
+
+
+request *getNewRequest(int ID, int type, int hasDelay, long minDelay, long maxDelay, int nbOfParams, int **params) {
+  request *req = (request *)(malloc(sizeof(struct request)));
+  
+  if (req == NULL) {
+    criticalError("Allocation of request failed");
+  }
+
+  makeNewRequest(req,  ID, type, hasDelay, minDelay, maxDelay, nbOfParams, params);  
+  return req;
+}
+
+
+// Delays are in microseconds
+void makeNewRequest(request *req, int ID, int type, int hasDelay, long minDelay, long maxDelay, int nbOfParams, int **params) {
+  long delay;
+  int i;
+
+  req->next = NULL;
+  req->listOfRequests = NULL;
+  req->nextRequestInList = NULL;
+
+  req->type = type;
+  req->ID = ID;
+  req->hasDelay = hasDelay;
+
+  if (req->hasDelay > 0) {
+    delay = computeLongRandom(minDelay, maxDelay);
+    delayToTimeSpec(&(req->delay), delay);
+  }
+
+  req->selected = 0;
+  req->nbOfParams = nbOfParams;
+  req->params = params;
+
+  req->alreadyPending = 0;
+  req->delayElapsed = 0;
+
+  req->relatedRequest = NULL;
+
+  if (type == SEND_ASYNC_REQUEST) {
+    // Must create a new message
+    req->msg = getNewMessageWithParams(nbOfParams);
+    for(i=0; i<nbOfParams; i++) {
+      req->msg->params[i] = *(params[i]);
+    }
+  }
+
+}
+
+
+
+
+void destroyRequest(request *req) {
+  free((void *)req);
+}
+
+int isRequestSelected(request *req) {
+  return req->selected;
+}
+
+int nbOfRequests(setOfRequests *list) {
+  int cpt = 0;
+  request *req;
+
+  req = list->head;
+
+  while(req != NULL) {
+    cpt ++;
+    req = req->nextRequestInList;
+  }
+
+  return cpt;
+}
+
+request *getRequestAtIndex(setOfRequests *list, int index) {
+  int cpt = 0;
+  request * req = list->head;
+
+  while(cpt < index) {
+    req = req->nextRequestInList;
+    cpt ++;
+  }
+
+  return req;
+  
+}
+
+
+request * addToRequestQueue(request *list, request *requestToAdd) {
+  request *origin = list;
+
+  if (list == NULL) {
+    return requestToAdd;
+  }
+
+  while(list->next != NULL) {
+    list = list->next;
+  }
+  
+  list->next = requestToAdd;
+
+  requestToAdd->next = NULL;
+
+  return origin;
+}
+
+request * removeRequestFromList(request *list, request *requestToRemove) {
+  request *origin = list;
+
+  if (list == requestToRemove) {
+    return list->next;
+  }
+
+
+  while(list->next != requestToRemove) {
+    list = list->next;
+  }
+
+  list->next = requestToRemove->next;
+
+  return origin;
+} 
+
+
+void copyParameters(request *src, request *dst) {
+  int i;
+  for(i=0; i<dst->nbOfParams; i++) {
+    *(dst->params[i]) = *(src->params[i]);
+  }
+}
+
+
+void clearListOfRequests(setOfRequests *list) {
+  list->head = NULL;
+}
+
+setOfRequests *newListOfRequests(pthread_cond_t *wakeupCondition, pthread_mutex_t *mutex) {
+  setOfRequests *list = (setOfRequests *)(malloc(sizeof(setOfRequests)));
+  list->head = NULL;
+  list->wakeupCondition = wakeupCondition;
+  list->mutex = mutex;
+
+  return list;
+}
+
+void fillListOfRequests(setOfRequests *list, char *name, pthread_cond_t *wakeupCondition, pthread_mutex_t *mutex) {
+  list->head = NULL;
+  list->owner = name;
+  list->wakeupCondition = wakeupCondition;
+  list->mutex = mutex;
+}
+
+
+void addRequestToList(setOfRequests *list, request* req) {
+  request *tmpreq;
+
+  if (list == NULL) {
+    criticalError("NULL List in addRequestToList");
+  }
+
+  if (req == NULL) {
+    criticalError("NULL req in addRequestToList");
+  }
+
+  req->listOfRequests = list;
+
+  if (list->head == NULL) {
+    list->head = req;
+    req->nextRequestInList = NULL;
+    return;
+  }
+
+  tmpreq = list->head;
+  while(tmpreq->nextRequestInList != NULL) {
+    tmpreq = tmpreq->nextRequestInList;
+  }
+
+  tmpreq->nextRequestInList = req;
+  req->nextRequestInList = NULL;
+}
+
+void removeAllPendingRequestsFromPendingLists(request *req, int apartThisOne) {
+  setOfRequests *list = req->listOfRequests;
+  request *reqtmp;
+
+  if (list == NULL) {
+    return;
+  }
+
+  reqtmp = list->head;
+
+  while(reqtmp != NULL) {
+    debugInt("Considering request of type", reqtmp->type);
+      if (reqtmp->alreadyPending) {
+	if (reqtmp->type ==  RECEIVE_SYNC_REQUEST) {
+	  debugMsg("Removing send sync request from inWaitQueue");
+	  reqtmp->syncChannel->inWaitQueue = removeRequestFromList(reqtmp->syncChannel->inWaitQueue, reqtmp);
+	  debugMsg("done");
+	}
+
+	if (reqtmp->type ==  SEND_SYNC_REQUEST) {
+	  debugMsg("Removing receive sync request from outWaitQueue");
+	  reqtmp->syncChannel->outWaitQueue = removeRequestFromList(reqtmp->syncChannel->outWaitQueue, reqtmp);
+	  debugMsg("done");
+	}
+
+	if (reqtmp->type ==  RECEIVE_BROADCAST_REQUEST) {
+	  debugMsg("Removing broadcast receive request from inWaitQueue");
+	  reqtmp->syncChannel->inWaitQueue = removeRequestFromList(reqtmp->syncChannel->inWaitQueue, reqtmp);
+	  debugMsg("done");
+	}
+      }
+    reqtmp = reqtmp->nextRequestInList;
+  }
+}
+
+
+// Identical means belonging to the same ListOfRequest
+// Returns the identical request if found, otherwise, null
+request *hasIdenticalRequestInListOfSelectedRequests(request *req, request *list) {
+ 
+  while(list != NULL) {
+    if (list->listOfRequests == req->listOfRequests) {
+      return list;
+    }
+    list = list->relatedRequest;
+  }
+
+  return NULL;
+}
+
+request* replaceInListOfSelectedRequests(request *oldRequest, request *newRequest, request *list) {
+  request *head = list;
+
+  if (list == oldRequest) {
+    newRequest->relatedRequest = oldRequest->relatedRequest;
+    return newRequest;
+  }
+
+  //list=list->relatedRequest;
+  while(list->relatedRequest != oldRequest) {
+    list = list->relatedRequest;
+  }
+
+  list->relatedRequest = newRequest;
+  newRequest->relatedRequest = oldRequest->relatedRequest;
+
+  return head;
+}
+
+
+int nbOfRelatedRequests(request *list) {
+  int cpt = 0;
+  while(list->relatedRequest != NULL) {
+    cpt ++;
+    list = list->relatedRequest;
+  }
+
+  return cpt;
+}
diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/request.h b/modeling/Blinking.ttool/AVATAR_executablecode/src/request.h
new file mode 100644
index 0000000000000000000000000000000000000000..00b93c8e5a007e2eecf6bde40417cdfb9457edc2
--- /dev/null
+++ b/modeling/Blinking.ttool/AVATAR_executablecode/src/request.h
@@ -0,0 +1,89 @@
+#ifndef REQUEST_H
+#define REQUEST_H
+
+#include <time.h>
+#include <pthread.h>
+
+struct request;
+
+#include "syncchannel.h"
+#include "asyncchannel.h"
+#include "message.h"
+
+#define SEND_SYNC_REQUEST 0
+#define RECEIVE_SYNC_REQUEST 2
+#define SEND_ASYNC_REQUEST 4
+#define RECEIVE_ASYNC_REQUEST 6
+#define DELAY 8
+#define IMMEDIATE 10
+#define SEND_BROADCAST_REQUEST 12
+#define RECEIVE_BROADCAST_REQUEST 14
+
+typedef struct timespec timespec;
+
+struct setOfRequests {
+  char* owner;
+  struct request *head;
+  timespec startTime;
+  timespec completionTime;
+  pthread_cond_t *wakeupCondition;
+  pthread_mutex_t *mutex;
+
+  int hasATimeRequest; // Means that at least on request of the list hasn't completed yet its time delay
+  timespec minTimeToWait;
+  struct request *selectedRequest;
+};
+
+typedef struct setOfRequests setOfRequests;
+
+struct request {
+  struct request *next;
+  struct setOfRequests* listOfRequests;
+  struct request* nextRequestInList;
+  struct request* relatedRequest; // For synchro and broadcast
+  struct syncchannel *syncChannel;
+  struct asyncchannel *asyncChannel;
+  
+  int type;
+  int ID;
+  int hasDelay;;
+  timespec delay;
+  int nbOfParams; // synchronous com.
+  int **params;  // synchronous com.
+  message *msg; // Asynchronous comm.
+
+
+  // Filled by the request manager
+  int executable;
+  int selected;
+  int alreadyPending; // Whether it has been taken into account for execution or not
+  int delayElapsed;
+  timespec myStartTime; // Time at which the delay has expired
+};
+
+typedef struct request request;
+
+void makeNewRequest(request *req, int ID, int type, int hasDelay, long minDelay, long maxDelay, int nbOfParams, int **params);
+request *getNewRequest(int ID, int type, int hasDelay, long minDelay, long maxDelay, int nbOfParams, int **params);
+void destroyRequest(request *req);
+extern int isRequestSelected(request *req);
+
+int nbOfRequests(setOfRequests *list);
+request *getRequestAtIndex(setOfRequests *list, int index);
+
+request * addToRequestQueue(request *list, request *requestToAdd);
+request * removeRequestFromList(request *list, request *requestToRemove);
+
+void copyParameters(request *src, request *dst);
+
+setOfRequests *newListOfRequests(pthread_cond_t *wakeupCondition, pthread_mutex_t *mutex);
+void addRequestToList(setOfRequests *list, request* req);
+void clearListOfRequests(setOfRequests *list);
+void fillListOfRequests(setOfRequests *list, char *name, pthread_cond_t *wakeupCondition, pthread_mutex_t *mutex);
+
+void removeAllPendingRequestsFromPendingLists(request *req, int apartThisOne);
+request *hasIdenticalRequestInListOfSelectedRequests(request *req, request *list);
+request* replaceInListOfSelectedRequests(request *oldRequest, request *newRequest, request *list);
+int nbOfRelatedRequests(request *list);
+
+#endif
diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/request_manager.c b/modeling/Blinking.ttool/AVATAR_executablecode/src/request_manager.c
new file mode 100644
index 0000000000000000000000000000000000000000..e1c39ba777944c41c018918f4fa7594eaf3f96b5
--- /dev/null
+++ b/modeling/Blinking.ttool/AVATAR_executablecode/src/request_manager.c
@@ -0,0 +1,570 @@
+#include <stdlib.h>
+#include <pthread.h>
+#include <time.h>
+
+#include "request_manager.h"
+#include "request.h"
+#include "myerrors.h"
+#include "debug.h"
+#include "mytimelib.h"
+#include "random.h"
+#include "asyncchannel.h"
+#include "tracemanager.h"
+
+
+
+void executeSendSyncTransaction(request *req) {
+  int cpt;
+  request *selectedReq;
+
+  // At least one transaction available -> must select one randomly
+  // First: count how many of them are available
+  // Then, select one
+  // Broadcast the new condition!
+
+  cpt = 0;
+  request* currentReq = req->syncChannel->inWaitQueue;
+  debugMsg("Execute send sync tr");
+
+  while(currentReq != NULL) {
+    cpt ++;
+    currentReq = currentReq->next;
+  }
+
+  cpt = random() % cpt;
+
+  // Head of the list?
+  selectedReq = req->syncChannel->inWaitQueue;
+  while (cpt > 0) {
+    selectedReq = selectedReq->next;
+    cpt --;
+  } 
+
+  // Remove all related request from list requests
+  //req->syncChannel->inWaitQueue = removeRequestFromList(req->syncChannel->inWaitQueue, selectedReq);
+  debugMsg("Setting related request");
+  req->relatedRequest = selectedReq;
+
+  // Select the selected request, and notify the information
+  selectedReq->selected = 1;
+  selectedReq->listOfRequests->selectedRequest = selectedReq;
+
+  // Handle parameters
+  copyParameters(req, selectedReq);
+
+  debugMsg("Signaling");
+  pthread_cond_signal(selectedReq->listOfRequests->wakeupCondition);
+
+  traceSynchroRequest(req, selectedReq);
+}
+
+void executeReceiveSyncTransaction(request *req) {
+  int cpt;
+  request *selectedReq;
+  
+  // At least one transaction available -> must select one randomly
+  // First: count how many of them are available
+  // Then, select one
+  // Broadcast the new condition!
+
+  request* currentReq = req->syncChannel->outWaitQueue;
+  cpt = 0;
+  debugMsg("Execute receive sync tr");
+
+  while(currentReq != NULL) {
+    cpt ++;
+    //debugInt("cpt", cpt);
+    currentReq = currentReq->next;
+  }
+  cpt = random() % cpt;
+  selectedReq = req->syncChannel->outWaitQueue;
+  while (cpt > 0) {
+    selectedReq = selectedReq->next;
+    cpt --;
+  } 
+
+  //req->syncChannel->outWaitQueue = removeRequestFromList(req->syncChannel->outWaitQueue, selectedReq);
+  debugMsg("Setting related request");
+  req->relatedRequest = selectedReq;
+
+  // Select the request, and notify the information in the channel
+  selectedReq->selected = 1;
+  selectedReq->listOfRequests->selectedRequest = selectedReq;
+
+  // Handle parameters
+  copyParameters(selectedReq, req);
+
+  debugMsg("Signaling");
+  pthread_cond_signal(selectedReq->listOfRequests->wakeupCondition);
+
+  traceSynchroRequest(selectedReq, req);
+}
+
+
+void executeSendAsyncTransaction(request *req) {
+  request *selectedReq;
+
+  // Full FIFO?
+  if (req->asyncChannel->currentNbOfMessages == req->asyncChannel->maxNbOfMessages) {
+    // Must remove the oldest  message
+    getAndRemoveOldestMessageFromAsyncChannel(req->asyncChannel);
+  }
+
+  addMessageToAsyncChannel(req->asyncChannel, req->msg);
+  
+  debugMsg("Signaling async write to all requests waiting ");
+  selectedReq = req->asyncChannel->inWaitQueue;
+  while (selectedReq != NULL) {
+    pthread_cond_signal(selectedReq->listOfRequests->wakeupCondition);
+    selectedReq = selectedReq->next;
+  }
+  debugMsg("Signaling done");
+
+  traceAsynchronousSendRequest(req);
+}
+
+void executeReceiveAsyncTransaction(request *req) {
+  int i;
+  request *selectedReq;
+
+  req->msg = getAndRemoveOldestMessageFromAsyncChannel(req->asyncChannel);
+    
+  selectedReq = req->asyncChannel->outWaitQueue;
+
+  // Must recopy parameters
+  for(i=0; i<req->nbOfParams; i++) {
+    *(req->params[i]) = req->msg->params[i];
+  }
+
+  traceAsynchronousReceiveRequest(req);
+
+  // unallocate message
+  destroyMessageWithParams(req->msg);
+
+  debugMsg("Signaling async read to all requests waiting ");
+  while (selectedReq != NULL) {
+    pthread_cond_signal(selectedReq->listOfRequests->wakeupCondition);
+    selectedReq = selectedReq->next;
+  }
+  debugMsg("Signaling done");
+}
+
+
+void executeSendBroadcastTransaction(request *req) {
+  int cpt;
+  request *tmpreq;
+
+  // At least one transaction available -> must select all of them
+  // but at most one per task
+  // Then, broadcast the new condition!
+
+  request* currentReq = req->syncChannel->inWaitQueue;
+  request* currentLastReq = req;
+  debugMsg("Execute broadcast sync tr");
+
+  
+  while(currentReq != NULL) {
+    tmpreq = hasIdenticalRequestInListOfSelectedRequests(currentReq, req->relatedRequest);
+    if (tmpreq != NULL) {
+      // Must select one of the two
+      // If =1, replace, otherwise, just do nothing
+      cpt = random() % 2;
+      if (cpt == 1) {
+	debugMsg("Replacing broadcast request");
+	req->relatedRequest = replaceInListOfSelectedRequests(tmpreq, currentReq, req->relatedRequest);
+	currentReq->listOfRequests->selectedRequest = currentReq;
+	copyParameters(req, currentReq);
+	currentReq->selected = 1;
+	currentLastReq = req;
+	while(currentLastReq->relatedRequest != NULL) {
+	  currentLastReq = currentLastReq->relatedRequest;
+	}
+      }
+    } else {
+      currentLastReq->relatedRequest = currentReq;
+      currentReq->relatedRequest = NULL;
+      currentReq->selected = 1;
+      currentReq->listOfRequests->selectedRequest = currentReq;
+      copyParameters(req, currentReq);
+      currentLastReq = currentReq;
+    }
+
+    currentReq = currentReq->next;
+    
+    debugInt("Nb of requests selected:", nbOfRelatedRequests(req));
+  }
+
+
+  debugMsg("Signaling");
+  currentReq = req->relatedRequest;
+  cpt = 0;
+  while(currentReq != NULL) {
+    cpt ++;
+    pthread_cond_signal(currentReq->listOfRequests->wakeupCondition);
+    traceSynchroRequest(req, currentReq);
+    currentReq = currentReq->relatedRequest;
+  }
+
+  debugInt("NUMBER of broadcast Requests", cpt);
+}
+
+
+int executable(setOfRequests *list, int nb) {
+  int cpt = 0;
+  //int index = 0;
+  request *req = list->head;
+  timespec ts;
+  int tsDone = 0;
+
+  debugMsg("Starting loop");
+
+  list->hasATimeRequest = 0;
+
+  while(req != NULL) {
+    if (!(req->delayElapsed)) {
+      if (req->hasDelay) {
+	// Is the delay elapsed???
+	debugTime("begin time of list of request", &list->startTime);
+	debugTime("start time of this request", &req->myStartTime);
+	if (tsDone == 0) {
+	  my_clock_gettime(&ts);
+	  debugTime("Current time", &ts);
+	  tsDone = 1;
+	}
+
+	if (isBefore(&ts, &(req->myStartTime)) == 1) {
+	  // Delay not elapsed
+	  debugMsg("---------t--------> delay NOT elapsed");
+	  if (list->hasATimeRequest == 0) {
+	    list->hasATimeRequest = 1;
+	    list->minTimeToWait.tv_nsec = req->myStartTime.tv_nsec;
+	    list->minTimeToWait.tv_sec = req->myStartTime.tv_sec;
+	  } else {
+	    minTime(&(req->myStartTime), &(list->minTimeToWait),&(list->minTimeToWait));
+	  }
+	}  else {
+	  // Delay elapsed
+	  debugMsg("---------t--------> delay elapsed");
+	  req->delayElapsed = 1;
+	}
+      } else {
+	req->delayElapsed = 1;
+      }
+    }
+    req = req->nextRequestInList;
+  }
+  
+  req = list->head;
+  while((req != NULL) && (cpt < nb)) {
+    req->executable = 0;
+    if (req->delayElapsed) {
+      if (req->type == SEND_SYNC_REQUEST) {
+	debugMsg("Send sync");
+
+	if (req->syncChannel->inWaitQueue != NULL) {
+	  debugMsg("Send sync executable");
+	  req->executable = 1;
+	  cpt ++;
+	}  else {
+	  debugMsg("Send sync not executable");
+	}
+	//index ++;
+      }
+
+      if (req->type == RECEIVE_SYNC_REQUEST) {
+	debugMsg("receive sync");
+	if (req->syncChannel->outWaitQueue != NULL) {
+	  req->executable = 1;
+	  cpt ++;
+	}
+	//index ++;
+      }
+
+      if (req->type == SEND_ASYNC_REQUEST) {
+	debugMsg("Send async");
+
+	if (!(req->asyncChannel->isBlocking)) {
+	  // Can always add a message -> executable
+	  debugMsg("Send async executable since non blocking");
+	  req->executable = 1;
+	  cpt ++;
+
+	  //blocking case ... channel full?
+	} else {
+	  if (req->asyncChannel->currentNbOfMessages < req->asyncChannel->maxNbOfMessages) {
+	    // Not full!
+	    debugMsg("Send async executable since channel not full");
+	    req->executable = 1;
+	    cpt ++;
+	  } else {
+	    debugMsg("Send async not executable: full, and channel is blocking");
+	  }
+	}
+      }
+
+      if (req->type == RECEIVE_ASYNC_REQUEST) {
+	debugMsg("receive async");
+	if (req->asyncChannel->currentNbOfMessages >0) {
+	  debugMsg("Receive async executable: not empty");
+	  req->executable = 1;
+	  cpt ++;
+	} else {
+	  debugMsg("Receive async not executable: empty");
+	}
+	//index ++;
+      }
+      
+
+      if (req->type == SEND_BROADCAST_REQUEST) {
+	debugMsg("send broadcast");
+	req->executable = 1;
+	cpt ++;
+      }
+
+      if (req->type == RECEIVE_BROADCAST_REQUEST) {
+	debugMsg("receive broadcast");
+	// A receive broadcast is never executable
+	req->executable = 0;
+	//index ++;
+      }
+
+      
+      
+
+      if (req->type == IMMEDIATE) {
+	debugMsg("immediate");
+	req->executable = 1;
+	cpt ++;
+      }
+    }
+
+    req = req->nextRequestInList;
+    
+  }
+
+  return cpt;
+}
+
+void private__makeRequestPending(setOfRequests *list) {
+  request *req = list->head;
+  while(req != NULL) {
+    if ((req->delayElapsed) && (!(req->alreadyPending))) {
+      if (req->type == SEND_SYNC_REQUEST) {
+	debugMsg("Adding pending request in outWaitqueue");
+	req->syncChannel->outWaitQueue = addToRequestQueue(req->syncChannel->outWaitQueue, req);
+	req->alreadyPending = 1;
+      }
+
+      if (req->type ==  RECEIVE_SYNC_REQUEST) {
+	debugMsg("Adding pending request in inWaitqueue");
+	req->alreadyPending = 1;
+	req->syncChannel->inWaitQueue = addToRequestQueue(req->syncChannel->inWaitQueue, req);
+      }
+
+      if (req->type == SEND_ASYNC_REQUEST) {
+	debugMsg("Adding pending request in outWaitqueue");
+	req->asyncChannel->outWaitQueue = addToRequestQueue(req->asyncChannel->outWaitQueue, req);
+	req->alreadyPending = 1;
+      }
+
+      if (req->type ==  RECEIVE_ASYNC_REQUEST) {
+	debugMsg("Adding pending request in inWaitqueue");
+	req->alreadyPending = 1;
+	req->asyncChannel->inWaitQueue = addToRequestQueue(req->asyncChannel->inWaitQueue, req);
+      }
+
+      if (req->type ==  RECEIVE_BROADCAST_REQUEST) {
+	debugMsg("Adding pending broadcast request in inWaitqueue");
+	req->alreadyPending = 1;
+	req->syncChannel->inWaitQueue = addToRequestQueue(req->syncChannel->inWaitQueue, req);
+      }
+
+      if (req->type ==  SEND_BROADCAST_REQUEST) {
+	debugMsg("Adding pending broadcast request in outWaitqueue");
+	req->alreadyPending = 1;
+	req->syncChannel->outWaitQueue = addToRequestQueue(req->syncChannel->outWaitQueue, req);
+      }
+      
+    }
+
+    req = req->nextRequestInList;
+  }
+}
+
+void private__makeRequest(request *req) {
+  if (req->type == SEND_SYNC_REQUEST) {
+    executeSendSyncTransaction(req);
+  }
+
+  if (req->type == RECEIVE_SYNC_REQUEST) {
+    executeReceiveSyncTransaction(req);
+  }
+
+  if (req->type == SEND_ASYNC_REQUEST) {
+    executeSendAsyncTransaction(req);
+  }
+
+  if (req->type == RECEIVE_ASYNC_REQUEST) {
+    executeReceiveAsyncTransaction(req);
+  }
+
+  if (req->type == SEND_BROADCAST_REQUEST) {
+    executeSendBroadcastTransaction(req);
+  }
+
+  // IMMEDIATE: Nothing to do
+  
+  // In all cases: remove other requests of the same list from their pending form
+  debugMsg("Removing original req");
+  removeAllPendingRequestsFromPendingLists(req, 1);
+  removeAllPendingRequestsFromPendingListsRelatedRequests(req);
+  /*if (req->relatedRequest != NULL) {
+    debugMsg("Removing related req");
+    removeAllPendingRequestsFromPendingLists(req->relatedRequest, 0);
+    }*/
+  
+}
+
+void removeAllPendingRequestsFromPendingListsRelatedRequests(request *req) {
+  if (req->relatedRequest != NULL) {
+    debugMsg("Removing related req");
+    removeAllPendingRequestsFromPendingLists(req->relatedRequest, 0);
+    // Recursive call
+    removeAllPendingRequestsFromPendingListsRelatedRequests(req->relatedRequest);
+  }
+}
+
+
+request *private__executeRequests0(setOfRequests *list, int nb) {
+  int howMany, found;
+  int selectedIndex, realIndex;
+  request *selectedReq;
+  request *req;
+  
+  // Compute which requests can be executed
+  debugMsg("Counting requests");
+  howMany = executable(list, nb);
+
+  debugInt("Counting requests=", howMany);
+
+  if (howMany == 0) {
+    debugMsg("No pending requests");
+    // Must make them pending
+    
+    private__makeRequestPending(list);
+
+    return NULL;
+  }
+  
+  debugInt("At least one pending request is executable", howMany);
+
+  
+  // Select a request
+  req = list->head;
+  selectedIndex = (rand() % howMany)+1;
+  debugInt("selectedIndex=", selectedIndex);
+  realIndex = 0;
+  found = 0;
+  while(req != NULL) {
+    if (req->executable == 1) {
+      found ++;
+      if (found == selectedIndex) {
+	break;
+      }
+    }
+    realIndex ++;
+    req = req->nextRequestInList;
+  }
+
+  debugInt("Getting request at index", realIndex);
+  selectedReq = getRequestAtIndex(list, realIndex);
+  selectedReq->selected = 1;
+  selectedReq->listOfRequests->selectedRequest = selectedReq;
+
+  debugInt("Selected request of type", selectedReq->type);
+
+  // Execute that request
+  private__makeRequest(selectedReq);
+
+  return selectedReq;  
+}
+
+
+request *private__executeRequests(setOfRequests *list) {
+  // Is a request already selected?
+
+  if (list->selectedRequest != NULL) {
+    return list->selectedRequest;
+  }
+
+  debugMsg("No request selected -> looking for one!");
+
+  return private__executeRequests0(list, nbOfRequests(list));
+}
+
+
+
+
+request *executeOneRequest(setOfRequests *list, request *req) {
+  req->nextRequestInList = NULL;
+  req->listOfRequests = list;
+  list->head = req;
+  return executeListOfRequests(list);
+}
+
+
+void setLocalStartTime(setOfRequests *list) {
+  request *req = list->head;
+
+  while(req != NULL) {
+    if (req->hasDelay) {
+      req->delayElapsed = 0;
+      addTime(&(list->startTime), &(req->delay), &(req->myStartTime));
+      debug2Msg(list->owner, " -----t------>: Request with delay");
+    } else {
+      req->delayElapsed = 1;
+      req->myStartTime.tv_nsec = list->startTime.tv_nsec;
+      req->myStartTime.tv_sec = list->startTime.tv_sec;
+    }
+    req = req->nextRequestInList;
+  }
+}
+
+
+// Return the executed request
+request *executeListOfRequests(setOfRequests *list) {
+  request *req;
+
+  my_clock_gettime(&list->startTime);
+  list->selectedRequest = NULL;
+  setLocalStartTime(list);
+  
+  // Try to find a request that could be executed
+  debug2Msg(list->owner, "Locking mutex");
+  pthread_mutex_lock(list->mutex);
+  debug2Msg(list->owner, "Mutex locked");
+
+  debug2Msg(list->owner, "Going to execute request");
+
+  while((req = private__executeRequests(list)) == NULL) {
+    debug2Msg(list->owner, "Waiting for request!");
+    if (list->hasATimeRequest == 1) {
+      debug2Msg(list->owner, "Waiting for a request and at most for a given time");
+      debugTime("Min time to wait=", &(list->minTimeToWait));
+      pthread_cond_timedwait(list->wakeupCondition, list->mutex, &(list->minTimeToWait));
+    } else {
+      debug2Msg(list->owner, "Releasing mutex");
+      pthread_cond_wait(list->wakeupCondition, list->mutex);
+    }
+    debug2Msg(list->owner, "Waking up for requests! -> getting mutex");
+  }
+
+  debug2Msg(list->owner, "Request selected!");
+
+  my_clock_gettime(&list->completionTime);
+
+  pthread_mutex_unlock(list->mutex); 
+  debug2Msg(list->owner, "Mutex unlocked");
+  return req;
+}
+
diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/request_manager.h b/modeling/Blinking.ttool/AVATAR_executablecode/src/request_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..e2ae0f800025b9394d6488c012b47f7396aaf609
--- /dev/null
+++ b/modeling/Blinking.ttool/AVATAR_executablecode/src/request_manager.h
@@ -0,0 +1,14 @@
+#ifndef REQUEST_MANAGER_H
+#define REQUEST_MANAGER_H
+
+
+#include "request.h"
+#include "syncchannel.h"
+
+
+request *executeOneRequest(setOfRequests *list, request *req);
+request *executeListOfRequests(setOfRequests *list);
+
+void removeAllPendingRequestsFromPendingListsRelatedRequests(request *req);
+
+#endif
diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/syncchannel.c b/modeling/Blinking.ttool/AVATAR_executablecode/src/syncchannel.c
new file mode 100644
index 0000000000000000000000000000000000000000..e1c90875f2574a15318facbda32b27f918f82592
--- /dev/null
+++ b/modeling/Blinking.ttool/AVATAR_executablecode/src/syncchannel.c
@@ -0,0 +1,41 @@
+#include <stdlib.h>
+
+
+#include "syncchannel.h"
+#include "request.h"
+#include "myerrors.h"
+#include "debug.h"
+
+
+syncchannel *getNewSyncchannel(char *outname, char *inname) {
+  syncchannel * syncch = (syncchannel *)(malloc(sizeof(struct syncchannel)));
+  if (syncch == NULL) {
+    criticalError("Allocation of request failed");
+  }
+  syncch->inname = inname;
+  syncch->outname = outname;
+  syncch->inWaitQueue = NULL;
+  syncch->outWaitQueue = NULL;
+  syncch->isBroadcast = false;
+  return syncch;
+}
+
+void setBroadcast(syncchannel *syncch, bool b) {
+  syncch->isBroadcast = b;
+}
+
+
+
+/*request *makeNewSendSync(int hasDelay, long delay, int nbOfParams, int *params[]) {
+  request *req = getNewRequest(SEND_SYNC_REQUEST, hasDelay, delay, nbOfParams, params);
+  return req;
+}
+
+request *makeNewReceiveSync(int hasDelay, long delay, int nbOfParams, int *params[]) {
+  request *req = getNewRequest(RECEIVE_SYNC_REQUEST, hasDelay, delay, nbOfParams, params);
+  return req;
+  }*/
+
+void destroySyncchannel(syncchannel *syncch) {
+  free(syncch);
+}
diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/syncchannel.h b/modeling/Blinking.ttool/AVATAR_executablecode/src/syncchannel.h
new file mode 100644
index 0000000000000000000000000000000000000000..6f4f92de5531f14c36b7d520992eb3decb305cdd
--- /dev/null
+++ b/modeling/Blinking.ttool/AVATAR_executablecode/src/syncchannel.h
@@ -0,0 +1,27 @@
+#ifndef SYNCCHANNEL_H
+#define SYNCCHANNEL_H
+
+struct syncchannel;
+
+#include "request.h"
+#include "defs.h"
+
+struct syncchannel {
+  char *outname;
+  char *inname;
+  struct request* inWaitQueue;
+  struct request* outWaitQueue; 
+  bool isBroadcast;
+};
+
+typedef struct syncchannel syncchannel;
+
+
+void setBroadcast(syncchannel *syncch, bool b);
+syncchannel *getNewSyncchannel(char *inname, char *outname);
+//request *makeNewSendSync(int hasDelay, long delay, int nbOfParams, int *params[]);
+//request *makeNewReceiveSync(int hasDelay, long delay, int nbOfParams, int *params[]);
+void destroySyncchannel(syncchannel *syncch);
+
+
+#endif
diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/tracemanager.c b/modeling/Blinking.ttool/AVATAR_executablecode/src/tracemanager.c
new file mode 100644
index 0000000000000000000000000000000000000000..fda3a0db1c76a9861708dd422c2cea7f180688b0
--- /dev/null
+++ b/modeling/Blinking.ttool/AVATAR_executablecode/src/tracemanager.c
@@ -0,0 +1,304 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <time.h>
+
+#include "tracemanager.h"
+#include "debug.h"
+#include "mytimelib.h"
+
+
+#define TRACE_OFF 0
+#define TRACE_IN_FILE 1
+#define TRACE_IN_CONSOLE 2
+
+#define TRACE_FILE_NAME "Trace.txt"
+
+
+pthread_mutex_t __traceMutex;
+
+int trace = TRACE_OFF;
+int id = 0;
+
+FILE *file;
+
+struct timespec begints;
+
+
+void addInfo(char *dest, char *info) {
+  //char s1[10];
+  long tmp;
+  //long tmp1;
+  //int i;
+  struct timespec ts, ts1;
+  my_clock_gettime(&ts);
+  
+  debugMsg("DIFF TIME");
+  diffTime(&begints, &ts, &ts1);
+
+  tmp = ts1.tv_nsec;
+
+  if (tmp < 0) {
+    tmp = -tmp;
+  }
+
+  /*tmp1 = 100000000;
+
+  for(i=0; i<9; i++) {
+    s1[i] = 48 + (tmp / tmp1);
+    tmp = tmp % tmp1;
+    tmp1 = tmp1 / 10;
+    }
+    s1[9] = '\0';*/
+  
+  /* s1 -> tmp */
+  sprintf(dest, "#%d time=%ld.%09ld %s", id, ts1.tv_sec, tmp, info);
+  id ++;
+}
+
+
+void writeInTrace(char *info) {
+  pthread_mutex_lock(&__traceMutex);
+  char s[CHAR_ALLOC_SIZE];
+  addInfo(s, info);
+		 //printf("Write in file\n");
+  switch(trace){
+  case TRACE_IN_FILE:
+    if (file != NULL) {
+      debug2Msg("Saving in file", s);
+      fprintf(file, s);
+      fflush(file);
+    }
+    break;
+  case TRACE_IN_CONSOLE:
+    printf("%s\n", s);
+    break;
+  }
+  
+  pthread_mutex_unlock(&__traceMutex);
+}
+
+
+void activeTracingInFile(char *fileName) {
+  char *name;
+  trace = TRACE_IN_FILE;
+  my_clock_gettime(&begints); 
+  if (fileName == NULL) {
+    name = TRACE_FILE_NAME;
+  } else {
+    name  = fileName;
+  }
+  file = fopen(name,"w");
+
+  /* Initializing mutex */
+  if (pthread_mutex_init(&__traceMutex, NULL) < 0) { exit(-1);}
+}
+
+void activeTracingInConsole() {
+  trace = TRACE_IN_CONSOLE;
+  my_clock_gettime(&begints); 
+  
+  /* Initializing mutex */
+  if (pthread_mutex_init(&__traceMutex, NULL) < 0) { exit(-1);}
+}
+
+void unactiveTracing() {
+  trace = TRACE_OFF;
+}
+
+
+void traceStateEntering(char *myname, char *statename) {
+  char s[CHAR_ALLOC_SIZE];
+
+  debugMsg("Trace function");
+
+  if (trace == TRACE_OFF) {
+    return;
+  }
+
+  sprintf(s, "block=%s type=state_entering state=%s\n", myname, statename);
+
+  // Saving trace
+  writeInTrace(s);
+}
+
+void traceFunctionCall(char *block, char *func, char *params) {
+  char s[CHAR_ALLOC_SIZE];
+
+  debugMsg("Trace function");
+
+  if (trace == TRACE_OFF) {
+    return;
+  }
+
+  sprintf(s, "block=%s type=function_call func=%s parameters=%s\n", block, func, params);
+
+  // Saving trace
+  writeInTrace(s);
+}
+
+
+// type=0: int type = 1:bool
+void traceVariableModification(char *block, char *var, int value, int type) {
+  char s[CHAR_ALLOC_SIZE];
+  debugMsg("Trace variable modification");
+
+  if (trace == TRACE_OFF) {
+    return;
+  }
+
+  
+  if (type == 0) {
+    sprintf(s, "block=%s type=variable_modification variable=%s setTo=%d\n", block, var, value);
+  }
+
+  if (type == 1) {
+    if (value == 0) {
+      sprintf(s, "block=%s type=variable_modification variable=%s setTo=false\n", block, var);
+    } else {
+      sprintf(s, "block=%s type=variable_modification variable=%s setTo=true\n", block, var);
+    }
+  }
+
+  // Saving trace
+  writeInTrace(s);
+
+}
+
+void traceSynchroRequest(request *from, request *to) {
+  char s[1024];
+  int i;
+
+  if (trace == TRACE_OFF) {
+    return;
+  }
+
+  sprintf(s, "block=%s blockdestination=%s type=synchro channel=%s params=", from->listOfRequests->owner, to->listOfRequests->owner, from->syncChannel->outname);
+  for(i=0; i<from->nbOfParams; i++) {
+    if (i>0) {
+      sprintf(s, "%s,", s);
+    }
+    sprintf(s, "%s%d", s, *(from->params[i]));
+  }
+  sprintf(s, "%s\n", s);
+
+  debugMsg("Trace request synchro");
+  
+
+  // Saving trace
+  writeInTrace(s);
+}
+
+
+void traceAsynchronousSendRequest(request *req) {
+  char s[1024];
+  int i;
+
+  if (trace == TRACE_OFF) {
+    return;
+  }
+
+  sprintf(s, "block=%s type=send_async channel=%s msgid=%ld params=", req->listOfRequests->owner, req->asyncChannel->outname, req->msg->id);
+  if (req->msg != NULL) {
+    debugMsg("Computing params");
+    for(i=0; i<req->msg->nbOfParams; i++) {
+      if (i>0) {
+	sprintf(s, "%s,", s);
+      }
+      sprintf(s, "%s%d", s, req->msg->params[i]);
+    }
+  }
+  sprintf(s, "%s\n", s);
+
+  
+
+  // Saving trace
+  writeInTrace(s);
+}
+
+
+void traceAsynchronousReceiveRequest(request *req) {
+  char s[1024];
+  int i;
+
+  if (trace == TRACE_OFF) {
+    return;
+  }
+
+  sprintf(s, "block=%s type=receive_async channel=%s msgid=%ld params=", req->listOfRequests->owner, req->asyncChannel->outname, req->msg->id);
+  if (req->msg != NULL) {
+    debugMsg("Computing params");
+    for(i=0; i<req->msg->nbOfParams; i++) {
+      if (i>0) {
+	sprintf(s, "%s,", s);
+      }
+      sprintf(s, "%s%d", s, req->msg->params[i]);
+    }
+  }
+  sprintf(s, "%s\n", s);
+
+  
+
+  // Saving trace
+  writeInTrace(s);
+}
+
+
+
+void traceRequest(char *myname, request *req) {
+  char s[1024];
+  int i;
+ 
+
+  debugMsg("Trace request");
+
+
+  if (trace == TRACE_OFF) {
+    return;
+  }
+
+  // Build corresponding char*;
+
+  switch(req->type) {
+    case SEND_SYNC_REQUEST:
+    debug2Msg("Sync channel", req->syncChannel->outname);
+    sprintf(s, "block=%s type=send_synchro channel=%s params=", myname, req->syncChannel->outname);
+    for(i=0; i<req->nbOfParams; i++) {
+      if (i>0) {
+	sprintf(s, "%s,", s);
+      }
+      sprintf(s, "%s%d", s, *(req->params[i]));
+    }
+    sprintf(s, "%s\n", s);
+ 
+    break;
+  case RECEIVE_SYNC_REQUEST:
+    sprintf(s, "block=%s type=receive_synchro channel=%s\n", myname, req->syncChannel->inname);
+    break;
+    case SEND_ASYNC_REQUEST:
+    debug2Msg("Async channel", req->asyncChannel->outname);
+    sprintf(s, "block=%s type=send_async_2 channel=%s\n", myname, req->asyncChannel->outname);
+    break;
+  case RECEIVE_ASYNC_REQUEST:
+    sprintf(s, "block=%s type=receive_async_2 channel=%s\n", myname, req->asyncChannel->inname);
+    break;
+   case SEND_BROADCAST_REQUEST:
+    debug2Msg("Sync channel", req->syncChannel->outname);
+    sprintf(s, "block=%s type=send_broadcast channel=%s\n", myname, req->syncChannel->outname);
+    break; 
+   case RECEIVE_BROADCAST_REQUEST:
+    debug2Msg("Sync channel", req->syncChannel->outname);
+    sprintf(s, "block=%s type=receive_broadcast channel=%s\n", myname, req->syncChannel->outname);
+    break; 
+   case IMMEDIATE:
+     sprintf(s, "block=%s type=action\n", myname);
+    break;
+  default:
+    sprintf(s, "block=%s type=unknown\n", myname);
+  }
+
+  debugMsg("Trace request 2");
+  
+
+  // Saving trace
+  writeInTrace(s);
+}
diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/tracemanager.h b/modeling/Blinking.ttool/AVATAR_executablecode/src/tracemanager.h
new file mode 100644
index 0000000000000000000000000000000000000000..d33f3532a4bcb9fc7b96ddda00bcfee9cfb2a4bc
--- /dev/null
+++ b/modeling/Blinking.ttool/AVATAR_executablecode/src/tracemanager.h
@@ -0,0 +1,21 @@
+#ifndef TRACEMANAGER_H
+#define TRACEMANAGER_H
+
+#include "request.h"
+
+#define CHAR_ALLOC_SIZE 1024
+
+
+void activeTracingInFile();
+void unactiveTracing();
+void traceRequest(char *myname, request *req);
+void traceFunctionCall(char *block, char *func, char* params);
+void traceVariableModification(char *block, char *var, int value, int type); // type=0: int type = 1:bool
+void traceStateEntering(char *myname, char *statename);
+void traceSynchroRequest(request *from, request *to);
+void traceAsynchronousSendRequest(request *req);
+void traceAsynchronousReceiveRequest(request *req);
+
+#endif
+
+
diff --git a/modeling/Blinking.ttool/Blinking.xml b/modeling/Blinking.ttool/Blinking.xml
new file mode 100644
index 0000000000000000000000000000000000000000..6f600dde5cce92b421447cb49885f49c6fb61683
--- /dev/null
+++ b/modeling/Blinking.ttool/Blinking.xml
@@ -0,0 +1,339 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<TURTLEGMODELING version="1.0beta">
+
+<Modeling type="AVATAR Design" nameTab="Design" >
+<AVATARBlockDiagramPanel name="Block Diagram" minX="10" maxX="2500" minY="10" maxY="1500" zoom="1.0" >
+<MainCode value="void __user_init() {"/>
+<MainCode value="}"/>
+<Optimized value="true" />
+<Validated value="MainBlock;" />
+<Ignored value="" />
+
+<COMPONENT type="5000" id="25" >
+<cdparam x="194" y="62" />
+<sizeparam width="250" height="200" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Block0" value="MainBlock" />
+<TGConnectingPoint num="0" id="1" />
+<TGConnectingPoint num="1" id="2" />
+<TGConnectingPoint num="2" id="3" />
+<TGConnectingPoint num="3" id="4" />
+<TGConnectingPoint num="4" id="5" />
+<TGConnectingPoint num="5" id="6" />
+<TGConnectingPoint num="6" id="7" />
+<TGConnectingPoint num="7" id="8" />
+<TGConnectingPoint num="8" id="9" />
+<TGConnectingPoint num="9" id="10" />
+<TGConnectingPoint num="10" id="11" />
+<TGConnectingPoint num="11" id="12" />
+<TGConnectingPoint num="12" id="13" />
+<TGConnectingPoint num="13" id="14" />
+<TGConnectingPoint num="14" id="15" />
+<TGConnectingPoint num="15" id="16" />
+<TGConnectingPoint num="16" id="17" />
+<TGConnectingPoint num="17" id="18" />
+<TGConnectingPoint num="18" id="19" />
+<TGConnectingPoint num="19" id="20" />
+<TGConnectingPoint num="20" id="21" />
+<TGConnectingPoint num="21" id="22" />
+<TGConnectingPoint num="22" id="23" />
+<TGConnectingPoint num="23" id="24" />
+<extraparam>
+<blockType data="block" color="-4072719" />
+<CryptoBlock value="false" />
+<Attribute access="0" id="period" value="2" type="8" typeOther="" />
+<Attribute access="0" id="x" value="0" type="8" typeOther="" />
+<Method value="$LED1on()" />
+<Method value="$LED1off(int x)" />
+<globalCode value="DigitalOut myled1(LED1);" />
+<globalCode value="" />
+<globalCode value="void __userImplemented__MainBlock__LED1on() {" />
+<globalCode value=" myled1 = 1;" />
+<globalCode value=" printf(&quot;Led1 on.\n&quot;);" />
+<globalCode value="}" />
+<globalCode value="void __userImplemented__MainBlock__LED1off(int val){" />
+<globalCode value=" myled1 = 0;" />
+<globalCode value=" printf(&quot;Led1 off.\n&quot;);" />
+<globalCode value=" printf(&quot;value of x=%d\n&quot;,val);" />
+<globalCode value="}" />
+</extraparam>
+</COMPONENT>
+
+
+</AVATARBlockDiagramPanel>
+
+<AVATARStateMachineDiagramPanel name="MainBlock" minX="10" maxX="2500" minY="10" maxY="1500" >
+<CONNECTOR type="5102" id="36" >
+<cdparam x="487" y="358" />
+<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="33" />
+<TGConnectingPoint num="1" id="34" />
+<TGConnectingPoint num="2" id="35" />
+<P1  x="487" y="358" id="86" />
+<P2  x="487" y="177" id="124" />
+<Point x="653" y="359" />
+<Point x="646" y="185" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="26" >
+<father id="36" num="0" />
+<cdparam x="653" y="359" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="27" >
+<father id="36" num="1" />
+<cdparam x="646" y="185" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="32" >
+<father id="36" num="2" />
+<cdparam x="658" y="253" />
+<sizeparam width="123" height="45" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="28" />
+<TGConnectingPoint num="1" id="29" />
+<TGConnectingPoint num="2" id="30" />
+<TGConnectingPoint num="3" id="31" />
+<extraparam>
+<guard value="[ else ]" enabled="true"/>
+<afterMin value="period" enabled="true"/>
+<afterMax value="period" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+<actions value="LED1on()" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="43" >
+<cdparam x="415" y="209" />
+<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="42" />
+<P1  x="415" y="209" id="107" />
+<P2  x="415" y="327" id="61" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="41" >
+<father id="43" num="0" />
+<cdparam x="415" y="267" />
+<sizeparam width="123" height="45" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="37" />
+<TGConnectingPoint num="1" id="38" />
+<TGConnectingPoint num="2" id="39" />
+<TGConnectingPoint num="3" id="40" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="period" enabled="true"/>
+<afterMax value="period" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+<actions value="x = x + 1" enabled="true"/>
+<actions value="LED1off(x)" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="50" >
+<cdparam x="407" y="70" />
+<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="49" />
+<P1  x="407" y="70" id="142" />
+<P2  x="396" y="159" id="118" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="48" >
+<father id="50" num="0" />
+<cdparam x="411" y="89" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="44" />
+<TGConnectingPoint num="1" id="45" />
+<TGConnectingPoint num="2" id="46" />
+<TGConnectingPoint num="3" id="47" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="57" >
+<cdparam x="432" y="377" />
+<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="56" />
+<P1  x="432" y="377" id="90" />
+<P2  x="427" y="453" id="58" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="55" >
+<father id="57" num="0" />
+<cdparam x="429" y="416" />
+<sizeparam width="64" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="51" />
+<TGConnectingPoint num="1" id="52" />
+<TGConnectingPoint num="2" id="53" />
+<TGConnectingPoint num="3" id="54" />
+<extraparam>
+<guard value="[ x &gt;10 ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<COMPONENT type="5101" id="59" >
+<cdparam x="417" y="458" />
+<sizeparam width="20" height="20" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="stop state" value="null" />
+<TGConnectingPoint num="0" id="58" />
+</COMPONENT>
+
+<COMPONENT type="5106" id="100" >
+<cdparam x="344" y="327" />
+<sizeparam width="143" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="State" value="Led1off" />
+<TGConnectingPoint num="0" id="60" />
+<TGConnectingPoint num="1" id="61" />
+<TGConnectingPoint num="2" id="62" />
+<TGConnectingPoint num="3" id="63" />
+<TGConnectingPoint num="4" id="64" />
+<TGConnectingPoint num="5" id="65" />
+<TGConnectingPoint num="6" id="66" />
+<TGConnectingPoint num="7" id="67" />
+<TGConnectingPoint num="8" id="68" />
+<TGConnectingPoint num="9" id="69" />
+<TGConnectingPoint num="10" id="70" />
+<TGConnectingPoint num="11" id="71" />
+<TGConnectingPoint num="12" id="72" />
+<TGConnectingPoint num="13" id="73" />
+<TGConnectingPoint num="14" id="74" />
+<TGConnectingPoint num="15" id="75" />
+<TGConnectingPoint num="16" id="76" />
+<TGConnectingPoint num="17" id="77" />
+<TGConnectingPoint num="18" id="78" />
+<TGConnectingPoint num="19" id="79" />
+<TGConnectingPoint num="20" id="80" />
+<TGConnectingPoint num="21" id="81" />
+<TGConnectingPoint num="22" id="82" />
+<TGConnectingPoint num="23" id="83" />
+<TGConnectingPoint num="24" id="84" />
+<TGConnectingPoint num="25" id="85" />
+<TGConnectingPoint num="26" id="86" />
+<TGConnectingPoint num="27" id="87" />
+<TGConnectingPoint num="28" id="88" />
+<TGConnectingPoint num="29" id="89" />
+<TGConnectingPoint num="30" id="90" />
+<TGConnectingPoint num="31" id="91" />
+<TGConnectingPoint num="32" id="92" />
+<TGConnectingPoint num="33" id="93" />
+<TGConnectingPoint num="34" id="94" />
+<TGConnectingPoint num="35" id="95" />
+<TGConnectingPoint num="36" id="96" />
+<TGConnectingPoint num="37" id="97" />
+<TGConnectingPoint num="38" id="98" />
+<TGConnectingPoint num="39" id="99" />
+<extraparam>
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="5106" id="141" >
+<cdparam x="344" y="159" />
+<sizeparam width="143" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="State" value="Led1on" />
+<TGConnectingPoint num="0" id="101" />
+<TGConnectingPoint num="1" id="102" />
+<TGConnectingPoint num="2" id="103" />
+<TGConnectingPoint num="3" id="104" />
+<TGConnectingPoint num="4" id="105" />
+<TGConnectingPoint num="5" id="106" />
+<TGConnectingPoint num="6" id="107" />
+<TGConnectingPoint num="7" id="108" />
+<TGConnectingPoint num="8" id="109" />
+<TGConnectingPoint num="9" id="110" />
+<TGConnectingPoint num="10" id="111" />
+<TGConnectingPoint num="11" id="112" />
+<TGConnectingPoint num="12" id="113" />
+<TGConnectingPoint num="13" id="114" />
+<TGConnectingPoint num="14" id="115" />
+<TGConnectingPoint num="15" id="116" />
+<TGConnectingPoint num="16" id="117" />
+<TGConnectingPoint num="17" id="118" />
+<TGConnectingPoint num="18" id="119" />
+<TGConnectingPoint num="19" id="120" />
+<TGConnectingPoint num="20" id="121" />
+<TGConnectingPoint num="21" id="122" />
+<TGConnectingPoint num="22" id="123" />
+<TGConnectingPoint num="23" id="124" />
+<TGConnectingPoint num="24" id="125" />
+<TGConnectingPoint num="25" id="126" />
+<TGConnectingPoint num="26" id="127" />
+<TGConnectingPoint num="27" id="128" />
+<TGConnectingPoint num="28" id="129" />
+<TGConnectingPoint num="29" id="130" />
+<TGConnectingPoint num="30" id="131" />
+<TGConnectingPoint num="31" id="132" />
+<TGConnectingPoint num="32" id="133" />
+<TGConnectingPoint num="33" id="134" />
+<TGConnectingPoint num="34" id="135" />
+<TGConnectingPoint num="35" id="136" />
+<TGConnectingPoint num="36" id="137" />
+<TGConnectingPoint num="37" id="138" />
+<TGConnectingPoint num="38" id="139" />
+<TGConnectingPoint num="39" id="140" />
+<extraparam>
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="5100" id="143" >
+<cdparam x="400" y="50" />
+<sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="start state" value="null" />
+<TGConnectingPoint num="0" id="142" />
+</COMPONENT>
+
+
+</AVATARStateMachineDiagramPanel>
+
+</Modeling>
+
+
+
+
+</TURTLEGMODELING>
\ No newline at end of file
diff --git a/modeling/Blinking.ttool/project_config.xml b/modeling/Blinking.ttool/project_config.xml
new file mode 100644
index 0000000000000000000000000000000000000000..af16091e2363455364258ba7c54cec415551f2c0
--- /dev/null
+++ b/modeling/Blinking.ttool/project_config.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<PROJECTCONFIGURATION>
+<LastVCD data=""/>
+<LastOpenDiagram tab="0" panel="0"/>
+</PROJECTCONFIGURATION>
diff --git a/modeling/BlinkingLed.ttool/.DS_Store b/modeling/BlinkingLed.ttool/.DS_Store
index 86e029c283cfdd36d9dad05e53560239b9f0b815..733a46fccde2ef836ce1efa4ccb390d6ee48015a 100644
Binary files a/modeling/BlinkingLed.ttool/.DS_Store and b/modeling/BlinkingLed.ttool/.DS_Store differ
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/.DS_Store b/modeling/BlinkingLed.ttool/AVATAR_executablecode/.DS_Store
index 1d43dbea19ceaaca3606ae8033c1c744b4825c6b..e822ab9a1ee9a6b5f6026f365d62f62222f636d2 100644
Binary files a/modeling/BlinkingLed.ttool/AVATAR_executablecode/.DS_Store and b/modeling/BlinkingLed.ttool/AVATAR_executablecode/.DS_Store differ
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/Makefile.soclib b/modeling/BlinkingLed.ttool/AVATAR_executablecode/Makefile.soclib
index b2a6f0d8913ce4791dee7973b2ffbbe40ddb455b..aa40bd7d2e96f87549605fe56c635b5f61c539eb 100644
--- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/Makefile.soclib
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/Makefile.soclib
@@ -1 +1 @@
-objs = main.o MainBlock.o 
\ No newline at end of file
+objs = main.o SecondaryBlock.o MainBlock.o 
\ No newline at end of file
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/Makefile.src b/modeling/BlinkingLed.ttool/AVATAR_executablecode/Makefile.src
index f7056e9b6293cd43780de9e63c2614df674f1fcb..2f6da4749f31f01213975afcd9629e735529dbb5 100644
--- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/Makefile.src
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/Makefile.src
@@ -1 +1 @@
-SRCS = generated_src/main.c generated_src/MainBlock.c 
\ No newline at end of file
+SRCS = generated_src/main.c generated_src/SecondaryBlock.c generated_src/MainBlock.c 
\ No newline at end of file
diff --git a/executablecode/src_MBED/.DS_Store b/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/.DS_Store
similarity index 100%
rename from executablecode/src_MBED/.DS_Store
rename to modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/.DS_Store
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/MainBlock.c b/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/MainBlock.c
new file mode 100644
index 0000000000000000000000000000000000000000..6d312505b8abdea09bb61a88732def3f254d47a0
--- /dev/null
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/MainBlock.c
@@ -0,0 +1,150 @@
+#include "MainBlock.h"
+
+
+// Header code defined in the model
+DigitalOut myled1(LED1);
+
+void __userImplemented__MainBlock__LED1on() {
+   myled1 = 1;
+   printf("Led1 on.\n");
+}
+void __userImplemented__MainBlock__LED1off(int val){
+   myled1 = 0;
+   printf("Led1 off.\n");
+   printf("value of x=%d\n",val);
+}
+
+// End of header code defined in the model
+
+#define STATE__START__STATE 0
+#define STATE__Waiting_For_Value 1
+#define STATE__choice__0 2
+#define STATE__Led1On 3
+#define STATE__Led1Off 4
+#define STATE__STOP__STATE 5
+
+void MainBlock__LED1on() {
+  traceFunctionCall("MainBlock", "LED1on", "-");
+  __userImplemented__MainBlock__LED1on();
+}
+
+
+void MainBlock__LED1off(int x) {
+  char my__attr[CHAR_ALLOC_SIZE];
+  sprintf(my__attr, "%d",x);
+  traceFunctionCall("MainBlock", "LED1off", my__attr);
+  __userImplemented__MainBlock__LED1off(x);
+}
+
+
+void *mainFunc__MainBlock(void *arg){
+  int period = 2;
+  int x = 0;
+  int currentRand = 0;
+  
+  int __currentState = STATE__START__STATE;
+  __attribute__((unused)) request __req0;
+  __attribute__((unused))int *__params0[1];
+  __attribute__((unused)) request __req1;
+  __attribute__((unused))int *__params1[1];
+  __attribute__((unused))setOfRequests __list;
+  __attribute__((unused))pthread_cond_t __myCond;
+  __attribute__((unused))request *__returnRequest;
+  
+  char * __myname = (char *)arg;
+  
+  pthread_cond_init(&__myCond, NULL);
+  
+  fillListOfRequests(&__list, __myname, &__myCond, &__mainMutex);
+  //printf("my name = %s\n", __myname);
+  
+  /* Main loop on states */
+  while(__currentState != STATE__STOP__STATE) {
+    switch(__currentState) {
+      case STATE__START__STATE: 
+      traceStateEntering(__myname, "__StartState");
+      __currentState = STATE__Waiting_For_Value;
+      break;
+      
+      case STATE__Waiting_For_Value: 
+      traceStateEntering(__myname, "Waiting_For_Value");
+      __params0[0] = &currentRand;
+      makeNewRequest(&__req0, 281, RECEIVE_SYNC_REQUEST, 0, 0, 0, 1, __params0);
+      __req0.syncChannel = &__MainBlock_RandVal__SecondaryBlock_RanVal;
+      __returnRequest = executeOneRequest(&__list, &__req0);
+      clearListOfRequests(&__list);
+      traceRequest(__myname, __returnRequest);
+      __currentState = STATE__choice__0;
+      break;
+      
+      case STATE__choice__0: 
+      traceStateEntering(__myname, "choice__0");
+      if (!(currentRand > 5)) {
+        makeNewRequest(&__req0, 286, IMMEDIATE, 0, 0, 0, 0, __params0);
+        addRequestToList(&__list, &__req0);
+      }
+      if (currentRand > 5) {
+        makeNewRequest(&__req1, 291, IMMEDIATE, 0, 0, 0, 0, __params1);
+        addRequestToList(&__list, &__req1);
+      }
+      if (nbOfRequests(&__list) == 0) {
+        debug2Msg(__myname, "No possible request");
+        __currentState = STATE__STOP__STATE;
+        break;
+      }
+      __returnRequest = executeListOfRequests(&__list);
+      clearListOfRequests(&__list);
+      traceRequest(__myname, __returnRequest);
+       if (__returnRequest == &__req0) {
+        __currentState = STATE__Waiting_For_Value;
+        
+      }
+      else  if (__returnRequest == &__req1) {
+        __currentState = STATE__Led1On;
+        
+      }
+      break;
+      
+      case STATE__Led1On: 
+      traceStateEntering(__myname, "Led1On");
+      waitFor((period)*1000000, (period)*1000000);
+      x = x+1;
+      traceVariableModification("MainBlock", "x", x,0);
+      MainBlock__LED1off(x);
+      __currentState = STATE__Led1Off;
+      break;
+      
+      case STATE__Led1Off: 
+      traceStateEntering(__myname, "Led1Off");
+      if (!(x > 10)) {
+        makeNewRequest(&__req0, 287, IMMEDIATE, 1, (period)*1000000, (period)*1000000, 0, __params0);
+        addRequestToList(&__list, &__req0);
+      }
+      if (x > 10) {
+        makeNewRequest(&__req1, 305, IMMEDIATE, 0, 0, 0, 0, __params1);
+        addRequestToList(&__list, &__req1);
+      }
+      if (nbOfRequests(&__list) == 0) {
+        debug2Msg(__myname, "No possible request");
+        __currentState = STATE__STOP__STATE;
+        break;
+      }
+      __returnRequest = executeListOfRequests(&__list);
+      clearListOfRequests(&__list);
+      traceRequest(__myname, __returnRequest);
+       if (__returnRequest == &__req0) {
+        __currentState = STATE__Waiting_For_Value;
+        
+      }
+      else  if (__returnRequest == &__req1) {
+        __currentState = STATE__STOP__STATE;
+        
+      }
+      break;
+      
+    }
+  }
+  //printf("Exiting = %s\n", __myname);
+  return NULL;
+}
+
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/MainBlock.cpp b/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/MainBlock.cpp
index a42de1469bfd578cb1f3ae64e86653b7a47dd460..4c74846ea81a681f6ea48065cd949731b04b4cbd 100644
--- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/MainBlock.cpp
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/MainBlock.cpp
@@ -3,58 +3,141 @@
 
 // Header code defined in the model
 DigitalOut myled1(LED1);
-DigitalOut myled2(LED2);
 
-void __userImplemented__MainBlock__LED1onLED2off() {
-  	myled1 = 1;
-  	myled2 = 0;
-  	printf("Led1 encendido y Led2 apagado.\n");
+void __userImplemented__MainBlock__LED1on() {
+   myled1 = 1;
+   printf("Led1 on.\n");
 }
-void __userImplemented__MainBlock__LED1offLED2on(){
-  	myled1 = 0;
-  	myled2 = 1;
-  	printf("Led1 apagado y Led2 encendido.\n");
+void __userImplemented__MainBlock__LED1off(int val){
+   myled1 = 0;
+   printf("Led1 off.\n");
+   printf("value of x=%d\n",val);
 }
 
 // End of header code defined in the model
 
 #define STATE__START__STATE 0
-#define STATE__Led1onLed2off 1
-#define STATE__Led1offLed2on 2
-#define STATE__STOP__STATE 3
+#define STATE__Waiting_For_Value 1
+#define STATE__choice__0 2
+#define STATE__Led1On 3
+#define STATE__Led1Off 4
+#define STATE__STOP__STATE 5
 
-void MainBlock__LED1onLED2off() {
-  __userImplemented__MainBlock__LED1onLED2off();
+void MainBlock__LED1on() {
+  traceFunctionCall("MainBlock", "LED1on", "-");
+  __userImplemented__MainBlock__LED1on();
 }
 
 
-void MainBlock__LED1offLED2on() {
-  __userImplemented__MainBlock__LED1offLED2on();
+void MainBlock__LED1off(int x) {
+  char my__attr[CHAR_ALLOC_SIZE];
+  sprintf(my__attr, "%d",x);
+  traceFunctionCall("MainBlock", "LED1off", my__attr);
+  __userImplemented__MainBlock__LED1off(x);
 }
 
 
 void mainFunc__MainBlock(){
   int period = 2;
+  int x = 0;
+  int currentRand = 0;
   
   int __currentState = STATE__START__STATE;
+  __attribute__((unused)) request __req0;
+  __attribute__((unused))int *__params0[1];
+  __attribute__((unused)) request __req1;
+  __attribute__((unused))int *__params1[1];
+  __attribute__((unused))setOfRequests __list;
+  __attribute__((unused))size_t __myCond;
+  __attribute__((unused))request *__returnRequest;
+  
+  char * __myname = "mainFunc__MainBlock";
+  
+  fillListOfRequests(&__list, __myname, NULL, __myCond, &__mainMutex);
+  //printf("my name = %s\n", __myname);
   
   /* Main loop on states */
   while(__currentState != STATE__STOP__STATE) {
     switch(__currentState) {
       case STATE__START__STATE: 
-      __currentState = STATE__Led1onLed2off;
+      traceStateEntering(__myname, "__StartState");
+      __currentState = STATE__Waiting_For_Value;
       break;
       
-      case STATE__Led1onLed2off: 
-      wait_us((period)*1000000);
-      MainBlock__LED1offLED2on();
-      __currentState = STATE__Led1offLed2on;
+      case STATE__Waiting_For_Value: 
+      traceStateEntering(__myname, "Waiting_For_Value");
+      __params0[0] = &currentRand;
+      makeNewRequest(&__req0, 163, RECEIVE_SYNC_REQUEST, 0, 0, 0, 1, __params0);
+      __req0.syncChannel = &__MainBlock_RandVal__SecondaryBlock_RanVal;
+      __returnRequest = executeOneRequest(&__list, &__req0);
+      clearListOfRequests(&__list);
+      traceRequest(__myname, __returnRequest);
+      __currentState = STATE__choice__0;
       break;
       
-      case STATE__Led1offLed2on: 
+      case STATE__choice__0: 
+      traceStateEntering(__myname, "choice__0");
+      if (!(currentRand > 5)) {
+        makeNewRequest(&__req0, 168, IMMEDIATE, 0, 0, 0, 0, __params0);
+        addRequestToList(&__list, &__req0);
+      }
+      if (currentRand > 5) {
+        makeNewRequest(&__req1, 173, IMMEDIATE, 0, 0, 0, 0, __params1);
+        addRequestToList(&__list, &__req1);
+      }
+      if (nbOfRequests(&__list) == 0) {
+        debug2Msg(__myname, "No possible request");
+        __currentState = STATE__STOP__STATE;
+        break;
+      }
+      __returnRequest = executeListOfRequests(&__list);
+      clearListOfRequests(&__list);
+      traceRequest(__myname, __returnRequest);
+       if (__returnRequest == &__req0) {
+        __currentState = STATE__Waiting_For_Value;
+        
+      }
+      else  if (__returnRequest == &__req1) {
+        __currentState = STATE__Led1On;
+        
+      }
+      break;
+      
+      case STATE__Led1On: 
+      traceStateEntering(__myname, "Led1On");
       wait_us((period)*1000000);
-      MainBlock__LED1onLED2off();
-      __currentState = STATE__Led1onLed2off;
+      x = x+1;
+      traceVariableModification("MainBlock", "x", x,0);
+      MainBlock__LED1off(x);
+      __currentState = STATE__Led1Off;
+      break;
+      
+      case STATE__Led1Off: 
+      traceStateEntering(__myname, "Led1Off");
+      if (!(x > 10)) {
+        makeNewRequest(&__req0, 169, IMMEDIATE, 1, (period)*1000000, (period)*1000000, 0, __params0);
+        addRequestToList(&__list, &__req0);
+      }
+      if (x > 10) {
+        makeNewRequest(&__req1, 187, IMMEDIATE, 0, 0, 0, 0, __params1);
+        addRequestToList(&__list, &__req1);
+      }
+      if (nbOfRequests(&__list) == 0) {
+        debug2Msg(__myname, "No possible request");
+        __currentState = STATE__STOP__STATE;
+        break;
+      }
+      __returnRequest = executeListOfRequests(&__list);
+      clearListOfRequests(&__list);
+      traceRequest(__myname, __returnRequest);
+       if (__returnRequest == &__req0) {
+        __currentState = STATE__Waiting_For_Value;
+        
+      }
+      else  if (__returnRequest == &__req1) {
+        __currentState = STATE__STOP__STATE;
+        
+      }
       break;
       
     }
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/MainBlock.h b/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/MainBlock.h
index 09ad66a7ca77256d917ec2a37cc9dfe8c78a23d2..07444898d21d3af927e8f9e1b14973c95676c1fe 100644
--- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/MainBlock.h
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/MainBlock.h
@@ -1,10 +1,20 @@
 #ifndef MainBlock_H
 #define MainBlock_H
-#include <mbed.h>
-#include <rtos.h>
+#include <stdio.h>
+#include <pthread.h>
+#include <unistd.h>
+#include <stdlib.h>
 
+#include "request.h"
+#include "syncchannel.h"
+#include "request_manager.h"
+#include "debug.h"
+#include "defs.h"
+#include "mytimelib.h"
+#include "random.h"
+#include "tracemanager.h"
 #include "main.h"
 
-extern void mainFunc__MainBlock();
+extern void *mainFunc__MainBlock(void *arg);
 
 #endif
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/SecondaryBlock.c b/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/SecondaryBlock.c
new file mode 100644
index 0000000000000000000000000000000000000000..836c0ad99c3ee6e5b1f42635573a03ae226263d0
--- /dev/null
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/SecondaryBlock.c
@@ -0,0 +1,68 @@
+#include "SecondaryBlock.h"
+
+
+// Header code defined in the model
+extern int val;
+
+// End of header code defined in the model
+
+#define STATE__START__STATE 0
+#define STATE__Waiting_Cycle 1
+#define STATE__CalculatingRand 2
+#define STATE__SendingRand 3
+#define STATE__STOP__STATE 4
+
+void *mainFunc__SecondaryBlock(void *arg){
+  int val = 0;
+  
+  int __currentState = STATE__START__STATE;
+  __attribute__((unused)) request __req0;
+  __attribute__((unused))int *__params0[1];
+  __attribute__((unused))setOfRequests __list;
+  __attribute__((unused))pthread_cond_t __myCond;
+  __attribute__((unused))request *__returnRequest;
+  
+  char * __myname = (char *)arg;
+  
+  pthread_cond_init(&__myCond, NULL);
+  
+  fillListOfRequests(&__list, __myname, &__myCond, &__mainMutex);
+  //printf("my name = %s\n", __myname);
+  
+  /* Main loop on states */
+  while(__currentState != STATE__STOP__STATE) {
+    switch(__currentState) {
+      case STATE__START__STATE: 
+      traceStateEntering(__myname, "__StartState");
+      __currentState = STATE__Waiting_Cycle;
+      break;
+      
+      case STATE__Waiting_Cycle: 
+      traceStateEntering(__myname, "Waiting_Cycle");
+      waitFor((4)*1000000, (4)*1000000);
+      __currentState = STATE__CalculatingRand;
+      break;
+      
+      case STATE__CalculatingRand: 
+      traceStateEntering(__myname, "CalculatingRand");
+      val = computeRandom(1, 10);
+      __currentState = STATE__SendingRand;
+      break;
+      
+      case STATE__SendingRand: 
+      traceStateEntering(__myname, "SendingRand");
+      __params0[0] = &val;
+      makeNewRequest(&__req0, 272, SEND_SYNC_REQUEST, 0, 0, 0, 1, __params0);
+      __req0.syncChannel = &__MainBlock_RandVal__SecondaryBlock_RanVal;
+      __returnRequest = executeOneRequest(&__list, &__req0);
+      clearListOfRequests(&__list);
+      traceRequest(__myname, __returnRequest);
+      __currentState = STATE__Waiting_Cycle;
+      break;
+      
+    }
+  }
+  //printf("Exiting = %s\n", __myname);
+  return NULL;
+}
+
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/SecondaryBlock.cpp b/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/SecondaryBlock.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..ee7bcdaec799d5c4b6d6a90e8c75e7146b9edad9
--- /dev/null
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/SecondaryBlock.cpp
@@ -0,0 +1,66 @@
+#include "SecondaryBlock.h"
+
+
+// Header code defined in the model
+extern int val;
+
+// End of header code defined in the model
+
+#define STATE__START__STATE 0
+#define STATE__Waiting_Cycle 1
+#define STATE__CalculatingRand 2
+#define STATE__SendingRand 3
+#define STATE__STOP__STATE 4
+
+void mainFunc__SecondaryBlock(){
+  int val = 0;
+  
+  int __currentState = STATE__START__STATE;
+  __attribute__((unused)) request __req0;
+  __attribute__((unused))int *__params0[1];
+  __attribute__((unused))setOfRequests __list;
+  __attribute__((unused))size_t __myCond;
+  __attribute__((unused))request *__returnRequest;
+  
+  char * __myname = "mainFunc__SecondaryBlock";
+  
+  fillListOfRequests(&__list, __myname, NULL, __myCond, &__mainMutex);
+  //printf("my name = %s\n", __myname);
+  
+  /* Main loop on states */
+  while(__currentState != STATE__STOP__STATE) {
+    switch(__currentState) {
+      case STATE__START__STATE: 
+      traceStateEntering(__myname, "__StartState");
+      __currentState = STATE__Waiting_Cycle;
+      break;
+      
+      case STATE__Waiting_Cycle: 
+      traceStateEntering(__myname, "Waiting_Cycle");
+      wait_us((4)*1000000);
+      __currentState = STATE__CalculatingRand;
+      break;
+      
+      case STATE__CalculatingRand: 
+      traceStateEntering(__myname, "CalculatingRand");
+      val = computeRandom(1, 10);
+      __currentState = STATE__SendingRand;
+      break;
+      
+      case STATE__SendingRand: 
+      traceStateEntering(__myname, "SendingRand");
+      __params0[0] = &val;
+      makeNewRequest(&__req0, 154, SEND_SYNC_REQUEST, 0, 0, 0, 1, __params0);
+      __req0.syncChannel = &__MainBlock_RandVal__SecondaryBlock_RanVal;
+      __returnRequest = executeOneRequest(&__list, &__req0);
+      clearListOfRequests(&__list);
+      traceRequest(__myname, __returnRequest);
+      __currentState = STATE__Waiting_Cycle;
+      break;
+      
+    }
+  }
+  //printf("Exiting = %s\n", __myname);
+  return ;
+}
+
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/SecondaryBlock.h b/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/SecondaryBlock.h
new file mode 100644
index 0000000000000000000000000000000000000000..901896f23259f570eabdc4563bd8de4dee6d14f2
--- /dev/null
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/SecondaryBlock.h
@@ -0,0 +1,20 @@
+#ifndef SecondaryBlock_H
+#define SecondaryBlock_H
+#include <stdio.h>
+#include <pthread.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+#include "request.h"
+#include "syncchannel.h"
+#include "request_manager.h"
+#include "debug.h"
+#include "defs.h"
+#include "mytimelib.h"
+#include "random.h"
+#include "tracemanager.h"
+#include "main.h"
+
+extern void *mainFunc__SecondaryBlock(void *arg);
+
+#endif
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/main.c b/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/main.c
new file mode 100644
index 0000000000000000000000000000000000000000..f77ce651f55e62e03d5ebfb1cc907f78845ae681
--- /dev/null
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/main.c
@@ -0,0 +1,70 @@
+#include <stdio.h>
+#include <pthread.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+#include "request.h"
+#include "syncchannel.h"
+#include "request_manager.h"
+#include "debug.h"
+#include "random.h"
+#include "tracemanager.h"
+
+/* User code */
+void __user_init() {
+}
+
+/* End of User code */
+
+/* Main mutex */
+pthread_mutex_t __mainMutex;
+
+/* Synchronous channels */
+syncchannel __MainBlock_RandVal__SecondaryBlock_RanVal;
+/* Asynchronous channels */
+
+#include "SecondaryBlock.h"
+#include "MainBlock.h"
+
+
+int main(int argc, char *argv[]) {
+  
+  /* disable buffering on stdout */
+  setvbuf(stdout, NULL, _IONBF, 0);
+  
+  /* Synchronous channels */
+  __MainBlock_RandVal__SecondaryBlock_RanVal.inname ="RandVal";
+  __MainBlock_RandVal__SecondaryBlock_RanVal.outname ="RanVal";
+  /* Asynchronous channels */
+  
+  /* Threads of tasks */
+  pthread_t thread__SecondaryBlock;
+  pthread_t thread__MainBlock;
+  /* Activating tracing  */
+  if (argc>1){
+    activeTracingInFile(argv[1]);
+  } else {
+    activeTracingInConsole();
+  }
+  /* Activating randomness */
+  initRandom();
+  /* Initializing the main mutex */
+if (pthread_mutex_init(&__mainMutex, NULL) < 0) { exit(-1);}
+  
+  /* Initializing mutex of messages */
+  initMessages();
+  /* User initialization */
+  __user_init();
+  
+  
+  pthread_create(&thread__SecondaryBlock, NULL, mainFunc__SecondaryBlock, (void *)"SecondaryBlock");
+  pthread_create(&thread__MainBlock, NULL, mainFunc__MainBlock, (void *)"MainBlock");
+  
+  
+  pthread_join(thread__SecondaryBlock, NULL);
+  pthread_join(thread__MainBlock, NULL);
+  
+  
+  return 0;
+  
+}
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/main.cpp b/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/main.cpp
index fb2c5386c76154b78dc6f53b5d64eb0a1b2fb113..6c2b919b3bdbb20586263514f6425a33c489dea7 100644
--- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/main.cpp
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/main.cpp
@@ -5,8 +5,8 @@
 
 /* User code */
 void __user_init() {
-    printf("Initializing...\n");
 }
+
 /* End of User code */
 
 /* Main mutex */
@@ -15,7 +15,11 @@ rtos::Mutex __mainMutex;
 /* ConcurrencyMutex mutex */
 rtos::Mutex __concurrencyMutex;
 
+/* Synchronous channels */
+syncchannel __MainBlock_RandVal__SecondaryBlock_RanVal;
+/* Asynchronous channels */
 
+#include "SecondaryBlock.h"
 #include "MainBlock.h"
 
 
@@ -24,8 +28,13 @@ int main(int argc, char *argv[]) {
   /* disable buffering on stdout */
   setvbuf(stdout, (char*)NULL, _IONBF, 0);
   
+  /* Synchronous channels */
+  __MainBlock_RandVal__SecondaryBlock_RanVal.inname ="RandVal";
+  __MainBlock_RandVal__SecondaryBlock_RanVal.outname ="RanVal";
+  /* Asynchronous channels */
   
   /* Threads of tasks */
+  rtos::Thread thread__SecondaryBlock;
   rtos::Thread thread__MainBlock;
   /* Activating tracing  */
   /* Activating randomness */
@@ -34,9 +43,11 @@ int main(int argc, char *argv[]) {
   __user_init();
   
   
+  thread__SecondaryBlock.start(mainFunc__SecondaryBlock);
   thread__MainBlock.start(mainFunc__MainBlock);
   
   
+  thread__SecondaryBlock.join();
   thread__MainBlock.join();
   
   
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/main.h b/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/main.h
index cb71fa7eef4a97d996ae84b7ec67480812d93d39..e2eb31884c1656f442ef7f3da2b7f2612981b22a 100644
--- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/main.h
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/main.h
@@ -1,9 +1,9 @@
 #ifndef MAIN_H
 #define MAIN_H
 /* Main mutex */
-extern rtos::Mutex __mainMutex;
-
-/* ConcurrencyMutex mutex */
-extern rtos::Mutex __concurrencyMutex;
+extern pthread_mutex_t __mainMutex;
 
+/* Synchronous channels */
+extern syncchannel __MainBlock_RandVal__SecondaryBlock_RanVal;
+/* Asynchronous channels */
 #endif
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/asyncchannel.c b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/asyncchannel.c
new file mode 100644
index 0000000000000000000000000000000000000000..e2ce2ac48a62b888eedc7940c74b1ae1f3953013
--- /dev/null
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/asyncchannel.c
@@ -0,0 +1,56 @@
+#include <stdlib.h>
+
+#include "message.h"
+#include "asyncchannel.h"
+#include "myerrors.h"
+
+
+asyncchannel *getNewAsyncchannel(char *outname, char *inname, int isBlocking, int maxNbOfMessages) {
+  asyncchannel * asyncch = (asyncchannel *)(malloc(sizeof(struct asyncchannel)));
+  if (asyncch == NULL) {
+    criticalError("Allocation of asyncchannel failed");
+  }
+  asyncch->inname = inname;
+  asyncch->outname = outname;
+  asyncch->isBlocking = isBlocking;
+  asyncch->maxNbOfMessages = maxNbOfMessages;
+  
+  return asyncch;
+}
+
+void destroyAsyncchannel(asyncchannel *asyncch) {
+  free(asyncch);
+}
+
+message* getAndRemoveOldestMessageFromAsyncChannel(asyncchannel *channel) {
+  message *msg;
+  message *previous;
+
+  if (channel->currentNbOfMessages == 0) {
+    return NULL;
+  }
+
+  if (channel->currentNbOfMessages == 1) {
+    channel->currentNbOfMessages = 0;
+    msg = channel->pendingMessages;
+    channel->pendingMessages = NULL;
+    return msg;
+  }
+
+  msg = channel->pendingMessages;
+  previous = msg;
+  while(msg->next != NULL) {
+    previous = msg;
+    msg = msg->next;
+  }
+
+  channel->currentNbOfMessages = channel->currentNbOfMessages -1;
+  previous->next = NULL;
+  return msg;
+}
+
+void addMessageToAsyncChannel(asyncchannel *channel, message *msg) {
+  msg->next = channel->pendingMessages;
+  channel->pendingMessages = msg;
+  channel->currentNbOfMessages = channel->currentNbOfMessages+1;
+}
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/asyncchannel.h b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/asyncchannel.h
new file mode 100644
index 0000000000000000000000000000000000000000..8f812359dbd67311f37391807b883890ee163f04
--- /dev/null
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/asyncchannel.h
@@ -0,0 +1,28 @@
+#ifndef ASYNCCHANNEL_H
+#define ASYNCCHANNEL_H
+
+struct asyncchannel;
+
+#include "message.h"
+#include "request.h"
+
+
+struct asyncchannel {
+  char *outname;
+  char *inname;
+  int isBlocking; // In writing. Reading is always blocking
+  int maxNbOfMessages; //
+  struct request* outWaitQueue;
+  struct request* inWaitQueue;
+  message *pendingMessages;
+  int currentNbOfMessages;
+};
+
+typedef struct asyncchannel asyncchannel;
+
+asyncchannel *getNewAsyncchannel(char *inname, char *outname, int isBlocking, int maxNbOfMessages);
+void destroyAsyncchannel(asyncchannel *syncch);
+message* getAndRemoveOldestMessageFromAsyncChannel(asyncchannel *channel);
+void addMessageToAsyncChannel(asyncchannel *channel, message *msg);
+
+#endif
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/debug.c b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/debug.c
new file mode 100644
index 0000000000000000000000000000000000000000..067d0a8c17e3861ce60191884c13041d9e88431b
--- /dev/null
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/debug.c
@@ -0,0 +1,86 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <time.h>
+
+#include "debug.h"
+
+
+#define DEBUG_ON 1
+#define DEBUG_OFF 2
+
+int debug = DEBUG_OFF;
+
+void activeDebug() {
+  debug = DEBUG_ON;
+}
+
+void unactiveDebug() {
+  debug = DEBUG_OFF;
+}
+
+void debugThreeInts(char *msg, int value1, int value2, int value3) {
+  if (debug == DEBUG_OFF) {
+    return;
+  }
+  
+  if (msg != NULL) {
+    printf("DT> %s: %d, %d, %d\n", msg, value1, value2, value3);
+  }
+}
+
+void debugTwoInts(char *msg, int value1, int value2) {
+  if (debug == DEBUG_OFF) {
+    return;
+  }
+  
+  if (msg != NULL) {
+    printf("DT> %s: %d, %d\n", msg, value1, value2);
+  }
+}
+
+void debugInt(char *msg, int value) {
+  if (debug == DEBUG_OFF) {
+    return;
+  }
+  
+  if (msg != NULL) {
+    printf("DT> %s: %d\n", msg, value);
+  }
+}
+
+void debugLong(char *msg, long value) {
+  if (debug == DEBUG_OFF) {
+    return;
+  }
+  
+  if (msg != NULL) {
+    printf("DT> %s: %ld\n", msg, value);
+  }
+}
+
+void debugMsg(char *msg) {
+  if (debug == DEBUG_OFF) {
+    return;
+  }
+
+  if (msg != NULL) {
+    printf("DT> %s\n", msg);
+  }
+}
+
+void debug2Msg(char *name, char *msg) {
+  if (debug == DEBUG_OFF) {
+    return;
+  }
+
+  if ((name != NULL) && (msg != NULL)) {
+    printf("DT - %s -> %s\n", name, msg);
+  }
+}
+
+void debugTime(char *msg, struct timespec *ts) {
+  if (debug == DEBUG_OFF) {
+    return;
+  }
+  printf("DT> (-------t------->) %s sec=%ld nsec=%ld\n", msg, ts->tv_sec, ts->tv_nsec);
+}
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/debug.h b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/debug.h
new file mode 100644
index 0000000000000000000000000000000000000000..7e73f3ce91684420195a07eb365184b0629e74f3
--- /dev/null
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/debug.h
@@ -0,0 +1,19 @@
+
+
+#ifndef DEBUG_H
+#define DEBUG_H
+
+void activeDebug();
+void unactiveDebug();
+
+void debugThreeInts(char *msg, int value1, int value2, int value3);
+void debugTwoInts(char *msg, int value1, int value2);
+void debugLong(char *msg, long value);
+void debugInt(char *msg, int value);
+void debugMsg(char *msg);
+void debug2Msg(char *name, char* msg);
+void debugTime(char* msg, struct timespec *ts);
+
+#endif
+
+
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/defs.h b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/defs.h
new file mode 100644
index 0000000000000000000000000000000000000000..3b997bfdf885b560dc4fde8264e8b5026565de10
--- /dev/null
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/defs.h
@@ -0,0 +1,9 @@
+#ifndef DEFS_H
+#define DEFS_H
+
+#define bool int
+#define true 1
+#define false 0
+
+
+#endif
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/message.c b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/message.c
new file mode 100644
index 0000000000000000000000000000000000000000..1153a882f51d93d8596621162f82278bc01d7158
--- /dev/null
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/message.c
@@ -0,0 +1,59 @@
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <pthread.h>
+
+#include "message.h"
+#include "myerrors.h"
+
+long __id_message = 0;
+pthread_mutex_t __message_mutex;
+
+
+void initMessages() {
+  if (pthread_mutex_init(&__message_mutex, NULL) < 0) { exit(-1);}
+}
+
+long getMessageID() {
+  long tmp;
+  pthread_mutex_lock(&__message_mutex);
+  tmp = __id_message;
+  __id_message ++;
+  pthread_mutex_unlock(&__message_mutex);
+  return tmp;
+}
+
+message *getNewMessageWithParams(int nbOfParams) {
+	
+	message *msg = (message *)(malloc(sizeof(struct message)));
+	if (msg == NULL) {
+		criticalError("Allocation of request failed");
+	}
+	msg->nbOfParams = nbOfParams;
+	msg->params = (int *)(malloc(sizeof(int) * nbOfParams));
+	msg->id = getMessageID();
+	return msg;
+}
+
+message *getNewMessage(int nbOfParams, int *params) {
+
+  message *msg = (message *)(malloc(sizeof(struct message)));
+  if (msg == NULL) {
+    criticalError("Allocation of request failed");
+  }
+  msg->nbOfParams = nbOfParams;
+  msg->params = params;
+  msg->id = getMessageID();
+  return msg;
+}
+
+
+
+void destroyMessageWithParams(message *msg) {
+  free(msg->params);
+  free(msg);
+}
+
+void destroyMessage(message *msg) {
+  free(msg);
+}
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/message.h b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/message.h
new file mode 100644
index 0000000000000000000000000000000000000000..700ed07d97f6ae925ceeb6c172238a2f4bd37680
--- /dev/null
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/message.h
@@ -0,0 +1,22 @@
+#ifndef MESSAGE_H
+#define MESSAGE_H
+
+
+struct message {
+  struct message *next;
+  int nbOfParams;
+  int *params;
+  long id;
+};
+
+typedef struct message message;
+
+void initMessages();
+message *getNewMessageWithParams(int nbOfParams);
+message *getNewMessage(int nbOfParams, int *params);
+void destroyMessageWithParams(message *msg);
+void destroyMessage(message *msg);
+
+
+
+#endif
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/myerrors.c b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/myerrors.c
new file mode 100644
index 0000000000000000000000000000000000000000..dfe16a1c469f6e11382dfae037b3d4ff89cf8c7b
--- /dev/null
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/myerrors.c
@@ -0,0 +1,24 @@
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "myerrors.h"
+
+
+
+
+void criticalErrorInt(char *msg, int value) {
+  if (msg != NULL) {
+    printf("\nCritical error: %s, %d\n", msg, value);
+  }
+
+  exit(-1);
+}
+
+
+void criticalError(char *msg) {
+  if (msg != NULL) {
+    printf("\nCritical error: %s\n", msg);
+  }
+
+  exit(-1);
+}
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/myerrors.h b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/myerrors.h
new file mode 100644
index 0000000000000000000000000000000000000000..8300da3ccfd1b5f2efd2f3514a8f543409363003
--- /dev/null
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/myerrors.h
@@ -0,0 +1,11 @@
+
+
+#ifndef MY_ERRORS_H
+#define MY_ERRORS_H
+
+void criticalErrorInt(char *msg, int value);
+void criticalError(char *msg);
+
+#endif
+
+
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/mytimelib.c b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/mytimelib.c
new file mode 100644
index 0000000000000000000000000000000000000000..d39c07ea85c258ce227365364163ce1761038663
--- /dev/null
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/mytimelib.c
@@ -0,0 +1,108 @@
+#include<time.h>
+
+#include "mytimelib.h"
+#include "random.h"
+#include "debug.h"
+
+#ifndef CLOCK_REALTIME
+#define CLOCK_REALTIME
+
+int clock_gettime(struct timespec *ts) {
+  struct timeval tv;
+  gettimeofday(&tv, NULL);
+  ts->tv_sec = tv.tv_sec;
+  ts->tv_nsec = tv.tv_usec * 1000;
+  return 0;
+}
+
+int my_clock_gettime(struct timespec *tp) {
+  return clock_gettime(tp);
+}
+
+#else
+
+int my_clock_gettime(struct timespec *tp) {
+  return clock_gettime(CLOCK_REALTIME, tp);
+}
+
+#endif
+
+
+
+void addTime(struct timespec *src1, struct timespec *src2, struct timespec *dest) {
+  dest->tv_nsec = src1->tv_nsec + src2->tv_nsec;
+  dest->tv_sec = src1->tv_sec + src2->tv_sec;
+  if (dest->tv_nsec > 1000000000) {
+    dest->tv_sec = dest->tv_sec + (dest->tv_nsec / 1000000000);
+    dest->tv_nsec = dest->tv_nsec % 1000000000;
+  }
+}
+
+void diffTime(struct timespec *src1, struct timespec *src2, struct timespec *dest) {
+  int diff = 0;
+  if (src1->tv_nsec > src2->tv_nsec) {
+    diff ++;
+    dest->tv_nsec = src2->tv_nsec - src1->tv_nsec + 1000000000;
+  } else {
+    dest->tv_nsec = src2->tv_nsec - src1->tv_nsec;
+  }
+
+  dest->tv_sec = src2->tv_sec - src1->tv_sec - diff;
+}
+
+
+
+int isBefore(struct timespec *src1, struct timespec *src2) {
+  if (src1->tv_sec > src2->tv_sec) {
+    return 0;
+  }
+
+  if (src1->tv_sec < src2->tv_sec) {
+    return 1;
+  }
+
+  if (src1->tv_nsec < src2->tv_nsec) {
+    return 1;
+  }
+  return 0;
+}
+
+void minTime(struct timespec *src1, struct timespec *src2, struct timespec *dest) {
+  debugMsg("MIN TIME COMPUTATION");
+  if (isBefore(src1,src2)) {
+    dest->tv_nsec = src1->tv_nsec;
+    dest->tv_sec = src1->tv_sec;
+  } else {
+    dest->tv_nsec = src2->tv_nsec;
+    dest->tv_sec = src2->tv_sec;
+  }
+  
+}
+
+
+void delayToTimeSpec(struct timespec *ts, long delay) {
+  ts->tv_nsec = (delay % 1000000)*1000;
+  ts->tv_sec = (delay / 1000000);
+}
+
+void waitFor(long minDelay, long maxDelay) {
+  struct timespec tssrc;
+  struct timespec tsret;
+  int delay;
+
+
+  
+  debugMsg("Computing random delay");
+  //debugLong("Min delay", minDelay);
+  //debugLong("Max delay", maxDelay);
+  delay = computeLongRandom(minDelay, maxDelay);
+
+  debugLong("Random delay=", delay);
+
+  delayToTimeSpec(&tssrc, delay);
+
+  debugLong("............. waiting For", delay);
+  nanosleep(&tssrc, &tsret);
+  debugLong("............. waiting Done for: ", delay);
+}
+
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/mytimelib.h b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/mytimelib.h
new file mode 100644
index 0000000000000000000000000000000000000000..76ed5d22fcd7cf9a2750cf2a9726f5cdb89e48f2
--- /dev/null
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/mytimelib.h
@@ -0,0 +1,19 @@
+#ifndef MYTIMELIB_H
+#define MYTIMELIB_H
+
+#include <time.h>
+#include <sys/time.h>
+
+
+
+// in usec
+
+int my_clock_gettime(struct timespec *tp);
+void addTime(struct timespec *src1, struct timespec *src2, struct timespec *dest);
+void diffTime(struct timespec *src1, struct timespec *src2, struct timespec *dest);
+int isBefore(struct timespec *src1, struct timespec *src2);
+void minTime(struct timespec *src1, struct timespec *src2, struct timespec *dest);
+void delayToTimeSpec(struct timespec *ts, long delay);
+extern void waitFor(long minDelay, long maxDelay);
+
+#endif
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/random.c b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/random.c
new file mode 100644
index 0000000000000000000000000000000000000000..b4bbddb19ac1e4a51bf5c0205aab571a7580dd32
--- /dev/null
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/random.c
@@ -0,0 +1,43 @@
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <time.h>
+#include <limits.h>
+
+#include "random.h"
+#include "debug.h"
+#include <math.h>
+
+#include "mytimelib.h"
+
+int computeRandom(int min, int max) {
+  if (min == max) {
+    return min;
+  }
+  return (rand() % (max - min)) + min;
+}
+
+long computeLongRandom(long min, long max) {
+
+  if (min == max) {
+    return min;
+  }
+
+
+  long rand0 = (long)rand();
+  long rand1 = rand0 % (max - min);
+  //debugLong("min=", min);
+  //debugLong("max=", max);
+  //debugLong("rand0", rand0);
+ //debugLong("rand1", rand1);
+ //debugLong("Random long", rand1 + min);
+  return rand1 + min;
+}
+
+void initRandom() {
+  struct timespec ts;
+
+  my_clock_gettime(&ts);
+
+  srand((int)(ts.tv_nsec));
+}
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/random.h b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/random.h
new file mode 100644
index 0000000000000000000000000000000000000000..ecff7cb43cb9d3c38fd390243ad0cbd186fead97
--- /dev/null
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/random.h
@@ -0,0 +1,7 @@
+#ifndef RANDOM_H
+#define RANDOM_H
+
+extern void initRandom();
+extern int computeRandom(int min, int max);
+extern long computeLongRandom(long min, long max);
+#endif
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/request.c b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/request.c
new file mode 100644
index 0000000000000000000000000000000000000000..af1231c61b71a7aab28063dfcf5eefc9faabf6b5
--- /dev/null
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/request.c
@@ -0,0 +1,271 @@
+
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "request.h"
+#include "mytimelib.h"
+#include "myerrors.h"
+#include "random.h"
+#include "debug.h"
+
+
+request *getNewRequest(int ID, int type, int hasDelay, long minDelay, long maxDelay, int nbOfParams, int **params) {
+  request *req = (request *)(malloc(sizeof(struct request)));
+  
+  if (req == NULL) {
+    criticalError("Allocation of request failed");
+  }
+
+  makeNewRequest(req,  ID, type, hasDelay, minDelay, maxDelay, nbOfParams, params);  
+  return req;
+}
+
+
+// Delays are in microseconds
+void makeNewRequest(request *req, int ID, int type, int hasDelay, long minDelay, long maxDelay, int nbOfParams, int **params) {
+  long delay;
+  int i;
+
+  req->next = NULL;
+  req->listOfRequests = NULL;
+  req->nextRequestInList = NULL;
+
+  req->type = type;
+  req->ID = ID;
+  req->hasDelay = hasDelay;
+
+  if (req->hasDelay > 0) {
+    delay = computeLongRandom(minDelay, maxDelay);
+    delayToTimeSpec(&(req->delay), delay);
+  }
+
+  req->selected = 0;
+  req->nbOfParams = nbOfParams;
+  req->params = params;
+
+  req->alreadyPending = 0;
+  req->delayElapsed = 0;
+
+  req->relatedRequest = NULL;
+
+  if (type == SEND_ASYNC_REQUEST) {
+    // Must create a new message
+    req->msg = getNewMessageWithParams(nbOfParams);
+    for(i=0; i<nbOfParams; i++) {
+      req->msg->params[i] = *(params[i]);
+    }
+  }
+
+}
+
+
+
+
+void destroyRequest(request *req) {
+  free((void *)req);
+}
+
+int isRequestSelected(request *req) {
+  return req->selected;
+}
+
+int nbOfRequests(setOfRequests *list) {
+  int cpt = 0;
+  request *req;
+
+  req = list->head;
+
+  while(req != NULL) {
+    cpt ++;
+    req = req->nextRequestInList;
+  }
+
+  return cpt;
+}
+
+request *getRequestAtIndex(setOfRequests *list, int index) {
+  int cpt = 0;
+  request * req = list->head;
+
+  while(cpt < index) {
+    req = req->nextRequestInList;
+    cpt ++;
+  }
+
+  return req;
+  
+}
+
+
+request * addToRequestQueue(request *list, request *requestToAdd) {
+  request *origin = list;
+
+  if (list == NULL) {
+    return requestToAdd;
+  }
+
+  while(list->next != NULL) {
+    list = list->next;
+  }
+  
+  list->next = requestToAdd;
+
+  requestToAdd->next = NULL;
+
+  return origin;
+}
+
+request * removeRequestFromList(request *list, request *requestToRemove) {
+  request *origin = list;
+
+  if (list == requestToRemove) {
+    return list->next;
+  }
+
+
+  while(list->next != requestToRemove) {
+    list = list->next;
+  }
+
+  list->next = requestToRemove->next;
+
+  return origin;
+} 
+
+
+void copyParameters(request *src, request *dst) {
+  int i;
+  for(i=0; i<dst->nbOfParams; i++) {
+    *(dst->params[i]) = *(src->params[i]);
+  }
+}
+
+
+void clearListOfRequests(setOfRequests *list) {
+  list->head = NULL;
+}
+
+setOfRequests *newListOfRequests(pthread_cond_t *wakeupCondition, pthread_mutex_t *mutex) {
+  setOfRequests *list = (setOfRequests *)(malloc(sizeof(setOfRequests)));
+  list->head = NULL;
+  list->wakeupCondition = wakeupCondition;
+  list->mutex = mutex;
+
+  return list;
+}
+
+void fillListOfRequests(setOfRequests *list, char *name, pthread_cond_t *wakeupCondition, pthread_mutex_t *mutex) {
+  list->head = NULL;
+  list->owner = name;
+  list->wakeupCondition = wakeupCondition;
+  list->mutex = mutex;
+}
+
+
+void addRequestToList(setOfRequests *list, request* req) {
+  request *tmpreq;
+
+  if (list == NULL) {
+    criticalError("NULL List in addRequestToList");
+  }
+
+  if (req == NULL) {
+    criticalError("NULL req in addRequestToList");
+  }
+
+  req->listOfRequests = list;
+
+  if (list->head == NULL) {
+    list->head = req;
+    req->nextRequestInList = NULL;
+    return;
+  }
+
+  tmpreq = list->head;
+  while(tmpreq->nextRequestInList != NULL) {
+    tmpreq = tmpreq->nextRequestInList;
+  }
+
+  tmpreq->nextRequestInList = req;
+  req->nextRequestInList = NULL;
+}
+
+void removeAllPendingRequestsFromPendingLists(request *req, int apartThisOne) {
+  setOfRequests *list = req->listOfRequests;
+  request *reqtmp;
+
+  if (list == NULL) {
+    return;
+  }
+
+  reqtmp = list->head;
+
+  while(reqtmp != NULL) {
+    debugInt("Considering request of type", reqtmp->type);
+      if (reqtmp->alreadyPending) {
+	if (reqtmp->type ==  RECEIVE_SYNC_REQUEST) {
+	  debugMsg("Removing send sync request from inWaitQueue");
+	  reqtmp->syncChannel->inWaitQueue = removeRequestFromList(reqtmp->syncChannel->inWaitQueue, reqtmp);
+	  debugMsg("done");
+	}
+
+	if (reqtmp->type ==  SEND_SYNC_REQUEST) {
+	  debugMsg("Removing receive sync request from outWaitQueue");
+	  reqtmp->syncChannel->outWaitQueue = removeRequestFromList(reqtmp->syncChannel->outWaitQueue, reqtmp);
+	  debugMsg("done");
+	}
+
+	if (reqtmp->type ==  RECEIVE_BROADCAST_REQUEST) {
+	  debugMsg("Removing broadcast receive request from inWaitQueue");
+	  reqtmp->syncChannel->inWaitQueue = removeRequestFromList(reqtmp->syncChannel->inWaitQueue, reqtmp);
+	  debugMsg("done");
+	}
+      }
+    reqtmp = reqtmp->nextRequestInList;
+  }
+}
+
+
+// Identical means belonging to the same ListOfRequest
+// Returns the identical request if found, otherwise, null
+request *hasIdenticalRequestInListOfSelectedRequests(request *req, request *list) {
+ 
+  while(list != NULL) {
+    if (list->listOfRequests == req->listOfRequests) {
+      return list;
+    }
+    list = list->relatedRequest;
+  }
+
+  return NULL;
+}
+
+request* replaceInListOfSelectedRequests(request *oldRequest, request *newRequest, request *list) {
+  request *head = list;
+
+  if (list == oldRequest) {
+    newRequest->relatedRequest = oldRequest->relatedRequest;
+    return newRequest;
+  }
+
+  //list=list->relatedRequest;
+  while(list->relatedRequest != oldRequest) {
+    list = list->relatedRequest;
+  }
+
+  list->relatedRequest = newRequest;
+  newRequest->relatedRequest = oldRequest->relatedRequest;
+
+  return head;
+}
+
+
+int nbOfRelatedRequests(request *list) {
+  int cpt = 0;
+  while(list->relatedRequest != NULL) {
+    cpt ++;
+    list = list->relatedRequest;
+  }
+
+  return cpt;
+}
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/request.h b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/request.h
new file mode 100644
index 0000000000000000000000000000000000000000..00b93c8e5a007e2eecf6bde40417cdfb9457edc2
--- /dev/null
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/request.h
@@ -0,0 +1,89 @@
+#ifndef REQUEST_H
+#define REQUEST_H
+
+#include <time.h>
+#include <pthread.h>
+
+struct request;
+
+#include "syncchannel.h"
+#include "asyncchannel.h"
+#include "message.h"
+
+#define SEND_SYNC_REQUEST 0
+#define RECEIVE_SYNC_REQUEST 2
+#define SEND_ASYNC_REQUEST 4
+#define RECEIVE_ASYNC_REQUEST 6
+#define DELAY 8
+#define IMMEDIATE 10
+#define SEND_BROADCAST_REQUEST 12
+#define RECEIVE_BROADCAST_REQUEST 14
+
+typedef struct timespec timespec;
+
+struct setOfRequests {
+  char* owner;
+  struct request *head;
+  timespec startTime;
+  timespec completionTime;
+  pthread_cond_t *wakeupCondition;
+  pthread_mutex_t *mutex;
+
+  int hasATimeRequest; // Means that at least on request of the list hasn't completed yet its time delay
+  timespec minTimeToWait;
+  struct request *selectedRequest;
+};
+
+typedef struct setOfRequests setOfRequests;
+
+struct request {
+  struct request *next;
+  struct setOfRequests* listOfRequests;
+  struct request* nextRequestInList;
+  struct request* relatedRequest; // For synchro and broadcast
+  struct syncchannel *syncChannel;
+  struct asyncchannel *asyncChannel;
+  
+  int type;
+  int ID;
+  int hasDelay;;
+  timespec delay;
+  int nbOfParams; // synchronous com.
+  int **params;  // synchronous com.
+  message *msg; // Asynchronous comm.
+
+
+  // Filled by the request manager
+  int executable;
+  int selected;
+  int alreadyPending; // Whether it has been taken into account for execution or not
+  int delayElapsed;
+  timespec myStartTime; // Time at which the delay has expired
+};
+
+typedef struct request request;
+
+void makeNewRequest(request *req, int ID, int type, int hasDelay, long minDelay, long maxDelay, int nbOfParams, int **params);
+request *getNewRequest(int ID, int type, int hasDelay, long minDelay, long maxDelay, int nbOfParams, int **params);
+void destroyRequest(request *req);
+extern int isRequestSelected(request *req);
+
+int nbOfRequests(setOfRequests *list);
+request *getRequestAtIndex(setOfRequests *list, int index);
+
+request * addToRequestQueue(request *list, request *requestToAdd);
+request * removeRequestFromList(request *list, request *requestToRemove);
+
+void copyParameters(request *src, request *dst);
+
+setOfRequests *newListOfRequests(pthread_cond_t *wakeupCondition, pthread_mutex_t *mutex);
+void addRequestToList(setOfRequests *list, request* req);
+void clearListOfRequests(setOfRequests *list);
+void fillListOfRequests(setOfRequests *list, char *name, pthread_cond_t *wakeupCondition, pthread_mutex_t *mutex);
+
+void removeAllPendingRequestsFromPendingLists(request *req, int apartThisOne);
+request *hasIdenticalRequestInListOfSelectedRequests(request *req, request *list);
+request* replaceInListOfSelectedRequests(request *oldRequest, request *newRequest, request *list);
+int nbOfRelatedRequests(request *list);
+
+#endif
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/request_manager.c b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/request_manager.c
new file mode 100644
index 0000000000000000000000000000000000000000..e1c39ba777944c41c018918f4fa7594eaf3f96b5
--- /dev/null
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/request_manager.c
@@ -0,0 +1,570 @@
+#include <stdlib.h>
+#include <pthread.h>
+#include <time.h>
+
+#include "request_manager.h"
+#include "request.h"
+#include "myerrors.h"
+#include "debug.h"
+#include "mytimelib.h"
+#include "random.h"
+#include "asyncchannel.h"
+#include "tracemanager.h"
+
+
+
+void executeSendSyncTransaction(request *req) {
+  int cpt;
+  request *selectedReq;
+
+  // At least one transaction available -> must select one randomly
+  // First: count how many of them are available
+  // Then, select one
+  // Broadcast the new condition!
+
+  cpt = 0;
+  request* currentReq = req->syncChannel->inWaitQueue;
+  debugMsg("Execute send sync tr");
+
+  while(currentReq != NULL) {
+    cpt ++;
+    currentReq = currentReq->next;
+  }
+
+  cpt = random() % cpt;
+
+  // Head of the list?
+  selectedReq = req->syncChannel->inWaitQueue;
+  while (cpt > 0) {
+    selectedReq = selectedReq->next;
+    cpt --;
+  } 
+
+  // Remove all related request from list requests
+  //req->syncChannel->inWaitQueue = removeRequestFromList(req->syncChannel->inWaitQueue, selectedReq);
+  debugMsg("Setting related request");
+  req->relatedRequest = selectedReq;
+
+  // Select the selected request, and notify the information
+  selectedReq->selected = 1;
+  selectedReq->listOfRequests->selectedRequest = selectedReq;
+
+  // Handle parameters
+  copyParameters(req, selectedReq);
+
+  debugMsg("Signaling");
+  pthread_cond_signal(selectedReq->listOfRequests->wakeupCondition);
+
+  traceSynchroRequest(req, selectedReq);
+}
+
+void executeReceiveSyncTransaction(request *req) {
+  int cpt;
+  request *selectedReq;
+  
+  // At least one transaction available -> must select one randomly
+  // First: count how many of them are available
+  // Then, select one
+  // Broadcast the new condition!
+
+  request* currentReq = req->syncChannel->outWaitQueue;
+  cpt = 0;
+  debugMsg("Execute receive sync tr");
+
+  while(currentReq != NULL) {
+    cpt ++;
+    //debugInt("cpt", cpt);
+    currentReq = currentReq->next;
+  }
+  cpt = random() % cpt;
+  selectedReq = req->syncChannel->outWaitQueue;
+  while (cpt > 0) {
+    selectedReq = selectedReq->next;
+    cpt --;
+  } 
+
+  //req->syncChannel->outWaitQueue = removeRequestFromList(req->syncChannel->outWaitQueue, selectedReq);
+  debugMsg("Setting related request");
+  req->relatedRequest = selectedReq;
+
+  // Select the request, and notify the information in the channel
+  selectedReq->selected = 1;
+  selectedReq->listOfRequests->selectedRequest = selectedReq;
+
+  // Handle parameters
+  copyParameters(selectedReq, req);
+
+  debugMsg("Signaling");
+  pthread_cond_signal(selectedReq->listOfRequests->wakeupCondition);
+
+  traceSynchroRequest(selectedReq, req);
+}
+
+
+void executeSendAsyncTransaction(request *req) {
+  request *selectedReq;
+
+  // Full FIFO?
+  if (req->asyncChannel->currentNbOfMessages == req->asyncChannel->maxNbOfMessages) {
+    // Must remove the oldest  message
+    getAndRemoveOldestMessageFromAsyncChannel(req->asyncChannel);
+  }
+
+  addMessageToAsyncChannel(req->asyncChannel, req->msg);
+  
+  debugMsg("Signaling async write to all requests waiting ");
+  selectedReq = req->asyncChannel->inWaitQueue;
+  while (selectedReq != NULL) {
+    pthread_cond_signal(selectedReq->listOfRequests->wakeupCondition);
+    selectedReq = selectedReq->next;
+  }
+  debugMsg("Signaling done");
+
+  traceAsynchronousSendRequest(req);
+}
+
+void executeReceiveAsyncTransaction(request *req) {
+  int i;
+  request *selectedReq;
+
+  req->msg = getAndRemoveOldestMessageFromAsyncChannel(req->asyncChannel);
+    
+  selectedReq = req->asyncChannel->outWaitQueue;
+
+  // Must recopy parameters
+  for(i=0; i<req->nbOfParams; i++) {
+    *(req->params[i]) = req->msg->params[i];
+  }
+
+  traceAsynchronousReceiveRequest(req);
+
+  // unallocate message
+  destroyMessageWithParams(req->msg);
+
+  debugMsg("Signaling async read to all requests waiting ");
+  while (selectedReq != NULL) {
+    pthread_cond_signal(selectedReq->listOfRequests->wakeupCondition);
+    selectedReq = selectedReq->next;
+  }
+  debugMsg("Signaling done");
+}
+
+
+void executeSendBroadcastTransaction(request *req) {
+  int cpt;
+  request *tmpreq;
+
+  // At least one transaction available -> must select all of them
+  // but at most one per task
+  // Then, broadcast the new condition!
+
+  request* currentReq = req->syncChannel->inWaitQueue;
+  request* currentLastReq = req;
+  debugMsg("Execute broadcast sync tr");
+
+  
+  while(currentReq != NULL) {
+    tmpreq = hasIdenticalRequestInListOfSelectedRequests(currentReq, req->relatedRequest);
+    if (tmpreq != NULL) {
+      // Must select one of the two
+      // If =1, replace, otherwise, just do nothing
+      cpt = random() % 2;
+      if (cpt == 1) {
+	debugMsg("Replacing broadcast request");
+	req->relatedRequest = replaceInListOfSelectedRequests(tmpreq, currentReq, req->relatedRequest);
+	currentReq->listOfRequests->selectedRequest = currentReq;
+	copyParameters(req, currentReq);
+	currentReq->selected = 1;
+	currentLastReq = req;
+	while(currentLastReq->relatedRequest != NULL) {
+	  currentLastReq = currentLastReq->relatedRequest;
+	}
+      }
+    } else {
+      currentLastReq->relatedRequest = currentReq;
+      currentReq->relatedRequest = NULL;
+      currentReq->selected = 1;
+      currentReq->listOfRequests->selectedRequest = currentReq;
+      copyParameters(req, currentReq);
+      currentLastReq = currentReq;
+    }
+
+    currentReq = currentReq->next;
+    
+    debugInt("Nb of requests selected:", nbOfRelatedRequests(req));
+  }
+
+
+  debugMsg("Signaling");
+  currentReq = req->relatedRequest;
+  cpt = 0;
+  while(currentReq != NULL) {
+    cpt ++;
+    pthread_cond_signal(currentReq->listOfRequests->wakeupCondition);
+    traceSynchroRequest(req, currentReq);
+    currentReq = currentReq->relatedRequest;
+  }
+
+  debugInt("NUMBER of broadcast Requests", cpt);
+}
+
+
+int executable(setOfRequests *list, int nb) {
+  int cpt = 0;
+  //int index = 0;
+  request *req = list->head;
+  timespec ts;
+  int tsDone = 0;
+
+  debugMsg("Starting loop");
+
+  list->hasATimeRequest = 0;
+
+  while(req != NULL) {
+    if (!(req->delayElapsed)) {
+      if (req->hasDelay) {
+	// Is the delay elapsed???
+	debugTime("begin time of list of request", &list->startTime);
+	debugTime("start time of this request", &req->myStartTime);
+	if (tsDone == 0) {
+	  my_clock_gettime(&ts);
+	  debugTime("Current time", &ts);
+	  tsDone = 1;
+	}
+
+	if (isBefore(&ts, &(req->myStartTime)) == 1) {
+	  // Delay not elapsed
+	  debugMsg("---------t--------> delay NOT elapsed");
+	  if (list->hasATimeRequest == 0) {
+	    list->hasATimeRequest = 1;
+	    list->minTimeToWait.tv_nsec = req->myStartTime.tv_nsec;
+	    list->minTimeToWait.tv_sec = req->myStartTime.tv_sec;
+	  } else {
+	    minTime(&(req->myStartTime), &(list->minTimeToWait),&(list->minTimeToWait));
+	  }
+	}  else {
+	  // Delay elapsed
+	  debugMsg("---------t--------> delay elapsed");
+	  req->delayElapsed = 1;
+	}
+      } else {
+	req->delayElapsed = 1;
+      }
+    }
+    req = req->nextRequestInList;
+  }
+  
+  req = list->head;
+  while((req != NULL) && (cpt < nb)) {
+    req->executable = 0;
+    if (req->delayElapsed) {
+      if (req->type == SEND_SYNC_REQUEST) {
+	debugMsg("Send sync");
+
+	if (req->syncChannel->inWaitQueue != NULL) {
+	  debugMsg("Send sync executable");
+	  req->executable = 1;
+	  cpt ++;
+	}  else {
+	  debugMsg("Send sync not executable");
+	}
+	//index ++;
+      }
+
+      if (req->type == RECEIVE_SYNC_REQUEST) {
+	debugMsg("receive sync");
+	if (req->syncChannel->outWaitQueue != NULL) {
+	  req->executable = 1;
+	  cpt ++;
+	}
+	//index ++;
+      }
+
+      if (req->type == SEND_ASYNC_REQUEST) {
+	debugMsg("Send async");
+
+	if (!(req->asyncChannel->isBlocking)) {
+	  // Can always add a message -> executable
+	  debugMsg("Send async executable since non blocking");
+	  req->executable = 1;
+	  cpt ++;
+
+	  //blocking case ... channel full?
+	} else {
+	  if (req->asyncChannel->currentNbOfMessages < req->asyncChannel->maxNbOfMessages) {
+	    // Not full!
+	    debugMsg("Send async executable since channel not full");
+	    req->executable = 1;
+	    cpt ++;
+	  } else {
+	    debugMsg("Send async not executable: full, and channel is blocking");
+	  }
+	}
+      }
+
+      if (req->type == RECEIVE_ASYNC_REQUEST) {
+	debugMsg("receive async");
+	if (req->asyncChannel->currentNbOfMessages >0) {
+	  debugMsg("Receive async executable: not empty");
+	  req->executable = 1;
+	  cpt ++;
+	} else {
+	  debugMsg("Receive async not executable: empty");
+	}
+	//index ++;
+      }
+      
+
+      if (req->type == SEND_BROADCAST_REQUEST) {
+	debugMsg("send broadcast");
+	req->executable = 1;
+	cpt ++;
+      }
+
+      if (req->type == RECEIVE_BROADCAST_REQUEST) {
+	debugMsg("receive broadcast");
+	// A receive broadcast is never executable
+	req->executable = 0;
+	//index ++;
+      }
+
+      
+      
+
+      if (req->type == IMMEDIATE) {
+	debugMsg("immediate");
+	req->executable = 1;
+	cpt ++;
+      }
+    }
+
+    req = req->nextRequestInList;
+    
+  }
+
+  return cpt;
+}
+
+void private__makeRequestPending(setOfRequests *list) {
+  request *req = list->head;
+  while(req != NULL) {
+    if ((req->delayElapsed) && (!(req->alreadyPending))) {
+      if (req->type == SEND_SYNC_REQUEST) {
+	debugMsg("Adding pending request in outWaitqueue");
+	req->syncChannel->outWaitQueue = addToRequestQueue(req->syncChannel->outWaitQueue, req);
+	req->alreadyPending = 1;
+      }
+
+      if (req->type ==  RECEIVE_SYNC_REQUEST) {
+	debugMsg("Adding pending request in inWaitqueue");
+	req->alreadyPending = 1;
+	req->syncChannel->inWaitQueue = addToRequestQueue(req->syncChannel->inWaitQueue, req);
+      }
+
+      if (req->type == SEND_ASYNC_REQUEST) {
+	debugMsg("Adding pending request in outWaitqueue");
+	req->asyncChannel->outWaitQueue = addToRequestQueue(req->asyncChannel->outWaitQueue, req);
+	req->alreadyPending = 1;
+      }
+
+      if (req->type ==  RECEIVE_ASYNC_REQUEST) {
+	debugMsg("Adding pending request in inWaitqueue");
+	req->alreadyPending = 1;
+	req->asyncChannel->inWaitQueue = addToRequestQueue(req->asyncChannel->inWaitQueue, req);
+      }
+
+      if (req->type ==  RECEIVE_BROADCAST_REQUEST) {
+	debugMsg("Adding pending broadcast request in inWaitqueue");
+	req->alreadyPending = 1;
+	req->syncChannel->inWaitQueue = addToRequestQueue(req->syncChannel->inWaitQueue, req);
+      }
+
+      if (req->type ==  SEND_BROADCAST_REQUEST) {
+	debugMsg("Adding pending broadcast request in outWaitqueue");
+	req->alreadyPending = 1;
+	req->syncChannel->outWaitQueue = addToRequestQueue(req->syncChannel->outWaitQueue, req);
+      }
+      
+    }
+
+    req = req->nextRequestInList;
+  }
+}
+
+void private__makeRequest(request *req) {
+  if (req->type == SEND_SYNC_REQUEST) {
+    executeSendSyncTransaction(req);
+  }
+
+  if (req->type == RECEIVE_SYNC_REQUEST) {
+    executeReceiveSyncTransaction(req);
+  }
+
+  if (req->type == SEND_ASYNC_REQUEST) {
+    executeSendAsyncTransaction(req);
+  }
+
+  if (req->type == RECEIVE_ASYNC_REQUEST) {
+    executeReceiveAsyncTransaction(req);
+  }
+
+  if (req->type == SEND_BROADCAST_REQUEST) {
+    executeSendBroadcastTransaction(req);
+  }
+
+  // IMMEDIATE: Nothing to do
+  
+  // In all cases: remove other requests of the same list from their pending form
+  debugMsg("Removing original req");
+  removeAllPendingRequestsFromPendingLists(req, 1);
+  removeAllPendingRequestsFromPendingListsRelatedRequests(req);
+  /*if (req->relatedRequest != NULL) {
+    debugMsg("Removing related req");
+    removeAllPendingRequestsFromPendingLists(req->relatedRequest, 0);
+    }*/
+  
+}
+
+void removeAllPendingRequestsFromPendingListsRelatedRequests(request *req) {
+  if (req->relatedRequest != NULL) {
+    debugMsg("Removing related req");
+    removeAllPendingRequestsFromPendingLists(req->relatedRequest, 0);
+    // Recursive call
+    removeAllPendingRequestsFromPendingListsRelatedRequests(req->relatedRequest);
+  }
+}
+
+
+request *private__executeRequests0(setOfRequests *list, int nb) {
+  int howMany, found;
+  int selectedIndex, realIndex;
+  request *selectedReq;
+  request *req;
+  
+  // Compute which requests can be executed
+  debugMsg("Counting requests");
+  howMany = executable(list, nb);
+
+  debugInt("Counting requests=", howMany);
+
+  if (howMany == 0) {
+    debugMsg("No pending requests");
+    // Must make them pending
+    
+    private__makeRequestPending(list);
+
+    return NULL;
+  }
+  
+  debugInt("At least one pending request is executable", howMany);
+
+  
+  // Select a request
+  req = list->head;
+  selectedIndex = (rand() % howMany)+1;
+  debugInt("selectedIndex=", selectedIndex);
+  realIndex = 0;
+  found = 0;
+  while(req != NULL) {
+    if (req->executable == 1) {
+      found ++;
+      if (found == selectedIndex) {
+	break;
+      }
+    }
+    realIndex ++;
+    req = req->nextRequestInList;
+  }
+
+  debugInt("Getting request at index", realIndex);
+  selectedReq = getRequestAtIndex(list, realIndex);
+  selectedReq->selected = 1;
+  selectedReq->listOfRequests->selectedRequest = selectedReq;
+
+  debugInt("Selected request of type", selectedReq->type);
+
+  // Execute that request
+  private__makeRequest(selectedReq);
+
+  return selectedReq;  
+}
+
+
+request *private__executeRequests(setOfRequests *list) {
+  // Is a request already selected?
+
+  if (list->selectedRequest != NULL) {
+    return list->selectedRequest;
+  }
+
+  debugMsg("No request selected -> looking for one!");
+
+  return private__executeRequests0(list, nbOfRequests(list));
+}
+
+
+
+
+request *executeOneRequest(setOfRequests *list, request *req) {
+  req->nextRequestInList = NULL;
+  req->listOfRequests = list;
+  list->head = req;
+  return executeListOfRequests(list);
+}
+
+
+void setLocalStartTime(setOfRequests *list) {
+  request *req = list->head;
+
+  while(req != NULL) {
+    if (req->hasDelay) {
+      req->delayElapsed = 0;
+      addTime(&(list->startTime), &(req->delay), &(req->myStartTime));
+      debug2Msg(list->owner, " -----t------>: Request with delay");
+    } else {
+      req->delayElapsed = 1;
+      req->myStartTime.tv_nsec = list->startTime.tv_nsec;
+      req->myStartTime.tv_sec = list->startTime.tv_sec;
+    }
+    req = req->nextRequestInList;
+  }
+}
+
+
+// Return the executed request
+request *executeListOfRequests(setOfRequests *list) {
+  request *req;
+
+  my_clock_gettime(&list->startTime);
+  list->selectedRequest = NULL;
+  setLocalStartTime(list);
+  
+  // Try to find a request that could be executed
+  debug2Msg(list->owner, "Locking mutex");
+  pthread_mutex_lock(list->mutex);
+  debug2Msg(list->owner, "Mutex locked");
+
+  debug2Msg(list->owner, "Going to execute request");
+
+  while((req = private__executeRequests(list)) == NULL) {
+    debug2Msg(list->owner, "Waiting for request!");
+    if (list->hasATimeRequest == 1) {
+      debug2Msg(list->owner, "Waiting for a request and at most for a given time");
+      debugTime("Min time to wait=", &(list->minTimeToWait));
+      pthread_cond_timedwait(list->wakeupCondition, list->mutex, &(list->minTimeToWait));
+    } else {
+      debug2Msg(list->owner, "Releasing mutex");
+      pthread_cond_wait(list->wakeupCondition, list->mutex);
+    }
+    debug2Msg(list->owner, "Waking up for requests! -> getting mutex");
+  }
+
+  debug2Msg(list->owner, "Request selected!");
+
+  my_clock_gettime(&list->completionTime);
+
+  pthread_mutex_unlock(list->mutex); 
+  debug2Msg(list->owner, "Mutex unlocked");
+  return req;
+}
+
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/request_manager.h b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/request_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..e2ae0f800025b9394d6488c012b47f7396aaf609
--- /dev/null
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/request_manager.h
@@ -0,0 +1,14 @@
+#ifndef REQUEST_MANAGER_H
+#define REQUEST_MANAGER_H
+
+
+#include "request.h"
+#include "syncchannel.h"
+
+
+request *executeOneRequest(setOfRequests *list, request *req);
+request *executeListOfRequests(setOfRequests *list);
+
+void removeAllPendingRequestsFromPendingListsRelatedRequests(request *req);
+
+#endif
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/syncchannel.c b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/syncchannel.c
new file mode 100644
index 0000000000000000000000000000000000000000..e1c90875f2574a15318facbda32b27f918f82592
--- /dev/null
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/syncchannel.c
@@ -0,0 +1,41 @@
+#include <stdlib.h>
+
+
+#include "syncchannel.h"
+#include "request.h"
+#include "myerrors.h"
+#include "debug.h"
+
+
+syncchannel *getNewSyncchannel(char *outname, char *inname) {
+  syncchannel * syncch = (syncchannel *)(malloc(sizeof(struct syncchannel)));
+  if (syncch == NULL) {
+    criticalError("Allocation of request failed");
+  }
+  syncch->inname = inname;
+  syncch->outname = outname;
+  syncch->inWaitQueue = NULL;
+  syncch->outWaitQueue = NULL;
+  syncch->isBroadcast = false;
+  return syncch;
+}
+
+void setBroadcast(syncchannel *syncch, bool b) {
+  syncch->isBroadcast = b;
+}
+
+
+
+/*request *makeNewSendSync(int hasDelay, long delay, int nbOfParams, int *params[]) {
+  request *req = getNewRequest(SEND_SYNC_REQUEST, hasDelay, delay, nbOfParams, params);
+  return req;
+}
+
+request *makeNewReceiveSync(int hasDelay, long delay, int nbOfParams, int *params[]) {
+  request *req = getNewRequest(RECEIVE_SYNC_REQUEST, hasDelay, delay, nbOfParams, params);
+  return req;
+  }*/
+
+void destroySyncchannel(syncchannel *syncch) {
+  free(syncch);
+}
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/syncchannel.h b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/syncchannel.h
new file mode 100644
index 0000000000000000000000000000000000000000..6f4f92de5531f14c36b7d520992eb3decb305cdd
--- /dev/null
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/syncchannel.h
@@ -0,0 +1,27 @@
+#ifndef SYNCCHANNEL_H
+#define SYNCCHANNEL_H
+
+struct syncchannel;
+
+#include "request.h"
+#include "defs.h"
+
+struct syncchannel {
+  char *outname;
+  char *inname;
+  struct request* inWaitQueue;
+  struct request* outWaitQueue; 
+  bool isBroadcast;
+};
+
+typedef struct syncchannel syncchannel;
+
+
+void setBroadcast(syncchannel *syncch, bool b);
+syncchannel *getNewSyncchannel(char *inname, char *outname);
+//request *makeNewSendSync(int hasDelay, long delay, int nbOfParams, int *params[]);
+//request *makeNewReceiveSync(int hasDelay, long delay, int nbOfParams, int *params[]);
+void destroySyncchannel(syncchannel *syncch);
+
+
+#endif
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/tracemanager.c b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/tracemanager.c
new file mode 100644
index 0000000000000000000000000000000000000000..fda3a0db1c76a9861708dd422c2cea7f180688b0
--- /dev/null
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/tracemanager.c
@@ -0,0 +1,304 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <time.h>
+
+#include "tracemanager.h"
+#include "debug.h"
+#include "mytimelib.h"
+
+
+#define TRACE_OFF 0
+#define TRACE_IN_FILE 1
+#define TRACE_IN_CONSOLE 2
+
+#define TRACE_FILE_NAME "Trace.txt"
+
+
+pthread_mutex_t __traceMutex;
+
+int trace = TRACE_OFF;
+int id = 0;
+
+FILE *file;
+
+struct timespec begints;
+
+
+void addInfo(char *dest, char *info) {
+  //char s1[10];
+  long tmp;
+  //long tmp1;
+  //int i;
+  struct timespec ts, ts1;
+  my_clock_gettime(&ts);
+  
+  debugMsg("DIFF TIME");
+  diffTime(&begints, &ts, &ts1);
+
+  tmp = ts1.tv_nsec;
+
+  if (tmp < 0) {
+    tmp = -tmp;
+  }
+
+  /*tmp1 = 100000000;
+
+  for(i=0; i<9; i++) {
+    s1[i] = 48 + (tmp / tmp1);
+    tmp = tmp % tmp1;
+    tmp1 = tmp1 / 10;
+    }
+    s1[9] = '\0';*/
+  
+  /* s1 -> tmp */
+  sprintf(dest, "#%d time=%ld.%09ld %s", id, ts1.tv_sec, tmp, info);
+  id ++;
+}
+
+
+void writeInTrace(char *info) {
+  pthread_mutex_lock(&__traceMutex);
+  char s[CHAR_ALLOC_SIZE];
+  addInfo(s, info);
+		 //printf("Write in file\n");
+  switch(trace){
+  case TRACE_IN_FILE:
+    if (file != NULL) {
+      debug2Msg("Saving in file", s);
+      fprintf(file, s);
+      fflush(file);
+    }
+    break;
+  case TRACE_IN_CONSOLE:
+    printf("%s\n", s);
+    break;
+  }
+  
+  pthread_mutex_unlock(&__traceMutex);
+}
+
+
+void activeTracingInFile(char *fileName) {
+  char *name;
+  trace = TRACE_IN_FILE;
+  my_clock_gettime(&begints); 
+  if (fileName == NULL) {
+    name = TRACE_FILE_NAME;
+  } else {
+    name  = fileName;
+  }
+  file = fopen(name,"w");
+
+  /* Initializing mutex */
+  if (pthread_mutex_init(&__traceMutex, NULL) < 0) { exit(-1);}
+}
+
+void activeTracingInConsole() {
+  trace = TRACE_IN_CONSOLE;
+  my_clock_gettime(&begints); 
+  
+  /* Initializing mutex */
+  if (pthread_mutex_init(&__traceMutex, NULL) < 0) { exit(-1);}
+}
+
+void unactiveTracing() {
+  trace = TRACE_OFF;
+}
+
+
+void traceStateEntering(char *myname, char *statename) {
+  char s[CHAR_ALLOC_SIZE];
+
+  debugMsg("Trace function");
+
+  if (trace == TRACE_OFF) {
+    return;
+  }
+
+  sprintf(s, "block=%s type=state_entering state=%s\n", myname, statename);
+
+  // Saving trace
+  writeInTrace(s);
+}
+
+void traceFunctionCall(char *block, char *func, char *params) {
+  char s[CHAR_ALLOC_SIZE];
+
+  debugMsg("Trace function");
+
+  if (trace == TRACE_OFF) {
+    return;
+  }
+
+  sprintf(s, "block=%s type=function_call func=%s parameters=%s\n", block, func, params);
+
+  // Saving trace
+  writeInTrace(s);
+}
+
+
+// type=0: int type = 1:bool
+void traceVariableModification(char *block, char *var, int value, int type) {
+  char s[CHAR_ALLOC_SIZE];
+  debugMsg("Trace variable modification");
+
+  if (trace == TRACE_OFF) {
+    return;
+  }
+
+  
+  if (type == 0) {
+    sprintf(s, "block=%s type=variable_modification variable=%s setTo=%d\n", block, var, value);
+  }
+
+  if (type == 1) {
+    if (value == 0) {
+      sprintf(s, "block=%s type=variable_modification variable=%s setTo=false\n", block, var);
+    } else {
+      sprintf(s, "block=%s type=variable_modification variable=%s setTo=true\n", block, var);
+    }
+  }
+
+  // Saving trace
+  writeInTrace(s);
+
+}
+
+void traceSynchroRequest(request *from, request *to) {
+  char s[1024];
+  int i;
+
+  if (trace == TRACE_OFF) {
+    return;
+  }
+
+  sprintf(s, "block=%s blockdestination=%s type=synchro channel=%s params=", from->listOfRequests->owner, to->listOfRequests->owner, from->syncChannel->outname);
+  for(i=0; i<from->nbOfParams; i++) {
+    if (i>0) {
+      sprintf(s, "%s,", s);
+    }
+    sprintf(s, "%s%d", s, *(from->params[i]));
+  }
+  sprintf(s, "%s\n", s);
+
+  debugMsg("Trace request synchro");
+  
+
+  // Saving trace
+  writeInTrace(s);
+}
+
+
+void traceAsynchronousSendRequest(request *req) {
+  char s[1024];
+  int i;
+
+  if (trace == TRACE_OFF) {
+    return;
+  }
+
+  sprintf(s, "block=%s type=send_async channel=%s msgid=%ld params=", req->listOfRequests->owner, req->asyncChannel->outname, req->msg->id);
+  if (req->msg != NULL) {
+    debugMsg("Computing params");
+    for(i=0; i<req->msg->nbOfParams; i++) {
+      if (i>0) {
+	sprintf(s, "%s,", s);
+      }
+      sprintf(s, "%s%d", s, req->msg->params[i]);
+    }
+  }
+  sprintf(s, "%s\n", s);
+
+  
+
+  // Saving trace
+  writeInTrace(s);
+}
+
+
+void traceAsynchronousReceiveRequest(request *req) {
+  char s[1024];
+  int i;
+
+  if (trace == TRACE_OFF) {
+    return;
+  }
+
+  sprintf(s, "block=%s type=receive_async channel=%s msgid=%ld params=", req->listOfRequests->owner, req->asyncChannel->outname, req->msg->id);
+  if (req->msg != NULL) {
+    debugMsg("Computing params");
+    for(i=0; i<req->msg->nbOfParams; i++) {
+      if (i>0) {
+	sprintf(s, "%s,", s);
+      }
+      sprintf(s, "%s%d", s, req->msg->params[i]);
+    }
+  }
+  sprintf(s, "%s\n", s);
+
+  
+
+  // Saving trace
+  writeInTrace(s);
+}
+
+
+
+void traceRequest(char *myname, request *req) {
+  char s[1024];
+  int i;
+ 
+
+  debugMsg("Trace request");
+
+
+  if (trace == TRACE_OFF) {
+    return;
+  }
+
+  // Build corresponding char*;
+
+  switch(req->type) {
+    case SEND_SYNC_REQUEST:
+    debug2Msg("Sync channel", req->syncChannel->outname);
+    sprintf(s, "block=%s type=send_synchro channel=%s params=", myname, req->syncChannel->outname);
+    for(i=0; i<req->nbOfParams; i++) {
+      if (i>0) {
+	sprintf(s, "%s,", s);
+      }
+      sprintf(s, "%s%d", s, *(req->params[i]));
+    }
+    sprintf(s, "%s\n", s);
+ 
+    break;
+  case RECEIVE_SYNC_REQUEST:
+    sprintf(s, "block=%s type=receive_synchro channel=%s\n", myname, req->syncChannel->inname);
+    break;
+    case SEND_ASYNC_REQUEST:
+    debug2Msg("Async channel", req->asyncChannel->outname);
+    sprintf(s, "block=%s type=send_async_2 channel=%s\n", myname, req->asyncChannel->outname);
+    break;
+  case RECEIVE_ASYNC_REQUEST:
+    sprintf(s, "block=%s type=receive_async_2 channel=%s\n", myname, req->asyncChannel->inname);
+    break;
+   case SEND_BROADCAST_REQUEST:
+    debug2Msg("Sync channel", req->syncChannel->outname);
+    sprintf(s, "block=%s type=send_broadcast channel=%s\n", myname, req->syncChannel->outname);
+    break; 
+   case RECEIVE_BROADCAST_REQUEST:
+    debug2Msg("Sync channel", req->syncChannel->outname);
+    sprintf(s, "block=%s type=receive_broadcast channel=%s\n", myname, req->syncChannel->outname);
+    break; 
+   case IMMEDIATE:
+     sprintf(s, "block=%s type=action\n", myname);
+    break;
+  default:
+    sprintf(s, "block=%s type=unknown\n", myname);
+  }
+
+  debugMsg("Trace request 2");
+  
+
+  // Saving trace
+  writeInTrace(s);
+}
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/tracemanager.h b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/tracemanager.h
new file mode 100644
index 0000000000000000000000000000000000000000..d33f3532a4bcb9fc7b96ddda00bcfee9cfb2a4bc
--- /dev/null
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/tracemanager.h
@@ -0,0 +1,21 @@
+#ifndef TRACEMANAGER_H
+#define TRACEMANAGER_H
+
+#include "request.h"
+
+#define CHAR_ALLOC_SIZE 1024
+
+
+void activeTracingInFile();
+void unactiveTracing();
+void traceRequest(char *myname, request *req);
+void traceFunctionCall(char *block, char *func, char* params);
+void traceVariableModification(char *block, char *var, int value, int type); // type=0: int type = 1:bool
+void traceStateEntering(char *myname, char *statename);
+void traceSynchroRequest(request *from, request *to);
+void traceAsynchronousSendRequest(request *req);
+void traceAsynchronousReceiveRequest(request *req);
+
+#endif
+
+
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/asyncchannel.cpp b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/asyncchannel.cpp
index 9c9ffd3a89478bd2733aac5e93194a8f708a068a..40c52ac0f1d127c8ac5e1ef4b39d7d58d2400130 100644
--- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/asyncchannel.cpp
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/asyncchannel.cpp
@@ -1,9 +1,7 @@
-//#include <stdlib.h>
-
 #include "message.h"
 #include "asyncchannel.h"
 #include "myerrors.h"
-#include <mbed.h>
+#include "mbed.h"
 
 asyncchannel *getNewAsyncchannel(char *outname, char *inname, int isBlocking, int maxNbOfMessages) {
   asyncchannel * asyncch = (asyncchannel *)(malloc(sizeof(struct asyncchannel)));
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/debug.cpp b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/debug.cpp
index b52637800ce09de9e18c46421a001168aea0b135..9602c6c20bb42ff09cdb674f559ec216d5bb791e 100644
--- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/debug.cpp
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/debug.cpp
@@ -6,7 +6,6 @@
 #define DEBUG_OFF 2
 Serial pc(USBTX,USBRX);
 
-#include <mbed.h>
 #include "debug.h"
 
 int _debug = DEBUG_OFF;
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/mytimelib.cpp b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/mytimelib.cpp
index 51430f8bb92d716ffbf60ca6b69415b2d5a6e802..f24986a16ca60213cd251d498ec65656bee275ca 100644
--- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/mytimelib.cpp
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/mytimelib.cpp
@@ -21,8 +21,24 @@ int my_clock_gettime(struct timespec *tp) {
 
 #else
 
+int clock_gettime(struct timespec *ts) {
+  //struct timeval tv;
+  //time(NULL);time since epoch in seconds
+  //people also use the variable localtime
+  //Dont understand the difference between this function and the other one
+  ts->tv_sec = time(NULL);
+  ts->tv_nsec = 0;
+  return 0;
+}
+
 int my_clock_gettime(struct timespec *tp) {
-  return clock_gettime(CLOCK_REALTIME, tp);
+  
+  return clock_gettime(tp);
+  //this functions justs gives back the real time since epoch,
+  //is it the same as time()???
+  //return clock_gettime(CLOCK_REALTIME, tp);
+  //printf("Led1 encendido, led2 apagado, %d\n",seconds);
+
 }
 
 #endif
@@ -102,7 +118,11 @@ void waitFor(long minDelay, long maxDelay) {
   delayToTimeSpec(&tssrc, delay);
 
   debugLong("............. waiting For", delay);
-  nanosleep(&tssrc, &tsret);
+  if(tssrc.tv_nsec > tsret.tv_nsec){
+    wait_us(tsret.tv_nsec/1000);
+  }else{
+    wait_us(tssrc.tv_nsec/1000);
+  }
   debugLong("............. waiting Done for: ", delay);
 }
 
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/mytimelib.h b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/mytimelib.h
index 76ed5d22fcd7cf9a2750cf2a9726f5cdb89e48f2..f22f60028a8890fef19d51fc6269db03a069a436 100644
--- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/mytimelib.h
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/mytimelib.h
@@ -3,6 +3,7 @@
 
 #include <time.h>
 #include <sys/time.h>
+#include "mbed.h"
 
 
 
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/random.cpp b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/random.cpp
index 67ceed377f3689876e2200f1fc82b54091bb6777..4a5df9dd59e1b3dfa0cbf8c9fa924ca094b1e243 100644
--- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/random.cpp
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/random.cpp
@@ -7,7 +7,6 @@
 #include "random.h"
 #include <mbed.h>
 #include "debug.h"
-#include <math.h>
 
 #include "mytimelib.h"
 
diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/request_manager.cpp b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/request_manager.cpp
index f6ae01521c37df65029085f788f9134802543bd4..76b27cf68d513c10ba70e8b22dd420dfa9fa4537 100644
--- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/request_manager.cpp
+++ b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/request_manager.cpp
@@ -54,7 +54,7 @@ void executeSendSyncTransaction(request *req) {
 
 	debugMsg("Signaling");
   
-	pthread_cond_signal(selectedReq->listOfRequests->wakeupCondition);
+	rtos::Thread::signal_wait(selectedReq->listOfRequests->wakeupCondition);
 
 	traceSynchroRequest(req, selectedReq);
 }
@@ -96,8 +96,8 @@ void executeReceiveSyncTransaction(request *req) {
   copyParameters(selectedReq, req);
 
   debugMsg("Signaling");
-  pthread_cond_signal(selectedReq->listOfRequests->wakeupCondition);
-
+  //pthread_cond_signal(selectedReq->listOfRequests->wakeupCondition);
+  rtos::Thread::signal_wait(selectedReq->listOfRequests->wakeupCondition);
   traceSynchroRequest(selectedReq, req);
 }
 
@@ -116,7 +116,8 @@ void executeSendAsyncTransaction(request *req) {
   debugMsg("Signaling async write to all requests waiting ");
   selectedReq = req->asyncChannel->inWaitQueue;
   while (selectedReq != NULL) {
-    pthread_cond_signal(selectedReq->listOfRequests->wakeupCondition);
+    //pthread_cond_signal(selectedReq->listOfRequests->wakeupCondition);
+    rtos::Thread::signal_wait(selectedReq->listOfRequests->wakeupCondition);
     selectedReq = selectedReq->next;
   }
   debugMsg("Signaling done");
@@ -144,7 +145,8 @@ void executeReceiveAsyncTransaction(request *req) {
 
   debugMsg("Signaling async read to all requests waiting ");
   while (selectedReq != NULL) {
-    pthread_cond_signal(selectedReq->listOfRequests->wakeupCondition);
+    //pthread_cond_signal(selectedReq->listOfRequests->wakeupCondition);
+    rtos::Thread::signal_wait(selectedReq->listOfRequests->wakeupCondition);
     selectedReq = selectedReq->next;
   }
   debugMsg("Signaling done");
@@ -201,7 +203,8 @@ void executeSendBroadcastTransaction(request *req) {
   cpt = 0;
   while(currentReq != NULL) {
     cpt ++;
-    pthread_cond_signal(currentReq->listOfRequests->wakeupCondition);
+    //pthread_cond_signal(currentReq->listOfRequests->wakeupCondition);
+    rtos::Thread::signal_wait(currentReq->listOfRequests->wakeupCondition);
     traceSynchroRequest(req, currentReq);
     currentReq = currentReq->relatedRequest;
   }
diff --git a/modeling/BlinkingLed.ttool/BlinkingLed.xml b/modeling/BlinkingLed.ttool/BlinkingLed.xml
index 8343b1d95821d1123f4b4afe8e34200b63e2e88f..2ae49e3f57c0e0f9799c405fd99127d35d8057d5 100644
--- a/modeling/BlinkingLed.ttool/BlinkingLed.xml
+++ b/modeling/BlinkingLed.ttool/BlinkingLed.xml
@@ -5,60 +5,113 @@
 <Modeling type="AVATAR Design" nameTab="Design" >
 <AVATARBlockDiagramPanel name="Block Diagram" minX="10" maxX="2500" minY="10" maxY="1500" zoom="1.0" >
 <MainCode value="void __user_init() {"/>
-<MainCode value="  printf(&quot;Initializing...\n&quot;);"/>
 <MainCode value="}"/>
 <Optimized value="true" />
-<Validated value="MainBlock;" />
+<Validated value="SecondaryBlock;MainBlock;" />
 <Ignored value="" />
 
-<COMPONENT type="5000" id="25" >
-<cdparam x="194" y="63" />
+<CONNECTOR type="5002" id="2" >
+<cdparam x="444" y="162" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<infoparam name="connector" value="" />
+<TGConnectingPoint num="0" id="1" />
+<P1  x="444" y="162" id="32" />
+<P2  x="533" y="164" id="6" />
+<AutomaticDrawing  data="true" />
+<extraparam>
+<iso value="in RandVal(int val)" />
+<osd value="out RanVal(int val)" />
+<FIFOType asynchronous="false" size="1" blocking="false" private="true" broadcast="false" lossy="false" />
+</extraparam>
+</CONNECTOR>
+<COMPONENT type="5000" id="27" >
+<cdparam x="533" y="64" />
+<sizeparam width="250" height="200" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Block0" value="SecondaryBlock" />
+<TGConnectingPoint num="0" id="3" />
+<TGConnectingPoint num="1" id="4" />
+<TGConnectingPoint num="2" id="5" />
+<TGConnectingPoint num="3" id="6" />
+<TGConnectingPoint num="4" id="7" />
+<TGConnectingPoint num="5" id="8" />
+<TGConnectingPoint num="6" id="9" />
+<TGConnectingPoint num="7" id="10" />
+<TGConnectingPoint num="8" id="11" />
+<TGConnectingPoint num="9" id="12" />
+<TGConnectingPoint num="10" id="13" />
+<TGConnectingPoint num="11" id="14" />
+<TGConnectingPoint num="12" id="15" />
+<TGConnectingPoint num="13" id="16" />
+<TGConnectingPoint num="14" id="17" />
+<TGConnectingPoint num="15" id="18" />
+<TGConnectingPoint num="16" id="19" />
+<TGConnectingPoint num="17" id="20" />
+<TGConnectingPoint num="18" id="21" />
+<TGConnectingPoint num="19" id="22" />
+<TGConnectingPoint num="20" id="23" />
+<TGConnectingPoint num="21" id="24" />
+<TGConnectingPoint num="22" id="25" />
+<TGConnectingPoint num="23" id="26" />
+<extraparam>
+<blockType data="block" color="-4072719" />
+<CryptoBlock value="false" />
+<Attribute access="0" id="val" value="" type="8" typeOther="" />
+<Signal value="out RanVal(int val)" attached="true" />
+<globalCode value="extern int val;" />
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="5000" id="52" >
+<cdparam x="194" y="62" />
 <sizeparam width="250" height="200" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
 <cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
 <infoparam name="Block0" value="MainBlock" />
-<TGConnectingPoint num="0" id="1" />
-<TGConnectingPoint num="1" id="2" />
-<TGConnectingPoint num="2" id="3" />
-<TGConnectingPoint num="3" id="4" />
-<TGConnectingPoint num="4" id="5" />
-<TGConnectingPoint num="5" id="6" />
-<TGConnectingPoint num="6" id="7" />
-<TGConnectingPoint num="7" id="8" />
-<TGConnectingPoint num="8" id="9" />
-<TGConnectingPoint num="9" id="10" />
-<TGConnectingPoint num="10" id="11" />
-<TGConnectingPoint num="11" id="12" />
-<TGConnectingPoint num="12" id="13" />
-<TGConnectingPoint num="13" id="14" />
-<TGConnectingPoint num="14" id="15" />
-<TGConnectingPoint num="15" id="16" />
-<TGConnectingPoint num="16" id="17" />
-<TGConnectingPoint num="17" id="18" />
-<TGConnectingPoint num="18" id="19" />
-<TGConnectingPoint num="19" id="20" />
-<TGConnectingPoint num="20" id="21" />
-<TGConnectingPoint num="21" id="22" />
-<TGConnectingPoint num="22" id="23" />
-<TGConnectingPoint num="23" id="24" />
+<TGConnectingPoint num="0" id="28" />
+<TGConnectingPoint num="1" id="29" />
+<TGConnectingPoint num="2" id="30" />
+<TGConnectingPoint num="3" id="31" />
+<TGConnectingPoint num="4" id="32" />
+<TGConnectingPoint num="5" id="33" />
+<TGConnectingPoint num="6" id="34" />
+<TGConnectingPoint num="7" id="35" />
+<TGConnectingPoint num="8" id="36" />
+<TGConnectingPoint num="9" id="37" />
+<TGConnectingPoint num="10" id="38" />
+<TGConnectingPoint num="11" id="39" />
+<TGConnectingPoint num="12" id="40" />
+<TGConnectingPoint num="13" id="41" />
+<TGConnectingPoint num="14" id="42" />
+<TGConnectingPoint num="15" id="43" />
+<TGConnectingPoint num="16" id="44" />
+<TGConnectingPoint num="17" id="45" />
+<TGConnectingPoint num="18" id="46" />
+<TGConnectingPoint num="19" id="47" />
+<TGConnectingPoint num="20" id="48" />
+<TGConnectingPoint num="21" id="49" />
+<TGConnectingPoint num="22" id="50" />
+<TGConnectingPoint num="23" id="51" />
 <extraparam>
 <blockType data="block" color="-4072719" />
 <CryptoBlock value="false" />
 <Attribute access="0" id="period" value="2" type="8" typeOther="" />
-<Method value="$LED1onLED2off()" />
-<Method value="$LED1offLED2on()" />
+<Attribute access="0" id="x" value="0" type="8" typeOther="" />
+<Attribute access="0" id="currentRand" value="0" type="8" typeOther="" />
+<Method value="$LED1on()" />
+<Method value="$LED1off(int x)" />
+<Signal value="in RandVal(int val)" attached="true" />
 <globalCode value="DigitalOut myled1(LED1);" />
-<globalCode value="DigitalOut myled2(LED2);" />
 <globalCode value="" />
-<globalCode value="void __userImplemented__MainBlock__LED1onLED2off() {" />
-<globalCode value="	myled1 = 1;" />
-<globalCode value="	myled2 = 0;" />
-<globalCode value="	printf(&quot;Led1 encendido y Led2 apagado.\n&quot;);" />
+<globalCode value="void __userImplemented__MainBlock__LED1on() {" />
+<globalCode value=" myled1 = 1;" />
+<globalCode value=" printf(&quot;Led1 on.\n&quot;);" />
 <globalCode value="}" />
-<globalCode value="void __userImplemented__MainBlock__LED1offLED2on(){" />
-<globalCode value="	myled1 = 0;" />
-<globalCode value="	myled2 = 1;" />
-<globalCode value="	printf(&quot;Led1 apagado y Led2 encendido.\n&quot;);" />
+<globalCode value="void __userImplemented__MainBlock__LED1off(int val){" />
+<globalCode value=" myled1 = 0;" />
+<globalCode value=" printf(&quot;Led1 off.\n&quot;);" />
+<globalCode value=" printf(&quot;value of x=%d\n&quot;,val);" />
 <globalCode value="}" />
 </extraparam>
 </COMPONENT>
@@ -66,160 +119,372 @@
 
 </AVATARBlockDiagramPanel>
 
-<AVATARStateMachineDiagramPanel name="MainBlock" minX="10" maxX="2500" minY="10" maxY="1500" >
-<CONNECTOR type="5102" id="140" >
-<cdparam x="487" y="358" />
+<AVATARStateMachineDiagramPanel name="SecondaryBlock" minX="10" maxX="2500" minY="10" maxY="1500" >
+<COMPONENT type="5106" id="501" >
+<cdparam x="414" y="102" />
+<sizeparam width="143" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="State" value="Waiting_Cycle" />
+<TGConnectingPoint num="0" id="502" />
+<TGConnectingPoint num="1" id="503" />
+<TGConnectingPoint num="2" id="504" />
+<TGConnectingPoint num="3" id="505" />
+<TGConnectingPoint num="4" id="506" />
+<TGConnectingPoint num="5" id="507" />
+<TGConnectingPoint num="6" id="508" />
+<TGConnectingPoint num="7" id="509" />
+<TGConnectingPoint num="8" id="510" />
+<TGConnectingPoint num="9" id="511" />
+<TGConnectingPoint num="10" id="512" />
+<TGConnectingPoint num="11" id="513" />
+<TGConnectingPoint num="12" id="514" />
+<TGConnectingPoint num="13" id="515" />
+<TGConnectingPoint num="14" id="516" />
+<TGConnectingPoint num="15" id="517" />
+<TGConnectingPoint num="16" id="518" />
+<TGConnectingPoint num="17" id="519" />
+<TGConnectingPoint num="18" id="520" />
+<TGConnectingPoint num="19" id="521" />
+<TGConnectingPoint num="20" id="522" />
+<TGConnectingPoint num="21" id="523" />
+<TGConnectingPoint num="22" id="524" />
+<TGConnectingPoint num="23" id="525" />
+<TGConnectingPoint num="24" id="526" />
+<TGConnectingPoint num="25" id="527" />
+<TGConnectingPoint num="26" id="528" />
+<TGConnectingPoint num="27" id="529" />
+<TGConnectingPoint num="28" id="530" />
+<TGConnectingPoint num="29" id="531" />
+<TGConnectingPoint num="30" id="532" />
+<TGConnectingPoint num="31" id="533" />
+<TGConnectingPoint num="32" id="534" />
+<TGConnectingPoint num="33" id="535" />
+<TGConnectingPoint num="34" id="536" />
+<TGConnectingPoint num="35" id="537" />
+<TGConnectingPoint num="36" id="538" />
+<TGConnectingPoint num="37" id="539" />
+<TGConnectingPoint num="38" id="540" />
+<TGConnectingPoint num="39" id="541" />
+<extraparam>
+</extraparam>
+</COMPONENT>
+
+<CONNECTOR type="5102" id="488" >
+<cdparam x="488" y="498" />
 <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="143" />
-<TGConnectingPoint num="1" id="144" />
-<TGConnectingPoint num="2" id="145" />
-<P1  x="487" y="358" id="119" />
-<P2  x="487" y="177" id="71" />
-<Point x="653" y="359" />
-<Point x="646" y="185" />
+<TGConnectingPoint num="0" id="492" />
+<TGConnectingPoint num="1" id="493" />
+<TGConnectingPoint num="2" id="494" />
+<TGConnectingPoint num="3" id="495" />
+<P1  x="488" y="498" id="472" />
+<P2  x="557" y="127" id="506" />
+<Point x="557" y="530" />
+<Point x="617" y="336" />
+<Point x="591" y="234" />
 <AutomaticDrawing  data="true" />
-</CONNECTOR><SUBCOMPONENT type="-1" id="141" >
-<father id="140" num="0" />
-<cdparam x="653" y="359" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="489" >
+<father id="488" num="0" />
+<cdparam x="557" y="530" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="490" >
+<father id="488" num="1" />
+<cdparam x="617" y="336" />
 <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
 <cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
 <infoparam name="point " value="null" />
 </SUBCOMPONENT>
-<SUBCOMPONENT type="-1" id="142" >
-<father id="140" num="1" />
-<cdparam x="646" y="185" />
+<SUBCOMPONENT type="-1" id="491" >
+<father id="488" num="2" />
+<cdparam x="591" y="234" />
 <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
 <cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
 <infoparam name="point " value="null" />
 </SUBCOMPONENT>
-<SUBCOMPONENT type="-1" id="146" >
-<father id="140" num="2" />
-<cdparam x="658" y="253" />
-<sizeparam width="123" height="30" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<SUBCOMPONENT type="-1" id="496" >
+<father id="488" num="3" />
+<cdparam x="497" y="367" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
 <enabled value="true" />
 <cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
 <infoparam name="List of all parameters of an Avatar SMD transition" value="" />
-<TGConnectingPoint num="0" id="147" />
-<TGConnectingPoint num="1" id="148" />
-<TGConnectingPoint num="2" id="149" />
-<TGConnectingPoint num="3" id="150" />
+<TGConnectingPoint num="0" id="497" />
+<TGConnectingPoint num="1" id="498" />
+<TGConnectingPoint num="2" id="499" />
+<TGConnectingPoint num="3" id="500" />
 <extraparam>
 <guard value="[ ]" enabled="true"/>
-<afterMin value="period" enabled="true"/>
-<afterMax value="period" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
 <computeMin value="" enabled="true"/>
 <computeMax value="" enabled="true"/>
 <probability value="" enabled="true"/>
-<actions value="LED1onLED2off()" enabled="true"/>
 </extraparam>
 </SUBCOMPONENT>
 
-<CONNECTOR type="5102" id="133" >
-<cdparam x="415" y="209" />
+<COMPONENT type="5103" id="470" >
+<cdparam x="451" y="473" />
+<sizeparam width="74" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Send signal" value="RanVal(val)" />
+<TGConnectingPoint num="0" id="471" />
+<TGConnectingPoint num="1" id="472" />
+<TGConnectingPoint num="2" id="473" />
+<TGConnectingPoint num="3" id="474" />
+<TGConnectingPoint num="4" id="475" />
+<TGConnectingPoint num="5" id="476" />
+<TGConnectingPoint num="6" id="477" />
+<TGConnectingPoint num="7" id="478" />
+<TGConnectingPoint num="8" id="479" />
+<TGConnectingPoint num="9" id="480" />
+</COMPONENT>
+
+<COMPONENT type="5106" id="422" >
+<cdparam x="407" y="368" />
+<sizeparam width="121" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="State" value="SendingRand" />
+<TGConnectingPoint num="0" id="423" />
+<TGConnectingPoint num="1" id="424" />
+<TGConnectingPoint num="2" id="425" />
+<TGConnectingPoint num="3" id="426" />
+<TGConnectingPoint num="4" id="427" />
+<TGConnectingPoint num="5" id="428" />
+<TGConnectingPoint num="6" id="429" />
+<TGConnectingPoint num="7" id="430" />
+<TGConnectingPoint num="8" id="431" />
+<TGConnectingPoint num="9" id="432" />
+<TGConnectingPoint num="10" id="433" />
+<TGConnectingPoint num="11" id="434" />
+<TGConnectingPoint num="12" id="435" />
+<TGConnectingPoint num="13" id="436" />
+<TGConnectingPoint num="14" id="437" />
+<TGConnectingPoint num="15" id="438" />
+<TGConnectingPoint num="16" id="439" />
+<TGConnectingPoint num="17" id="440" />
+<TGConnectingPoint num="18" id="441" />
+<TGConnectingPoint num="19" id="442" />
+<TGConnectingPoint num="20" id="443" />
+<TGConnectingPoint num="21" id="444" />
+<TGConnectingPoint num="22" id="445" />
+<TGConnectingPoint num="23" id="446" />
+<TGConnectingPoint num="24" id="447" />
+<TGConnectingPoint num="25" id="448" />
+<TGConnectingPoint num="26" id="449" />
+<TGConnectingPoint num="27" id="450" />
+<TGConnectingPoint num="28" id="451" />
+<TGConnectingPoint num="29" id="452" />
+<TGConnectingPoint num="30" id="453" />
+<TGConnectingPoint num="31" id="454" />
+<TGConnectingPoint num="32" id="455" />
+<TGConnectingPoint num="33" id="456" />
+<TGConnectingPoint num="34" id="457" />
+<TGConnectingPoint num="35" id="458" />
+<TGConnectingPoint num="36" id="459" />
+<TGConnectingPoint num="37" id="460" />
+<TGConnectingPoint num="38" id="461" />
+<TGConnectingPoint num="39" id="462" />
+<extraparam>
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="5108" id="394" >
+<cdparam x="331" y="307" />
+<sizeparam width="145" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="TGComponent" value="null" />
+<TGConnectingPoint num="0" id="395" />
+<TGConnectingPoint num="1" id="396" />
+<extraparam>
+<Data variable="val" minValue="1" maxValue="10" functionId="0" />
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="5106" id="186" >
+<cdparam x="342" y="212" />
+<sizeparam width="165" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="State" value="CalculatingRand" />
+<TGConnectingPoint num="0" id="146" />
+<TGConnectingPoint num="1" id="147" />
+<TGConnectingPoint num="2" id="148" />
+<TGConnectingPoint num="3" id="149" />
+<TGConnectingPoint num="4" id="150" />
+<TGConnectingPoint num="5" id="151" />
+<TGConnectingPoint num="6" id="152" />
+<TGConnectingPoint num="7" id="153" />
+<TGConnectingPoint num="8" id="154" />
+<TGConnectingPoint num="9" id="155" />
+<TGConnectingPoint num="10" id="156" />
+<TGConnectingPoint num="11" id="157" />
+<TGConnectingPoint num="12" id="158" />
+<TGConnectingPoint num="13" id="159" />
+<TGConnectingPoint num="14" id="160" />
+<TGConnectingPoint num="15" id="161" />
+<TGConnectingPoint num="16" id="162" />
+<TGConnectingPoint num="17" id="163" />
+<TGConnectingPoint num="18" id="164" />
+<TGConnectingPoint num="19" id="165" />
+<TGConnectingPoint num="20" id="166" />
+<TGConnectingPoint num="21" id="167" />
+<TGConnectingPoint num="22" id="168" />
+<TGConnectingPoint num="23" id="169" />
+<TGConnectingPoint num="24" id="170" />
+<TGConnectingPoint num="25" id="171" />
+<TGConnectingPoint num="26" id="172" />
+<TGConnectingPoint num="27" id="173" />
+<TGConnectingPoint num="28" id="174" />
+<TGConnectingPoint num="29" id="175" />
+<TGConnectingPoint num="30" id="176" />
+<TGConnectingPoint num="31" id="177" />
+<TGConnectingPoint num="32" id="178" />
+<TGConnectingPoint num="33" id="179" />
+<TGConnectingPoint num="34" id="180" />
+<TGConnectingPoint num="35" id="181" />
+<TGConnectingPoint num="36" id="182" />
+<TGConnectingPoint num="37" id="183" />
+<TGConnectingPoint num="38" id="184" />
+<TGConnectingPoint num="39" id="185" />
+<extraparam>
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="5100" id="188" >
+<cdparam x="400" y="50" />
+<sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="start state" value="null" />
+<TGConnectingPoint num="0" id="187" />
+</COMPONENT>
+
+<CONNECTOR type="5102" id="397" >
+<cdparam x="404" y="262" />
 <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="134" />
-<P1  x="415" y="209" id="54" />
-<P2  x="415" y="327" id="94" />
+<TGConnectingPoint num="0" id="398" />
+<P1  x="444" y="262" id="176" />
+<P2  x="403" y="302" id="395" />
 <AutomaticDrawing  data="true" />
-</CONNECTOR><SUBCOMPONENT type="-1" id="135" >
-<father id="133" num="0" />
-<cdparam x="415" y="268" />
-<sizeparam width="123" height="30" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="399" >
+<father id="397" num="0" />
+<cdparam x="403" y="282" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
 <enabled value="true" />
 <cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
 <infoparam name="List of all parameters of an Avatar SMD transition" value="" />
-<TGConnectingPoint num="0" id="136" />
-<TGConnectingPoint num="1" id="137" />
-<TGConnectingPoint num="2" id="138" />
-<TGConnectingPoint num="3" id="139" />
+<TGConnectingPoint num="0" id="400" />
+<TGConnectingPoint num="1" id="401" />
+<TGConnectingPoint num="2" id="402" />
+<TGConnectingPoint num="3" id="403" />
 <extraparam>
 <guard value="[ ]" enabled="true"/>
-<afterMin value="period" enabled="true"/>
-<afterMax value="period" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
 <computeMin value="" enabled="true"/>
 <computeMax value="" enabled="true"/>
 <probability value="" enabled="true"/>
-<actions value="LED1offLED2on()" enabled="true"/>
 </extraparam>
 </SUBCOMPONENT>
 
-<COMPONENT type="5106" id="92" >
-<cdparam x="344" y="327" />
-<sizeparam width="143" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<CONNECTOR type="5102" id="463" >
+<cdparam x="403" y="332" />
+<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="464" />
+<P1  x="403" y="332" id="396" />
+<P2  x="407" y="368" id="423" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="465" >
+<father id="463" num="0" />
+<cdparam x="405" y="350" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="466" />
+<TGConnectingPoint num="1" id="467" />
+<TGConnectingPoint num="2" id="468" />
+<TGConnectingPoint num="3" id="469" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="481" >
+<cdparam x="482" y="418" />
+<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="482" />
+<P1  x="482" y="418" id="453" />
+<P2  x="488" y="468" id="471" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="483" >
+<father id="481" num="0" />
+<cdparam x="485" y="443" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
 <enabled value="true" />
 <cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
-<infoparam name="State" value="Led1offLed2on" />
-<TGConnectingPoint num="0" id="93" />
-<TGConnectingPoint num="1" id="94" />
-<TGConnectingPoint num="2" id="95" />
-<TGConnectingPoint num="3" id="96" />
-<TGConnectingPoint num="4" id="97" />
-<TGConnectingPoint num="5" id="98" />
-<TGConnectingPoint num="6" id="99" />
-<TGConnectingPoint num="7" id="100" />
-<TGConnectingPoint num="8" id="101" />
-<TGConnectingPoint num="9" id="102" />
-<TGConnectingPoint num="10" id="103" />
-<TGConnectingPoint num="11" id="104" />
-<TGConnectingPoint num="12" id="105" />
-<TGConnectingPoint num="13" id="106" />
-<TGConnectingPoint num="14" id="107" />
-<TGConnectingPoint num="15" id="108" />
-<TGConnectingPoint num="16" id="109" />
-<TGConnectingPoint num="17" id="110" />
-<TGConnectingPoint num="18" id="111" />
-<TGConnectingPoint num="19" id="112" />
-<TGConnectingPoint num="20" id="113" />
-<TGConnectingPoint num="21" id="114" />
-<TGConnectingPoint num="22" id="115" />
-<TGConnectingPoint num="23" id="116" />
-<TGConnectingPoint num="24" id="117" />
-<TGConnectingPoint num="25" id="118" />
-<TGConnectingPoint num="26" id="119" />
-<TGConnectingPoint num="27" id="120" />
-<TGConnectingPoint num="28" id="121" />
-<TGConnectingPoint num="29" id="122" />
-<TGConnectingPoint num="30" id="123" />
-<TGConnectingPoint num="31" id="124" />
-<TGConnectingPoint num="32" id="125" />
-<TGConnectingPoint num="33" id="126" />
-<TGConnectingPoint num="34" id="127" />
-<TGConnectingPoint num="35" id="128" />
-<TGConnectingPoint num="36" id="129" />
-<TGConnectingPoint num="37" id="130" />
-<TGConnectingPoint num="38" id="131" />
-<TGConnectingPoint num="39" id="132" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="484" />
+<TGConnectingPoint num="1" id="485" />
+<TGConnectingPoint num="2" id="486" />
+<TGConnectingPoint num="3" id="487" />
 <extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
 </extraparam>
-</COMPONENT>
+</SUBCOMPONENT>
 
-<CONNECTOR type="5102" id="47" >
+<CONNECTOR type="5102" id="542" >
 <cdparam x="407" y="70" />
 <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="46" />
-<P1  x="407" y="70" id="89" />
-<P2  x="396" y="159" id="65" />
+<TGConnectingPoint num="0" id="543" />
+<P1  x="407" y="70" id="187" />
+<P2  x="414" y="102" id="502" />
 <AutomaticDrawing  data="true" />
-</CONNECTOR><SUBCOMPONENT type="-1" id="45" >
-<father id="47" num="0" />
-<cdparam x="411" y="89" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="544" >
+<father id="542" num="0" />
+<cdparam x="410" y="86" />
 <sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
 <enabled value="true" />
 <cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
 <infoparam name="List of all parameters of an Avatar SMD transition" value="" />
-<TGConnectingPoint num="0" id="41" />
-<TGConnectingPoint num="1" id="42" />
-<TGConnectingPoint num="2" id="43" />
-<TGConnectingPoint num="3" id="44" />
+<TGConnectingPoint num="0" id="545" />
+<TGConnectingPoint num="1" id="546" />
+<TGConnectingPoint num="2" id="547" />
+<TGConnectingPoint num="3" id="548" />
 <extraparam>
 <guard value="[ ]" enabled="true"/>
 <afterMin value="" enabled="true"/>
@@ -230,66 +495,547 @@
 </extraparam>
 </SUBCOMPONENT>
 
-<COMPONENT type="5106" id="88" >
-<cdparam x="344" y="159" />
-<sizeparam width="143" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<CONNECTOR type="5102" id="549" >
+<cdparam x="464" y="152" />
+<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="550" />
+<P1  x="485" y="152" id="508" />
+<P2  x="465" y="212" id="155" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="551" >
+<father id="549" num="0" />
+<cdparam x="464" y="182" />
+<sizeparam width="63" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="552" />
+<TGConnectingPoint num="1" id="553" />
+<TGConnectingPoint num="2" id="554" />
+<TGConnectingPoint num="3" id="555" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="4" enabled="true"/>
+<afterMax value="4" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+
+</AVATARStateMachineDiagramPanel>
+
+<AVATARStateMachineDiagramPanel name="MainBlock" minX="10" maxX="2500" minY="10" maxY="1500" >
+<CONNECTOR type="5102" id="715" >
+<cdparam x="139" y="304" />
+<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="718" />
+<TGConnectingPoint num="1" id="719" />
+<TGConnectingPoint num="2" id="720" />
+<P1  x="139" y="304" id="576" />
+<P2  x="65" y="169" id="332" />
+<Point x="41" y="263" />
+<Point x="37" y="169" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="716" >
+<father id="715" num="0" />
+<cdparam x="41" y="263" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="717" >
+<father id="715" num="1" />
+<cdparam x="37" y="169" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="721" >
+<father id="715" num="2" />
+<cdparam x="50" y="247" />
+<sizeparam width="39" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="722" />
+<TGConnectingPoint num="1" id="723" />
+<TGConnectingPoint num="2" id="724" />
+<TGConnectingPoint num="3" id="725" />
+<extraparam>
+<guard value="[ else ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="702" >
+<cdparam x="301" y="528" />
+<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="706" />
+<TGConnectingPoint num="1" id="707" />
+<TGConnectingPoint num="2" id="708" />
+<TGConnectingPoint num="3" id="709" />
+<P1  x="301" y="528" id="650" />
+<P2  x="252" y="169" id="333" />
+<Point x="434" y="528" />
+<Point x="415" y="329" />
+<Point x="397" y="163" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="703" >
+<father id="702" num="0" />
+<cdparam x="434" y="528" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="704" >
+<father id="702" num="1" />
+<cdparam x="415" y="329" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="705" >
+<father id="702" num="2" />
+<cdparam x="397" y="163" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="710" >
+<father id="702" num="3" />
+<cdparam x="426" y="353" />
+<sizeparam width="123" height="45" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
 <enabled value="true" />
 <cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
-<infoparam name="State" value="Led1onLed2off" />
-<TGConnectingPoint num="0" id="48" />
-<TGConnectingPoint num="1" id="49" />
-<TGConnectingPoint num="2" id="50" />
-<TGConnectingPoint num="3" id="51" />
-<TGConnectingPoint num="4" id="52" />
-<TGConnectingPoint num="5" id="53" />
-<TGConnectingPoint num="6" id="54" />
-<TGConnectingPoint num="7" id="55" />
-<TGConnectingPoint num="8" id="56" />
-<TGConnectingPoint num="9" id="57" />
-<TGConnectingPoint num="10" id="58" />
-<TGConnectingPoint num="11" id="59" />
-<TGConnectingPoint num="12" id="60" />
-<TGConnectingPoint num="13" id="61" />
-<TGConnectingPoint num="14" id="62" />
-<TGConnectingPoint num="15" id="63" />
-<TGConnectingPoint num="16" id="64" />
-<TGConnectingPoint num="17" id="65" />
-<TGConnectingPoint num="18" id="66" />
-<TGConnectingPoint num="19" id="67" />
-<TGConnectingPoint num="20" id="68" />
-<TGConnectingPoint num="21" id="69" />
-<TGConnectingPoint num="22" id="70" />
-<TGConnectingPoint num="23" id="71" />
-<TGConnectingPoint num="24" id="72" />
-<TGConnectingPoint num="25" id="73" />
-<TGConnectingPoint num="26" id="74" />
-<TGConnectingPoint num="27" id="75" />
-<TGConnectingPoint num="28" id="76" />
-<TGConnectingPoint num="29" id="77" />
-<TGConnectingPoint num="30" id="78" />
-<TGConnectingPoint num="31" id="79" />
-<TGConnectingPoint num="32" id="80" />
-<TGConnectingPoint num="33" id="81" />
-<TGConnectingPoint num="34" id="82" />
-<TGConnectingPoint num="35" id="83" />
-<TGConnectingPoint num="36" id="84" />
-<TGConnectingPoint num="37" id="85" />
-<TGConnectingPoint num="38" id="86" />
-<TGConnectingPoint num="39" id="87" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="711" />
+<TGConnectingPoint num="1" id="712" />
+<TGConnectingPoint num="2" id="713" />
+<TGConnectingPoint num="3" id="714" />
 <extraparam>
+<guard value="[ else ]" enabled="true"/>
+<afterMin value="period" enabled="true"/>
+<afterMax value="period" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+<actions value="" enabled="true"/>
 </extraparam>
+</SUBCOMPONENT>
+
+<COMPONENT type="5101" id="693" >
+<cdparam x="240" y="641" />
+<sizeparam width="20" height="20" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="stop state" value="null" />
+<TGConnectingPoint num="0" id="694" />
 </COMPONENT>
 
-<COMPONENT type="5100" id="90" >
-<cdparam x="400" y="50" />
+<COMPONENT type="5106" id="645" >
+<cdparam x="201" y="487" />
+<sizeparam width="100" height="82" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="State" value="Led1Off" />
+<TGConnectingPoint num="0" id="646" />
+<TGConnectingPoint num="1" id="647" />
+<TGConnectingPoint num="2" id="648" />
+<TGConnectingPoint num="3" id="649" />
+<TGConnectingPoint num="4" id="650" />
+<TGConnectingPoint num="5" id="651" />
+<TGConnectingPoint num="6" id="652" />
+<TGConnectingPoint num="7" id="653" />
+<TGConnectingPoint num="8" id="654" />
+<TGConnectingPoint num="9" id="655" />
+<TGConnectingPoint num="10" id="656" />
+<TGConnectingPoint num="11" id="657" />
+<TGConnectingPoint num="12" id="658" />
+<TGConnectingPoint num="13" id="659" />
+<TGConnectingPoint num="14" id="660" />
+<TGConnectingPoint num="15" id="661" />
+<TGConnectingPoint num="16" id="662" />
+<TGConnectingPoint num="17" id="663" />
+<TGConnectingPoint num="18" id="664" />
+<TGConnectingPoint num="19" id="665" />
+<TGConnectingPoint num="20" id="666" />
+<TGConnectingPoint num="21" id="667" />
+<TGConnectingPoint num="22" id="668" />
+<TGConnectingPoint num="23" id="669" />
+<TGConnectingPoint num="24" id="670" />
+<TGConnectingPoint num="25" id="671" />
+<TGConnectingPoint num="26" id="672" />
+<TGConnectingPoint num="27" id="673" />
+<TGConnectingPoint num="28" id="674" />
+<TGConnectingPoint num="29" id="675" />
+<TGConnectingPoint num="30" id="676" />
+<TGConnectingPoint num="31" id="677" />
+<TGConnectingPoint num="32" id="678" />
+<TGConnectingPoint num="33" id="679" />
+<TGConnectingPoint num="34" id="680" />
+<TGConnectingPoint num="35" id="681" />
+<TGConnectingPoint num="36" id="682" />
+<TGConnectingPoint num="37" id="683" />
+<TGConnectingPoint num="38" id="684" />
+<TGConnectingPoint num="39" id="685" />
+<extraparam>
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="5106" id="597" >
+<cdparam x="145" y="366" />
+<sizeparam width="100" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="State" value="Led1On" />
+<TGConnectingPoint num="0" id="598" />
+<TGConnectingPoint num="1" id="599" />
+<TGConnectingPoint num="2" id="600" />
+<TGConnectingPoint num="3" id="601" />
+<TGConnectingPoint num="4" id="602" />
+<TGConnectingPoint num="5" id="603" />
+<TGConnectingPoint num="6" id="604" />
+<TGConnectingPoint num="7" id="605" />
+<TGConnectingPoint num="8" id="606" />
+<TGConnectingPoint num="9" id="607" />
+<TGConnectingPoint num="10" id="608" />
+<TGConnectingPoint num="11" id="609" />
+<TGConnectingPoint num="12" id="610" />
+<TGConnectingPoint num="13" id="611" />
+<TGConnectingPoint num="14" id="612" />
+<TGConnectingPoint num="15" id="613" />
+<TGConnectingPoint num="16" id="614" />
+<TGConnectingPoint num="17" id="615" />
+<TGConnectingPoint num="18" id="616" />
+<TGConnectingPoint num="19" id="617" />
+<TGConnectingPoint num="20" id="618" />
+<TGConnectingPoint num="21" id="619" />
+<TGConnectingPoint num="22" id="620" />
+<TGConnectingPoint num="23" id="621" />
+<TGConnectingPoint num="24" id="622" />
+<TGConnectingPoint num="25" id="623" />
+<TGConnectingPoint num="26" id="624" />
+<TGConnectingPoint num="27" id="625" />
+<TGConnectingPoint num="28" id="626" />
+<TGConnectingPoint num="29" id="627" />
+<TGConnectingPoint num="30" id="628" />
+<TGConnectingPoint num="31" id="629" />
+<TGConnectingPoint num="32" id="630" />
+<TGConnectingPoint num="33" id="631" />
+<TGConnectingPoint num="34" id="632" />
+<TGConnectingPoint num="35" id="633" />
+<TGConnectingPoint num="36" id="634" />
+<TGConnectingPoint num="37" id="635" />
+<TGConnectingPoint num="38" id="636" />
+<TGConnectingPoint num="39" id="637" />
+<extraparam>
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="5107" id="574" >
+<cdparam x="149" y="289" />
+<sizeparam width="30" height="30" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="choice" value="null" />
+<TGConnectingPoint num="0" id="575" />
+<TGConnectingPoint num="1" id="576" />
+<TGConnectingPoint num="2" id="577" />
+<TGConnectingPoint num="3" id="578" />
+<TGConnectingPoint num="4" id="579" />
+<TGConnectingPoint num="5" id="580" />
+<TGConnectingPoint num="6" id="581" />
+<TGConnectingPoint num="7" id="582" />
+<TGConnectingPoint num="8" id="583" />
+<TGConnectingPoint num="9" id="584" />
+<TGConnectingPoint num="10" id="585" />
+<TGConnectingPoint num="11" id="586" />
+<TGConnectingPoint num="12" id="587" />
+<TGConnectingPoint num="13" id="588" />
+<TGConnectingPoint num="14" id="589" />
+</COMPONENT>
+
+<COMPONENT type="5104" id="556" >
+<cdparam x="91" y="231" />
+<sizeparam width="145" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Receive signal" value="RandVal(currentRand)" />
+<TGConnectingPoint num="0" id="557" />
+<TGConnectingPoint num="1" id="558" />
+<TGConnectingPoint num="2" id="559" />
+<TGConnectingPoint num="3" id="560" />
+<TGConnectingPoint num="4" id="561" />
+<TGConnectingPoint num="5" id="562" />
+<TGConnectingPoint num="6" id="563" />
+<TGConnectingPoint num="7" id="564" />
+<TGConnectingPoint num="8" id="565" />
+<TGConnectingPoint num="9" id="566" />
+</COMPONENT>
+
+<COMPONENT type="5106" id="328" >
+<cdparam x="65" y="148" />
+<sizeparam width="187" height="43" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="State" value="Waiting_For_Value" />
+<TGConnectingPoint num="0" id="329" />
+<TGConnectingPoint num="1" id="330" />
+<TGConnectingPoint num="2" id="331" />
+<TGConnectingPoint num="3" id="332" />
+<TGConnectingPoint num="4" id="333" />
+<TGConnectingPoint num="5" id="334" />
+<TGConnectingPoint num="6" id="335" />
+<TGConnectingPoint num="7" id="336" />
+<TGConnectingPoint num="8" id="337" />
+<TGConnectingPoint num="9" id="338" />
+<TGConnectingPoint num="10" id="339" />
+<TGConnectingPoint num="11" id="340" />
+<TGConnectingPoint num="12" id="341" />
+<TGConnectingPoint num="13" id="342" />
+<TGConnectingPoint num="14" id="343" />
+<TGConnectingPoint num="15" id="344" />
+<TGConnectingPoint num="16" id="345" />
+<TGConnectingPoint num="17" id="346" />
+<TGConnectingPoint num="18" id="347" />
+<TGConnectingPoint num="19" id="348" />
+<TGConnectingPoint num="20" id="349" />
+<TGConnectingPoint num="21" id="350" />
+<TGConnectingPoint num="22" id="351" />
+<TGConnectingPoint num="23" id="352" />
+<TGConnectingPoint num="24" id="353" />
+<TGConnectingPoint num="25" id="354" />
+<TGConnectingPoint num="26" id="355" />
+<TGConnectingPoint num="27" id="356" />
+<TGConnectingPoint num="28" id="357" />
+<TGConnectingPoint num="29" id="358" />
+<TGConnectingPoint num="30" id="359" />
+<TGConnectingPoint num="31" id="360" />
+<TGConnectingPoint num="32" id="361" />
+<TGConnectingPoint num="33" id="362" />
+<TGConnectingPoint num="34" id="363" />
+<TGConnectingPoint num="35" id="364" />
+<TGConnectingPoint num="36" id="365" />
+<TGConnectingPoint num="37" id="366" />
+<TGConnectingPoint num="38" id="367" />
+<TGConnectingPoint num="39" id="368" />
+<extraparam>
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="5100" id="326" >
+<cdparam x="109" y="76" />
 <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
 <cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
 <infoparam name="start state" value="null" />
-<TGConnectingPoint num="0" id="89" />
+<TGConnectingPoint num="0" id="327" />
 </COMPONENT>
 
+<CONNECTOR type="5102" id="369" >
+<cdparam x="116" y="96" />
+<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="370" />
+<P1  x="116" y="96" id="327" />
+<P2  x="65" y="148" id="329" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="371" >
+<father id="369" num="0" />
+<cdparam x="116" y="121" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="372" />
+<TGConnectingPoint num="1" id="373" />
+<TGConnectingPoint num="2" id="374" />
+<TGConnectingPoint num="3" id="375" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="567" >
+<cdparam x="158" y="191" />
+<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="568" />
+<P1  x="158" y="191" id="335" />
+<P2  x="163" y="226" id="557" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="569" >
+<father id="567" num="0" />
+<cdparam x="160" y="208" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="570" />
+<TGConnectingPoint num="1" id="571" />
+<TGConnectingPoint num="2" id="572" />
+<TGConnectingPoint num="3" id="573" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="590" >
+<cdparam x="163" y="256" />
+<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="591" />
+<P1  x="163" y="256" id="558" />
+<P2  x="164" y="279" id="575" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="592" >
+<father id="590" num="0" />
+<cdparam x="170" y="266" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="593" />
+<TGConnectingPoint num="1" id="594" />
+<TGConnectingPoint num="2" id="595" />
+<TGConnectingPoint num="3" id="596" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="638" >
+<cdparam x="164" y="329" />
+<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="639" />
+<P1  x="164" y="329" id="581" />
+<P2  x="232" y="366" id="617" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="640" >
+<father id="638" num="0" />
+<cdparam x="174" y="330" />
+<sizeparam width="113" height="30" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="641" />
+<TGConnectingPoint num="1" id="642" />
+<TGConnectingPoint num="2" id="643" />
+<TGConnectingPoint num="3" id="644" />
+<extraparam>
+<guard value="[ currentRand &gt; 5 ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+<actions value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="686" >
+<cdparam x="245" y="416" />
+<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="687" />
+<P1  x="245" y="416" id="605" />
+<P2  x="251" y="487" id="647" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="688" >
+<father id="686" num="0" />
+<cdparam x="248" y="451" />
+<sizeparam width="123" height="45" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="689" />
+<TGConnectingPoint num="1" id="690" />
+<TGConnectingPoint num="2" id="691" />
+<TGConnectingPoint num="3" id="692" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="period" enabled="true"/>
+<afterMax value="period" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+<actions value="x = x +1" enabled="true"/>
+<actions value="LED1off(x)" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="695" >
+<cdparam x="251" y="569" />
+<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="696" />
+<P1  x="251" y="569" id="652" />
+<P2  x="250" y="636" id="694" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="697" >
+<father id="695" num="0" />
+<cdparam x="250" y="602" />
+<sizeparam width="57" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="698" />
+<TGConnectingPoint num="1" id="699" />
+<TGConnectingPoint num="2" id="700" />
+<TGConnectingPoint num="3" id="701" />
+<extraparam>
+<guard value="[ x &gt; 10 ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
 
 </AVATARStateMachineDiagramPanel>
 
diff --git a/modeling/HelloWorldCodeGeneration.ttool/HelloWorldCodeGeneration.xml b/modeling/HelloWorldCodeGeneration.ttool/HelloWorldCodeGeneration.xml
new file mode 100644
index 0000000000000000000000000000000000000000..ecb02d69d9d944ff969a0a08d66c8ca74588536b
--- /dev/null
+++ b/modeling/HelloWorldCodeGeneration.ttool/HelloWorldCodeGeneration.xml
@@ -0,0 +1,222 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<TURTLEGMODELING version="0.99-beta4">
+
+<Modeling type="AVATAR Design" nameTab="Design" >
+<AVATARBlockDiagramPanel name="Block Diagram" minX="10" maxX="2500" minY="10" maxY="1500" >
+<MainCode value="void __user_init() {"/>
+<MainCode value="  printf(&quot;Initializing...\n&quot;);"/>
+<MainCode value="}"/>
+<Optimized value="true" />
+<Validated value="" />
+<Ignored value="" />
+
+<COMPONENT type="5000" id="25" >
+<cdparam x="194" y="64" />
+<sizeparam width="250" height="200" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Block0" value="MainBlock" />
+<TGConnectingPoint num="0" id="1" />
+<TGConnectingPoint num="1" id="2" />
+<TGConnectingPoint num="2" id="3" />
+<TGConnectingPoint num="3" id="4" />
+<TGConnectingPoint num="4" id="5" />
+<TGConnectingPoint num="5" id="6" />
+<TGConnectingPoint num="6" id="7" />
+<TGConnectingPoint num="7" id="8" />
+<TGConnectingPoint num="8" id="9" />
+<TGConnectingPoint num="9" id="10" />
+<TGConnectingPoint num="10" id="11" />
+<TGConnectingPoint num="11" id="12" />
+<TGConnectingPoint num="12" id="13" />
+<TGConnectingPoint num="13" id="14" />
+<TGConnectingPoint num="14" id="15" />
+<TGConnectingPoint num="15" id="16" />
+<TGConnectingPoint num="16" id="17" />
+<TGConnectingPoint num="17" id="18" />
+<TGConnectingPoint num="18" id="19" />
+<TGConnectingPoint num="19" id="20" />
+<TGConnectingPoint num="20" id="21" />
+<TGConnectingPoint num="21" id="22" />
+<TGConnectingPoint num="22" id="23" />
+<TGConnectingPoint num="23" id="24" />
+<extraparam>
+<CryptoBlock value="false" />
+<Attribute access="0" id="period" value="2" type="8" typeOther="" />
+<Method value="$printHelloWorld()" />
+<globalCode value="void __userImplemented__MainBlock__printHelloWorld() {" />
+<globalCode value="  printf(&quot;Hello world from generated code\n&quot;);" />
+<globalCode value="}" />
+</extraparam>
+</COMPONENT>
+
+
+</AVATARBlockDiagramPanel>
+
+<AVATARStateMachineDiagramPanel name="MainBlock" minX="10" maxX="2500" minY="10" maxY="1500" >
+<CONNECTOR type="5102" id="40" >
+<cdparam x="432" y="208" />
+<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="35" />
+<TGConnectingPoint num="1" id="36" />
+<TGConnectingPoint num="2" id="37" />
+<TGConnectingPoint num="3" id="38" />
+<TGConnectingPoint num="4" id="39" />
+<P1  x="432" y="208" id="78" />
+<P2  x="470" y="183" id="52" />
+<Point x="432" y="228" />
+<Point x="582" y="228" />
+<Point x="582" y="163" />
+<Point x="490" y="163" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="26" >
+<father id="40" num="0" />
+<cdparam x="432" y="228" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="27" >
+<father id="40" num="1" />
+<cdparam x="582" y="228" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="28" >
+<father id="40" num="2" />
+<cdparam x="582" y="163" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="29" >
+<father id="40" num="3" />
+<cdparam x="490" y="163" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="34" >
+<father id="40" num="4" />
+<cdparam x="459" y="246" />
+<sizeparam width="128" height="30" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="30" />
+<TGConnectingPoint num="1" id="31" />
+<TGConnectingPoint num="2" id="32" />
+<TGConnectingPoint num="3" id="33" />
+<extraparam>
+<guard value="[ ]" />
+<afterMin value="period" />
+<afterMax value="period" />
+<computeMin value="" />
+<computeMax value="" />
+<actions value="printHelloWorld() " />
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="47" >
+<cdparam x="407" y="70" />
+<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="46" />
+<P1  x="407" y="70" id="89" />
+<P2  x="407" y="158" id="65" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="45" >
+<father id="47" num="0" />
+<cdparam x="411" y="89" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="41" />
+<TGConnectingPoint num="1" id="42" />
+<TGConnectingPoint num="2" id="43" />
+<TGConnectingPoint num="3" id="44" />
+<extraparam>
+<guard value="[ ]" />
+<afterMin value="" />
+<afterMax value="" />
+<computeMin value="" />
+<computeMax value="" />
+</extraparam>
+</SUBCOMPONENT>
+
+<COMPONENT type="5106" id="88" >
+<cdparam x="370" y="158" />
+<sizeparam width="100" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="State" value="MainState" />
+<TGConnectingPoint num="0" id="48" />
+<TGConnectingPoint num="1" id="49" />
+<TGConnectingPoint num="2" id="50" />
+<TGConnectingPoint num="3" id="51" />
+<TGConnectingPoint num="4" id="52" />
+<TGConnectingPoint num="5" id="53" />
+<TGConnectingPoint num="6" id="54" />
+<TGConnectingPoint num="7" id="55" />
+<TGConnectingPoint num="8" id="56" />
+<TGConnectingPoint num="9" id="57" />
+<TGConnectingPoint num="10" id="58" />
+<TGConnectingPoint num="11" id="59" />
+<TGConnectingPoint num="12" id="60" />
+<TGConnectingPoint num="13" id="61" />
+<TGConnectingPoint num="14" id="62" />
+<TGConnectingPoint num="15" id="63" />
+<TGConnectingPoint num="16" id="64" />
+<TGConnectingPoint num="17" id="65" />
+<TGConnectingPoint num="18" id="66" />
+<TGConnectingPoint num="19" id="67" />
+<TGConnectingPoint num="20" id="68" />
+<TGConnectingPoint num="21" id="69" />
+<TGConnectingPoint num="22" id="70" />
+<TGConnectingPoint num="23" id="71" />
+<TGConnectingPoint num="24" id="72" />
+<TGConnectingPoint num="25" id="73" />
+<TGConnectingPoint num="26" id="74" />
+<TGConnectingPoint num="27" id="75" />
+<TGConnectingPoint num="28" id="76" />
+<TGConnectingPoint num="29" id="77" />
+<TGConnectingPoint num="30" id="78" />
+<TGConnectingPoint num="31" id="79" />
+<TGConnectingPoint num="32" id="80" />
+<TGConnectingPoint num="33" id="81" />
+<TGConnectingPoint num="34" id="82" />
+<TGConnectingPoint num="35" id="83" />
+<TGConnectingPoint num="36" id="84" />
+<TGConnectingPoint num="37" id="85" />
+<TGConnectingPoint num="38" id="86" />
+<TGConnectingPoint num="39" id="87" />
+<extraparam>
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="5100" id="90" >
+<cdparam x="400" y="50" />
+<sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="start state" value="null" />
+<TGConnectingPoint num="0" id="89" />
+</COMPONENT>
+
+
+</AVATARStateMachineDiagramPanel>
+
+</Modeling>
+
+
+
+
+</TURTLEGMODELING>
\ No newline at end of file
diff --git a/modeling/HelloWorldCodeGeneration.ttool/project_config.xml b/modeling/HelloWorldCodeGeneration.ttool/project_config.xml
new file mode 100644
index 0000000000000000000000000000000000000000..e4f2cc86226546578b0c2b7d75411cedb98ab93d
--- /dev/null
+++ b/modeling/HelloWorldCodeGeneration.ttool/project_config.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<PROJECTCONFIGURATION>
+<LastVCD data=""/>
+<LastOpenDiagram  tab="0" panel="1" />
+</PROJECTCONFIGURATION>
diff --git a/modeling/PressureController.ttool/.DS_Store b/modeling/PressureController.ttool/.DS_Store
new file mode 100644
index 0000000000000000000000000000000000000000..520207b621cb9a9ccb0bdd0d4f9f9d841df2fc12
Binary files /dev/null and b/modeling/PressureController.ttool/.DS_Store differ
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/.DS_Store b/modeling/PressureController.ttool/AVATAR_executablecode/.DS_Store
new file mode 100644
index 0000000000000000000000000000000000000000..04f91f8f125f29a51ddbaa3ac821f9e65d94b28a
Binary files /dev/null and b/modeling/PressureController.ttool/AVATAR_executablecode/.DS_Store differ
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/LICENSE b/modeling/PressureController.ttool/AVATAR_executablecode/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..80a6487e0e38fde802e5fa47fd63578fdacb6262
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/LICENSE
@@ -0,0 +1,39 @@
+/**Copyright or (C) or Copr. Intitut Telecom, Telecom ParisTech, 
+Ludovic Apvrille, Renaud Pacalet
+ *
+ * ludovic.apvrille AT telecom-paristech.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,
+ * that may mean  that it is complicated to manipulate,  and  that  also
+ * therefore means  that it is reserved for developers  and  experienced
+ * professionals having in-depth computer knowledge. Users are therefore
+ * encouraged to load and test the software's suitability as regards their
+ * 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.
+ *
+ * /**
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/LICENSE_CECILL_ENG b/modeling/PressureController.ttool/AVATAR_executablecode/LICENSE_CECILL_ENG
new file mode 100644
index 0000000000000000000000000000000000000000..2813867170ada86df401c9e49d9f69a02bbeaa9e
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/LICENSE_CECILL_ENG
@@ -0,0 +1,504 @@
+CeCILL FREE SOFTWARE LICENSE AGREEMENT
+
+
+    Notice
+
+This Agreement is a Free Software license agreement that is the result
+of discussions between its authors in order to ensure compliance with
+the two main principles guiding its drafting:
+
+    * firstly, compliance with the principles governing the distribution
+      of Free Software: access to source code, broad rights granted to
+      users,
+    * secondly, the election of a governing law, French law, with which
+      it is conformant, both as regards the law of torts and
+      intellectual property law, and the protection that it offers to
+      both authors and holders of the economic rights over software.
+
+The authors of the CeCILL (for Ce[a] C[nrs] I[nria] L[logiciel] L[ibre])
+license are:
+
+Commissariat � l'Energie Atomique - CEA, a public scientific, technical
+and industrial establishment, having its principal place of business at
+31-33 rue de la F�d�ration, 75752 Paris cedex 15, France.
+
+Centre National de la Recherche Scientifique - CNRS, a public scientific
+and technological establishment, having its principal place of business
+at 3 rue Michel-Ange 75794 Paris cedex 16, France.
+
+Institut National de Recherche en Informatique et en Automatique -
+INRIA, a public scientific and technological establishment, having its
+principal place of business at Domaine de Voluceau, Rocquencourt, BP
+105, 78153 Le Chesnay cedex, France.
+
+
+    Preamble
+
+The purpose of this Free Software license agreement is to grant users
+the right to modify and redistribute the software governed by this
+license within the framework of an open source distribution model.
+
+The exercising of these rights is conditional upon certain obligations
+for users so as to preserve this status for all subsequent redistributions.
+
+In consideration of access to the source code and the 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 only have limited liability.
+
+In this respect, the risks associated with loading, using, modifying
+and/or developing or reproducing the software by the user are brought to
+the user's attention, given its Free Software status, which may make it
+complicated to use, with the result that its use is reserved for
+developers and experienced professionals having in-depth computer
+knowledge. Users are therefore encouraged to load and test the
+Software's suitability as regards their 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 of
+security. This Agreement may be freely reproduced and published,
+provided it is not altered, and that no provisions are either added or
+removed herefrom.
+
+This Agreement may apply to any or all software for which the holder of
+the economic rights decides to submit the use thereof to its provisions.
+
+
+    Article 1 - DEFINITIONS
+
+For the purpose of this Agreement, when the following expressions
+commence with a capital letter, they shall have the following meaning:
+
+Agreement: means this license agreement, and its possible subsequent
+versions and annexes.
+
+Software: means the software in its Object Code and/or Source Code form
+and, where applicable, its documentation, "as is" when the Licensee
+accepts the Agreement.
+
+Initial Software: means the Software in its Source Code and possibly its
+Object Code form and, where applicable, its documentation, "as is" when
+it is first distributed under the terms and conditions of the Agreement.
+
+Modified Software: means the Software modified by at least one
+Contribution.
+
+Source Code: means all the Software's instructions and program lines to
+which access is required so as to modify the Software.
+
+Object Code: means the binary files originating from the compilation of
+the Source Code.
+
+Holder: means the holder(s) of the economic rights over the Initial
+Software.
+
+Licensee: means the Software user(s) having accepted the Agreement.
+
+Contributor: means a Licensee having made at least one Contribution.
+
+Licensor: means the Holder, or any other individual or legal entity, who
+distributes the Software under the Agreement.
+
+Contribution: means any or all modifications, corrections, translations,
+adaptations and/or new functions integrated into the Software by any or
+all Contributors, as well as any or all Internal Modules.
+
+Module: means a set of sources files including their documentation that
+enables supplementary functions or services in addition to those offered
+by the Software.
+
+External Module: means any or all Modules, not derived from the
+Software, so that this Module and the Software run in separate address
+spaces, with one calling the other when they are run.
+
+Internal Module: means any or all Module, connected to the Software so
+that they both execute in the same address space.
+
+GNU GPL: means the GNU General Public License version 2 or any
+subsequent version, as published by the Free Software Foundation Inc.
+
+Parties: mean both the Licensee and the Licensor.
+
+These expressions may be used both in singular and plural form.
+
+
+    Article 2 - PURPOSE
+
+The purpose of the Agreement is the grant by the Licensor to the
+Licensee of a non-exclusive, transferable and worldwide license for the
+Software as set forth in Article 5 hereinafter for the whole term of the 
+protection granted by the rights over said Software.
+
+
+    Article 3 - ACCEPTANCE
+
+3.1 The Licensee shall be deemed as having accepted the terms and
+conditions of this Agreement upon the occurrence of the first of the
+following events:
+
+    * (i) loading the Software by any or all means, notably, by
+      downloading from a remote server, or by loading from a physical
+      medium;
+    * (ii) the first time the Licensee exercises any of the rights
+      granted hereunder.
+
+3.2 One copy of the Agreement, containing a notice relating to the
+characteristics of the Software, to the limited warranty, and to the
+fact that its use is restricted to experienced users has been provided
+to the Licensee prior to its acceptance as set forth in Article 3.1
+hereinabove, and the Licensee hereby acknowledges that it has read and 
+understood it.
+
+
+    Article 4 - EFFECTIVE DATE AND TERM
+
+
+      4.1 EFFECTIVE DATE
+
+The Agreement shall become effective on the date when it is accepted by
+the Licensee as set forth in Article 3.1.
+
+
+      4.2 TERM
+
+The Agreement shall remain in force for the entire legal term of
+protection of the economic rights over the Software.
+
+
+    Article 5 - SCOPE OF RIGHTS GRANTED
+
+The Licensor hereby grants to the Licensee, who accepts, the following
+rights over the Software for any or all use, and for the term of the
+Agreement, on the basis of the terms and conditions set forth hereinafter.
+
+Besides, if the Licensor owns or comes to own one or more patents
+protecting all or part of the functions of the Software or of its
+components, the Licensor undertakes not to enforce the rights granted by
+these patents against successive Licensees using, exploiting or
+modifying the Software. If these patents are transferred, the Licensor
+undertakes to have the transferees subscribe to the obligations set
+forth in this paragraph.
+
+
+      5.1 RIGHT OF USE
+
+The Licensee is authorized to use the Software, without any limitation
+as to its fields of application, with it being hereinafter specified
+that this comprises:
+
+   1. permanent or temporary reproduction of all or part of the Software
+      by any or all means and in any or all form.
+
+   2. loading, displaying, running, or storing the Software on any or
+      all medium.
+
+   3. entitlement to observe, study or test its operation so as to
+      determine the ideas and principles behind any or all constituent
+      elements of said Software. This shall apply when the Licensee
+      carries out any or all loading, displaying, running, transmission
+      or storage operation as regards the Software, that it is entitled
+      to carry out hereunder.
+
+
+      5.2 ENTITLEMENT TO MAKE CONTRIBUTIONS
+
+The right to make Contributions includes the right to translate, adapt,
+arrange, or make any or all modifications to the Software, and the right
+to reproduce the resulting Software.
+
+The Licensee is authorized to make any or all Contributions to the
+Software provided that it includes an explicit notice that it is the
+author of said Contribution and indicates the date of the creation thereof.
+
+
+      5.3 RIGHT OF DISTRIBUTION
+
+In particular, the right of distribution includes the right to publish,
+transmit and communicate the Software to the general public on any or
+all medium, and by any or all means, and the right to market, either in
+consideration of a fee, or free of charge, one or more copies of the
+Software by any means.
+
+The Licensee is further authorized to distribute copies of the modified
+or unmodified Software to third parties according to the terms and
+conditions set forth hereinafter.
+
+
+        5.3.1 DISTRIBUTION OF SOFTWARE WITHOUT MODIFICATION
+
+The Licensee is authorized to distribute true copies of the Software in
+Source Code or Object Code form, provided that said distribution
+complies with all the provisions of the Agreement and is accompanied by:
+
+   1. a copy of the Agreement,
+
+   2. a notice relating to the limitation of both the Licensor's
+      warranty and liability as set forth in Articles 8 and 9,
+
+and that, in the event that only the Object Code of the Software is
+redistributed, the Licensee allows future Licensees unhindered access to
+the full Source Code of the Software by indicating how to access it, it
+being understood that the additional cost of acquiring the Source Code
+shall not exceed the cost of transferring the data.
+
+
+        5.3.2 DISTRIBUTION OF MODIFIED SOFTWARE
+
+When the Licensee makes a Contribution to the Software, the terms and
+conditions for the distribution of the Modified Software become subject
+to all the provisions of this Agreement.
+
+The Licensee is authorized to distribute the Modified Software, in
+Source Code or Object Code form, provided that said distribution
+complies with all the provisions of the Agreement and is accompanied by:
+
+   1. a copy of the Agreement,
+
+   2. a notice relating to the limitation of both the Licensor's
+      warranty and liability as set forth in Articles 8 and 9,
+
+and that, in the event that only the Object Code of the Modified
+Software is redistributed, the Licensee allows future Licensees
+unhindered access to the full Source Code of the Modified Software by
+indicating how to access it, it being understood that the additional
+cost of acquiring the Source Code shall not exceed the cost of
+transferring the data.
+
+
+        5.3.3 DISTRIBUTION OF EXTERNAL MODULES
+
+When the Licensee has developed an External Module, the terms and
+conditions of this Agreement do not apply to said External Module, that
+may be distributed under a separate license agreement.
+
+
+        5.3.4 COMPATIBILITY WITH THE GNU GPL
+
+The Licensee can include a code that is subject to the provisions of one
+of the versions of the GNU GPL in the Modified or unmodified Software,
+and distribute that entire code under the terms of the same version of
+the GNU GPL.
+
+The Licensee can include the Modified or unmodified Software in a code
+that is subject to the provisions of one of the versions of the GNU GPL,
+and distribute that entire code under the terms of the same version of
+the GNU GPL.
+
+
+    Article 6 - INTELLECTUAL PROPERTY
+
+
+      6.1 OVER THE INITIAL SOFTWARE
+
+The Holder owns the economic rights over the Initial Software. Any or
+all use of the Initial Software is subject to compliance with the terms
+and conditions under which the Holder has elected to distribute its work
+and no one shall be entitled to modify the terms and conditions for the
+distribution of said Initial Software.
+
+The Holder undertakes that the Initial Software will remain ruled at
+least by the current license, for the duration set forth in article 4.2.
+
+
+      6.2 OVER THE CONTRIBUTIONS
+
+A Licensee who develops a Contribution is the owner of the intellectual
+property rights over this Contribution as defined by applicable law.
+
+
+      6.3 OVER THE EXTERNAL MODULES
+
+A Licensee who develops an External Module is the owner of the
+intellectual property rights over this External Module as defined by
+applicable law and is free to choose the type of agreement that shall
+govern its distribution.
+
+
+      6.4 JOINT PROVISIONS
+
+The Licensee expressly undertakes:
+
+   1. not to remove, or modify, in any manner, the intellectual property
+      notices attached to the Software;
+
+   2. to reproduce said notices, in an identical manner, in the copies
+      of the Software modified or not.
+
+The Licensee undertakes not to directly or indirectly infringe the
+intellectual property rights of the Holder and/or Contributors on the
+Software and to take, where applicable, vis-�-vis its staff, any and all
+measures required to ensure respect of said intellectual property rights
+of the Holder and/or Contributors.
+
+
+    Article 7 - RELATED SERVICES
+
+7.1 Under no circumstances shall the Agreement oblige the Licensor to
+provide technical assistance or maintenance services for the Software.
+
+However, the Licensor is entitled to offer this type of services. The
+terms and conditions of such technical assistance, and/or such
+maintenance, shall be set forth in a separate instrument. Only the
+Licensor offering said maintenance and/or technical assistance services
+shall incur liability therefor.
+
+7.2 Similarly, any Licensor is entitled to offer to its licensees, under
+its sole responsibility, a warranty, that shall only be binding upon
+itself, for the redistribution of the Software and/or the Modified
+Software, under terms and conditions that it is free to decide. Said
+warranty, and the financial terms and conditions of its application,
+shall be subject of a separate instrument executed between the Licensor
+and the Licensee.
+
+
+    Article 8 - LIABILITY
+
+8.1 Subject to the provisions of Article 8.2, the Licensee shall be
+entitled to claim compensation for any direct loss it may have suffered
+from the Software as a result of a fault on the part of the relevant
+Licensor, subject to providing evidence thereof.
+
+8.2 The Licensor's liability is limited to the commitments made under
+this Agreement and shall not be incurred as a result of in particular:
+(i) loss due the Licensee's total or partial failure to fulfill its
+obligations, (ii) direct or consequential loss that is suffered by the
+Licensee due to the use or performance of the Software, and (iii) more
+generally, any consequential loss. In particular the Parties expressly
+agree that any or all pecuniary or business loss (i.e. loss of data,
+loss of profits, operating loss, loss of customers or orders,
+opportunity cost, any disturbance to business activities) or any or all
+legal proceedings instituted against the Licensee by a third party,
+shall constitute consequential loss and shall not provide entitlement to
+any or all compensation from the Licensor.
+
+
+    Article 9 - WARRANTY
+
+9.1 The Licensee acknowledges that the scientific and technical
+state-of-the-art when the Software was distributed did not enable all
+possible uses to be tested and verified, nor for the presence of
+possible defects to be detected. In this respect, the Licensee's
+attention has been drawn to the risks associated with loading, using,
+modifying and/or developing and reproducing the Software which are
+reserved for experienced users.
+
+The Licensee shall be responsible for verifying, by any or all means,
+the product's suitability for its requirements, its good working order,
+and for ensuring that it shall not cause damage to either persons or
+properties.
+
+9.2 The Licensor hereby represents, in good faith, that it is entitled
+to grant all the rights over the Software (including in particular the
+rights set forth in Article 5).
+
+9.3 The Licensee acknowledges that the Software is supplied "as is" by
+the Licensor without any other express or tacit warranty, other than
+that provided for in Article 9.2 and, in particular, without any warranty
+as to its commercial value, its secured, safe, innovative or relevant 
+nature.
+
+Specifically, the Licensor does not warrant that the Software is free
+from any error, that it will operate without interruption, that it will
+be compatible with the Licensee's own equipment and software
+configuration, nor that it will meet the Licensee's requirements.
+
+9.4 The Licensor does not either expressly or tacitly warrant that the
+Software does not infringe any third party intellectual property right
+relating to a patent, software or any other property right. Therefore,
+the Licensor disclaims any and all liability towards the Licensee
+arising out of any or all proceedings for infringement that may be
+instituted in respect of the use, modification and redistribution of the
+Software. Nevertheless, should such proceedings be instituted against
+the Licensee, the Licensor shall provide it with technical and legal
+assistance for its defense. Such technical and legal assistance shall be
+decided on a case-by-case basis between the relevant Licensor and the
+Licensee pursuant to a memorandum of understanding. The Licensor
+disclaims any and all liability as regards the Licensee's use of the
+name of the Software. No warranty is given as regards the existence of
+prior rights over the name of the Software or as regards the existence
+of a trademark.
+
+
+    Article 10 - TERMINATION
+
+10.1 In the event of a breach by the Licensee of its obligations
+hereunder, the Licensor may automatically terminate this Agreement
+thirty (30) days after notice has been sent to the Licensee and has
+remained ineffective.
+
+10.2 A Licensee whose Agreement is terminated shall no longer be
+authorized to use, modify or distribute the Software. However, any
+licenses that it may have granted prior to termination of the Agreement
+shall remain valid subject to their having been granted in compliance
+with the terms and conditions hereof.
+
+
+    Article 11 - MISCELLANEOUS
+
+
+      11.1 EXCUSABLE EVENTS
+
+Neither Party shall be liable for any or all delay, or failure to
+perform the Agreement, that may be attributable to an event of force
+majeure, an act of God or an outside cause, such as defective
+functioning or interruptions of the electricity or telecommunications
+networks, network paralysis following a virus attack, intervention by
+government authorities, natural disasters, water damage, earthquakes,
+fire, explosions, strikes and labor unrest, war, etc.
+
+11.2 Any Failure by either Party, on one or more occasions, to invoke
+one or more of the provisions hereof, shall under no circumstances be
+interpreted as being a waiver by the interested Party of its right to
+invoke said provision(s) subsequently.
+
+11.3 The Agreement cancels and replaces any or all previous agreements,
+whether written or oral, between the Parties and having the same
+purpose, and constitutes the entirety of the agreement between said
+Parties concerning said purpose. No supplement or modification to the
+terms and conditions hereof shall be effective as between the Parties
+unless it is made in writing and signed by their duly authorized
+representatives.
+
+11.4 In the event that one or more of the provisions hereof were to
+conflict with a current or future applicable act or legislative text,
+said act or legislative text shall prevail, and the Parties shall make
+the necessary amendments so as to comply with said act or legislative
+text. All other provisions shall remain effective. Similarly, invalidity
+of a provision of the Agreement, for any reason whatsoever, shall not
+cause the Agreement as a whole to be invalid.
+
+
+      11.5 LANGUAGE
+
+The Agreement is drafted in both French and English and both versions
+are deemed authentic.
+
+
+    Article 12 - NEW VERSIONS OF THE AGREEMENT
+
+12.1 Any person is authorized to duplicate and distribute copies of this
+Agreement.
+
+12.2 So as to ensure coherence, the wording of this Agreement is
+protected and may only be modified by the authors of the License, who
+reserve the right to periodically publish updates or new versions of the
+Agreement, each with a separate number. These subsequent versions may
+address new issues encountered by Free Software.
+
+12.3 Any Software distributed under a given version of the Agreement may
+only be subsequently distributed under the same version of the Agreement
+or a subsequent version, subject to the provisions of Article 5.3.4.
+
+
+    Article 13 - GOVERNING LAW AND JURISDICTION
+
+13.1 The Agreement is governed by French law. The Parties agree to
+endeavor to seek an amicable solution to any disagreements or disputes
+that may arise during the performance of the Agreement.
+
+13.2 Failing an amicable solution within two (2) months as from their
+occurrence, and unless emergency proceedings are necessary, the
+disagreements or disputes shall be referred to the Paris Courts having
+jurisdiction, by the more diligent Party.
+
+
+Version 2.0 dated 2005-05-21.
\ No newline at end of file
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/LICENSE_CECILL_FR b/modeling/PressureController.ttool/AVATAR_executablecode/LICENSE_CECILL_FR
new file mode 100644
index 0000000000000000000000000000000000000000..32ac7d2182f825f627e5f5409415f869dc1b02d0
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/LICENSE_CECILL_FR
@@ -0,0 +1,511 @@
+CONTRAT DE LICENCE DE LOGICIEL LIBRE CeCILL
+
+
+    Avertissement
+
+Ce contrat est une licence de logiciel libre issue d'une concertation
+entre ses auteurs afin que le respect de deux grands principes pr�side �
+sa r�daction:
+
+    * d'une part, le respect des principes de diffusion des logiciels
+      libres: acc�s au code source, droits �tendus conf�r�s aux
+      utilisateurs,
+    * d'autre part, la d�signation d'un droit applicable, le droit
+      fran�ais, auquel elle est conforme, tant au regard du droit de la
+      responsabilit� civile que du droit de la propri�t� intellectuelle
+      et de la protection qu'il offre aux auteurs et titulaires des
+      droits patrimoniaux sur un logiciel.
+
+Les auteurs de la licence CeCILL (pour Ce[a] C[nrs] I[nria] L[ogiciel]
+L[ibre]) sont: 
+
+Commissariat � l'Energie Atomique - CEA, �tablissement public de
+caract�re scientifique technique et industriel, dont le si�ge est situ�
+31-33 rue de la F�d�ration, 75752 Paris cedex 15.
+
+Centre National de la Recherche Scientifique - CNRS, �tablissement
+public � caract�re scientifique et technologique, dont le si�ge est
+situ� 3 rue Michel-Ange 75794 Paris cedex 16.
+
+Institut National de Recherche en Informatique et en Automatique -
+INRIA, �tablissement public � caract�re scientifique et technologique,
+dont le si�ge est situ� Domaine de Voluceau, Rocquencourt, BP 105, 78153
+Le Chesnay cedex.
+
+
+    Pr�ambule
+
+Ce contrat est une licence de logiciel libre dont l'objectif est de
+conf�rer aux utilisateurs la libert� de modification et de
+redistribution du logiciel r�gi par cette licence dans le cadre d'un
+mod�le de diffusion en logiciel libre.
+
+L'exercice de ces libert�s est assorti de certains devoirs � la charge
+des utilisateurs afin de pr�server ce statut au cours des
+redistributions ult�rieures.
+
+L'accessibilit� au code source et les droits de copie, de modification
+et de redistribution qui en d�coulent ont pour contrepartie de n'offrir
+aux utilisateurs qu'une garantie limit�e et de ne faire peser sur
+l'auteur du logiciel, le titulaire des droits patrimoniaux et les
+conc�dants successifs qu'une responsabilit� restreinte.
+
+A cet �gard l'attention de l'utilisateur est attir�e sur les risques
+associ�s au chargement, � l'utilisation, � la modification et/ou au
+d�veloppement et � la reproduction du logiciel par l'utilisateur �tant
+donn� sa sp�cificit� de logiciel libre, qui peut le rendre complexe �
+manipuler et qui le r�serve donc � des d�veloppeurs ou des
+professionnels avertis poss�dant des connaissances informatiques
+approfondies. Les utilisateurs sont donc invit�s � charger et tester
+l'ad�quation du Logiciel � leurs besoins dans des conditions permettant
+d'assurer la s�curit� de leurs syst�mes et/ou de leurs donn�es et, plus
+g�n�ralement, � l'utiliser et l'exploiter dans les m�me conditions de
+s�curit�. Ce contrat peut �tre reproduit et diffus� librement, sous
+r�serve de le conserver en l'�tat, sans ajout ni suppression de clauses.
+
+Ce contrat est susceptible de s'appliquer � tout logiciel dont le
+titulaire des droits patrimoniaux d�cide de soumettre l'exploitation aux
+dispositions qu'il contient.
+
+
+    Article 1 - DEFINITIONS
+
+Dans ce contrat, les termes suivants, lorsqu'ils seront �crits avec une
+lettre capitale, auront la signification suivante:
+
+Contrat: d�signe le pr�sent contrat de licence, ses �ventuelles versions
+post�rieures et annexes.
+
+Logiciel: d�signe le logiciel sous sa forme de Code Objet et/ou de Code
+Source et le cas �ch�ant sa documentation, dans leur �tat au moment de
+l'acceptation du Contrat par le Licenci�.
+
+Logiciel Initial: d�signe le Logiciel sous sa forme de Code Source et
+�ventuellement de Code Objet et le cas �ch�ant sa documentation, dans
+leur �tat au moment de leur premi�re diffusion sous les termes du Contrat.
+
+Logiciel Modifi�: d�signe le Logiciel modifi� par au moins une
+Contribution.
+
+Code Source: d�signe l'ensemble des instructions et des lignes de
+programme du Logiciel et auquel l'acc�s est n�cessaire en vue de
+modifier le Logiciel.
+
+Code Objet: d�signe les fichiers binaires issus de la compilation du
+Code Source.
+
+Titulaire: d�signe le ou les d�tenteurs des droits patrimoniaux d'auteur
+sur le Logiciel Initial
+
+Licenci�: d�signe le ou les utilisateurs du Logiciel ayant accept� le
+Contrat.
+
+Contributeur: d�signe le Licenci� auteur d'au moins une Contribution.
+
+Conc�dant: d�signe le Titulaire ou toute personne physique ou morale
+distribuant le Logiciel sous le Contrat.
+
+Contribution: d�signe l'ensemble des modifications, corrections,
+traductions, adaptations et/ou nouvelles fonctionnalit�s int�gr�es dans
+le Logiciel par tout Contributeur, ainsi que tout Module Interne.
+
+Module: d�signe un ensemble de fichiers sources y compris leur
+documentation qui permet de r�aliser des fonctionnalit�s ou services
+suppl�mentaires � ceux fournis par le Logiciel.
+
+Module Externe: d�signe tout Module, non d�riv� du Logiciel, tel que ce
+Module et le Logiciel s'ex�cutent dans des espaces d'adressages
+diff�rents, l'un appelant l'autre au moment de leur ex�cution.
+
+Module Interne: d�signe tout Module li� au Logiciel de telle sorte
+qu'ils s'ex�cutent dans le m�me espace d'adressage.
+
+GNU GPL: d�signe la GNU General Public License dans sa version 2 ou
+toute version ult�rieure, telle que publi�e par Free Software Foundation
+Inc.
+
+Parties: d�signe collectivement le Licenci� et le Conc�dant.
+
+Ces termes s'entendent au singulier comme au pluriel.
+
+
+    Article 2 - OBJET
+
+Le Contrat a pour objet la concession par le Conc�dant au Licenci� d'une
+licence non exclusive, cessible et mondiale du Logiciel telle que
+d�finie ci-apr�s � l'article 5 pour toute la dur�e de protection des 
+droits portant sur ce Logiciel.
+
+
+    Article 3 - ACCEPTATION
+
+3.1 L'acceptation par le Licenci� des termes du Contrat est r�put�e
+acquise du fait du premier des faits suivants:
+
+    * (i) le chargement du Logiciel par tout moyen notamment par
+      t�l�chargement � partir d'un serveur distant ou par chargement �
+      partir d'un support physique;
+    * (ii) le premier exercice par le Licenci� de l'un quelconque des
+      droits conc�d�s par le Contrat.
+
+3.2 Un exemplaire du Contrat, contenant notamment un avertissement
+relatif aux sp�cificit�s du Logiciel, � la restriction de garantie et �
+la limitation � un usage par des utilisateurs exp�riment�s a �t� mis �
+disposition du Licenci� pr�alablement � son acceptation telle que
+d�finie � l'article 3.1 ci dessus et le Licenci�
+reconna�t en avoir pris connaissance.
+
+
+    Article 4 - ENTREE EN VIGUEUR ET DUREE
+
+
+      4.1 ENTREE EN VIGUEUR
+
+Le Contrat entre en vigueur � la date de son acceptation par le Licenci�
+telle que d�finie en 3.1.
+
+
+      4.2 DUREE
+
+Le Contrat produira ses effets pendant toute la dur�e l�gale de
+protection des droits patrimoniaux portant sur le Logiciel.
+
+
+    Article 5 - ETENDUE DES DROITS CONCEDES
+
+Le Conc�dant conc�de au Licenci�, qui accepte, les droits suivants sur
+le Logiciel pour toutes destinations et pour la dur�e du Contrat dans
+les conditions ci-apr�s d�taill�es.
+
+Par ailleurs, si le Conc�dant d�tient ou venait � d�tenir un ou
+plusieurs brevets d'invention prot�geant tout ou partie des
+fonctionnalit�s du Logiciel ou de ses composants, il s'engage � ne pas
+opposer les �ventuels droits conf�r�s par ces brevets aux Licenci�s
+successifs qui utiliseraient, exploiteraient ou modifieraient le
+Logiciel. En cas de cession de ces brevets, le Conc�dant s'engage �
+faire reprendre les obligations du pr�sent alin�a aux cessionnaires.
+
+
+      5.1 DROIT D'UTILISATION
+
+Le Licenci� est autoris� � utiliser le Logiciel, sans restriction quant
+aux domaines d'application, �tant ci-apr�s pr�cis� que cela comporte:
+
+   1. la reproduction permanente ou provisoire du Logiciel en tout ou
+      partie par tout moyen et sous toute forme.
+
+   2. le chargement, l'affichage, l'ex�cution, ou le stockage du
+      Logiciel sur tout support.
+
+   3. la possibilit� d'en observer, d'en �tudier, ou d'en tester le
+      fonctionnement afin de d�terminer les id�es et principes qui sont
+      � la base de n'importe quel �l�ment de ce Logiciel; et ceci,
+      lorsque le Licenci� effectue toute op�ration de chargement,
+      d'affichage, d'ex�cution, de transmission ou de stockage du
+      Logiciel qu'il est en droit d'effectuer en vertu du Contrat.
+
+
+      5.2 DROIT D'APPORTER DES CONTRIBUTIONS
+
+Le droit d'apporter des Contributions comporte le droit de traduire,
+d'adapter, d'arranger ou d'apporter toute autre modification au Logiciel
+et le droit de reproduire le Logiciel en r�sultant.
+
+Le Licenci� est autoris� � apporter toute Contribution au Logiciel sous
+r�serve de mentionner, de fa�on explicite, son nom en tant qu'auteur de
+cette Contribution et la date de cr�ation de celle-ci.
+
+
+      5.3 DROIT DE DISTRIBUTION
+
+Le droit de distribution comporte notamment le droit de diffuser, de
+transmettre et de communiquer le Logiciel au public sur tout support et
+par tout moyen ainsi que le droit de mettre sur le march� � titre
+on�reux ou gratuit, un ou des exemplaires du Logiciel par tout proc�d�.
+
+Le Licenci� est autoris� � distribuer des copies du Logiciel, modifi� ou
+non, � des tiers dans les conditions ci-apr�s d�taill�es.
+
+
+        5.3.1 DISTRIBUTION DU LOGICIEL SANS MODIFICATION
+
+Le Licenci� est autoris� � distribuer des copies conformes du Logiciel,
+sous forme de Code Source ou de Code Objet, � condition que cette
+distribution respecte les dispositions du Contrat dans leur totalit� et
+soit accompagn�e:
+
+   1. d'un exemplaire du Contrat,
+
+   2. d'un avertissement relatif � la restriction de garantie et de
+      responsabilit� du Conc�dant telle que pr�vue aux articles 8
+      et 9,
+
+et que, dans le cas o� seul le Code Objet du Logiciel est redistribu�,
+le Licenci� permette aux futurs Licenci�s d'acc�der facilement au Code
+Source complet du Logiciel en indiquant les modalit�s d'acc�s, �tant
+entendu que le co�t additionnel d'acquisition du Code Source ne devra
+pas exc�der le simple co�t de transfert des donn�es.
+
+
+        5.3.2 DISTRIBUTION DU LOGICIEL MODIFIE
+
+Lorsque le Licenci� apporte une Contribution au Logiciel, les conditions
+de distribution du Logiciel Modifi� sont alors soumises � l'int�gralit�
+des dispositions du Contrat.
+
+Le Licenci� est autoris� � distribuer le Logiciel Modifi�, sous forme de
+Code Source ou de Code Objet, � condition que cette distribution
+respecte les dispositions du Contrat dans leur totalit� et soit
+accompagn�e:
+
+   1. d'un exemplaire du Contrat,
+
+   2. d'un avertissement relatif � la restriction de garantie et de
+      responsabilit� du Conc�dant telle que pr�vue aux articles 8
+      et 9,
+
+et que, dans le cas o� seul le Code Objet du Logiciel Modifi� est
+redistribu�, le Licenci� permette aux futurs Licenci�s d'acc�der
+facilement au Code Source complet du Logiciel Modifi� en indiquant les
+modalit�s d'acc�s, �tant entendu que le co�t additionnel d'acquisition
+du Code Source ne devra pas exc�der le simple co�t de transfert des donn�es.
+
+
+        5.3.3 DISTRIBUTION DES MODULES EXTERNES
+
+Lorsque le Licenci� a d�velopp� un Module Externe les conditions du
+Contrat ne s'appliquent pas � ce Module Externe, qui peut �tre distribu�
+sous un contrat de licence diff�rent.
+
+
+        5.3.4 COMPATIBILITE AVEC LA LICENCE GNU GPL
+
+Le Licenci� peut inclure un code soumis aux dispositions d'une des
+versions de la licence GNU GPL dans le Logiciel modifi� ou non et
+distribuer l'ensemble sous les conditions de la m�me version de la
+licence GNU GPL.
+
+Le Licenci� peut inclure le Logiciel modifi� ou non dans un code soumis
+aux dispositions d'une des versions de la licence GNU GPL et distribuer
+l'ensemble sous les conditions de la m�me version de la licence GNU GPL.
+
+
+    Article 6 - PROPRIETE INTELLECTUELLE
+
+
+      6.1 SUR LE LOGICIEL INITIAL
+
+Le Titulaire est d�tenteur des droits patrimoniaux sur le Logiciel
+Initial. Toute utilisation du Logiciel Initial est soumise au respect
+des conditions dans lesquelles le Titulaire a choisi de diffuser son
+oeuvre et nul autre n'a la facult� de modifier les conditions de
+diffusion de ce Logiciel Initial.
+
+Le Titulaire s'engage � ce que le Logiciel Initial reste au moins r�gi
+par la pr�sente licence et ce, pour la dur�e vis�e � l'article 4.2.
+
+
+      6.2 SUR LES CONTRIBUTIONS
+
+Le Licenci� qui a d�velopp� une Contribution est titulaire sur celle-ci
+des droits de propri�t� intellectuelle dans les conditions d�finies par
+la l�gislation applicable.
+
+
+      6.3 SUR LES MODULES EXTERNES
+
+Le Licenci� qui a d�velopp� un Module Externe est titulaire sur celui-ci
+des droits de propri�t� intellectuelle dans les conditions d�finies par
+la l�gislation applicable et reste libre du choix du contrat r�gissant
+sa diffusion.
+
+
+      6.4 DISPOSITIONS COMMUNES
+
+Le Licenci� s'engage express�ment:
+
+   1. � ne pas supprimer ou modifier de quelque mani�re que ce soit les
+      mentions de propri�t� intellectuelle appos�es sur le Logiciel;
+
+   2. � reproduire � l'identique lesdites mentions de propri�t�
+      intellectuelle sur les copies du Logiciel modifi� ou non.
+
+Le Licenci� s'engage � ne pas porter atteinte, directement ou
+indirectement, aux droits de propri�t� intellectuelle du Titulaire et/ou
+des Contributeurs sur le Logiciel et � prendre, le cas �ch�ant, �
+l'�gard de son personnel toutes les mesures n�cessaires pour assurer le
+respect des dits droits de propri�t� intellectuelle du Titulaire et/ou
+des Contributeurs.
+
+
+    Article 7 - SERVICES ASSOCIES
+
+7.1 Le Contrat n'oblige en aucun cas le Conc�dant � la r�alisation de
+prestations d'assistance technique ou de maintenance du Logiciel.
+
+Cependant le Conc�dant reste libre de proposer ce type de services. Les
+termes et conditions d'une telle assistance technique et/ou d'une telle
+maintenance seront alors d�termin�s dans un acte s�par�. Ces actes de
+maintenance et/ou assistance technique n'engageront que la seule
+responsabilit� du Conc�dant qui les propose.
+
+7.2 De m�me, tout Conc�dant est libre de proposer, sous sa seule
+responsabilit�, � ses licenci�s une garantie, qui n'engagera que lui,
+lors de la redistribution du Logiciel et/ou du Logiciel Modifi� et ce,
+dans les conditions qu'il souhaite. Cette garantie et les modalit�s
+financi�res de son application feront l'objet d'un acte s�par� entre le
+Conc�dant et le Licenci�.
+
+
+    Article 8 - RESPONSABILITE
+
+8.1 Sous r�serve des dispositions de l'article 8.2, le Licenci� a la 
+facult�, sous r�serve de prouver la faute du Conc�dant concern�, de
+solliciter la r�paration du pr�judice direct qu'il subirait du fait du
+logiciel et dont il apportera la preuve.
+
+8.2 La responsabilit� du Conc�dant est limit�e aux engagements pris en
+application du Contrat et ne saurait �tre engag�e en raison notamment:
+(i) des dommages dus � l'inex�cution, totale ou partielle, de ses
+obligations par le Licenci�, (ii) des dommages directs ou indirects
+d�coulant de l'utilisation ou des performances du Logiciel subis par le
+Licenci� et (iii) plus g�n�ralement d'un quelconque dommage indirect. En
+particulier, les Parties conviennent express�ment que tout pr�judice
+financier ou commercial (par exemple perte de donn�es, perte de
+b�n�fices, perte d'exploitation, perte de client�le ou de commandes,
+manque � gagner, trouble commercial quelconque) ou toute action dirig�e
+contre le Licenci� par un tiers, constitue un dommage indirect et
+n'ouvre pas droit � r�paration par le Conc�dant.
+
+
+    Article 9 - GARANTIE
+
+9.1 Le Licenci� reconna�t que l'�tat actuel des connaissances
+scientifiques et techniques au moment de la mise en circulation du
+Logiciel ne permet pas d'en tester et d'en v�rifier toutes les
+utilisations ni de d�tecter l'existence d'�ventuels d�fauts. L'attention
+du Licenci� a �t� attir�e sur ce point sur les risques associ�s au
+chargement, � l'utilisation, la modification et/ou au d�veloppement et �
+la reproduction du Logiciel qui sont r�serv�s � des utilisateurs avertis.
+
+Il rel�ve de la responsabilit� du Licenci� de contr�ler, par tous
+moyens, l'ad�quation du produit � ses besoins, son bon fonctionnement et
+de s'assurer qu'il ne causera pas de dommages aux personnes et aux biens.
+
+9.2 Le Conc�dant d�clare de bonne foi �tre en droit de conc�der
+l'ensemble des droits attach�s au Logiciel (comprenant notamment les
+droits vis�s � l'article 5).
+
+9.3 Le Licenci� reconna�t que le Logiciel est fourni "en l'�tat" par le
+Conc�dant sans autre garantie, expresse ou tacite, que celle pr�vue �
+l'article 9.2 et notamment sans aucune garantie sur sa valeur 
+commerciale, son caract�re s�curis�, innovant ou pertinent.
+
+En particulier, le Conc�dant ne garantit pas que le Logiciel est exempt
+d'erreur, qu'il fonctionnera sans interruption, qu'il sera compatible
+avec l'�quipement du Licenci� et sa configuration logicielle ni qu'il
+remplira les besoins du Licenci�.
+
+9.4 Le Conc�dant ne garantit pas, de mani�re expresse ou tacite, que le
+Logiciel ne porte pas atteinte � un quelconque droit de propri�t�
+intellectuelle d'un tiers portant sur un brevet, un logiciel ou sur tout
+autre droit de propri�t�. Ainsi, le Conc�dant exclut toute garantie au
+profit du Licenci� contre les actions en contrefa�on qui pourraient �tre
+diligent�es au titre de l'utilisation, de la modification, et de la
+redistribution du Logiciel. N�anmoins, si de telles actions sont
+exerc�es contre le Licenci�, le Conc�dant lui apportera son aide
+technique et juridique pour sa d�fense. Cette aide technique et
+juridique est d�termin�e au cas par cas entre le Conc�dant concern� et
+le Licenci� dans le cadre d'un protocole d'accord. Le Conc�dant d�gage
+toute responsabilit� quant � l'utilisation de la d�nomination du
+Logiciel par le Licenci�. Aucune garantie n'est apport�e quant �
+l'existence de droits ant�rieurs sur le nom du Logiciel et sur
+l'existence d'une marque.
+
+
+    Article 10 - RESILIATION
+
+10.1 En cas de manquement par le Licenci� aux obligations mises � sa
+charge par le Contrat, le Conc�dant pourra r�silier de plein droit le
+Contrat trente (30) jours apr�s notification adress�e au Licenci� et
+rest�e sans effet.
+
+10.2 Le Licenci� dont le Contrat est r�sili� n'est plus autoris� �
+utiliser, modifier ou distribuer le Logiciel. Cependant, toutes les
+licences qu'il aura conc�d�es ant�rieurement � la r�siliation du Contrat
+resteront valides sous r�serve qu'elles aient �t� effectu�es en
+conformit� avec le Contrat.
+
+
+    Article 11 - DISPOSITIONS DIVERSES
+
+
+      11.1 CAUSE EXTERIEURE
+
+Aucune des Parties ne sera responsable d'un retard ou d'une d�faillance
+d'ex�cution du Contrat qui serait d� � un cas de force majeure, un cas
+fortuit ou une cause ext�rieure, telle que, notamment, le mauvais
+fonctionnement ou les interruptions du r�seau �lectrique ou de
+t�l�communication, la paralysie du r�seau li�e � une attaque
+informatique, l'intervention des autorit�s gouvernementales, les
+catastrophes naturelles, les d�g�ts des eaux, les tremblements de terre,
+le feu, les explosions, les gr�ves et les conflits sociaux, l'�tat de
+guerre...
+
+11.2 Le fait, par l'une ou l'autre des Parties, d'omettre en une ou
+plusieurs occasions de se pr�valoir d'une ou plusieurs dispositions du
+Contrat, ne pourra en aucun cas impliquer renonciation par la Partie
+int�ress�e � s'en pr�valoir ult�rieurement.
+
+11.3 Le Contrat annule et remplace toute convention ant�rieure, �crite
+ou orale, entre les Parties sur le m�me objet et constitue l'accord
+entier entre les Parties sur cet objet. Aucune addition ou modification
+aux termes du Contrat n'aura d'effet � l'�gard des Parties � moins
+d'�tre faite par �crit et sign�e par leurs repr�sentants d�ment habilit�s.
+
+11.4 Dans l'hypoth�se o� une ou plusieurs des dispositions du Contrat
+s'av�rerait contraire � une loi ou � un texte applicable, existants ou
+futurs, cette loi ou ce texte pr�vaudrait, et les Parties feraient les
+amendements n�cessaires pour se conformer � cette loi ou � ce texte.
+Toutes les autres dispositions resteront en vigueur. De m�me, la
+nullit�, pour quelque raison que ce soit, d'une des dispositions du
+Contrat ne saurait entra�ner la nullit� de l'ensemble du Contrat.
+
+
+      11.5 LANGUE
+
+Le Contrat est r�dig� en langue fran�aise et en langue anglaise, ces
+deux versions faisant �galement foi.
+
+
+    Article 12 - NOUVELLES VERSIONS DU CONTRAT
+
+12.1 Toute personne est autoris�e � copier et distribuer des copies de
+ce Contrat.
+
+12.2 Afin d'en pr�server la coh�rence, le texte du Contrat est prot�g�
+et ne peut �tre modifi� que par les auteurs de la licence, lesquels se
+r�servent le droit de publier p�riodiquement des mises � jour ou de
+nouvelles versions du Contrat, qui poss�deront chacune un num�ro
+distinct. Ces versions ult�rieures seront susceptibles de prendre en
+compte de nouvelles probl�matiques rencontr�es par les logiciels libres.
+
+12.3 Tout Logiciel diffus� sous une version donn�e du Contrat ne pourra
+faire l'objet d'une diffusion ult�rieure que sous la m�me version du
+Contrat ou une version post�rieure, sous r�serve des dispositions de
+l'article 5.3.4.
+
+
+    Article 13 - LOI APPLICABLE ET COMPETENCE TERRITORIALE
+
+13.1 Le Contrat est r�gi par la loi fran�aise. Les Parties conviennent
+de tenter de r�gler � l'amiable les diff�rends ou litiges qui
+viendraient � se produire par suite ou � l'occasion du Contrat.
+
+13.2 A d�faut d'accord amiable dans un d�lai de deux (2) mois � compter
+de leur survenance et sauf situation relevant d'une proc�dure d'urgence,
+les diff�rends ou litiges seront port�s par la Partie la plus diligente
+devant les Tribunaux comp�tents de Paris.
+
+
+Version 2.0 du 2005-05-21.
\ No newline at end of file
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/Makefile b/modeling/PressureController.ttool/AVATAR_executablecode/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..1678a90ea9235bc5e820653343b58edb7ac41fc0
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/Makefile
@@ -0,0 +1,32 @@
+UNAME := $(shell uname -s)
+CC     = /usr/bin/gcc
+#CC     = test2.sh
+#CC = /packages/gcc_3.2.2/bin/g++32
+OPT    = -O1 -pthread
+# Solaris
+#LOPT   = -O1 -pthread -ldl -lnsl -lsocket
+#Linux
+LOPT_UNIX   = -O1 -pthread -ldl -lrt
+LOPT_MAC = -O1 -pthread -ldl
+
+DEBUG  = -g
+OTHER  = -Wall
+TRY    = 
+CFLAGS = $(OPT) $(OTHER) $(TRY)
+LFLAGS_MAC = $(LOPT_MAC) $(OTHER) $(TRY)
+LFLAGS_UNIX = $(LOPT_UNIX) $(OTHER) $(TRY)
+# CFLAGS = $(DEBUG) $(OTHER)
+OBJDIR = lib
+
+MODULE = run
+SRCS_generated_DIR = generated_src/
+include Makefile.src
+SRCS_base = src/request.c src/message.c src/myerrors.c src/debug.c src/syncchannel.c src/asyncchannel.c src/request_manager.c src/random.c src/mytimelib.c src/tracemanager.c
+SRCS_base_DIR = .
+SRCS_base_DIRSRC = src/ 
+OBJS_executor = $(SRCS_base:%.c=lib/%.o)
+OBJS = $(SRCS:%.c=lib/%.o)
+
+include Makefile.defs
+
+include Makefile.forsoclib
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/Makefile.defs b/modeling/PressureController.ttool/AVATAR_executablecode/Makefile.defs
new file mode 100644
index 0000000000000000000000000000000000000000..fa9276ff99651594a42f44ddcb827ffefe68c4c2
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/Makefile.defs
@@ -0,0 +1,36 @@
+## Variable that points to SystemC installation path
+
+
+INCDIR = -I. -I$(SRCS_base_DIR) -I$(SRCS_base_DIRSRC) -I$(SRCS_generated_DIR)
+LIBDIR = -L. -L.. 
+LIBS   =  -lm $(EXTRA_LIBS)
+
+EXE    = $(MODULE).x
+
+.SUFFIXES: .c .o .x
+
+
+$(EXE): makedir $(OBJS) $(OBJS_executor) 
+ifeq ($(UNAME),Darwin)
+	$(CC) $(LFLAGS_MAC) $(INCDIR) $(LIBDIR) -o $@ $(OBJS) $(OBJS_executor) $(LIBS) 2>&1 | c++filt
+endif
+ifneq ($(UNAME),Darwin)
+	$(CC) $(LFLAGS_UNIX) $(INCDIR) $(LIBDIR) -o $@ $(OBJS) $(OBJS_executor) $(LIBS) 2>&1 | c++filt
+endif
+
+makedir:
+	echo Making directories
+	mkdir -p ./lib
+	mkdir -p ./lib/$(SRCS_generated_DIR)
+	mkdir -p ./lib/$(SRCS_base_DIRSRC)
+
+$(OBJDIR)/%.o: $(SRCS_base_DIR)/%.c
+	$(CC) $(CFLAGS) $(INCDIR) -o $@ -c $<
+
+
+clean:
+	rm -f $(OBJS_simulator) $(OBJS_executor) $(OBJS) *~ $(EXE) core 
+
+ultraclean: clean
+	rm -f Makefile.deps
+
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/Makefile.forsoclib b/modeling/PressureController.ttool/AVATAR_executablecode/Makefile.forsoclib
new file mode 100644
index 0000000000000000000000000000000000000000..9f685d88168abf74e444f54116858668b96e1f55
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/Makefile.forsoclib
@@ -0,0 +1,23 @@
+SOCLIB_CPU=ppc
+MUTEKH_CPU=ppc
+
+PATH+=/opt/mutekh/bin
+export PATH
+
+updateruntime:
+	cp ~/TTool/executablecode/src/*.c ~/TTool/MPSoC/mutekh/libavatar/
+	cp ~/TTool/executablecode/src/*.h ~/TTool/MPSoC/mutekh/libavatar/include/  
+
+updategeneratedcode:
+	cp ~/TTool/executablecode/generated_src/*.h ~/TTool/MPSoC/mutekh/examples/avatar
+	cp ~/TTool/executablecode/generated_src/*.c ~/TTool/MPSoC/mutekh/examples/avatar	
+	cp ~/TTool/executablecode/Makefile.soclib ~/TTool/MPSoC/mutekh/examples/avatar/Makefile
+
+compilesoclib:
+	cd ~/TTool/MPSoC/mutekh; make CONF=examples/avatar/config BUILD=soclib-$(MUTEKH_CPU):pf-tutorial
+
+runsoclib:
+	echo "running soclib"
+	cd ~/TTool/MPSoC/soclib/soclib/platform/topcells/caba-vgmn-mutekh_kernel_tutorial; SOCLIB_GDB=S ./system.x $(SOCLIB_CPU):$(SOCLIB_CPU_COUNT) ~/TTool/MPSoC/mutekh/avatar-soclib-$(MUTEKH_CPU).out
+allsoclib: updateruntime updategeneratedcode compilesoclib runsoclib
+
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/Makefile.soclib b/modeling/PressureController.ttool/AVATAR_executablecode/Makefile.soclib
new file mode 100644
index 0000000000000000000000000000000000000000..6c7a2422bfa5dcdd66daf3e595232470dd2d8659
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/Makefile.soclib
@@ -0,0 +1 @@
+objs = main.o AlarmActuator.o PressureSensor.o PressureController.o AlarmManager.o MainController.o Timer__alarmTimer__AlarmManager.o 
\ No newline at end of file
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/Makefile.src b/modeling/PressureController.ttool/AVATAR_executablecode/Makefile.src
new file mode 100644
index 0000000000000000000000000000000000000000..318ad1aba0dc6c25adff59226637339f0066ad94
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/Makefile.src
@@ -0,0 +1 @@
+SRCS = generated_src/main.c generated_src/AlarmActuator.c generated_src/PressureSensor.c generated_src/PressureController.c generated_src/AlarmManager.c generated_src/MainController.c generated_src/Timer__alarmTimer__AlarmManager.c 
\ No newline at end of file
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/AlarmActuator.c b/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/AlarmActuator.c
new file mode 100644
index 0000000000000000000000000000000000000000..c8a45a0fc5b2caaaca9f7fe697653ee3579d460c
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/AlarmActuator.c
@@ -0,0 +1,89 @@
+#include "AlarmActuator.h"
+
+
+// Header code defined in the model
+
+
+void __userImplemented__AlarmActuator__setAlarm(bool att1) {
+    if (att1) {
+        printf("Alarm ON\n");
+        sendDatagram("+", 1);
+    } else {
+        printf("Alarm OFF\n");
+        sendDatagram("-", 1);
+    }
+}
+
+// End of header code defined in the model
+
+#define STATE__START__STATE 0
+#define STATE__WaitingForAlarmCommand 1
+#define STATE__STOP__STATE 2
+
+void AlarmActuator__setAlarm(bool onoff) {
+  char my__attr[CHAR_ALLOC_SIZE];
+  sprintf(my__attr, "%d",onoff);
+  traceFunctionCall("AlarmActuator", "setAlarm", my__attr);
+}
+
+
+void *mainFunc__AlarmActuator(void *arg){
+  
+  int __currentState = STATE__START__STATE;
+  __attribute__((unused)) request __req0;
+  __attribute__((unused))int *__params0[0];
+  __attribute__((unused)) request __req1;
+  __attribute__((unused))int *__params1[0];
+  __attribute__((unused))setOfRequests __list;
+  __attribute__((unused))pthread_cond_t __myCond;
+  __attribute__((unused))request *__returnRequest;
+  
+  char * __myname = (char *)arg;
+  
+  pthread_cond_init(&__myCond, NULL);
+  
+  fillListOfRequests(&__list, __myname, &__myCond, &__mainMutex);
+  //printf("my name = %s\n", __myname);
+  
+  /* Main loop on states */
+  while(__currentState != STATE__STOP__STATE) {
+    switch(__currentState) {
+      case STATE__START__STATE: 
+      traceStateEntering(__myname, "__StartState");
+      __currentState = STATE__WaitingForAlarmCommand;
+      break;
+      
+      case STATE__WaitingForAlarmCommand: 
+      traceStateEntering(__myname, "WaitingForAlarmCommand");
+      makeNewRequest(&__req0, 41, RECEIVE_SYNC_REQUEST, 0, 0, 0, 0, __params0);
+      __req0.syncChannel = &__AlarmManager_alarmOn__AlarmActuator_alarmOn;
+      addRequestToList(&__list, &__req0);
+      makeNewRequest(&__req1, 42, RECEIVE_SYNC_REQUEST, 0, 0, 0, 0, __params1);
+      __req1.syncChannel = &__AlarmManager_alarmOff__AlarmActuator_alarmOff;
+      addRequestToList(&__list, &__req1);
+      if (nbOfRequests(&__list) == 0) {
+        debug2Msg(__myname, "No possible request");
+        __currentState = STATE__STOP__STATE;
+        break;
+      }
+      __returnRequest = executeListOfRequests(&__list);
+      clearListOfRequests(&__list);
+      traceRequest(__myname, __returnRequest);
+       if (__returnRequest == &__req0) {
+        AlarmActuator__setAlarm(true);
+        __currentState = STATE__WaitingForAlarmCommand;
+        
+      }
+      else  if (__returnRequest == &__req1) {
+        AlarmActuator__setAlarm(false);
+        __currentState = STATE__WaitingForAlarmCommand;
+        
+      }
+      break;
+      
+    }
+  }
+  //printf("Exiting = %s\n", __myname);
+  return NULL;
+}
+
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/AlarmActuator.h b/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/AlarmActuator.h
new file mode 100644
index 0000000000000000000000000000000000000000..a74d991ce9f20b798452307feeb84c830e293b0b
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/AlarmActuator.h
@@ -0,0 +1,20 @@
+#ifndef AlarmActuator_H
+#define AlarmActuator_H
+#include <stdio.h>
+#include <pthread.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+#include "request.h"
+#include "syncchannel.h"
+#include "request_manager.h"
+#include "debug.h"
+#include "defs.h"
+#include "mytimelib.h"
+#include "random.h"
+#include "tracemanager.h"
+#include "main.h"
+
+extern void *mainFunc__AlarmActuator(void *arg);
+
+#endif
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/AlarmManager.c b/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/AlarmManager.c
new file mode 100644
index 0000000000000000000000000000000000000000..105240a78f16b6f78ba99952e1ef3d3c58051b72
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/AlarmManager.c
@@ -0,0 +1,113 @@
+#include "AlarmManager.h"
+
+
+// Header code defined in the model
+
+// End of header code defined in the model
+
+#define STATE__START__STATE 0
+#define STATE__AlarmIsOff 1
+#define STATE__AlarmIsOn 2
+#define STATE__STOP__STATE 3
+
+void *mainFunc__AlarmManager(void *arg){
+  int alarmDuration = 5;
+  int __timerValue = 0;
+  
+  int __currentState = STATE__START__STATE;
+  __attribute__((unused)) request __req0;
+  __attribute__((unused))int *__params0[1];
+  __attribute__((unused)) request __req1;
+  __attribute__((unused))int *__params1[1];
+  __attribute__((unused))setOfRequests __list;
+  __attribute__((unused))pthread_cond_t __myCond;
+  __attribute__((unused))request *__returnRequest;
+  
+  char * __myname = (char *)arg;
+  
+  pthread_cond_init(&__myCond, NULL);
+  
+  fillListOfRequests(&__list, __myname, &__myCond, &__mainMutex);
+  //printf("my name = %s\n", __myname);
+  
+  /* Main loop on states */
+  while(__currentState != STATE__STOP__STATE) {
+    switch(__currentState) {
+      case STATE__START__STATE: 
+      traceStateEntering(__myname, "__StartState");
+      __currentState = STATE__AlarmIsOff;
+      break;
+      
+      case STATE__AlarmIsOff: 
+      traceStateEntering(__myname, "AlarmIsOff");
+      makeNewRequest(&__req0, 81, RECEIVE_SYNC_REQUEST, 0, 0, 0, 0, __params0);
+      __req0.syncChannel = &__MainController_highPressure__AlarmManager_highPressure;
+      __returnRequest = executeOneRequest(&__list, &__req0);
+      clearListOfRequests(&__list);
+      traceRequest(__myname, __returnRequest);
+      __timerValue = alarmDuration;
+      traceVariableModification("AlarmManager", "__timerValue", __timerValue,0);
+      __params0[0] = &__timerValue;
+      makeNewRequest(&__req0, 156, SEND_SYNC_REQUEST, 0, 0, 0, 1, __params0);
+      __req0.syncChannel = &__AlarmManager_set__alarmTimer__Timer__alarmTimer__AlarmManager_set;
+      __returnRequest = executeOneRequest(&__list, &__req0);
+      clearListOfRequests(&__list);
+      traceRequest(__myname, __returnRequest);
+      makeNewRequest(&__req0, 83, SEND_SYNC_REQUEST, 0, 0, 0, 0, __params0);
+      __req0.syncChannel = &__AlarmManager_alarmOn__AlarmActuator_alarmOn;
+      __returnRequest = executeOneRequest(&__list, &__req0);
+      clearListOfRequests(&__list);
+      traceRequest(__myname, __returnRequest);
+      __currentState = STATE__AlarmIsOn;
+      break;
+      
+      case STATE__AlarmIsOn: 
+      traceStateEntering(__myname, "AlarmIsOn");
+      makeNewRequest(&__req0, 163, RECEIVE_SYNC_REQUEST, 0, 0, 0, 0, __params0);
+      __req0.syncChannel = &__AlarmManager_expire__alarmTimer__Timer__alarmTimer__AlarmManager_expire;
+      addRequestToList(&__list, &__req0);
+      makeNewRequest(&__req1, 85, RECEIVE_SYNC_REQUEST, 0, 0, 0, 0, __params1);
+      __req1.syncChannel = &__MainController_highPressure__AlarmManager_highPressure;
+      addRequestToList(&__list, &__req1);
+      if (nbOfRequests(&__list) == 0) {
+        debug2Msg(__myname, "No possible request");
+        __currentState = STATE__STOP__STATE;
+        break;
+      }
+      __returnRequest = executeListOfRequests(&__list);
+      clearListOfRequests(&__list);
+      traceRequest(__myname, __returnRequest);
+       if (__returnRequest == &__req0) {
+        makeNewRequest(&__req0, 89, SEND_SYNC_REQUEST, 0, 0, 0, 0, __params0);
+        __req0.syncChannel = &__AlarmManager_alarmOff__AlarmActuator_alarmOff;
+        __returnRequest = executeOneRequest(&__list, &__req0);
+        clearListOfRequests(&__list);
+        traceRequest(__myname, __returnRequest);
+        __currentState = STATE__AlarmIsOff;
+        
+      }
+      else  if (__returnRequest == &__req1) {
+        makeNewRequest(&__req0, 159, SEND_SYNC_REQUEST, 0, 0, 0, 0, __params0);
+        __req0.syncChannel = &__AlarmManager_reset__alarmTimer__Timer__alarmTimer__AlarmManager_reset;
+        __returnRequest = executeOneRequest(&__list, &__req0);
+        clearListOfRequests(&__list);
+        traceRequest(__myname, __returnRequest);
+        __timerValue = alarmDuration;
+        traceVariableModification("AlarmManager", "__timerValue", __timerValue,0);
+        __params0[0] = &__timerValue;
+        makeNewRequest(&__req0, 160, SEND_SYNC_REQUEST, 0, 0, 0, 1, __params0);
+        __req0.syncChannel = &__AlarmManager_set__alarmTimer__Timer__alarmTimer__AlarmManager_set;
+        __returnRequest = executeOneRequest(&__list, &__req0);
+        clearListOfRequests(&__list);
+        traceRequest(__myname, __returnRequest);
+        __currentState = STATE__AlarmIsOn;
+        
+      }
+      break;
+      
+    }
+  }
+  //printf("Exiting = %s\n", __myname);
+  return NULL;
+}
+
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/AlarmManager.h b/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/AlarmManager.h
new file mode 100644
index 0000000000000000000000000000000000000000..8d9e5e366e03b18712b638484a637ecb0b1a08eb
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/AlarmManager.h
@@ -0,0 +1,20 @@
+#ifndef AlarmManager_H
+#define AlarmManager_H
+#include <stdio.h>
+#include <pthread.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+#include "request.h"
+#include "syncchannel.h"
+#include "request_manager.h"
+#include "debug.h"
+#include "defs.h"
+#include "mytimelib.h"
+#include "random.h"
+#include "tracemanager.h"
+#include "main.h"
+
+extern void *mainFunc__AlarmManager(void *arg);
+
+#endif
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/MainController.c b/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/MainController.c
new file mode 100644
index 0000000000000000000000000000000000000000..c00d94f6765a2db505b3fdfb3def0a50eb89ce11
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/MainController.c
@@ -0,0 +1,127 @@
+#include "MainController.h"
+
+
+// Header code defined in the model
+
+// End of header code defined in the model
+
+#define STATE__START__STATE 0
+#define STATE__WaitFirstHighPressure 1
+#define STATE__choice__0 2
+#define STATE__WaitSecondHighPressure 3
+#define STATE__choice__1 4
+#define STATE__STOP__STATE 5
+
+void *mainFunc__MainController(void *arg){
+  int threshold = 20;
+  int currentPressure = 0;
+  
+  int __currentState = STATE__START__STATE;
+  __attribute__((unused)) request __req0;
+  __attribute__((unused))int *__params0[1];
+  __attribute__((unused)) request __req1;
+  __attribute__((unused))int *__params1[1];
+  __attribute__((unused))setOfRequests __list;
+  __attribute__((unused))pthread_cond_t __myCond;
+  __attribute__((unused))request *__returnRequest;
+  
+  char * __myname = (char *)arg;
+  
+  pthread_cond_init(&__myCond, NULL);
+  
+  fillListOfRequests(&__list, __myname, &__myCond, &__mainMutex);
+  //printf("my name = %s\n", __myname);
+  
+  /* Main loop on states */
+  while(__currentState != STATE__STOP__STATE) {
+    switch(__currentState) {
+      case STATE__START__STATE: 
+      traceStateEntering(__myname, "__StartState");
+      __currentState = STATE__WaitFirstHighPressure;
+      break;
+      
+      case STATE__WaitFirstHighPressure: 
+      traceStateEntering(__myname, "WaitFirstHighPressure");
+      __params0[0] = &currentPressure;
+      makeNewRequest(&__req0, 104, RECEIVE_SYNC_REQUEST, 0, 0, 0, 1, __params0);
+      __req0.syncChannel = &__PressureSensor_pressureValue__MainController_pressureValue;
+      __returnRequest = executeOneRequest(&__list, &__req0);
+      clearListOfRequests(&__list);
+      traceRequest(__myname, __returnRequest);
+      __currentState = STATE__choice__0;
+      break;
+      
+      case STATE__choice__0: 
+      traceStateEntering(__myname, "choice__0");
+      if (currentPressure < threshold) {
+        makeNewRequest(&__req0, 115, IMMEDIATE, 0, 0, 0, 0, __params0);
+        addRequestToList(&__list, &__req0);
+      }
+      if (!(currentPressure < threshold)) {
+        makeNewRequest(&__req1, 121, IMMEDIATE, 0, 0, 0, 0, __params1);
+        addRequestToList(&__list, &__req1);
+      }
+      if (nbOfRequests(&__list) == 0) {
+        debug2Msg(__myname, "No possible request");
+        __currentState = STATE__STOP__STATE;
+        break;
+      }
+      __returnRequest = executeListOfRequests(&__list);
+      clearListOfRequests(&__list);
+      traceRequest(__myname, __returnRequest);
+       if (__returnRequest == &__req0) {
+        __currentState = STATE__WaitFirstHighPressure;
+        
+      }
+      else  if (__returnRequest == &__req1) {
+        __currentState = STATE__WaitSecondHighPressure;
+        
+      }
+      break;
+      
+      case STATE__WaitSecondHighPressure: 
+      traceStateEntering(__myname, "WaitSecondHighPressure");
+      __params0[0] = &currentPressure;
+      makeNewRequest(&__req0, 107, RECEIVE_SYNC_REQUEST, 0, 0, 0, 1, __params0);
+      __req0.syncChannel = &__PressureSensor_pressureValue__MainController_pressureValue;
+      __returnRequest = executeOneRequest(&__list, &__req0);
+      clearListOfRequests(&__list);
+      traceRequest(__myname, __returnRequest);
+      __currentState = STATE__choice__1;
+      break;
+      
+      case STATE__choice__1: 
+      traceStateEntering(__myname, "choice__1");
+      if (currentPressure < threshold) {
+        makeNewRequest(&__req0, 112, IMMEDIATE, 0, 0, 0, 0, __params0);
+        addRequestToList(&__list, &__req0);
+      }
+      if (!(currentPressure < threshold)) {
+        makeNewRequest(&__req1, 109, SEND_SYNC_REQUEST, 0, 0, 0, 0, __params1);
+        __req1.syncChannel = &__MainController_highPressure__AlarmManager_highPressure;
+        addRequestToList(&__list, &__req1);
+      }
+      if (nbOfRequests(&__list) == 0) {
+        debug2Msg(__myname, "No possible request");
+        __currentState = STATE__STOP__STATE;
+        break;
+      }
+      __returnRequest = executeListOfRequests(&__list);
+      clearListOfRequests(&__list);
+      traceRequest(__myname, __returnRequest);
+       if (__returnRequest == &__req0) {
+        __currentState = STATE__WaitFirstHighPressure;
+        
+      }
+      else  if (__returnRequest == &__req1) {
+        __currentState = STATE__WaitFirstHighPressure;
+        
+      }
+      break;
+      
+    }
+  }
+  //printf("Exiting = %s\n", __myname);
+  return NULL;
+}
+
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/MainController.h b/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/MainController.h
new file mode 100644
index 0000000000000000000000000000000000000000..1acba04806edfd3495e37dcb24e80d3b0e888357
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/MainController.h
@@ -0,0 +1,20 @@
+#ifndef MainController_H
+#define MainController_H
+#include <stdio.h>
+#include <pthread.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+#include "request.h"
+#include "syncchannel.h"
+#include "request_manager.h"
+#include "debug.h"
+#include "defs.h"
+#include "mytimelib.h"
+#include "random.h"
+#include "tracemanager.h"
+#include "main.h"
+
+extern void *mainFunc__MainController(void *arg);
+
+#endif
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/PressureController.c b/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/PressureController.c
new file mode 100644
index 0000000000000000000000000000000000000000..861c34785ff3db48d0a13ba9356c442db6f2dfe1
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/PressureController.c
@@ -0,0 +1,40 @@
+#include "PressureController.h"
+
+
+// Header code defined in the model
+
+// End of header code defined in the model
+
+#define STATE__START__STATE 0
+#define STATE__STOP__STATE 1
+
+void *mainFunc__PressureController(void *arg){
+  
+  int __currentState = STATE__START__STATE;
+  __attribute__((unused)) request __req0;
+  __attribute__((unused))int *__params0[0];
+  __attribute__((unused))setOfRequests __list;
+  __attribute__((unused))pthread_cond_t __myCond;
+  __attribute__((unused))request *__returnRequest;
+  
+  char * __myname = (char *)arg;
+  
+  pthread_cond_init(&__myCond, NULL);
+  
+  fillListOfRequests(&__list, __myname, &__myCond, &__mainMutex);
+  //printf("my name = %s\n", __myname);
+  
+  /* Main loop on states */
+  while(__currentState != STATE__STOP__STATE) {
+    switch(__currentState) {
+      case STATE__START__STATE: 
+      traceStateEntering(__myname, "__StartState");
+      __currentState = STATE__STOP__STATE;
+      break;
+      
+    }
+  }
+  //printf("Exiting = %s\n", __myname);
+  return NULL;
+}
+
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/PressureController.h b/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/PressureController.h
new file mode 100644
index 0000000000000000000000000000000000000000..7ab5706e7c78abd15c8a3daa2c21f87cbc8000fc
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/PressureController.h
@@ -0,0 +1,20 @@
+#ifndef PressureController_H
+#define PressureController_H
+#include <stdio.h>
+#include <pthread.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+#include "request.h"
+#include "syncchannel.h"
+#include "request_manager.h"
+#include "debug.h"
+#include "defs.h"
+#include "mytimelib.h"
+#include "random.h"
+#include "tracemanager.h"
+#include "main.h"
+
+extern void *mainFunc__PressureController(void *arg);
+
+#endif
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/PressureSensor.c b/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/PressureSensor.c
new file mode 100644
index 0000000000000000000000000000000000000000..ae0648303e27fbadb47bcfc89c491d8d9e2a5919
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/PressureSensor.c
@@ -0,0 +1,124 @@
+#include "PressureSensor.h"
+
+
+// Header code defined in the model
+extern int pressure;
+
+int __userImplemented__PressureSensor__readingPressure() {
+    return pressure;
+}
+
+bool __userImplemented__PressureSensor__isInCode() {
+    return 1;
+}
+
+// End of header code defined in the model
+
+#define STATE__START__STATE 0
+#define STATE__WaitingForNextCycle 1
+#define STATE__SensingPressure 2
+#define STATE__choice__0 3
+#define STATE__SendingPressure 4
+#define STATE__STOP__STATE 5
+
+int PressureSensor__readingPressure() {
+  traceFunctionCall("PressureSensor", "readingPressure", "-");
+  return __userImplemented__PressureSensor__readingPressure();
+}
+
+
+bool PressureSensor__isInCode() {
+  traceFunctionCall("PressureSensor", "isInCode", "-");
+  return __userImplemented__PressureSensor__isInCode();
+}
+
+
+void *mainFunc__PressureSensor(void *arg){
+  int pressure = 0;
+  bool branchToUse = false;
+  
+  int __currentState = STATE__START__STATE;
+  __attribute__((unused)) request __req0;
+  __attribute__((unused))int *__params0[1];
+  __attribute__((unused)) request __req1;
+  __attribute__((unused))int *__params1[1];
+  __attribute__((unused))setOfRequests __list;
+  __attribute__((unused))pthread_cond_t __myCond;
+  __attribute__((unused))request *__returnRequest;
+  
+  char * __myname = (char *)arg;
+  
+  pthread_cond_init(&__myCond, NULL);
+  
+  fillListOfRequests(&__list, __myname, &__myCond, &__mainMutex);
+  //printf("my name = %s\n", __myname);
+  
+  /* Main loop on states */
+  while(__currentState != STATE__STOP__STATE) {
+    switch(__currentState) {
+      case STATE__START__STATE: 
+      traceStateEntering(__myname, "__StartState");
+      __currentState = STATE__WaitingForNextCycle;
+      break;
+      
+      case STATE__WaitingForNextCycle: 
+      traceStateEntering(__myname, "WaitingForNextCycle");
+      waitFor((1)*1000000, (1)*1000000);
+      __currentState = STATE__SensingPressure;
+      break;
+      
+      case STATE__SensingPressure: 
+      traceStateEntering(__myname, "SensingPressure");
+      branchToUse = PressureSensor__isInCode();
+      traceVariableModification("PressureSensor", "branchToUse", branchToUse,1);
+      __currentState = STATE__choice__0;
+      break;
+      
+      case STATE__choice__0: 
+      traceStateEntering(__myname, "choice__0");
+      if (!(branchToUse)) {
+        makeNewRequest(&__req0, 63, IMMEDIATE, 0, 0, 0, 0, __params0);
+        addRequestToList(&__list, &__req0);
+      }
+      if (branchToUse) {
+        makeNewRequest(&__req1, 67, IMMEDIATE, 0, 0, 0, 0, __params1);
+        addRequestToList(&__list, &__req1);
+      }
+      if (nbOfRequests(&__list) == 0) {
+        debug2Msg(__myname, "No possible request");
+        __currentState = STATE__STOP__STATE;
+        break;
+      }
+      __returnRequest = executeListOfRequests(&__list);
+      clearListOfRequests(&__list);
+      traceRequest(__myname, __returnRequest);
+       if (__returnRequest == &__req0) {
+        pressure = computeRandom(19, 21);
+        __currentState = STATE__SendingPressure;
+        
+      }
+      else  if (__returnRequest == &__req1) {
+        pressure = PressureSensor__readingPressure();
+        traceVariableModification("PressureSensor", "pressure", pressure,0);
+        __currentState = STATE__SendingPressure;
+        
+      }
+      break;
+      
+      case STATE__SendingPressure: 
+      traceStateEntering(__myname, "SendingPressure");
+      __params0[0] = &pressure;
+      makeNewRequest(&__req0, 59, SEND_SYNC_REQUEST, 0, 0, 0, 1, __params0);
+      __req0.syncChannel = &__PressureSensor_pressureValue__MainController_pressureValue;
+      __returnRequest = executeOneRequest(&__list, &__req0);
+      clearListOfRequests(&__list);
+      traceRequest(__myname, __returnRequest);
+      __currentState = STATE__WaitingForNextCycle;
+      break;
+      
+    }
+  }
+  //printf("Exiting = %s\n", __myname);
+  return NULL;
+}
+
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/PressureSensor.h b/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/PressureSensor.h
new file mode 100644
index 0000000000000000000000000000000000000000..3476c8d8a0e76aa43bf873647c70020080044c56
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/PressureSensor.h
@@ -0,0 +1,20 @@
+#ifndef PressureSensor_H
+#define PressureSensor_H
+#include <stdio.h>
+#include <pthread.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+#include "request.h"
+#include "syncchannel.h"
+#include "request_manager.h"
+#include "debug.h"
+#include "defs.h"
+#include "mytimelib.h"
+#include "random.h"
+#include "tracemanager.h"
+#include "main.h"
+
+extern void *mainFunc__PressureSensor(void *arg);
+
+#endif
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/Timer__alarmTimer__AlarmManager.c b/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/Timer__alarmTimer__AlarmManager.c
new file mode 100644
index 0000000000000000000000000000000000000000..63d779e1398e8bcf0c452985c05f2e6ba17f5ced
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/Timer__alarmTimer__AlarmManager.c
@@ -0,0 +1,108 @@
+#include "Timer__alarmTimer__AlarmManager.h"
+
+
+// Header code defined in the model
+
+// End of header code defined in the model
+
+#define STATE__START__STATE 0
+#define STATE__wait4set 1
+#define STATE__wait4expire 2
+#define STATE__STOP__STATE 3
+
+void *mainFunc__Timer__alarmTimer__AlarmManager(void *arg){
+  int value = 0;
+  
+  int __currentState = STATE__START__STATE;
+  __attribute__((unused)) request __req0;
+  __attribute__((unused))int *__params0[1];
+  __attribute__((unused)) request __req1;
+  __attribute__((unused))int *__params1[1];
+  __attribute__((unused)) request __req2;
+  __attribute__((unused))int *__params2[1];
+  __attribute__((unused))setOfRequests __list;
+  __attribute__((unused))pthread_cond_t __myCond;
+  __attribute__((unused))request *__returnRequest;
+  
+  char * __myname = (char *)arg;
+  
+  pthread_cond_init(&__myCond, NULL);
+  
+  fillListOfRequests(&__list, __myname, &__myCond, &__mainMutex);
+  //printf("my name = %s\n", __myname);
+  
+  /* Main loop on states */
+  while(__currentState != STATE__STOP__STATE) {
+    switch(__currentState) {
+      case STATE__START__STATE: 
+      traceStateEntering(__myname, "__StartState");
+      __currentState = STATE__wait4set;
+      break;
+      
+      case STATE__wait4set: 
+      traceStateEntering(__myname, "wait4set");
+      __params0[0] = &value;
+      makeNewRequest(&__req0, 138, RECEIVE_SYNC_REQUEST, 0, 0, 0, 1, __params0);
+      __req0.syncChannel = &__AlarmManager_set__alarmTimer__Timer__alarmTimer__AlarmManager_set;
+      addRequestToList(&__list, &__req0);
+      makeNewRequest(&__req1, 140, RECEIVE_SYNC_REQUEST, 0, 0, 0, 0, __params1);
+      __req1.syncChannel = &__AlarmManager_reset__alarmTimer__Timer__alarmTimer__AlarmManager_reset;
+      addRequestToList(&__list, &__req1);
+      if (nbOfRequests(&__list) == 0) {
+        debug2Msg(__myname, "No possible request");
+        __currentState = STATE__STOP__STATE;
+        break;
+      }
+      __returnRequest = executeListOfRequests(&__list);
+      clearListOfRequests(&__list);
+      traceRequest(__myname, __returnRequest);
+       if (__returnRequest == &__req0) {
+        __currentState = STATE__wait4expire;
+        
+      }
+      else  if (__returnRequest == &__req1) {
+        __currentState = STATE__wait4set;
+        
+      }
+      break;
+      
+      case STATE__wait4expire: 
+      traceStateEntering(__myname, "wait4expire");
+      __params0[0] = &value;
+      makeNewRequest(&__req0, 139, RECEIVE_SYNC_REQUEST, 0, 0, 0, 1, __params0);
+      __req0.syncChannel = &__AlarmManager_set__alarmTimer__Timer__alarmTimer__AlarmManager_set;
+      addRequestToList(&__list, &__req0);
+      makeNewRequest(&__req1, 142, SEND_SYNC_REQUEST, 1, (value)*1000000, (value)*1000000, 0, __params1);
+      __req1.syncChannel = &__AlarmManager_expire__alarmTimer__Timer__alarmTimer__AlarmManager_expire;
+      addRequestToList(&__list, &__req1);
+      makeNewRequest(&__req2, 141, RECEIVE_SYNC_REQUEST, 0, 0, 0, 0, __params2);
+      __req2.syncChannel = &__AlarmManager_reset__alarmTimer__Timer__alarmTimer__AlarmManager_reset;
+      addRequestToList(&__list, &__req2);
+      if (nbOfRequests(&__list) == 0) {
+        debug2Msg(__myname, "No possible request");
+        __currentState = STATE__STOP__STATE;
+        break;
+      }
+      __returnRequest = executeListOfRequests(&__list);
+      clearListOfRequests(&__list);
+      traceRequest(__myname, __returnRequest);
+       if (__returnRequest == &__req0) {
+        __currentState = STATE__wait4expire;
+        
+      }
+      else  if (__returnRequest == &__req1) {
+        __currentState = STATE__wait4set;
+        
+      }
+      else  if (__returnRequest == &__req2) {
+        __currentState = STATE__wait4set;
+        
+      }
+      break;
+      
+    }
+  }
+  //printf("Exiting = %s\n", __myname);
+  return NULL;
+}
+
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/Timer__alarmTimer__AlarmManager.h b/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/Timer__alarmTimer__AlarmManager.h
new file mode 100644
index 0000000000000000000000000000000000000000..d8b635c9eddfc5cdb26fa821a5d2ee27b6d1b92e
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/Timer__alarmTimer__AlarmManager.h
@@ -0,0 +1,20 @@
+#ifndef Timer__alarmTimer__AlarmManager_H
+#define Timer__alarmTimer__AlarmManager_H
+#include <stdio.h>
+#include <pthread.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+#include "request.h"
+#include "syncchannel.h"
+#include "request_manager.h"
+#include "debug.h"
+#include "defs.h"
+#include "mytimelib.h"
+#include "random.h"
+#include "tracemanager.h"
+#include "main.h"
+
+extern void *mainFunc__Timer__alarmTimer__AlarmManager(void *arg);
+
+#endif
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/main.c b/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/main.c
new file mode 100644
index 0000000000000000000000000000000000000000..786339859abaceef11a0e4d61372527eb21b3571
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/main.c
@@ -0,0 +1,191 @@
+#include <stdio.h>
+#include <pthread.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+#include "request.h"
+#include "syncchannel.h"
+#include "request_manager.h"
+#include "debug.h"
+#include "random.h"
+#include "tracemanager.h"
+
+/* User code */
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#include <stdio.h>
+#include <strings.h>
+#include <string.h>
+#include <errno.h>
+
+const char* hostname="localhost";
+const char* portname="8374";
+int fd;
+struct addrinfo* res;
+
+#define MAX_DGRAM_SIZE  549
+
+pthread_t thread__Datagram;
+
+// Handling pressure datagrams
+int pressure = 1;
+
+void pressureDatagram(char *buf) {
+    pressure = atoi(buf);
+  printf("Pressure=%d\n", atoi(buf));
+}
+
+// Assumes fd is valid
+void* receiveDatagram(void *arg) {
+    printf("Thread receive datagram started\n");
+  
+    char buffer[MAX_DGRAM_SIZE];
+    struct sockaddr_storage src_addr;
+    socklen_t src_addr_len=sizeof(src_addr);
+  
+    while(1) {
+        printf("Waiting for datagram packet\n");
+        ssize_t count=recvfrom(fd,buffer,sizeof(buffer),0,(struct sockaddr*)&src_addr,&src_addr_len);
+        if (count==-1) {
+            perror("recv failed");
+        } else if (count==sizeof(buffer)) {
+            perror("datagram too large for buffer: truncated");
+        } else {
+            //printf("Datagram size: %d.\n", (int)(count));
+            if (strncmp(buffer, "PRESSURE=", 9) == 0) {
+                printf("+++++++++++++++++++++++ PRESSURE\n");
+                pressureDatagram(buffer+9);
+            }
+        }
+    }
+}
+
+void sendDatagram(char * data, int size) {
+    printf("data=%s fd=%d size=%d\n", data, fd, size);
+    if (sendto(fd,data,size, 0, res->ai_addr,res->ai_addrlen)==-1) {
+            printf("Error when sending datagram");
+            exit(-1);
+      }
+}
+
+void __user_init() { 
+    const char* content = "salut";
+    struct addrinfo hints;
+  
+    memset(&hints,0,sizeof(hints));
+    hints.ai_family=AF_UNSPEC;
+    hints.ai_socktype=SOCK_DGRAM;
+    hints.ai_protocol=0;
+    hints.ai_flags=AI_ADDRCONFIG;
+   
+    int err=getaddrinfo(hostname,portname,&hints,&res);
+    if (err!=0) {
+        printf("failed to resolve remote socket address (err=%d)",err);
+        exit(-1);
+    }
+    fd=socket(res->ai_family,res->ai_socktype,res->ai_protocol);
+    if (fd==-1) {
+        printf("%s",strerror(errno));
+        exit(-1);
+    }
+    if (sendto(fd,content,sizeof(content),0,
+        res->ai_addr,res->ai_addrlen)==-1) {
+        printf("%s",strerror(errno));
+        exit(-1);
+    }
+  
+  // Start a thread to receive datagrams
+    pthread_create(&thread__Datagram, NULL, receiveDatagram, NULL);
+  
+}
+
+/* End of User code */
+
+/* Main mutex */
+pthread_mutex_t __mainMutex;
+
+/* Synchronous channels */
+syncchannel __AlarmManager_alarmOff__AlarmActuator_alarmOff;
+syncchannel __AlarmManager_alarmOn__AlarmActuator_alarmOn;
+syncchannel __MainController_highPressure__AlarmManager_highPressure;
+syncchannel __PressureSensor_pressureValue__MainController_pressureValue;
+syncchannel __AlarmManager_set__alarmTimer__Timer__alarmTimer__AlarmManager_set;
+syncchannel __AlarmManager_reset__alarmTimer__Timer__alarmTimer__AlarmManager_reset;
+syncchannel __AlarmManager_expire__alarmTimer__Timer__alarmTimer__AlarmManager_expire;
+/* Asynchronous channels */
+
+#include "AlarmActuator.h"
+#include "PressureSensor.h"
+#include "PressureController.h"
+#include "AlarmManager.h"
+#include "MainController.h"
+#include "Timer__alarmTimer__AlarmManager.h"
+
+
+int main(int argc, char *argv[]) {
+  
+  /* disable buffering on stdout */
+  setvbuf(stdout, NULL, _IONBF, 0);
+  
+  /* Synchronous channels */
+  __AlarmManager_alarmOff__AlarmActuator_alarmOff.inname ="alarmOff";
+  __AlarmManager_alarmOff__AlarmActuator_alarmOff.outname ="alarmOff";
+  __AlarmManager_alarmOn__AlarmActuator_alarmOn.inname ="alarmOn";
+  __AlarmManager_alarmOn__AlarmActuator_alarmOn.outname ="alarmOn";
+  __MainController_highPressure__AlarmManager_highPressure.inname ="highPressure";
+  __MainController_highPressure__AlarmManager_highPressure.outname ="highPressure";
+  __PressureSensor_pressureValue__MainController_pressureValue.inname ="pressureValue";
+  __PressureSensor_pressureValue__MainController_pressureValue.outname ="pressureValue";
+  __AlarmManager_set__alarmTimer__Timer__alarmTimer__AlarmManager_set.inname ="set";
+  __AlarmManager_set__alarmTimer__Timer__alarmTimer__AlarmManager_set.outname ="set__alarmTimer";
+  __AlarmManager_reset__alarmTimer__Timer__alarmTimer__AlarmManager_reset.inname ="reset";
+  __AlarmManager_reset__alarmTimer__Timer__alarmTimer__AlarmManager_reset.outname ="reset__alarmTimer";
+  __AlarmManager_expire__alarmTimer__Timer__alarmTimer__AlarmManager_expire.inname ="expire__alarmTimer";
+  __AlarmManager_expire__alarmTimer__Timer__alarmTimer__AlarmManager_expire.outname ="expire";
+  /* Asynchronous channels */
+  
+  /* Threads of tasks */
+  pthread_t thread__AlarmActuator;
+  pthread_t thread__PressureSensor;
+  pthread_t thread__PressureController;
+  pthread_t thread__AlarmManager;
+  pthread_t thread__MainController;
+  pthread_t thread__Timer__alarmTimer__AlarmManager;
+  /* Activating tracing  */
+  if (argc>1){
+    activeTracingInFile(argv[1]);
+  } else {
+    activeTracingInConsole();
+  }
+  /* Activating randomness */
+  initRandom();
+  /* Initializing the main mutex */
+if (pthread_mutex_init(&__mainMutex, NULL) < 0) { exit(-1);}
+  
+  /* Initializing mutex of messages */
+  initMessages();
+  /* User initialization */
+  __user_init();
+  
+  
+  pthread_create(&thread__AlarmActuator, NULL, mainFunc__AlarmActuator, (void *)"AlarmActuator");
+  pthread_create(&thread__PressureSensor, NULL, mainFunc__PressureSensor, (void *)"PressureSensor");
+  pthread_create(&thread__PressureController, NULL, mainFunc__PressureController, (void *)"PressureController");
+  pthread_create(&thread__AlarmManager, NULL, mainFunc__AlarmManager, (void *)"AlarmManager");
+  pthread_create(&thread__MainController, NULL, mainFunc__MainController, (void *)"MainController");
+  pthread_create(&thread__Timer__alarmTimer__AlarmManager, NULL, mainFunc__Timer__alarmTimer__AlarmManager, (void *)"Timer__alarmTimer__AlarmManager");
+  
+  
+  pthread_join(thread__AlarmActuator, NULL);
+  pthread_join(thread__PressureSensor, NULL);
+  pthread_join(thread__PressureController, NULL);
+  pthread_join(thread__AlarmManager, NULL);
+  pthread_join(thread__MainController, NULL);
+  pthread_join(thread__Timer__alarmTimer__AlarmManager, NULL);
+  
+  
+  return 0;
+  
+}
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/main.h b/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/main.h
new file mode 100644
index 0000000000000000000000000000000000000000..acafb80449a1c2c80e6900ebcae364dc472eea8d
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/generated_src/main.h
@@ -0,0 +1,15 @@
+#ifndef MAIN_H
+#define MAIN_H
+/* Main mutex */
+extern pthread_mutex_t __mainMutex;
+
+/* Synchronous channels */
+extern syncchannel __AlarmManager_alarmOff__AlarmActuator_alarmOff;
+extern syncchannel __AlarmManager_alarmOn__AlarmActuator_alarmOn;
+extern syncchannel __MainController_highPressure__AlarmManager_highPressure;
+extern syncchannel __PressureSensor_pressureValue__MainController_pressureValue;
+extern syncchannel __AlarmManager_set__alarmTimer__Timer__alarmTimer__AlarmManager_set;
+extern syncchannel __AlarmManager_reset__alarmTimer__Timer__alarmTimer__AlarmManager_reset;
+extern syncchannel __AlarmManager_expire__alarmTimer__Timer__alarmTimer__AlarmManager_expire;
+/* Asynchronous channels */
+#endif
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/src/asyncchannel.c b/modeling/PressureController.ttool/AVATAR_executablecode/src/asyncchannel.c
new file mode 100644
index 0000000000000000000000000000000000000000..e2ce2ac48a62b888eedc7940c74b1ae1f3953013
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/src/asyncchannel.c
@@ -0,0 +1,56 @@
+#include <stdlib.h>
+
+#include "message.h"
+#include "asyncchannel.h"
+#include "myerrors.h"
+
+
+asyncchannel *getNewAsyncchannel(char *outname, char *inname, int isBlocking, int maxNbOfMessages) {
+  asyncchannel * asyncch = (asyncchannel *)(malloc(sizeof(struct asyncchannel)));
+  if (asyncch == NULL) {
+    criticalError("Allocation of asyncchannel failed");
+  }
+  asyncch->inname = inname;
+  asyncch->outname = outname;
+  asyncch->isBlocking = isBlocking;
+  asyncch->maxNbOfMessages = maxNbOfMessages;
+  
+  return asyncch;
+}
+
+void destroyAsyncchannel(asyncchannel *asyncch) {
+  free(asyncch);
+}
+
+message* getAndRemoveOldestMessageFromAsyncChannel(asyncchannel *channel) {
+  message *msg;
+  message *previous;
+
+  if (channel->currentNbOfMessages == 0) {
+    return NULL;
+  }
+
+  if (channel->currentNbOfMessages == 1) {
+    channel->currentNbOfMessages = 0;
+    msg = channel->pendingMessages;
+    channel->pendingMessages = NULL;
+    return msg;
+  }
+
+  msg = channel->pendingMessages;
+  previous = msg;
+  while(msg->next != NULL) {
+    previous = msg;
+    msg = msg->next;
+  }
+
+  channel->currentNbOfMessages = channel->currentNbOfMessages -1;
+  previous->next = NULL;
+  return msg;
+}
+
+void addMessageToAsyncChannel(asyncchannel *channel, message *msg) {
+  msg->next = channel->pendingMessages;
+  channel->pendingMessages = msg;
+  channel->currentNbOfMessages = channel->currentNbOfMessages+1;
+}
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/src/asyncchannel.h b/modeling/PressureController.ttool/AVATAR_executablecode/src/asyncchannel.h
new file mode 100644
index 0000000000000000000000000000000000000000..8f812359dbd67311f37391807b883890ee163f04
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/src/asyncchannel.h
@@ -0,0 +1,28 @@
+#ifndef ASYNCCHANNEL_H
+#define ASYNCCHANNEL_H
+
+struct asyncchannel;
+
+#include "message.h"
+#include "request.h"
+
+
+struct asyncchannel {
+  char *outname;
+  char *inname;
+  int isBlocking; // In writing. Reading is always blocking
+  int maxNbOfMessages; //
+  struct request* outWaitQueue;
+  struct request* inWaitQueue;
+  message *pendingMessages;
+  int currentNbOfMessages;
+};
+
+typedef struct asyncchannel asyncchannel;
+
+asyncchannel *getNewAsyncchannel(char *inname, char *outname, int isBlocking, int maxNbOfMessages);
+void destroyAsyncchannel(asyncchannel *syncch);
+message* getAndRemoveOldestMessageFromAsyncChannel(asyncchannel *channel);
+void addMessageToAsyncChannel(asyncchannel *channel, message *msg);
+
+#endif
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/src/debug.c b/modeling/PressureController.ttool/AVATAR_executablecode/src/debug.c
new file mode 100644
index 0000000000000000000000000000000000000000..067d0a8c17e3861ce60191884c13041d9e88431b
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/src/debug.c
@@ -0,0 +1,86 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <time.h>
+
+#include "debug.h"
+
+
+#define DEBUG_ON 1
+#define DEBUG_OFF 2
+
+int debug = DEBUG_OFF;
+
+void activeDebug() {
+  debug = DEBUG_ON;
+}
+
+void unactiveDebug() {
+  debug = DEBUG_OFF;
+}
+
+void debugThreeInts(char *msg, int value1, int value2, int value3) {
+  if (debug == DEBUG_OFF) {
+    return;
+  }
+  
+  if (msg != NULL) {
+    printf("DT> %s: %d, %d, %d\n", msg, value1, value2, value3);
+  }
+}
+
+void debugTwoInts(char *msg, int value1, int value2) {
+  if (debug == DEBUG_OFF) {
+    return;
+  }
+  
+  if (msg != NULL) {
+    printf("DT> %s: %d, %d\n", msg, value1, value2);
+  }
+}
+
+void debugInt(char *msg, int value) {
+  if (debug == DEBUG_OFF) {
+    return;
+  }
+  
+  if (msg != NULL) {
+    printf("DT> %s: %d\n", msg, value);
+  }
+}
+
+void debugLong(char *msg, long value) {
+  if (debug == DEBUG_OFF) {
+    return;
+  }
+  
+  if (msg != NULL) {
+    printf("DT> %s: %ld\n", msg, value);
+  }
+}
+
+void debugMsg(char *msg) {
+  if (debug == DEBUG_OFF) {
+    return;
+  }
+
+  if (msg != NULL) {
+    printf("DT> %s\n", msg);
+  }
+}
+
+void debug2Msg(char *name, char *msg) {
+  if (debug == DEBUG_OFF) {
+    return;
+  }
+
+  if ((name != NULL) && (msg != NULL)) {
+    printf("DT - %s -> %s\n", name, msg);
+  }
+}
+
+void debugTime(char *msg, struct timespec *ts) {
+  if (debug == DEBUG_OFF) {
+    return;
+  }
+  printf("DT> (-------t------->) %s sec=%ld nsec=%ld\n", msg, ts->tv_sec, ts->tv_nsec);
+}
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/src/debug.h b/modeling/PressureController.ttool/AVATAR_executablecode/src/debug.h
new file mode 100644
index 0000000000000000000000000000000000000000..7e73f3ce91684420195a07eb365184b0629e74f3
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/src/debug.h
@@ -0,0 +1,19 @@
+
+
+#ifndef DEBUG_H
+#define DEBUG_H
+
+void activeDebug();
+void unactiveDebug();
+
+void debugThreeInts(char *msg, int value1, int value2, int value3);
+void debugTwoInts(char *msg, int value1, int value2);
+void debugLong(char *msg, long value);
+void debugInt(char *msg, int value);
+void debugMsg(char *msg);
+void debug2Msg(char *name, char* msg);
+void debugTime(char* msg, struct timespec *ts);
+
+#endif
+
+
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/src/defs.h b/modeling/PressureController.ttool/AVATAR_executablecode/src/defs.h
new file mode 100644
index 0000000000000000000000000000000000000000..3b997bfdf885b560dc4fde8264e8b5026565de10
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/src/defs.h
@@ -0,0 +1,9 @@
+#ifndef DEFS_H
+#define DEFS_H
+
+#define bool int
+#define true 1
+#define false 0
+
+
+#endif
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/src/message.c b/modeling/PressureController.ttool/AVATAR_executablecode/src/message.c
new file mode 100644
index 0000000000000000000000000000000000000000..1153a882f51d93d8596621162f82278bc01d7158
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/src/message.c
@@ -0,0 +1,59 @@
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <pthread.h>
+
+#include "message.h"
+#include "myerrors.h"
+
+long __id_message = 0;
+pthread_mutex_t __message_mutex;
+
+
+void initMessages() {
+  if (pthread_mutex_init(&__message_mutex, NULL) < 0) { exit(-1);}
+}
+
+long getMessageID() {
+  long tmp;
+  pthread_mutex_lock(&__message_mutex);
+  tmp = __id_message;
+  __id_message ++;
+  pthread_mutex_unlock(&__message_mutex);
+  return tmp;
+}
+
+message *getNewMessageWithParams(int nbOfParams) {
+	
+	message *msg = (message *)(malloc(sizeof(struct message)));
+	if (msg == NULL) {
+		criticalError("Allocation of request failed");
+	}
+	msg->nbOfParams = nbOfParams;
+	msg->params = (int *)(malloc(sizeof(int) * nbOfParams));
+	msg->id = getMessageID();
+	return msg;
+}
+
+message *getNewMessage(int nbOfParams, int *params) {
+
+  message *msg = (message *)(malloc(sizeof(struct message)));
+  if (msg == NULL) {
+    criticalError("Allocation of request failed");
+  }
+  msg->nbOfParams = nbOfParams;
+  msg->params = params;
+  msg->id = getMessageID();
+  return msg;
+}
+
+
+
+void destroyMessageWithParams(message *msg) {
+  free(msg->params);
+  free(msg);
+}
+
+void destroyMessage(message *msg) {
+  free(msg);
+}
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/src/message.h b/modeling/PressureController.ttool/AVATAR_executablecode/src/message.h
new file mode 100644
index 0000000000000000000000000000000000000000..700ed07d97f6ae925ceeb6c172238a2f4bd37680
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/src/message.h
@@ -0,0 +1,22 @@
+#ifndef MESSAGE_H
+#define MESSAGE_H
+
+
+struct message {
+  struct message *next;
+  int nbOfParams;
+  int *params;
+  long id;
+};
+
+typedef struct message message;
+
+void initMessages();
+message *getNewMessageWithParams(int nbOfParams);
+message *getNewMessage(int nbOfParams, int *params);
+void destroyMessageWithParams(message *msg);
+void destroyMessage(message *msg);
+
+
+
+#endif
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/src/myerrors.c b/modeling/PressureController.ttool/AVATAR_executablecode/src/myerrors.c
new file mode 100644
index 0000000000000000000000000000000000000000..dfe16a1c469f6e11382dfae037b3d4ff89cf8c7b
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/src/myerrors.c
@@ -0,0 +1,24 @@
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "myerrors.h"
+
+
+
+
+void criticalErrorInt(char *msg, int value) {
+  if (msg != NULL) {
+    printf("\nCritical error: %s, %d\n", msg, value);
+  }
+
+  exit(-1);
+}
+
+
+void criticalError(char *msg) {
+  if (msg != NULL) {
+    printf("\nCritical error: %s\n", msg);
+  }
+
+  exit(-1);
+}
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/src/myerrors.h b/modeling/PressureController.ttool/AVATAR_executablecode/src/myerrors.h
new file mode 100644
index 0000000000000000000000000000000000000000..8300da3ccfd1b5f2efd2f3514a8f543409363003
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/src/myerrors.h
@@ -0,0 +1,11 @@
+
+
+#ifndef MY_ERRORS_H
+#define MY_ERRORS_H
+
+void criticalErrorInt(char *msg, int value);
+void criticalError(char *msg);
+
+#endif
+
+
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/src/mytimelib.c b/modeling/PressureController.ttool/AVATAR_executablecode/src/mytimelib.c
new file mode 100644
index 0000000000000000000000000000000000000000..d39c07ea85c258ce227365364163ce1761038663
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/src/mytimelib.c
@@ -0,0 +1,108 @@
+#include<time.h>
+
+#include "mytimelib.h"
+#include "random.h"
+#include "debug.h"
+
+#ifndef CLOCK_REALTIME
+#define CLOCK_REALTIME
+
+int clock_gettime(struct timespec *ts) {
+  struct timeval tv;
+  gettimeofday(&tv, NULL);
+  ts->tv_sec = tv.tv_sec;
+  ts->tv_nsec = tv.tv_usec * 1000;
+  return 0;
+}
+
+int my_clock_gettime(struct timespec *tp) {
+  return clock_gettime(tp);
+}
+
+#else
+
+int my_clock_gettime(struct timespec *tp) {
+  return clock_gettime(CLOCK_REALTIME, tp);
+}
+
+#endif
+
+
+
+void addTime(struct timespec *src1, struct timespec *src2, struct timespec *dest) {
+  dest->tv_nsec = src1->tv_nsec + src2->tv_nsec;
+  dest->tv_sec = src1->tv_sec + src2->tv_sec;
+  if (dest->tv_nsec > 1000000000) {
+    dest->tv_sec = dest->tv_sec + (dest->tv_nsec / 1000000000);
+    dest->tv_nsec = dest->tv_nsec % 1000000000;
+  }
+}
+
+void diffTime(struct timespec *src1, struct timespec *src2, struct timespec *dest) {
+  int diff = 0;
+  if (src1->tv_nsec > src2->tv_nsec) {
+    diff ++;
+    dest->tv_nsec = src2->tv_nsec - src1->tv_nsec + 1000000000;
+  } else {
+    dest->tv_nsec = src2->tv_nsec - src1->tv_nsec;
+  }
+
+  dest->tv_sec = src2->tv_sec - src1->tv_sec - diff;
+}
+
+
+
+int isBefore(struct timespec *src1, struct timespec *src2) {
+  if (src1->tv_sec > src2->tv_sec) {
+    return 0;
+  }
+
+  if (src1->tv_sec < src2->tv_sec) {
+    return 1;
+  }
+
+  if (src1->tv_nsec < src2->tv_nsec) {
+    return 1;
+  }
+  return 0;
+}
+
+void minTime(struct timespec *src1, struct timespec *src2, struct timespec *dest) {
+  debugMsg("MIN TIME COMPUTATION");
+  if (isBefore(src1,src2)) {
+    dest->tv_nsec = src1->tv_nsec;
+    dest->tv_sec = src1->tv_sec;
+  } else {
+    dest->tv_nsec = src2->tv_nsec;
+    dest->tv_sec = src2->tv_sec;
+  }
+  
+}
+
+
+void delayToTimeSpec(struct timespec *ts, long delay) {
+  ts->tv_nsec = (delay % 1000000)*1000;
+  ts->tv_sec = (delay / 1000000);
+}
+
+void waitFor(long minDelay, long maxDelay) {
+  struct timespec tssrc;
+  struct timespec tsret;
+  int delay;
+
+
+  
+  debugMsg("Computing random delay");
+  //debugLong("Min delay", minDelay);
+  //debugLong("Max delay", maxDelay);
+  delay = computeLongRandom(minDelay, maxDelay);
+
+  debugLong("Random delay=", delay);
+
+  delayToTimeSpec(&tssrc, delay);
+
+  debugLong("............. waiting For", delay);
+  nanosleep(&tssrc, &tsret);
+  debugLong("............. waiting Done for: ", delay);
+}
+
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/src/mytimelib.h b/modeling/PressureController.ttool/AVATAR_executablecode/src/mytimelib.h
new file mode 100644
index 0000000000000000000000000000000000000000..76ed5d22fcd7cf9a2750cf2a9726f5cdb89e48f2
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/src/mytimelib.h
@@ -0,0 +1,19 @@
+#ifndef MYTIMELIB_H
+#define MYTIMELIB_H
+
+#include <time.h>
+#include <sys/time.h>
+
+
+
+// in usec
+
+int my_clock_gettime(struct timespec *tp);
+void addTime(struct timespec *src1, struct timespec *src2, struct timespec *dest);
+void diffTime(struct timespec *src1, struct timespec *src2, struct timespec *dest);
+int isBefore(struct timespec *src1, struct timespec *src2);
+void minTime(struct timespec *src1, struct timespec *src2, struct timespec *dest);
+void delayToTimeSpec(struct timespec *ts, long delay);
+extern void waitFor(long minDelay, long maxDelay);
+
+#endif
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/src/random.c b/modeling/PressureController.ttool/AVATAR_executablecode/src/random.c
new file mode 100644
index 0000000000000000000000000000000000000000..b4bbddb19ac1e4a51bf5c0205aab571a7580dd32
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/src/random.c
@@ -0,0 +1,43 @@
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <time.h>
+#include <limits.h>
+
+#include "random.h"
+#include "debug.h"
+#include <math.h>
+
+#include "mytimelib.h"
+
+int computeRandom(int min, int max) {
+  if (min == max) {
+    return min;
+  }
+  return (rand() % (max - min)) + min;
+}
+
+long computeLongRandom(long min, long max) {
+
+  if (min == max) {
+    return min;
+  }
+
+
+  long rand0 = (long)rand();
+  long rand1 = rand0 % (max - min);
+  //debugLong("min=", min);
+  //debugLong("max=", max);
+  //debugLong("rand0", rand0);
+ //debugLong("rand1", rand1);
+ //debugLong("Random long", rand1 + min);
+  return rand1 + min;
+}
+
+void initRandom() {
+  struct timespec ts;
+
+  my_clock_gettime(&ts);
+
+  srand((int)(ts.tv_nsec));
+}
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/src/random.h b/modeling/PressureController.ttool/AVATAR_executablecode/src/random.h
new file mode 100644
index 0000000000000000000000000000000000000000..ecff7cb43cb9d3c38fd390243ad0cbd186fead97
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/src/random.h
@@ -0,0 +1,7 @@
+#ifndef RANDOM_H
+#define RANDOM_H
+
+extern void initRandom();
+extern int computeRandom(int min, int max);
+extern long computeLongRandom(long min, long max);
+#endif
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/src/request.c b/modeling/PressureController.ttool/AVATAR_executablecode/src/request.c
new file mode 100644
index 0000000000000000000000000000000000000000..af1231c61b71a7aab28063dfcf5eefc9faabf6b5
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/src/request.c
@@ -0,0 +1,271 @@
+
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "request.h"
+#include "mytimelib.h"
+#include "myerrors.h"
+#include "random.h"
+#include "debug.h"
+
+
+request *getNewRequest(int ID, int type, int hasDelay, long minDelay, long maxDelay, int nbOfParams, int **params) {
+  request *req = (request *)(malloc(sizeof(struct request)));
+  
+  if (req == NULL) {
+    criticalError("Allocation of request failed");
+  }
+
+  makeNewRequest(req,  ID, type, hasDelay, minDelay, maxDelay, nbOfParams, params);  
+  return req;
+}
+
+
+// Delays are in microseconds
+void makeNewRequest(request *req, int ID, int type, int hasDelay, long minDelay, long maxDelay, int nbOfParams, int **params) {
+  long delay;
+  int i;
+
+  req->next = NULL;
+  req->listOfRequests = NULL;
+  req->nextRequestInList = NULL;
+
+  req->type = type;
+  req->ID = ID;
+  req->hasDelay = hasDelay;
+
+  if (req->hasDelay > 0) {
+    delay = computeLongRandom(minDelay, maxDelay);
+    delayToTimeSpec(&(req->delay), delay);
+  }
+
+  req->selected = 0;
+  req->nbOfParams = nbOfParams;
+  req->params = params;
+
+  req->alreadyPending = 0;
+  req->delayElapsed = 0;
+
+  req->relatedRequest = NULL;
+
+  if (type == SEND_ASYNC_REQUEST) {
+    // Must create a new message
+    req->msg = getNewMessageWithParams(nbOfParams);
+    for(i=0; i<nbOfParams; i++) {
+      req->msg->params[i] = *(params[i]);
+    }
+  }
+
+}
+
+
+
+
+void destroyRequest(request *req) {
+  free((void *)req);
+}
+
+int isRequestSelected(request *req) {
+  return req->selected;
+}
+
+int nbOfRequests(setOfRequests *list) {
+  int cpt = 0;
+  request *req;
+
+  req = list->head;
+
+  while(req != NULL) {
+    cpt ++;
+    req = req->nextRequestInList;
+  }
+
+  return cpt;
+}
+
+request *getRequestAtIndex(setOfRequests *list, int index) {
+  int cpt = 0;
+  request * req = list->head;
+
+  while(cpt < index) {
+    req = req->nextRequestInList;
+    cpt ++;
+  }
+
+  return req;
+  
+}
+
+
+request * addToRequestQueue(request *list, request *requestToAdd) {
+  request *origin = list;
+
+  if (list == NULL) {
+    return requestToAdd;
+  }
+
+  while(list->next != NULL) {
+    list = list->next;
+  }
+  
+  list->next = requestToAdd;
+
+  requestToAdd->next = NULL;
+
+  return origin;
+}
+
+request * removeRequestFromList(request *list, request *requestToRemove) {
+  request *origin = list;
+
+  if (list == requestToRemove) {
+    return list->next;
+  }
+
+
+  while(list->next != requestToRemove) {
+    list = list->next;
+  }
+
+  list->next = requestToRemove->next;
+
+  return origin;
+} 
+
+
+void copyParameters(request *src, request *dst) {
+  int i;
+  for(i=0; i<dst->nbOfParams; i++) {
+    *(dst->params[i]) = *(src->params[i]);
+  }
+}
+
+
+void clearListOfRequests(setOfRequests *list) {
+  list->head = NULL;
+}
+
+setOfRequests *newListOfRequests(pthread_cond_t *wakeupCondition, pthread_mutex_t *mutex) {
+  setOfRequests *list = (setOfRequests *)(malloc(sizeof(setOfRequests)));
+  list->head = NULL;
+  list->wakeupCondition = wakeupCondition;
+  list->mutex = mutex;
+
+  return list;
+}
+
+void fillListOfRequests(setOfRequests *list, char *name, pthread_cond_t *wakeupCondition, pthread_mutex_t *mutex) {
+  list->head = NULL;
+  list->owner = name;
+  list->wakeupCondition = wakeupCondition;
+  list->mutex = mutex;
+}
+
+
+void addRequestToList(setOfRequests *list, request* req) {
+  request *tmpreq;
+
+  if (list == NULL) {
+    criticalError("NULL List in addRequestToList");
+  }
+
+  if (req == NULL) {
+    criticalError("NULL req in addRequestToList");
+  }
+
+  req->listOfRequests = list;
+
+  if (list->head == NULL) {
+    list->head = req;
+    req->nextRequestInList = NULL;
+    return;
+  }
+
+  tmpreq = list->head;
+  while(tmpreq->nextRequestInList != NULL) {
+    tmpreq = tmpreq->nextRequestInList;
+  }
+
+  tmpreq->nextRequestInList = req;
+  req->nextRequestInList = NULL;
+}
+
+void removeAllPendingRequestsFromPendingLists(request *req, int apartThisOne) {
+  setOfRequests *list = req->listOfRequests;
+  request *reqtmp;
+
+  if (list == NULL) {
+    return;
+  }
+
+  reqtmp = list->head;
+
+  while(reqtmp != NULL) {
+    debugInt("Considering request of type", reqtmp->type);
+      if (reqtmp->alreadyPending) {
+	if (reqtmp->type ==  RECEIVE_SYNC_REQUEST) {
+	  debugMsg("Removing send sync request from inWaitQueue");
+	  reqtmp->syncChannel->inWaitQueue = removeRequestFromList(reqtmp->syncChannel->inWaitQueue, reqtmp);
+	  debugMsg("done");
+	}
+
+	if (reqtmp->type ==  SEND_SYNC_REQUEST) {
+	  debugMsg("Removing receive sync request from outWaitQueue");
+	  reqtmp->syncChannel->outWaitQueue = removeRequestFromList(reqtmp->syncChannel->outWaitQueue, reqtmp);
+	  debugMsg("done");
+	}
+
+	if (reqtmp->type ==  RECEIVE_BROADCAST_REQUEST) {
+	  debugMsg("Removing broadcast receive request from inWaitQueue");
+	  reqtmp->syncChannel->inWaitQueue = removeRequestFromList(reqtmp->syncChannel->inWaitQueue, reqtmp);
+	  debugMsg("done");
+	}
+      }
+    reqtmp = reqtmp->nextRequestInList;
+  }
+}
+
+
+// Identical means belonging to the same ListOfRequest
+// Returns the identical request if found, otherwise, null
+request *hasIdenticalRequestInListOfSelectedRequests(request *req, request *list) {
+ 
+  while(list != NULL) {
+    if (list->listOfRequests == req->listOfRequests) {
+      return list;
+    }
+    list = list->relatedRequest;
+  }
+
+  return NULL;
+}
+
+request* replaceInListOfSelectedRequests(request *oldRequest, request *newRequest, request *list) {
+  request *head = list;
+
+  if (list == oldRequest) {
+    newRequest->relatedRequest = oldRequest->relatedRequest;
+    return newRequest;
+  }
+
+  //list=list->relatedRequest;
+  while(list->relatedRequest != oldRequest) {
+    list = list->relatedRequest;
+  }
+
+  list->relatedRequest = newRequest;
+  newRequest->relatedRequest = oldRequest->relatedRequest;
+
+  return head;
+}
+
+
+int nbOfRelatedRequests(request *list) {
+  int cpt = 0;
+  while(list->relatedRequest != NULL) {
+    cpt ++;
+    list = list->relatedRequest;
+  }
+
+  return cpt;
+}
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/src/request.h b/modeling/PressureController.ttool/AVATAR_executablecode/src/request.h
new file mode 100644
index 0000000000000000000000000000000000000000..00b93c8e5a007e2eecf6bde40417cdfb9457edc2
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/src/request.h
@@ -0,0 +1,89 @@
+#ifndef REQUEST_H
+#define REQUEST_H
+
+#include <time.h>
+#include <pthread.h>
+
+struct request;
+
+#include "syncchannel.h"
+#include "asyncchannel.h"
+#include "message.h"
+
+#define SEND_SYNC_REQUEST 0
+#define RECEIVE_SYNC_REQUEST 2
+#define SEND_ASYNC_REQUEST 4
+#define RECEIVE_ASYNC_REQUEST 6
+#define DELAY 8
+#define IMMEDIATE 10
+#define SEND_BROADCAST_REQUEST 12
+#define RECEIVE_BROADCAST_REQUEST 14
+
+typedef struct timespec timespec;
+
+struct setOfRequests {
+  char* owner;
+  struct request *head;
+  timespec startTime;
+  timespec completionTime;
+  pthread_cond_t *wakeupCondition;
+  pthread_mutex_t *mutex;
+
+  int hasATimeRequest; // Means that at least on request of the list hasn't completed yet its time delay
+  timespec minTimeToWait;
+  struct request *selectedRequest;
+};
+
+typedef struct setOfRequests setOfRequests;
+
+struct request {
+  struct request *next;
+  struct setOfRequests* listOfRequests;
+  struct request* nextRequestInList;
+  struct request* relatedRequest; // For synchro and broadcast
+  struct syncchannel *syncChannel;
+  struct asyncchannel *asyncChannel;
+  
+  int type;
+  int ID;
+  int hasDelay;;
+  timespec delay;
+  int nbOfParams; // synchronous com.
+  int **params;  // synchronous com.
+  message *msg; // Asynchronous comm.
+
+
+  // Filled by the request manager
+  int executable;
+  int selected;
+  int alreadyPending; // Whether it has been taken into account for execution or not
+  int delayElapsed;
+  timespec myStartTime; // Time at which the delay has expired
+};
+
+typedef struct request request;
+
+void makeNewRequest(request *req, int ID, int type, int hasDelay, long minDelay, long maxDelay, int nbOfParams, int **params);
+request *getNewRequest(int ID, int type, int hasDelay, long minDelay, long maxDelay, int nbOfParams, int **params);
+void destroyRequest(request *req);
+extern int isRequestSelected(request *req);
+
+int nbOfRequests(setOfRequests *list);
+request *getRequestAtIndex(setOfRequests *list, int index);
+
+request * addToRequestQueue(request *list, request *requestToAdd);
+request * removeRequestFromList(request *list, request *requestToRemove);
+
+void copyParameters(request *src, request *dst);
+
+setOfRequests *newListOfRequests(pthread_cond_t *wakeupCondition, pthread_mutex_t *mutex);
+void addRequestToList(setOfRequests *list, request* req);
+void clearListOfRequests(setOfRequests *list);
+void fillListOfRequests(setOfRequests *list, char *name, pthread_cond_t *wakeupCondition, pthread_mutex_t *mutex);
+
+void removeAllPendingRequestsFromPendingLists(request *req, int apartThisOne);
+request *hasIdenticalRequestInListOfSelectedRequests(request *req, request *list);
+request* replaceInListOfSelectedRequests(request *oldRequest, request *newRequest, request *list);
+int nbOfRelatedRequests(request *list);
+
+#endif
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/src/request_manager.c b/modeling/PressureController.ttool/AVATAR_executablecode/src/request_manager.c
new file mode 100644
index 0000000000000000000000000000000000000000..e1c39ba777944c41c018918f4fa7594eaf3f96b5
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/src/request_manager.c
@@ -0,0 +1,570 @@
+#include <stdlib.h>
+#include <pthread.h>
+#include <time.h>
+
+#include "request_manager.h"
+#include "request.h"
+#include "myerrors.h"
+#include "debug.h"
+#include "mytimelib.h"
+#include "random.h"
+#include "asyncchannel.h"
+#include "tracemanager.h"
+
+
+
+void executeSendSyncTransaction(request *req) {
+  int cpt;
+  request *selectedReq;
+
+  // At least one transaction available -> must select one randomly
+  // First: count how many of them are available
+  // Then, select one
+  // Broadcast the new condition!
+
+  cpt = 0;
+  request* currentReq = req->syncChannel->inWaitQueue;
+  debugMsg("Execute send sync tr");
+
+  while(currentReq != NULL) {
+    cpt ++;
+    currentReq = currentReq->next;
+  }
+
+  cpt = random() % cpt;
+
+  // Head of the list?
+  selectedReq = req->syncChannel->inWaitQueue;
+  while (cpt > 0) {
+    selectedReq = selectedReq->next;
+    cpt --;
+  } 
+
+  // Remove all related request from list requests
+  //req->syncChannel->inWaitQueue = removeRequestFromList(req->syncChannel->inWaitQueue, selectedReq);
+  debugMsg("Setting related request");
+  req->relatedRequest = selectedReq;
+
+  // Select the selected request, and notify the information
+  selectedReq->selected = 1;
+  selectedReq->listOfRequests->selectedRequest = selectedReq;
+
+  // Handle parameters
+  copyParameters(req, selectedReq);
+
+  debugMsg("Signaling");
+  pthread_cond_signal(selectedReq->listOfRequests->wakeupCondition);
+
+  traceSynchroRequest(req, selectedReq);
+}
+
+void executeReceiveSyncTransaction(request *req) {
+  int cpt;
+  request *selectedReq;
+  
+  // At least one transaction available -> must select one randomly
+  // First: count how many of them are available
+  // Then, select one
+  // Broadcast the new condition!
+
+  request* currentReq = req->syncChannel->outWaitQueue;
+  cpt = 0;
+  debugMsg("Execute receive sync tr");
+
+  while(currentReq != NULL) {
+    cpt ++;
+    //debugInt("cpt", cpt);
+    currentReq = currentReq->next;
+  }
+  cpt = random() % cpt;
+  selectedReq = req->syncChannel->outWaitQueue;
+  while (cpt > 0) {
+    selectedReq = selectedReq->next;
+    cpt --;
+  } 
+
+  //req->syncChannel->outWaitQueue = removeRequestFromList(req->syncChannel->outWaitQueue, selectedReq);
+  debugMsg("Setting related request");
+  req->relatedRequest = selectedReq;
+
+  // Select the request, and notify the information in the channel
+  selectedReq->selected = 1;
+  selectedReq->listOfRequests->selectedRequest = selectedReq;
+
+  // Handle parameters
+  copyParameters(selectedReq, req);
+
+  debugMsg("Signaling");
+  pthread_cond_signal(selectedReq->listOfRequests->wakeupCondition);
+
+  traceSynchroRequest(selectedReq, req);
+}
+
+
+void executeSendAsyncTransaction(request *req) {
+  request *selectedReq;
+
+  // Full FIFO?
+  if (req->asyncChannel->currentNbOfMessages == req->asyncChannel->maxNbOfMessages) {
+    // Must remove the oldest  message
+    getAndRemoveOldestMessageFromAsyncChannel(req->asyncChannel);
+  }
+
+  addMessageToAsyncChannel(req->asyncChannel, req->msg);
+  
+  debugMsg("Signaling async write to all requests waiting ");
+  selectedReq = req->asyncChannel->inWaitQueue;
+  while (selectedReq != NULL) {
+    pthread_cond_signal(selectedReq->listOfRequests->wakeupCondition);
+    selectedReq = selectedReq->next;
+  }
+  debugMsg("Signaling done");
+
+  traceAsynchronousSendRequest(req);
+}
+
+void executeReceiveAsyncTransaction(request *req) {
+  int i;
+  request *selectedReq;
+
+  req->msg = getAndRemoveOldestMessageFromAsyncChannel(req->asyncChannel);
+    
+  selectedReq = req->asyncChannel->outWaitQueue;
+
+  // Must recopy parameters
+  for(i=0; i<req->nbOfParams; i++) {
+    *(req->params[i]) = req->msg->params[i];
+  }
+
+  traceAsynchronousReceiveRequest(req);
+
+  // unallocate message
+  destroyMessageWithParams(req->msg);
+
+  debugMsg("Signaling async read to all requests waiting ");
+  while (selectedReq != NULL) {
+    pthread_cond_signal(selectedReq->listOfRequests->wakeupCondition);
+    selectedReq = selectedReq->next;
+  }
+  debugMsg("Signaling done");
+}
+
+
+void executeSendBroadcastTransaction(request *req) {
+  int cpt;
+  request *tmpreq;
+
+  // At least one transaction available -> must select all of them
+  // but at most one per task
+  // Then, broadcast the new condition!
+
+  request* currentReq = req->syncChannel->inWaitQueue;
+  request* currentLastReq = req;
+  debugMsg("Execute broadcast sync tr");
+
+  
+  while(currentReq != NULL) {
+    tmpreq = hasIdenticalRequestInListOfSelectedRequests(currentReq, req->relatedRequest);
+    if (tmpreq != NULL) {
+      // Must select one of the two
+      // If =1, replace, otherwise, just do nothing
+      cpt = random() % 2;
+      if (cpt == 1) {
+	debugMsg("Replacing broadcast request");
+	req->relatedRequest = replaceInListOfSelectedRequests(tmpreq, currentReq, req->relatedRequest);
+	currentReq->listOfRequests->selectedRequest = currentReq;
+	copyParameters(req, currentReq);
+	currentReq->selected = 1;
+	currentLastReq = req;
+	while(currentLastReq->relatedRequest != NULL) {
+	  currentLastReq = currentLastReq->relatedRequest;
+	}
+      }
+    } else {
+      currentLastReq->relatedRequest = currentReq;
+      currentReq->relatedRequest = NULL;
+      currentReq->selected = 1;
+      currentReq->listOfRequests->selectedRequest = currentReq;
+      copyParameters(req, currentReq);
+      currentLastReq = currentReq;
+    }
+
+    currentReq = currentReq->next;
+    
+    debugInt("Nb of requests selected:", nbOfRelatedRequests(req));
+  }
+
+
+  debugMsg("Signaling");
+  currentReq = req->relatedRequest;
+  cpt = 0;
+  while(currentReq != NULL) {
+    cpt ++;
+    pthread_cond_signal(currentReq->listOfRequests->wakeupCondition);
+    traceSynchroRequest(req, currentReq);
+    currentReq = currentReq->relatedRequest;
+  }
+
+  debugInt("NUMBER of broadcast Requests", cpt);
+}
+
+
+int executable(setOfRequests *list, int nb) {
+  int cpt = 0;
+  //int index = 0;
+  request *req = list->head;
+  timespec ts;
+  int tsDone = 0;
+
+  debugMsg("Starting loop");
+
+  list->hasATimeRequest = 0;
+
+  while(req != NULL) {
+    if (!(req->delayElapsed)) {
+      if (req->hasDelay) {
+	// Is the delay elapsed???
+	debugTime("begin time of list of request", &list->startTime);
+	debugTime("start time of this request", &req->myStartTime);
+	if (tsDone == 0) {
+	  my_clock_gettime(&ts);
+	  debugTime("Current time", &ts);
+	  tsDone = 1;
+	}
+
+	if (isBefore(&ts, &(req->myStartTime)) == 1) {
+	  // Delay not elapsed
+	  debugMsg("---------t--------> delay NOT elapsed");
+	  if (list->hasATimeRequest == 0) {
+	    list->hasATimeRequest = 1;
+	    list->minTimeToWait.tv_nsec = req->myStartTime.tv_nsec;
+	    list->minTimeToWait.tv_sec = req->myStartTime.tv_sec;
+	  } else {
+	    minTime(&(req->myStartTime), &(list->minTimeToWait),&(list->minTimeToWait));
+	  }
+	}  else {
+	  // Delay elapsed
+	  debugMsg("---------t--------> delay elapsed");
+	  req->delayElapsed = 1;
+	}
+      } else {
+	req->delayElapsed = 1;
+      }
+    }
+    req = req->nextRequestInList;
+  }
+  
+  req = list->head;
+  while((req != NULL) && (cpt < nb)) {
+    req->executable = 0;
+    if (req->delayElapsed) {
+      if (req->type == SEND_SYNC_REQUEST) {
+	debugMsg("Send sync");
+
+	if (req->syncChannel->inWaitQueue != NULL) {
+	  debugMsg("Send sync executable");
+	  req->executable = 1;
+	  cpt ++;
+	}  else {
+	  debugMsg("Send sync not executable");
+	}
+	//index ++;
+      }
+
+      if (req->type == RECEIVE_SYNC_REQUEST) {
+	debugMsg("receive sync");
+	if (req->syncChannel->outWaitQueue != NULL) {
+	  req->executable = 1;
+	  cpt ++;
+	}
+	//index ++;
+      }
+
+      if (req->type == SEND_ASYNC_REQUEST) {
+	debugMsg("Send async");
+
+	if (!(req->asyncChannel->isBlocking)) {
+	  // Can always add a message -> executable
+	  debugMsg("Send async executable since non blocking");
+	  req->executable = 1;
+	  cpt ++;
+
+	  //blocking case ... channel full?
+	} else {
+	  if (req->asyncChannel->currentNbOfMessages < req->asyncChannel->maxNbOfMessages) {
+	    // Not full!
+	    debugMsg("Send async executable since channel not full");
+	    req->executable = 1;
+	    cpt ++;
+	  } else {
+	    debugMsg("Send async not executable: full, and channel is blocking");
+	  }
+	}
+      }
+
+      if (req->type == RECEIVE_ASYNC_REQUEST) {
+	debugMsg("receive async");
+	if (req->asyncChannel->currentNbOfMessages >0) {
+	  debugMsg("Receive async executable: not empty");
+	  req->executable = 1;
+	  cpt ++;
+	} else {
+	  debugMsg("Receive async not executable: empty");
+	}
+	//index ++;
+      }
+      
+
+      if (req->type == SEND_BROADCAST_REQUEST) {
+	debugMsg("send broadcast");
+	req->executable = 1;
+	cpt ++;
+      }
+
+      if (req->type == RECEIVE_BROADCAST_REQUEST) {
+	debugMsg("receive broadcast");
+	// A receive broadcast is never executable
+	req->executable = 0;
+	//index ++;
+      }
+
+      
+      
+
+      if (req->type == IMMEDIATE) {
+	debugMsg("immediate");
+	req->executable = 1;
+	cpt ++;
+      }
+    }
+
+    req = req->nextRequestInList;
+    
+  }
+
+  return cpt;
+}
+
+void private__makeRequestPending(setOfRequests *list) {
+  request *req = list->head;
+  while(req != NULL) {
+    if ((req->delayElapsed) && (!(req->alreadyPending))) {
+      if (req->type == SEND_SYNC_REQUEST) {
+	debugMsg("Adding pending request in outWaitqueue");
+	req->syncChannel->outWaitQueue = addToRequestQueue(req->syncChannel->outWaitQueue, req);
+	req->alreadyPending = 1;
+      }
+
+      if (req->type ==  RECEIVE_SYNC_REQUEST) {
+	debugMsg("Adding pending request in inWaitqueue");
+	req->alreadyPending = 1;
+	req->syncChannel->inWaitQueue = addToRequestQueue(req->syncChannel->inWaitQueue, req);
+      }
+
+      if (req->type == SEND_ASYNC_REQUEST) {
+	debugMsg("Adding pending request in outWaitqueue");
+	req->asyncChannel->outWaitQueue = addToRequestQueue(req->asyncChannel->outWaitQueue, req);
+	req->alreadyPending = 1;
+      }
+
+      if (req->type ==  RECEIVE_ASYNC_REQUEST) {
+	debugMsg("Adding pending request in inWaitqueue");
+	req->alreadyPending = 1;
+	req->asyncChannel->inWaitQueue = addToRequestQueue(req->asyncChannel->inWaitQueue, req);
+      }
+
+      if (req->type ==  RECEIVE_BROADCAST_REQUEST) {
+	debugMsg("Adding pending broadcast request in inWaitqueue");
+	req->alreadyPending = 1;
+	req->syncChannel->inWaitQueue = addToRequestQueue(req->syncChannel->inWaitQueue, req);
+      }
+
+      if (req->type ==  SEND_BROADCAST_REQUEST) {
+	debugMsg("Adding pending broadcast request in outWaitqueue");
+	req->alreadyPending = 1;
+	req->syncChannel->outWaitQueue = addToRequestQueue(req->syncChannel->outWaitQueue, req);
+      }
+      
+    }
+
+    req = req->nextRequestInList;
+  }
+}
+
+void private__makeRequest(request *req) {
+  if (req->type == SEND_SYNC_REQUEST) {
+    executeSendSyncTransaction(req);
+  }
+
+  if (req->type == RECEIVE_SYNC_REQUEST) {
+    executeReceiveSyncTransaction(req);
+  }
+
+  if (req->type == SEND_ASYNC_REQUEST) {
+    executeSendAsyncTransaction(req);
+  }
+
+  if (req->type == RECEIVE_ASYNC_REQUEST) {
+    executeReceiveAsyncTransaction(req);
+  }
+
+  if (req->type == SEND_BROADCAST_REQUEST) {
+    executeSendBroadcastTransaction(req);
+  }
+
+  // IMMEDIATE: Nothing to do
+  
+  // In all cases: remove other requests of the same list from their pending form
+  debugMsg("Removing original req");
+  removeAllPendingRequestsFromPendingLists(req, 1);
+  removeAllPendingRequestsFromPendingListsRelatedRequests(req);
+  /*if (req->relatedRequest != NULL) {
+    debugMsg("Removing related req");
+    removeAllPendingRequestsFromPendingLists(req->relatedRequest, 0);
+    }*/
+  
+}
+
+void removeAllPendingRequestsFromPendingListsRelatedRequests(request *req) {
+  if (req->relatedRequest != NULL) {
+    debugMsg("Removing related req");
+    removeAllPendingRequestsFromPendingLists(req->relatedRequest, 0);
+    // Recursive call
+    removeAllPendingRequestsFromPendingListsRelatedRequests(req->relatedRequest);
+  }
+}
+
+
+request *private__executeRequests0(setOfRequests *list, int nb) {
+  int howMany, found;
+  int selectedIndex, realIndex;
+  request *selectedReq;
+  request *req;
+  
+  // Compute which requests can be executed
+  debugMsg("Counting requests");
+  howMany = executable(list, nb);
+
+  debugInt("Counting requests=", howMany);
+
+  if (howMany == 0) {
+    debugMsg("No pending requests");
+    // Must make them pending
+    
+    private__makeRequestPending(list);
+
+    return NULL;
+  }
+  
+  debugInt("At least one pending request is executable", howMany);
+
+  
+  // Select a request
+  req = list->head;
+  selectedIndex = (rand() % howMany)+1;
+  debugInt("selectedIndex=", selectedIndex);
+  realIndex = 0;
+  found = 0;
+  while(req != NULL) {
+    if (req->executable == 1) {
+      found ++;
+      if (found == selectedIndex) {
+	break;
+      }
+    }
+    realIndex ++;
+    req = req->nextRequestInList;
+  }
+
+  debugInt("Getting request at index", realIndex);
+  selectedReq = getRequestAtIndex(list, realIndex);
+  selectedReq->selected = 1;
+  selectedReq->listOfRequests->selectedRequest = selectedReq;
+
+  debugInt("Selected request of type", selectedReq->type);
+
+  // Execute that request
+  private__makeRequest(selectedReq);
+
+  return selectedReq;  
+}
+
+
+request *private__executeRequests(setOfRequests *list) {
+  // Is a request already selected?
+
+  if (list->selectedRequest != NULL) {
+    return list->selectedRequest;
+  }
+
+  debugMsg("No request selected -> looking for one!");
+
+  return private__executeRequests0(list, nbOfRequests(list));
+}
+
+
+
+
+request *executeOneRequest(setOfRequests *list, request *req) {
+  req->nextRequestInList = NULL;
+  req->listOfRequests = list;
+  list->head = req;
+  return executeListOfRequests(list);
+}
+
+
+void setLocalStartTime(setOfRequests *list) {
+  request *req = list->head;
+
+  while(req != NULL) {
+    if (req->hasDelay) {
+      req->delayElapsed = 0;
+      addTime(&(list->startTime), &(req->delay), &(req->myStartTime));
+      debug2Msg(list->owner, " -----t------>: Request with delay");
+    } else {
+      req->delayElapsed = 1;
+      req->myStartTime.tv_nsec = list->startTime.tv_nsec;
+      req->myStartTime.tv_sec = list->startTime.tv_sec;
+    }
+    req = req->nextRequestInList;
+  }
+}
+
+
+// Return the executed request
+request *executeListOfRequests(setOfRequests *list) {
+  request *req;
+
+  my_clock_gettime(&list->startTime);
+  list->selectedRequest = NULL;
+  setLocalStartTime(list);
+  
+  // Try to find a request that could be executed
+  debug2Msg(list->owner, "Locking mutex");
+  pthread_mutex_lock(list->mutex);
+  debug2Msg(list->owner, "Mutex locked");
+
+  debug2Msg(list->owner, "Going to execute request");
+
+  while((req = private__executeRequests(list)) == NULL) {
+    debug2Msg(list->owner, "Waiting for request!");
+    if (list->hasATimeRequest == 1) {
+      debug2Msg(list->owner, "Waiting for a request and at most for a given time");
+      debugTime("Min time to wait=", &(list->minTimeToWait));
+      pthread_cond_timedwait(list->wakeupCondition, list->mutex, &(list->minTimeToWait));
+    } else {
+      debug2Msg(list->owner, "Releasing mutex");
+      pthread_cond_wait(list->wakeupCondition, list->mutex);
+    }
+    debug2Msg(list->owner, "Waking up for requests! -> getting mutex");
+  }
+
+  debug2Msg(list->owner, "Request selected!");
+
+  my_clock_gettime(&list->completionTime);
+
+  pthread_mutex_unlock(list->mutex); 
+  debug2Msg(list->owner, "Mutex unlocked");
+  return req;
+}
+
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/src/request_manager.h b/modeling/PressureController.ttool/AVATAR_executablecode/src/request_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..e2ae0f800025b9394d6488c012b47f7396aaf609
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/src/request_manager.h
@@ -0,0 +1,14 @@
+#ifndef REQUEST_MANAGER_H
+#define REQUEST_MANAGER_H
+
+
+#include "request.h"
+#include "syncchannel.h"
+
+
+request *executeOneRequest(setOfRequests *list, request *req);
+request *executeListOfRequests(setOfRequests *list);
+
+void removeAllPendingRequestsFromPendingListsRelatedRequests(request *req);
+
+#endif
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/src/syncchannel.c b/modeling/PressureController.ttool/AVATAR_executablecode/src/syncchannel.c
new file mode 100644
index 0000000000000000000000000000000000000000..e1c90875f2574a15318facbda32b27f918f82592
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/src/syncchannel.c
@@ -0,0 +1,41 @@
+#include <stdlib.h>
+
+
+#include "syncchannel.h"
+#include "request.h"
+#include "myerrors.h"
+#include "debug.h"
+
+
+syncchannel *getNewSyncchannel(char *outname, char *inname) {
+  syncchannel * syncch = (syncchannel *)(malloc(sizeof(struct syncchannel)));
+  if (syncch == NULL) {
+    criticalError("Allocation of request failed");
+  }
+  syncch->inname = inname;
+  syncch->outname = outname;
+  syncch->inWaitQueue = NULL;
+  syncch->outWaitQueue = NULL;
+  syncch->isBroadcast = false;
+  return syncch;
+}
+
+void setBroadcast(syncchannel *syncch, bool b) {
+  syncch->isBroadcast = b;
+}
+
+
+
+/*request *makeNewSendSync(int hasDelay, long delay, int nbOfParams, int *params[]) {
+  request *req = getNewRequest(SEND_SYNC_REQUEST, hasDelay, delay, nbOfParams, params);
+  return req;
+}
+
+request *makeNewReceiveSync(int hasDelay, long delay, int nbOfParams, int *params[]) {
+  request *req = getNewRequest(RECEIVE_SYNC_REQUEST, hasDelay, delay, nbOfParams, params);
+  return req;
+  }*/
+
+void destroySyncchannel(syncchannel *syncch) {
+  free(syncch);
+}
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/src/syncchannel.h b/modeling/PressureController.ttool/AVATAR_executablecode/src/syncchannel.h
new file mode 100644
index 0000000000000000000000000000000000000000..6f4f92de5531f14c36b7d520992eb3decb305cdd
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/src/syncchannel.h
@@ -0,0 +1,27 @@
+#ifndef SYNCCHANNEL_H
+#define SYNCCHANNEL_H
+
+struct syncchannel;
+
+#include "request.h"
+#include "defs.h"
+
+struct syncchannel {
+  char *outname;
+  char *inname;
+  struct request* inWaitQueue;
+  struct request* outWaitQueue; 
+  bool isBroadcast;
+};
+
+typedef struct syncchannel syncchannel;
+
+
+void setBroadcast(syncchannel *syncch, bool b);
+syncchannel *getNewSyncchannel(char *inname, char *outname);
+//request *makeNewSendSync(int hasDelay, long delay, int nbOfParams, int *params[]);
+//request *makeNewReceiveSync(int hasDelay, long delay, int nbOfParams, int *params[]);
+void destroySyncchannel(syncchannel *syncch);
+
+
+#endif
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/src/tracemanager.c b/modeling/PressureController.ttool/AVATAR_executablecode/src/tracemanager.c
new file mode 100644
index 0000000000000000000000000000000000000000..fda3a0db1c76a9861708dd422c2cea7f180688b0
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/src/tracemanager.c
@@ -0,0 +1,304 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <time.h>
+
+#include "tracemanager.h"
+#include "debug.h"
+#include "mytimelib.h"
+
+
+#define TRACE_OFF 0
+#define TRACE_IN_FILE 1
+#define TRACE_IN_CONSOLE 2
+
+#define TRACE_FILE_NAME "Trace.txt"
+
+
+pthread_mutex_t __traceMutex;
+
+int trace = TRACE_OFF;
+int id = 0;
+
+FILE *file;
+
+struct timespec begints;
+
+
+void addInfo(char *dest, char *info) {
+  //char s1[10];
+  long tmp;
+  //long tmp1;
+  //int i;
+  struct timespec ts, ts1;
+  my_clock_gettime(&ts);
+  
+  debugMsg("DIFF TIME");
+  diffTime(&begints, &ts, &ts1);
+
+  tmp = ts1.tv_nsec;
+
+  if (tmp < 0) {
+    tmp = -tmp;
+  }
+
+  /*tmp1 = 100000000;
+
+  for(i=0; i<9; i++) {
+    s1[i] = 48 + (tmp / tmp1);
+    tmp = tmp % tmp1;
+    tmp1 = tmp1 / 10;
+    }
+    s1[9] = '\0';*/
+  
+  /* s1 -> tmp */
+  sprintf(dest, "#%d time=%ld.%09ld %s", id, ts1.tv_sec, tmp, info);
+  id ++;
+}
+
+
+void writeInTrace(char *info) {
+  pthread_mutex_lock(&__traceMutex);
+  char s[CHAR_ALLOC_SIZE];
+  addInfo(s, info);
+		 //printf("Write in file\n");
+  switch(trace){
+  case TRACE_IN_FILE:
+    if (file != NULL) {
+      debug2Msg("Saving in file", s);
+      fprintf(file, s);
+      fflush(file);
+    }
+    break;
+  case TRACE_IN_CONSOLE:
+    printf("%s\n", s);
+    break;
+  }
+  
+  pthread_mutex_unlock(&__traceMutex);
+}
+
+
+void activeTracingInFile(char *fileName) {
+  char *name;
+  trace = TRACE_IN_FILE;
+  my_clock_gettime(&begints); 
+  if (fileName == NULL) {
+    name = TRACE_FILE_NAME;
+  } else {
+    name  = fileName;
+  }
+  file = fopen(name,"w");
+
+  /* Initializing mutex */
+  if (pthread_mutex_init(&__traceMutex, NULL) < 0) { exit(-1);}
+}
+
+void activeTracingInConsole() {
+  trace = TRACE_IN_CONSOLE;
+  my_clock_gettime(&begints); 
+  
+  /* Initializing mutex */
+  if (pthread_mutex_init(&__traceMutex, NULL) < 0) { exit(-1);}
+}
+
+void unactiveTracing() {
+  trace = TRACE_OFF;
+}
+
+
+void traceStateEntering(char *myname, char *statename) {
+  char s[CHAR_ALLOC_SIZE];
+
+  debugMsg("Trace function");
+
+  if (trace == TRACE_OFF) {
+    return;
+  }
+
+  sprintf(s, "block=%s type=state_entering state=%s\n", myname, statename);
+
+  // Saving trace
+  writeInTrace(s);
+}
+
+void traceFunctionCall(char *block, char *func, char *params) {
+  char s[CHAR_ALLOC_SIZE];
+
+  debugMsg("Trace function");
+
+  if (trace == TRACE_OFF) {
+    return;
+  }
+
+  sprintf(s, "block=%s type=function_call func=%s parameters=%s\n", block, func, params);
+
+  // Saving trace
+  writeInTrace(s);
+}
+
+
+// type=0: int type = 1:bool
+void traceVariableModification(char *block, char *var, int value, int type) {
+  char s[CHAR_ALLOC_SIZE];
+  debugMsg("Trace variable modification");
+
+  if (trace == TRACE_OFF) {
+    return;
+  }
+
+  
+  if (type == 0) {
+    sprintf(s, "block=%s type=variable_modification variable=%s setTo=%d\n", block, var, value);
+  }
+
+  if (type == 1) {
+    if (value == 0) {
+      sprintf(s, "block=%s type=variable_modification variable=%s setTo=false\n", block, var);
+    } else {
+      sprintf(s, "block=%s type=variable_modification variable=%s setTo=true\n", block, var);
+    }
+  }
+
+  // Saving trace
+  writeInTrace(s);
+
+}
+
+void traceSynchroRequest(request *from, request *to) {
+  char s[1024];
+  int i;
+
+  if (trace == TRACE_OFF) {
+    return;
+  }
+
+  sprintf(s, "block=%s blockdestination=%s type=synchro channel=%s params=", from->listOfRequests->owner, to->listOfRequests->owner, from->syncChannel->outname);
+  for(i=0; i<from->nbOfParams; i++) {
+    if (i>0) {
+      sprintf(s, "%s,", s);
+    }
+    sprintf(s, "%s%d", s, *(from->params[i]));
+  }
+  sprintf(s, "%s\n", s);
+
+  debugMsg("Trace request synchro");
+  
+
+  // Saving trace
+  writeInTrace(s);
+}
+
+
+void traceAsynchronousSendRequest(request *req) {
+  char s[1024];
+  int i;
+
+  if (trace == TRACE_OFF) {
+    return;
+  }
+
+  sprintf(s, "block=%s type=send_async channel=%s msgid=%ld params=", req->listOfRequests->owner, req->asyncChannel->outname, req->msg->id);
+  if (req->msg != NULL) {
+    debugMsg("Computing params");
+    for(i=0; i<req->msg->nbOfParams; i++) {
+      if (i>0) {
+	sprintf(s, "%s,", s);
+      }
+      sprintf(s, "%s%d", s, req->msg->params[i]);
+    }
+  }
+  sprintf(s, "%s\n", s);
+
+  
+
+  // Saving trace
+  writeInTrace(s);
+}
+
+
+void traceAsynchronousReceiveRequest(request *req) {
+  char s[1024];
+  int i;
+
+  if (trace == TRACE_OFF) {
+    return;
+  }
+
+  sprintf(s, "block=%s type=receive_async channel=%s msgid=%ld params=", req->listOfRequests->owner, req->asyncChannel->outname, req->msg->id);
+  if (req->msg != NULL) {
+    debugMsg("Computing params");
+    for(i=0; i<req->msg->nbOfParams; i++) {
+      if (i>0) {
+	sprintf(s, "%s,", s);
+      }
+      sprintf(s, "%s%d", s, req->msg->params[i]);
+    }
+  }
+  sprintf(s, "%s\n", s);
+
+  
+
+  // Saving trace
+  writeInTrace(s);
+}
+
+
+
+void traceRequest(char *myname, request *req) {
+  char s[1024];
+  int i;
+ 
+
+  debugMsg("Trace request");
+
+
+  if (trace == TRACE_OFF) {
+    return;
+  }
+
+  // Build corresponding char*;
+
+  switch(req->type) {
+    case SEND_SYNC_REQUEST:
+    debug2Msg("Sync channel", req->syncChannel->outname);
+    sprintf(s, "block=%s type=send_synchro channel=%s params=", myname, req->syncChannel->outname);
+    for(i=0; i<req->nbOfParams; i++) {
+      if (i>0) {
+	sprintf(s, "%s,", s);
+      }
+      sprintf(s, "%s%d", s, *(req->params[i]));
+    }
+    sprintf(s, "%s\n", s);
+ 
+    break;
+  case RECEIVE_SYNC_REQUEST:
+    sprintf(s, "block=%s type=receive_synchro channel=%s\n", myname, req->syncChannel->inname);
+    break;
+    case SEND_ASYNC_REQUEST:
+    debug2Msg("Async channel", req->asyncChannel->outname);
+    sprintf(s, "block=%s type=send_async_2 channel=%s\n", myname, req->asyncChannel->outname);
+    break;
+  case RECEIVE_ASYNC_REQUEST:
+    sprintf(s, "block=%s type=receive_async_2 channel=%s\n", myname, req->asyncChannel->inname);
+    break;
+   case SEND_BROADCAST_REQUEST:
+    debug2Msg("Sync channel", req->syncChannel->outname);
+    sprintf(s, "block=%s type=send_broadcast channel=%s\n", myname, req->syncChannel->outname);
+    break; 
+   case RECEIVE_BROADCAST_REQUEST:
+    debug2Msg("Sync channel", req->syncChannel->outname);
+    sprintf(s, "block=%s type=receive_broadcast channel=%s\n", myname, req->syncChannel->outname);
+    break; 
+   case IMMEDIATE:
+     sprintf(s, "block=%s type=action\n", myname);
+    break;
+  default:
+    sprintf(s, "block=%s type=unknown\n", myname);
+  }
+
+  debugMsg("Trace request 2");
+  
+
+  // Saving trace
+  writeInTrace(s);
+}
diff --git a/modeling/PressureController.ttool/AVATAR_executablecode/src/tracemanager.h b/modeling/PressureController.ttool/AVATAR_executablecode/src/tracemanager.h
new file mode 100644
index 0000000000000000000000000000000000000000..d33f3532a4bcb9fc7b96ddda00bcfee9cfb2a4bc
--- /dev/null
+++ b/modeling/PressureController.ttool/AVATAR_executablecode/src/tracemanager.h
@@ -0,0 +1,21 @@
+#ifndef TRACEMANAGER_H
+#define TRACEMANAGER_H
+
+#include "request.h"
+
+#define CHAR_ALLOC_SIZE 1024
+
+
+void activeTracingInFile();
+void unactiveTracing();
+void traceRequest(char *myname, request *req);
+void traceFunctionCall(char *block, char *func, char* params);
+void traceVariableModification(char *block, char *var, int value, int type); // type=0: int type = 1:bool
+void traceStateEntering(char *myname, char *statename);
+void traceSynchroRequest(request *from, request *to);
+void traceAsynchronousSendRequest(request *req);
+void traceAsynchronousReceiveRequest(request *req);
+
+#endif
+
+
diff --git a/modeling/PressureController.ttool/PressureController.xml b/modeling/PressureController.ttool/PressureController.xml
new file mode 100644
index 0000000000000000000000000000000000000000..444aec44cdabdd11e8eda0f4f2dd41a9f97117c1
--- /dev/null
+++ b/modeling/PressureController.ttool/PressureController.xml
@@ -0,0 +1,2565 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<TURTLEGMODELING version="1.0beta">
+
+<Modeling type="AVATAR Design" nameTab="Design" >
+<AVATARBlockDiagramPanel name="Block Diagram" minX="10" maxX="2500" minY="10" maxY="1500" zoom="1.0" >
+<MainCode value="#include &lt;sys/types.h&gt;"/>
+<MainCode value="#include &lt;sys/socket.h&gt;"/>
+<MainCode value="#include &lt;netinet/in.h&gt;"/>
+<MainCode value="#include &lt;netdb.h&gt;"/>
+<MainCode value="#include &lt;stdio.h&gt;"/>
+<MainCode value="#include &lt;strings.h&gt;"/>
+<MainCode value="#include &lt;string.h&gt;"/>
+<MainCode value="#include &lt;errno.h&gt;"/>
+<MainCode value=""/>
+<MainCode value="const char* hostname=&quot;localhost&quot;;"/>
+<MainCode value="const char* portname=&quot;8374&quot;;"/>
+<MainCode value="int fd;"/>
+<MainCode value="struct addrinfo* res;"/>
+<MainCode value=""/>
+<MainCode value="#define MAX_DGRAM_SIZE  549"/>
+<MainCode value=""/>
+<MainCode value="pthread_t thread__Datagram;"/>
+<MainCode value=""/>
+<MainCode value="// Handling pressure datagrams"/>
+<MainCode value="int pressure = 1;"/>
+<MainCode value=""/>
+<MainCode value="void pressureDatagram(char *buf) {"/>
+<MainCode value="  pressure = atoi(buf);"/>
+<MainCode value="printf(&quot;Pressure=%d\n&quot;, atoi(buf));"/>
+<MainCode value="}"/>
+<MainCode value=""/>
+<MainCode value="// Assumes fd is valid"/>
+<MainCode value="void* receiveDatagram(void *arg) {"/>
+<MainCode value="  printf(&quot;Thread receive datagram started\n&quot;);"/>
+<MainCode value=""/>
+<MainCode value="  char buffer[MAX_DGRAM_SIZE];"/>
+<MainCode value="  struct sockaddr_storage src_addr;"/>
+<MainCode value="  socklen_t src_addr_len=sizeof(src_addr);"/>
+<MainCode value=""/>
+<MainCode value="  while(1) {"/>
+<MainCode value="    printf(&quot;Waiting for datagram packet\n&quot;);"/>
+<MainCode value="    ssize_t count=recvfrom(fd,buffer,sizeof(buffer),0,(struct sockaddr*)&amp;src_addr,&amp;src_addr_len);"/>
+<MainCode value="    if (count==-1) {"/>
+<MainCode value="      perror(&quot;recv failed&quot;);"/>
+<MainCode value="    } else if (count==sizeof(buffer)) {"/>
+<MainCode value="      perror(&quot;datagram too large for buffer: truncated&quot;);"/>
+<MainCode value="    } else {"/>
+<MainCode value="      //printf(&quot;Datagram size: %d.\n&quot;, (int)(count));"/>
+<MainCode value="      if (strncmp(buffer, &quot;PRESSURE=&quot;, 9) == 0) {"/>
+<MainCode value="        printf(&quot;+++++++++++++++++++++++ PRESSURE\n&quot;);"/>
+<MainCode value="        pressureDatagram(buffer+9);"/>
+<MainCode value="      }"/>
+<MainCode value="    }"/>
+<MainCode value="  }"/>
+<MainCode value="}"/>
+<MainCode value=""/>
+<MainCode value="void sendDatagram(char * data, int size) {"/>
+<MainCode value="  printf(&quot;data=%s fd=%d size=%d\n&quot;, data, fd, size);"/>
+<MainCode value="  if (sendto(fd,data,size, 0, res-&gt;ai_addr,res-&gt;ai_addrlen)==-1) {"/>
+<MainCode value="        printf(&quot;Error when sending datagram&quot;);"/>
+<MainCode value="        exit(-1);"/>
+<MainCode value="    }"/>
+<MainCode value="}"/>
+<MainCode value=""/>
+<MainCode value="void __user_init() { "/>
+<MainCode value="  const char* content = &quot;salut&quot;;"/>
+<MainCode value="  struct addrinfo hints;"/>
+<MainCode value=""/>
+<MainCode value="  memset(&amp;hints,0,sizeof(hints));"/>
+<MainCode value="  hints.ai_family=AF_UNSPEC;"/>
+<MainCode value="  hints.ai_socktype=SOCK_DGRAM;"/>
+<MainCode value="  hints.ai_protocol=0;"/>
+<MainCode value="  hints.ai_flags=AI_ADDRCONFIG;"/>
+<MainCode value=" "/>
+<MainCode value="  int err=getaddrinfo(hostname,portname,&amp;hints,&amp;res);"/>
+<MainCode value="  if (err!=0) {"/>
+<MainCode value="    printf(&quot;failed to resolve remote socket address (err=%d)&quot;,err);"/>
+<MainCode value="    exit(-1);"/>
+<MainCode value="  }"/>
+<MainCode value="  fd=socket(res-&gt;ai_family,res-&gt;ai_socktype,res-&gt;ai_protocol);"/>
+<MainCode value="  if (fd==-1) {"/>
+<MainCode value="    printf(&quot;%s&quot;,strerror(errno));"/>
+<MainCode value="    exit(-1);"/>
+<MainCode value="  }"/>
+<MainCode value="  if (sendto(fd,content,sizeof(content),0,"/>
+<MainCode value="      res-&gt;ai_addr,res-&gt;ai_addrlen)==-1) {"/>
+<MainCode value="    printf(&quot;%s&quot;,strerror(errno));"/>
+<MainCode value="    exit(-1);"/>
+<MainCode value="  }"/>
+<MainCode value=""/>
+<MainCode value="// Start a thread to receive datagrams"/>
+<MainCode value="  pthread_create(&amp;thread__Datagram, NULL, receiveDatagram, NULL);"/>
+<MainCode value=""/>
+<MainCode value="}"/>
+<Optimized value="true" />
+<Validated value="AlarmActuator;PressureSensor;PressureController;AlarmManager;MainController;" />
+<Ignored value="" />
+
+<CONNECTOR type="5002" id="2" >
+<cdparam x="964" y="240" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<infoparam name="connector" value="" />
+<TGConnectingPoint num="0" id="1" />
+<P1  x="964" y="240" id="86" />
+<P2  x="1088" y="240" id="10" />
+<AutomaticDrawing  data="true" />
+<extraparam>
+<isd value="in alarmOff()" />
+<isd value="in alarmOn()" />
+<oso value="out alarmOff()" />
+<oso value="out alarmOn()" />
+<FIFOType asynchronous="false" size="1" blocking="false" private="true" broadcast="false" lossy="false" />
+</extraparam>
+</CONNECTOR>
+<CONNECTOR type="5002" id="4" >
+<cdparam x="659" y="240" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<infoparam name="connector" value="" />
+<TGConnectingPoint num="0" id="3" />
+<P1  x="659" y="240" id="61" />
+<P2  x="714" y="240" id="85" />
+<AutomaticDrawing  data="true" />
+<extraparam>
+<isd value="in highPressure()" />
+<oso value="out highPressure()" />
+<FIFOType asynchronous="false" size="1" blocking="false" private="true" broadcast="false" lossy="false" />
+</extraparam>
+</CONNECTOR>
+<CONNECTOR type="5002" id="6" >
+<cdparam x="297" y="232" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<infoparam name="connector" value="" />
+<TGConnectingPoint num="0" id="5" />
+<P1  x="325" y="241" id="36" />
+<P2  x="409" y="240" id="60" />
+<AutomaticDrawing  data="true" />
+<extraparam>
+<isd value="in pressureValue(int value)" />
+<oso value="out pressureValue(int value)" />
+<FIFOType asynchronous="false" size="1" blocking="false" private="true" broadcast="false" lossy="false" />
+</extraparam>
+</CONNECTOR>
+<COMPONENT type="5000" id="31" >
+<cdparam x="1088" y="140" />
+<sizeparam width="250" height="200" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Block0" value="AlarmActuator" />
+<TGConnectingPoint num="0" id="7" />
+<TGConnectingPoint num="1" id="8" />
+<TGConnectingPoint num="2" id="9" />
+<TGConnectingPoint num="3" id="10" />
+<TGConnectingPoint num="4" id="11" />
+<TGConnectingPoint num="5" id="12" />
+<TGConnectingPoint num="6" id="13" />
+<TGConnectingPoint num="7" id="14" />
+<TGConnectingPoint num="8" id="15" />
+<TGConnectingPoint num="9" id="16" />
+<TGConnectingPoint num="10" id="17" />
+<TGConnectingPoint num="11" id="18" />
+<TGConnectingPoint num="12" id="19" />
+<TGConnectingPoint num="13" id="20" />
+<TGConnectingPoint num="14" id="21" />
+<TGConnectingPoint num="15" id="22" />
+<TGConnectingPoint num="16" id="23" />
+<TGConnectingPoint num="17" id="24" />
+<TGConnectingPoint num="18" id="25" />
+<TGConnectingPoint num="19" id="26" />
+<TGConnectingPoint num="20" id="27" />
+<TGConnectingPoint num="21" id="28" />
+<TGConnectingPoint num="22" id="29" />
+<TGConnectingPoint num="23" id="30" />
+<extraparam>
+<blockType data="block" color="-4072719" />
+<CryptoBlock value="false" />
+<Method value="setAlarm(bool onoff)" />
+<Signal value="in alarmOn()" attached="true" />
+<Signal value="in alarmOff()" attached="true" />
+<globalCode value="" />
+<globalCode value="" />
+<globalCode value="void __userImplemented__AlarmActuator__setAlarm(bool att1) {" />
+<globalCode value="  if (att1) {" />
+<globalCode value="    printf(&quot;Alarm ON\n&quot;);" />
+<globalCode value="    sendDatagram(&quot;+&quot;, 1);" />
+<globalCode value="  } else {" />
+<globalCode value="    printf(&quot;Alarm OFF\n&quot;);" />
+<globalCode value="    sendDatagram(&quot;-&quot;, 1);" />
+<globalCode value="  }" />
+<globalCode value="}" />
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="5000" id="56" >
+<cdparam x="90" y="141" />
+<sizeparam width="235" height="200" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Block0" value="PressureSensor" />
+<TGConnectingPoint num="0" id="32" />
+<TGConnectingPoint num="1" id="33" />
+<TGConnectingPoint num="2" id="34" />
+<TGConnectingPoint num="3" id="35" />
+<TGConnectingPoint num="4" id="36" />
+<TGConnectingPoint num="5" id="37" />
+<TGConnectingPoint num="6" id="38" />
+<TGConnectingPoint num="7" id="39" />
+<TGConnectingPoint num="8" id="40" />
+<TGConnectingPoint num="9" id="41" />
+<TGConnectingPoint num="10" id="42" />
+<TGConnectingPoint num="11" id="43" />
+<TGConnectingPoint num="12" id="44" />
+<TGConnectingPoint num="13" id="45" />
+<TGConnectingPoint num="14" id="46" />
+<TGConnectingPoint num="15" id="47" />
+<TGConnectingPoint num="16" id="48" />
+<TGConnectingPoint num="17" id="49" />
+<TGConnectingPoint num="18" id="50" />
+<TGConnectingPoint num="19" id="51" />
+<TGConnectingPoint num="20" id="52" />
+<TGConnectingPoint num="21" id="53" />
+<TGConnectingPoint num="22" id="54" />
+<TGConnectingPoint num="23" id="55" />
+<extraparam>
+<blockType data="block" color="-4072719" />
+<CryptoBlock value="false" />
+<Attribute access="0" id="pressure" value="" type="8" typeOther="" />
+<Attribute access="0" id="branchToUse" value="false" type="4" typeOther="" />
+<Method value="$int readingPressure()" />
+<Method value="$bool isInCode()" />
+<Signal value="out pressureValue(int value)" attached="true" />
+<globalCode value="extern int pressure;" />
+<globalCode value="" />
+<globalCode value="int __userImplemented__PressureSensor__readingPressure() {" />
+<globalCode value="  return pressure;" />
+<globalCode value="}" />
+<globalCode value="" />
+<globalCode value="bool __userImplemented__PressureSensor__isInCode() {" />
+<globalCode value="  return 1;" />
+<globalCode value="}" />
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="5000" id="131" >
+<cdparam x="376" y="69" />
+<sizeparam width="605" height="338" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Block0" value="PressureController" />
+<TGConnectingPoint num="0" id="107" />
+<TGConnectingPoint num="1" id="108" />
+<TGConnectingPoint num="2" id="109" />
+<TGConnectingPoint num="3" id="110" />
+<TGConnectingPoint num="4" id="111" />
+<TGConnectingPoint num="5" id="112" />
+<TGConnectingPoint num="6" id="113" />
+<TGConnectingPoint num="7" id="114" />
+<TGConnectingPoint num="8" id="115" />
+<TGConnectingPoint num="9" id="116" />
+<TGConnectingPoint num="10" id="117" />
+<TGConnectingPoint num="11" id="118" />
+<TGConnectingPoint num="12" id="119" />
+<TGConnectingPoint num="13" id="120" />
+<TGConnectingPoint num="14" id="121" />
+<TGConnectingPoint num="15" id="122" />
+<TGConnectingPoint num="16" id="123" />
+<TGConnectingPoint num="17" id="124" />
+<TGConnectingPoint num="18" id="125" />
+<TGConnectingPoint num="19" id="126" />
+<TGConnectingPoint num="20" id="127" />
+<TGConnectingPoint num="21" id="128" />
+<TGConnectingPoint num="22" id="129" />
+<TGConnectingPoint num="23" id="130" />
+<extraparam>
+<blockType data="block" color="-4072719" />
+<CryptoBlock value="false" />
+</extraparam>
+</COMPONENT>
+<SUBCOMPONENT type="5000" id="81" >
+<father id="131" num="0" />
+<cdparam x="409" y="140" />
+<sizeparam width="250" height="200" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="0" maxX="355" minY="0" maxY="138" />
+<infoparam name="Block0" value="MainController" />
+<TGConnectingPoint num="0" id="57" />
+<TGConnectingPoint num="1" id="58" />
+<TGConnectingPoint num="2" id="59" />
+<TGConnectingPoint num="3" id="60" />
+<TGConnectingPoint num="4" id="61" />
+<TGConnectingPoint num="5" id="62" />
+<TGConnectingPoint num="6" id="63" />
+<TGConnectingPoint num="7" id="64" />
+<TGConnectingPoint num="8" id="65" />
+<TGConnectingPoint num="9" id="66" />
+<TGConnectingPoint num="10" id="67" />
+<TGConnectingPoint num="11" id="68" />
+<TGConnectingPoint num="12" id="69" />
+<TGConnectingPoint num="13" id="70" />
+<TGConnectingPoint num="14" id="71" />
+<TGConnectingPoint num="15" id="72" />
+<TGConnectingPoint num="16" id="73" />
+<TGConnectingPoint num="17" id="74" />
+<TGConnectingPoint num="18" id="75" />
+<TGConnectingPoint num="19" id="76" />
+<TGConnectingPoint num="20" id="77" />
+<TGConnectingPoint num="21" id="78" />
+<TGConnectingPoint num="22" id="79" />
+<TGConnectingPoint num="23" id="80" />
+<extraparam>
+<blockType data="block" color="-4072719" />
+<CryptoBlock value="false" />
+<Attribute access="0" id="threshold" value="20" type="8" typeOther="" />
+<Attribute access="0" id="currentPressure" value="0" type="8" typeOther="" />
+<Signal value="in pressureValue(int value)" attached="true" />
+<Signal value="out highPressure()" attached="true" />
+</extraparam>
+</SUBCOMPONENT>
+<SUBCOMPONENT type="5000" id="106" >
+<father id="131" num="1" />
+<cdparam x="714" y="140" />
+<sizeparam width="250" height="200" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="0" maxX="355" minY="0" maxY="138" />
+<infoparam name="Block0" value="AlarmManager" />
+<TGConnectingPoint num="0" id="82" />
+<TGConnectingPoint num="1" id="83" />
+<TGConnectingPoint num="2" id="84" />
+<TGConnectingPoint num="3" id="85" />
+<TGConnectingPoint num="4" id="86" />
+<TGConnectingPoint num="5" id="87" />
+<TGConnectingPoint num="6" id="88" />
+<TGConnectingPoint num="7" id="89" />
+<TGConnectingPoint num="8" id="90" />
+<TGConnectingPoint num="9" id="91" />
+<TGConnectingPoint num="10" id="92" />
+<TGConnectingPoint num="11" id="93" />
+<TGConnectingPoint num="12" id="94" />
+<TGConnectingPoint num="13" id="95" />
+<TGConnectingPoint num="14" id="96" />
+<TGConnectingPoint num="15" id="97" />
+<TGConnectingPoint num="16" id="98" />
+<TGConnectingPoint num="17" id="99" />
+<TGConnectingPoint num="18" id="100" />
+<TGConnectingPoint num="19" id="101" />
+<TGConnectingPoint num="20" id="102" />
+<TGConnectingPoint num="21" id="103" />
+<TGConnectingPoint num="22" id="104" />
+<TGConnectingPoint num="23" id="105" />
+<extraparam>
+<blockType data="block" color="-4072719" />
+<CryptoBlock value="false" />
+<Attribute access="0" id="alarmDuration" value="5" type="8" typeOther="" />
+<Attribute access="0" id="alarmTimer" value="" type="9" typeOther="" />
+<Signal value="in highPressure()" attached="true" />
+<Signal value="out alarmOff()" attached="true" />
+<Signal value="out alarmOn()" attached="true" />
+</extraparam>
+</SUBCOMPONENT>
+
+
+</AVATARBlockDiagramPanel>
+
+<AVATARStateMachineDiagramPanel name="AlarmActuator" minX="10" maxX="2500" minY="10" maxY="1500" >
+<CONNECTOR type="5102" id="146" >
+<cdparam x="582" y="231" />
+<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="141" />
+<TGConnectingPoint num="1" id="142" />
+<TGConnectingPoint num="2" id="143" />
+<TGConnectingPoint num="3" id="144" />
+<TGConnectingPoint num="4" id="145" />
+<P1  x="578" y="231" id="184" />
+<P2  x="610" y="133" id="209" />
+<Point x="578" y="251" />
+<Point x="658" y="251" />
+<Point x="658" y="113" />
+<Point x="630" y="113" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="132" >
+<father id="146" num="0" />
+<cdparam x="578" y="251" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="133" >
+<father id="146" num="1" />
+<cdparam x="658" y="251" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="134" >
+<father id="146" num="2" />
+<cdparam x="658" y="113" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="135" >
+<father id="146" num="3" />
+<cdparam x="630" y="113" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="140" >
+<father id="146" num="4" />
+<cdparam x="666" y="183" />
+<sizeparam width="99" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="136" />
+<TGConnectingPoint num="1" id="137" />
+<TGConnectingPoint num="2" id="138" />
+<TGConnectingPoint num="3" id="139" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+<actions value="setAlarm(false) " enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="161" >
+<cdparam x="363" y="233" />
+<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="156" />
+<TGConnectingPoint num="1" id="157" />
+<TGConnectingPoint num="2" id="158" />
+<TGConnectingPoint num="3" id="159" />
+<TGConnectingPoint num="4" id="160" />
+<P1  x="363" y="233" id="195" />
+<P2  x="368" y="139" id="229" />
+<Point x="363" y="253" />
+<Point x="277" y="253" />
+<Point x="277" y="119" />
+<Point x="348" y="119" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="147" >
+<father id="161" num="0" />
+<cdparam x="363" y="253" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="148" >
+<father id="161" num="1" />
+<cdparam x="277" y="253" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="149" >
+<father id="161" num="2" />
+<cdparam x="277" y="119" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="150" >
+<father id="161" num="3" />
+<cdparam x="348" y="119" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="155" >
+<father id="161" num="4" />
+<cdparam x="170" y="206" />
+<sizeparam width="95" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="151" />
+<TGConnectingPoint num="1" id="152" />
+<TGConnectingPoint num="2" id="153" />
+<TGConnectingPoint num="3" id="154" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+<actions value="setAlarm(true) " enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="168" >
+<cdparam x="407" y="70" />
+<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="167" />
+<P1  x="407" y="70" id="246" />
+<P2  x="457" y="108" id="222" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="166" >
+<father id="168" num="0" />
+<cdparam x="406" y="89" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="162" />
+<TGConnectingPoint num="1" id="163" />
+<TGConnectingPoint num="2" id="164" />
+<TGConnectingPoint num="3" id="165" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="175" >
+<cdparam x="397" y="158" />
+<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="174" />
+<P1  x="397" y="158" id="233" />
+<P2  x="363" y="203" id="194" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="173" >
+<father id="175" num="0" />
+<cdparam x="403" y="179" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="169" />
+<TGConnectingPoint num="1" id="170" />
+<TGConnectingPoint num="2" id="171" />
+<TGConnectingPoint num="3" id="172" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="182" >
+<cdparam x="578" y="158" />
+<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="181" />
+<P1  x="578" y="158" id="236" />
+<P2  x="578" y="201" id="183" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="180" >
+<father id="182" num="0" />
+<cdparam x="580" y="179" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="176" />
+<TGConnectingPoint num="1" id="177" />
+<TGConnectingPoint num="2" id="178" />
+<TGConnectingPoint num="3" id="179" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<COMPONENT type="5104" id="193" >
+<cdparam x="538" y="206" />
+<sizeparam width="80" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Receive signal" value="alarmOff()" />
+<TGConnectingPoint num="0" id="183" />
+<TGConnectingPoint num="1" id="184" />
+<TGConnectingPoint num="2" id="185" />
+<TGConnectingPoint num="3" id="186" />
+<TGConnectingPoint num="4" id="187" />
+<TGConnectingPoint num="5" id="188" />
+<TGConnectingPoint num="6" id="189" />
+<TGConnectingPoint num="7" id="190" />
+<TGConnectingPoint num="8" id="191" />
+<TGConnectingPoint num="9" id="192" />
+</COMPONENT>
+
+<COMPONENT type="5104" id="204" >
+<cdparam x="323" y="208" />
+<sizeparam width="80" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Receive signal" value="alarmOn()" />
+<TGConnectingPoint num="0" id="194" />
+<TGConnectingPoint num="1" id="195" />
+<TGConnectingPoint num="2" id="196" />
+<TGConnectingPoint num="3" id="197" />
+<TGConnectingPoint num="4" id="198" />
+<TGConnectingPoint num="5" id="199" />
+<TGConnectingPoint num="6" id="200" />
+<TGConnectingPoint num="7" id="201" />
+<TGConnectingPoint num="8" id="202" />
+<TGConnectingPoint num="9" id="203" />
+</COMPONENT>
+
+<COMPONENT type="5106" id="245" >
+<cdparam x="368" y="108" />
+<sizeparam width="242" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="State" value="WaitingForAlarmCommand" />
+<TGConnectingPoint num="0" id="205" />
+<TGConnectingPoint num="1" id="206" />
+<TGConnectingPoint num="2" id="207" />
+<TGConnectingPoint num="3" id="208" />
+<TGConnectingPoint num="4" id="209" />
+<TGConnectingPoint num="5" id="210" />
+<TGConnectingPoint num="6" id="211" />
+<TGConnectingPoint num="7" id="212" />
+<TGConnectingPoint num="8" id="213" />
+<TGConnectingPoint num="9" id="214" />
+<TGConnectingPoint num="10" id="215" />
+<TGConnectingPoint num="11" id="216" />
+<TGConnectingPoint num="12" id="217" />
+<TGConnectingPoint num="13" id="218" />
+<TGConnectingPoint num="14" id="219" />
+<TGConnectingPoint num="15" id="220" />
+<TGConnectingPoint num="16" id="221" />
+<TGConnectingPoint num="17" id="222" />
+<TGConnectingPoint num="18" id="223" />
+<TGConnectingPoint num="19" id="224" />
+<TGConnectingPoint num="20" id="225" />
+<TGConnectingPoint num="21" id="226" />
+<TGConnectingPoint num="22" id="227" />
+<TGConnectingPoint num="23" id="228" />
+<TGConnectingPoint num="24" id="229" />
+<TGConnectingPoint num="25" id="230" />
+<TGConnectingPoint num="26" id="231" />
+<TGConnectingPoint num="27" id="232" />
+<TGConnectingPoint num="28" id="233" />
+<TGConnectingPoint num="29" id="234" />
+<TGConnectingPoint num="30" id="235" />
+<TGConnectingPoint num="31" id="236" />
+<TGConnectingPoint num="32" id="237" />
+<TGConnectingPoint num="33" id="238" />
+<TGConnectingPoint num="34" id="239" />
+<TGConnectingPoint num="35" id="240" />
+<TGConnectingPoint num="36" id="241" />
+<TGConnectingPoint num="37" id="242" />
+<TGConnectingPoint num="38" id="243" />
+<TGConnectingPoint num="39" id="244" />
+<extraparam>
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="5100" id="247" >
+<cdparam x="400" y="50" />
+<sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="start state" value="null" />
+<TGConnectingPoint num="0" id="246" />
+</COMPONENT>
+
+
+</AVATARStateMachineDiagramPanel>
+
+<AVATARStateMachineDiagramPanel name="PressureSensor" minX="10" maxX="2500" minY="10" maxY="1500" >
+<CONNECTOR type="5102" id="254" >
+<cdparam x="534" y="553" />
+<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="253" />
+<P1  x="547" y="553" id="318" />
+<P2  x="547" y="573" id="372" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="252" >
+<father id="254" num="0" />
+<cdparam x="534" y="563" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="248" />
+<TGConnectingPoint num="1" id="249" />
+<TGConnectingPoint num="2" id="250" />
+<TGConnectingPoint num="3" id="251" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="261" >
+<cdparam x="624" y="474" />
+<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="260" />
+<P1  x="624" y="474" id="370" />
+<P2  x="567" y="503" id="330" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="259" >
+<father id="261" num="0" />
+<cdparam x="603" y="490" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="255" />
+<TGConnectingPoint num="1" id="256" />
+<TGConnectingPoint num="2" id="257" />
+<TGConnectingPoint num="3" id="258" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="268" >
+<cdparam x="531" y="340" />
+<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="267" />
+<P1  x="556" y="401" id="355" />
+<P2  x="624" y="444" id="369" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="266" >
+<father id="268" num="0" />
+<cdparam x="581" y="397" />
+<sizeparam width="44" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="262" />
+<TGConnectingPoint num="1" id="263" />
+<TGConnectingPoint num="2" id="264" />
+<TGConnectingPoint num="3" id="265" />
+<extraparam>
+<guard value="[ else ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="283" >
+<cdparam x="551" y="444" />
+<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="278" />
+<TGConnectingPoint num="1" id="279" />
+<TGConnectingPoint num="2" id="280" />
+<TGConnectingPoint num="3" id="281" />
+<TGConnectingPoint num="4" id="282" />
+<P1  x="547" y="603" id="373" />
+<P2  x="532" y="185" id="406" />
+<Point x="547" y="623" />
+<Point x="755" y="623" />
+<Point x="755" y="165" />
+<Point x="552" y="165" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="269" >
+<father id="283" num="0" />
+<cdparam x="547" y="623" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="270" >
+<father id="283" num="1" />
+<cdparam x="755" y="623" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="271" >
+<father id="283" num="2" />
+<cdparam x="755" y="165" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="272" >
+<father id="283" num="3" />
+<cdparam x="552" y="165" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="277" >
+<father id="283" num="4" />
+<cdparam x="551" y="314" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="273" />
+<TGConnectingPoint num="1" id="274" />
+<TGConnectingPoint num="2" id="275" />
+<TGConnectingPoint num="3" id="276" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="290" >
+<cdparam x="440" y="144" />
+<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="289" />
+<P1  x="323" y="133" id="465" />
+<P2  x="323" y="167" id="383" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="288" >
+<father id="290" num="0" />
+<cdparam x="446" y="169" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="284" />
+<TGConnectingPoint num="1" id="285" />
+<TGConnectingPoint num="2" id="286" />
+<TGConnectingPoint num="3" id="287" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="297" >
+<cdparam x="502" y="244" />
+<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="296" />
+<P1  x="427" y="217" id="389" />
+<P2  x="510" y="290" id="441" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="295" >
+<father id="297" num="0" />
+<cdparam x="498" y="267" />
+<sizeparam width="68" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="291" />
+<TGConnectingPoint num="1" id="292" />
+<TGConnectingPoint num="2" id="293" />
+<TGConnectingPoint num="3" id="294" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="1" enabled="true"/>
+<afterMax value="1" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="304" >
+<cdparam x="560" y="479" />
+<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="303" />
+<P1  x="506" y="401" id="354" />
+<P2  x="506" y="503" id="320" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="302" >
+<father id="304" num="0" />
+<cdparam x="303" y="451" />
+<sizeparam width="192" height="30" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="298" />
+<TGConnectingPoint num="1" id="299" />
+<TGConnectingPoint num="2" id="300" />
+<TGConnectingPoint num="3" id="301" />
+<extraparam>
+<guard value="[ branchToUse ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+<actions value="pressure = readingPressure() " enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="311" >
+<cdparam x="468" y="340" />
+<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="310" />
+<P1  x="531" y="340" id="430" />
+<P2  x="531" y="376" id="353" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="309" >
+<father id="311" num="0" />
+<cdparam x="351" y="370" />
+<sizeparam width="168" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="305" />
+<TGConnectingPoint num="1" id="306" />
+<TGConnectingPoint num="2" id="307" />
+<TGConnectingPoint num="3" id="308" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+<actions value="branchToUse = isInCode() " enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<COMPONENT type="5106" id="352" >
+<cdparam x="465" y="503" />
+<sizeparam width="165" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="State" value="SendingPressure" />
+<TGConnectingPoint num="0" id="312" />
+<TGConnectingPoint num="1" id="313" />
+<TGConnectingPoint num="2" id="314" />
+<TGConnectingPoint num="3" id="315" />
+<TGConnectingPoint num="4" id="316" />
+<TGConnectingPoint num="5" id="317" />
+<TGConnectingPoint num="6" id="318" />
+<TGConnectingPoint num="7" id="319" />
+<TGConnectingPoint num="8" id="320" />
+<TGConnectingPoint num="9" id="321" />
+<TGConnectingPoint num="10" id="322" />
+<TGConnectingPoint num="11" id="323" />
+<TGConnectingPoint num="12" id="324" />
+<TGConnectingPoint num="13" id="325" />
+<TGConnectingPoint num="14" id="326" />
+<TGConnectingPoint num="15" id="327" />
+<TGConnectingPoint num="16" id="328" />
+<TGConnectingPoint num="17" id="329" />
+<TGConnectingPoint num="18" id="330" />
+<TGConnectingPoint num="19" id="331" />
+<TGConnectingPoint num="20" id="332" />
+<TGConnectingPoint num="21" id="333" />
+<TGConnectingPoint num="22" id="334" />
+<TGConnectingPoint num="23" id="335" />
+<TGConnectingPoint num="24" id="336" />
+<TGConnectingPoint num="25" id="337" />
+<TGConnectingPoint num="26" id="338" />
+<TGConnectingPoint num="27" id="339" />
+<TGConnectingPoint num="28" id="340" />
+<TGConnectingPoint num="29" id="341" />
+<TGConnectingPoint num="30" id="342" />
+<TGConnectingPoint num="31" id="343" />
+<TGConnectingPoint num="32" id="344" />
+<TGConnectingPoint num="33" id="345" />
+<TGConnectingPoint num="34" id="346" />
+<TGConnectingPoint num="35" id="347" />
+<TGConnectingPoint num="36" id="348" />
+<TGConnectingPoint num="37" id="349" />
+<TGConnectingPoint num="38" id="350" />
+<TGConnectingPoint num="39" id="351" />
+<extraparam>
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="5107" id="368" >
+<cdparam x="516" y="386" />
+<sizeparam width="30" height="30" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="choice" value="null" />
+<TGConnectingPoint num="0" id="353" />
+<TGConnectingPoint num="1" id="354" />
+<TGConnectingPoint num="2" id="355" />
+<TGConnectingPoint num="3" id="356" />
+<TGConnectingPoint num="4" id="357" />
+<TGConnectingPoint num="5" id="358" />
+<TGConnectingPoint num="6" id="359" />
+<TGConnectingPoint num="7" id="360" />
+<TGConnectingPoint num="8" id="361" />
+<TGConnectingPoint num="9" id="362" />
+<TGConnectingPoint num="10" id="363" />
+<TGConnectingPoint num="11" id="364" />
+<TGConnectingPoint num="12" id="365" />
+<TGConnectingPoint num="13" id="366" />
+<TGConnectingPoint num="14" id="367" />
+</COMPONENT>
+
+<COMPONENT type="5108" id="371" >
+<cdparam x="527" y="449" />
+<sizeparam width="195" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="TGComponent" value="null" />
+<TGConnectingPoint num="0" id="369" />
+<TGConnectingPoint num="1" id="370" />
+<extraparam>
+<Data variable="pressure" minValue="19" maxValue="21" functionId="0" />
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="5103" id="382" >
+<cdparam x="464" y="578" />
+<sizeparam width="167" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Send signal" value="pressureValue(pressure)" />
+<TGConnectingPoint num="0" id="372" />
+<TGConnectingPoint num="1" id="373" />
+<TGConnectingPoint num="2" id="374" />
+<TGConnectingPoint num="3" id="375" />
+<TGConnectingPoint num="4" id="376" />
+<TGConnectingPoint num="5" id="377" />
+<TGConnectingPoint num="6" id="378" />
+<TGConnectingPoint num="7" id="379" />
+<TGConnectingPoint num="8" id="380" />
+<TGConnectingPoint num="9" id="381" />
+</COMPONENT>
+
+<COMPONENT type="5106" id="423" >
+<cdparam x="323" y="167" />
+<sizeparam width="209" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="State" value="WaitingForNextCycle" />
+<TGConnectingPoint num="0" id="383" />
+<TGConnectingPoint num="1" id="384" />
+<TGConnectingPoint num="2" id="385" />
+<TGConnectingPoint num="3" id="386" />
+<TGConnectingPoint num="4" id="387" />
+<TGConnectingPoint num="5" id="388" />
+<TGConnectingPoint num="6" id="389" />
+<TGConnectingPoint num="7" id="390" />
+<TGConnectingPoint num="8" id="391" />
+<TGConnectingPoint num="9" id="392" />
+<TGConnectingPoint num="10" id="393" />
+<TGConnectingPoint num="11" id="394" />
+<TGConnectingPoint num="12" id="395" />
+<TGConnectingPoint num="13" id="396" />
+<TGConnectingPoint num="14" id="397" />
+<TGConnectingPoint num="15" id="398" />
+<TGConnectingPoint num="16" id="399" />
+<TGConnectingPoint num="17" id="400" />
+<TGConnectingPoint num="18" id="401" />
+<TGConnectingPoint num="19" id="402" />
+<TGConnectingPoint num="20" id="403" />
+<TGConnectingPoint num="21" id="404" />
+<TGConnectingPoint num="22" id="405" />
+<TGConnectingPoint num="23" id="406" />
+<TGConnectingPoint num="24" id="407" />
+<TGConnectingPoint num="25" id="408" />
+<TGConnectingPoint num="26" id="409" />
+<TGConnectingPoint num="27" id="410" />
+<TGConnectingPoint num="28" id="411" />
+<TGConnectingPoint num="29" id="412" />
+<TGConnectingPoint num="30" id="413" />
+<TGConnectingPoint num="31" id="414" />
+<TGConnectingPoint num="32" id="415" />
+<TGConnectingPoint num="33" id="416" />
+<TGConnectingPoint num="34" id="417" />
+<TGConnectingPoint num="35" id="418" />
+<TGConnectingPoint num="36" id="419" />
+<TGConnectingPoint num="37" id="420" />
+<TGConnectingPoint num="38" id="421" />
+<TGConnectingPoint num="39" id="422" />
+<extraparam>
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="5106" id="464" >
+<cdparam x="449" y="290" />
+<sizeparam width="165" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="State" value="SensingPressure" />
+<TGConnectingPoint num="0" id="424" />
+<TGConnectingPoint num="1" id="425" />
+<TGConnectingPoint num="2" id="426" />
+<TGConnectingPoint num="3" id="427" />
+<TGConnectingPoint num="4" id="428" />
+<TGConnectingPoint num="5" id="429" />
+<TGConnectingPoint num="6" id="430" />
+<TGConnectingPoint num="7" id="431" />
+<TGConnectingPoint num="8" id="432" />
+<TGConnectingPoint num="9" id="433" />
+<TGConnectingPoint num="10" id="434" />
+<TGConnectingPoint num="11" id="435" />
+<TGConnectingPoint num="12" id="436" />
+<TGConnectingPoint num="13" id="437" />
+<TGConnectingPoint num="14" id="438" />
+<TGConnectingPoint num="15" id="439" />
+<TGConnectingPoint num="16" id="440" />
+<TGConnectingPoint num="17" id="441" />
+<TGConnectingPoint num="18" id="442" />
+<TGConnectingPoint num="19" id="443" />
+<TGConnectingPoint num="20" id="444" />
+<TGConnectingPoint num="21" id="445" />
+<TGConnectingPoint num="22" id="446" />
+<TGConnectingPoint num="23" id="447" />
+<TGConnectingPoint num="24" id="448" />
+<TGConnectingPoint num="25" id="449" />
+<TGConnectingPoint num="26" id="450" />
+<TGConnectingPoint num="27" id="451" />
+<TGConnectingPoint num="28" id="452" />
+<TGConnectingPoint num="29" id="453" />
+<TGConnectingPoint num="30" id="454" />
+<TGConnectingPoint num="31" id="455" />
+<TGConnectingPoint num="32" id="456" />
+<TGConnectingPoint num="33" id="457" />
+<TGConnectingPoint num="34" id="458" />
+<TGConnectingPoint num="35" id="459" />
+<TGConnectingPoint num="36" id="460" />
+<TGConnectingPoint num="37" id="461" />
+<TGConnectingPoint num="38" id="462" />
+<TGConnectingPoint num="39" id="463" />
+<extraparam>
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="5100" id="466" >
+<cdparam x="316" y="113" />
+<sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="start state" value="null" />
+<TGConnectingPoint num="0" id="465" />
+</COMPONENT>
+
+
+</AVATARStateMachineDiagramPanel>
+
+<AVATARStateMachineDiagramPanel name="PressureController" minX="10" maxX="2500" minY="10" maxY="1500" >
+<COMPONENT type="5100" id="468" >
+<cdparam x="400" y="50" />
+<sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="start state" value="null" />
+<TGConnectingPoint num="0" id="467" />
+</COMPONENT>
+
+
+</AVATARStateMachineDiagramPanel>
+
+<AVATARStateMachineDiagramPanel name="AlarmManager" minX="10" maxX="2500" minY="10" maxY="1500" >
+<CONNECTOR type="5102" id="475" >
+<cdparam x="574" y="423" />
+<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="474" />
+<P1  x="574" y="423" id="625" />
+<P2  x="574" y="472" id="580" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="473" >
+<father id="475" num="0" />
+<cdparam x="577" y="447" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="469" />
+<TGConnectingPoint num="1" id="470" />
+<TGConnectingPoint num="2" id="471" />
+<TGConnectingPoint num="3" id="472" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="490" >
+<cdparam x="327" y="531" />
+<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="485" />
+<TGConnectingPoint num="1" id="486" />
+<TGConnectingPoint num="2" id="487" />
+<TGConnectingPoint num="3" id="488" />
+<TGConnectingPoint num="4" id="489" />
+<P1  x="326" y="531" id="592" />
+<P2  x="368" y="318" id="656" />
+<Point x="326" y="551" />
+<Point x="178" y="551" />
+<Point x="178" y="298" />
+<Point x="348" y="298" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="476" >
+<father id="490" num="0" />
+<cdparam x="326" y="551" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="477" >
+<father id="490" num="1" />
+<cdparam x="178" y="551" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="478" >
+<father id="490" num="2" />
+<cdparam x="178" y="298" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="479" >
+<father id="490" num="3" />
+<cdparam x="348" y="298" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="484" >
+<father id="490" num="4" />
+<cdparam x="347" y="424" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="480" />
+<TGConnectingPoint num="1" id="481" />
+<TGConnectingPoint num="2" id="482" />
+<TGConnectingPoint num="3" id="483" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="505" >
+<cdparam x="590" y="423" />
+<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="500" />
+<TGConnectingPoint num="1" id="501" />
+<TGConnectingPoint num="2" id="502" />
+<TGConnectingPoint num="3" id="503" />
+<TGConnectingPoint num="4" id="504" />
+<P1  x="574" y="502" id="581" />
+<P2  x="563" y="133" id="702" />
+<Point x="574" y="522" />
+<Point x="726" y="522" />
+<Point x="726" y="113" />
+<Point x="583" y="113" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="491" >
+<father id="505" num="0" />
+<cdparam x="574" y="522" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="492" >
+<father id="505" num="1" />
+<cdparam x="726" y="522" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="493" >
+<father id="505" num="2" />
+<cdparam x="726" y="113" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="494" >
+<father id="505" num="3" />
+<cdparam x="583" y="113" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="499" >
+<father id="505" num="4" />
+<cdparam x="576" y="278" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="495" />
+<TGConnectingPoint num="1" id="496" />
+<TGConnectingPoint num="2" id="497" />
+<TGConnectingPoint num="3" id="498" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="512" >
+<cdparam x="407" y="70" />
+<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="511" />
+<P1  x="401" y="67" id="739" />
+<P2  x="401" y="113" id="714" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="510" >
+<father id="512" num="0" />
+<cdparam x="411" y="91" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="506" />
+<TGConnectingPoint num="1" id="507" />
+<TGConnectingPoint num="2" id="508" />
+<TGConnectingPoint num="3" id="509" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="519" >
+<cdparam x="425" y="154" />
+<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="518" />
+<P1  x="471" y="154" id="704" />
+<P2  x="471" y="177" id="687" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="517" >
+<father id="519" num="0" />
+<cdparam x="423" y="179" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="513" />
+<TGConnectingPoint num="1" id="514" />
+<TGConnectingPoint num="2" id="515" />
+<TGConnectingPoint num="3" id="516" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="526" >
+<cdparam x="400" y="252" />
+<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="525" />
+<P1  x="471" y="207" id="688" />
+<P2  x="471" y="210" id="676" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="524" >
+<father id="526" num="0" />
+<cdparam x="400" y="265" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="520" />
+<TGConnectingPoint num="1" id="521" />
+<TGConnectingPoint num="2" id="522" />
+<TGConnectingPoint num="3" id="523" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="533" >
+<cdparam x="574" y="350" />
+<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="532" />
+<P1  x="574" y="350" id="642" />
+<P2  x="574" y="393" id="624" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="531" >
+<father id="533" num="0" />
+<cdparam x="574" y="364" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="527" />
+<TGConnectingPoint num="1" id="528" />
+<TGConnectingPoint num="2" id="529" />
+<TGConnectingPoint num="3" id="530" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="540" >
+<cdparam x="368" y="350" />
+<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="539" />
+<P1  x="368" y="350" id="640" />
+<P2  x="326" y="392" id="613" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="538" >
+<father id="540" num="0" />
+<cdparam x="371" y="375" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="534" />
+<TGConnectingPoint num="1" id="535" />
+<TGConnectingPoint num="2" id="536" />
+<TGConnectingPoint num="3" id="537" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="547" >
+<cdparam x="326" y="422" />
+<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="546" />
+<P1  x="326" y="422" id="614" />
+<P2  x="326" y="444" id="602" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="545" >
+<father id="547" num="0" />
+<cdparam x="329" y="430" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="541" />
+<TGConnectingPoint num="1" id="542" />
+<TGConnectingPoint num="2" id="543" />
+<TGConnectingPoint num="3" id="544" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="554" >
+<cdparam x="326" y="474" />
+<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="553" />
+<P1  x="326" y="474" id="603" />
+<P2  x="326" y="501" id="591" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="552" >
+<father id="554" num="0" />
+<cdparam x="326" y="487" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="548" />
+<TGConnectingPoint num="1" id="549" />
+<TGConnectingPoint num="2" id="550" />
+<TGConnectingPoint num="3" id="551" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="561" >
+<cdparam x="471" y="240" />
+<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="560" />
+<P1  x="471" y="240" id="677" />
+<P2  x="471" y="252" id="569" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="559" >
+<father id="561" num="0" />
+<cdparam x="474" y="246" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="555" />
+<TGConnectingPoint num="1" id="556" />
+<TGConnectingPoint num="2" id="557" />
+<TGConnectingPoint num="3" id="558" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="568" >
+<cdparam x="478" y="282" />
+<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="567" />
+<P1  x="471" y="282" id="570" />
+<P2  x="471" y="300" id="636" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="566" >
+<father id="568" num="0" />
+<cdparam x="474" y="291" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="562" />
+<TGConnectingPoint num="1" id="563" />
+<TGConnectingPoint num="2" id="564" />
+<TGConnectingPoint num="3" id="565" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<COMPONENT type="5103" id="579" >
+<cdparam x="435" y="257" />
+<sizeparam width="72" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Send signal" value="alarmOn()" />
+<TGConnectingPoint num="0" id="569" />
+<TGConnectingPoint num="1" id="570" />
+<TGConnectingPoint num="2" id="571" />
+<TGConnectingPoint num="3" id="572" />
+<TGConnectingPoint num="4" id="573" />
+<TGConnectingPoint num="5" id="574" />
+<TGConnectingPoint num="6" id="575" />
+<TGConnectingPoint num="7" id="576" />
+<TGConnectingPoint num="8" id="577" />
+<TGConnectingPoint num="9" id="578" />
+</COMPONENT>
+
+<COMPONENT type="5103" id="590" >
+<cdparam x="538" y="477" />
+<sizeparam width="72" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Send signal" value="alarmOff()" />
+<TGConnectingPoint num="0" id="580" />
+<TGConnectingPoint num="1" id="581" />
+<TGConnectingPoint num="2" id="582" />
+<TGConnectingPoint num="3" id="583" />
+<TGConnectingPoint num="4" id="584" />
+<TGConnectingPoint num="5" id="585" />
+<TGConnectingPoint num="6" id="586" />
+<TGConnectingPoint num="7" id="587" />
+<TGConnectingPoint num="8" id="588" />
+<TGConnectingPoint num="9" id="589" />
+</COMPONENT>
+
+<COMPONENT type="5109" id="601" >
+<cdparam x="208" y="506" />
+<sizeparam width="236" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Set timer" value="setTimer(alarmTimer,alarmDuration)" />
+<TGConnectingPoint num="0" id="591" />
+<TGConnectingPoint num="1" id="592" />
+<TGConnectingPoint num="2" id="593" />
+<TGConnectingPoint num="3" id="594" />
+<TGConnectingPoint num="4" id="595" />
+<TGConnectingPoint num="5" id="596" />
+<TGConnectingPoint num="6" id="597" />
+<TGConnectingPoint num="7" id="598" />
+<TGConnectingPoint num="8" id="599" />
+<TGConnectingPoint num="9" id="600" />
+</COMPONENT>
+
+<COMPONENT type="5110" id="612" >
+<cdparam x="265" y="449" />
+<sizeparam width="122" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Reset timer" value="reset(alarmTimer)" />
+<TGConnectingPoint num="0" id="602" />
+<TGConnectingPoint num="1" id="603" />
+<TGConnectingPoint num="2" id="604" />
+<TGConnectingPoint num="3" id="605" />
+<TGConnectingPoint num="4" id="606" />
+<TGConnectingPoint num="5" id="607" />
+<TGConnectingPoint num="6" id="608" />
+<TGConnectingPoint num="7" id="609" />
+<TGConnectingPoint num="8" id="610" />
+<TGConnectingPoint num="9" id="611" />
+</COMPONENT>
+
+<COMPONENT type="5104" id="623" >
+<cdparam x="271" y="397" />
+<sizeparam width="111" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Receive signal" value="highPressure()" />
+<TGConnectingPoint num="0" id="613" />
+<TGConnectingPoint num="1" id="614" />
+<TGConnectingPoint num="2" id="615" />
+<TGConnectingPoint num="3" id="616" />
+<TGConnectingPoint num="4" id="617" />
+<TGConnectingPoint num="5" id="618" />
+<TGConnectingPoint num="6" id="619" />
+<TGConnectingPoint num="7" id="620" />
+<TGConnectingPoint num="8" id="621" />
+<TGConnectingPoint num="9" id="622" />
+</COMPONENT>
+
+<COMPONENT type="5111" id="634" >
+<cdparam x="506" y="398" />
+<sizeparam width="137" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Reset timer" value="expire(alarmTimer)" />
+<TGConnectingPoint num="0" id="624" />
+<TGConnectingPoint num="1" id="625" />
+<TGConnectingPoint num="2" id="626" />
+<TGConnectingPoint num="3" id="627" />
+<TGConnectingPoint num="4" id="628" />
+<TGConnectingPoint num="5" id="629" />
+<TGConnectingPoint num="6" id="630" />
+<TGConnectingPoint num="7" id="631" />
+<TGConnectingPoint num="8" id="632" />
+<TGConnectingPoint num="9" id="633" />
+</COMPONENT>
+
+<COMPONENT type="5106" id="675" >
+<cdparam x="368" y="300" />
+<sizeparam width="206" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="State" value="AlarmIsOn" />
+<TGConnectingPoint num="0" id="635" />
+<TGConnectingPoint num="1" id="636" />
+<TGConnectingPoint num="2" id="637" />
+<TGConnectingPoint num="3" id="638" />
+<TGConnectingPoint num="4" id="639" />
+<TGConnectingPoint num="5" id="640" />
+<TGConnectingPoint num="6" id="641" />
+<TGConnectingPoint num="7" id="642" />
+<TGConnectingPoint num="8" id="643" />
+<TGConnectingPoint num="9" id="644" />
+<TGConnectingPoint num="10" id="645" />
+<TGConnectingPoint num="11" id="646" />
+<TGConnectingPoint num="12" id="647" />
+<TGConnectingPoint num="13" id="648" />
+<TGConnectingPoint num="14" id="649" />
+<TGConnectingPoint num="15" id="650" />
+<TGConnectingPoint num="16" id="651" />
+<TGConnectingPoint num="17" id="652" />
+<TGConnectingPoint num="18" id="653" />
+<TGConnectingPoint num="19" id="654" />
+<TGConnectingPoint num="20" id="655" />
+<TGConnectingPoint num="21" id="656" />
+<TGConnectingPoint num="22" id="657" />
+<TGConnectingPoint num="23" id="658" />
+<TGConnectingPoint num="24" id="659" />
+<TGConnectingPoint num="25" id="660" />
+<TGConnectingPoint num="26" id="661" />
+<TGConnectingPoint num="27" id="662" />
+<TGConnectingPoint num="28" id="663" />
+<TGConnectingPoint num="29" id="664" />
+<TGConnectingPoint num="30" id="665" />
+<TGConnectingPoint num="31" id="666" />
+<TGConnectingPoint num="32" id="667" />
+<TGConnectingPoint num="33" id="668" />
+<TGConnectingPoint num="34" id="669" />
+<TGConnectingPoint num="35" id="670" />
+<TGConnectingPoint num="36" id="671" />
+<TGConnectingPoint num="37" id="672" />
+<TGConnectingPoint num="38" id="673" />
+<TGConnectingPoint num="39" id="674" />
+<extraparam>
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="5109" id="686" >
+<cdparam x="353" y="215" />
+<sizeparam width="236" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Set timer" value="setTimer(alarmTimer,alarmDuration)" />
+<TGConnectingPoint num="0" id="676" />
+<TGConnectingPoint num="1" id="677" />
+<TGConnectingPoint num="2" id="678" />
+<TGConnectingPoint num="3" id="679" />
+<TGConnectingPoint num="4" id="680" />
+<TGConnectingPoint num="5" id="681" />
+<TGConnectingPoint num="6" id="682" />
+<TGConnectingPoint num="7" id="683" />
+<TGConnectingPoint num="8" id="684" />
+<TGConnectingPoint num="9" id="685" />
+</COMPONENT>
+
+<COMPONENT type="5104" id="697" >
+<cdparam x="416" y="182" />
+<sizeparam width="111" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Receive signal" value="highPressure()" />
+<TGConnectingPoint num="0" id="687" />
+<TGConnectingPoint num="1" id="688" />
+<TGConnectingPoint num="2" id="689" />
+<TGConnectingPoint num="3" id="690" />
+<TGConnectingPoint num="4" id="691" />
+<TGConnectingPoint num="5" id="692" />
+<TGConnectingPoint num="6" id="693" />
+<TGConnectingPoint num="7" id="694" />
+<TGConnectingPoint num="8" id="695" />
+<TGConnectingPoint num="9" id="696" />
+</COMPONENT>
+
+<COMPONENT type="5106" id="738" >
+<cdparam x="380" y="113" />
+<sizeparam width="183" height="41" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="State" value="AlarmIsOff" />
+<TGConnectingPoint num="0" id="698" />
+<TGConnectingPoint num="1" id="699" />
+<TGConnectingPoint num="2" id="700" />
+<TGConnectingPoint num="3" id="701" />
+<TGConnectingPoint num="4" id="702" />
+<TGConnectingPoint num="5" id="703" />
+<TGConnectingPoint num="6" id="704" />
+<TGConnectingPoint num="7" id="705" />
+<TGConnectingPoint num="8" id="706" />
+<TGConnectingPoint num="9" id="707" />
+<TGConnectingPoint num="10" id="708" />
+<TGConnectingPoint num="11" id="709" />
+<TGConnectingPoint num="12" id="710" />
+<TGConnectingPoint num="13" id="711" />
+<TGConnectingPoint num="14" id="712" />
+<TGConnectingPoint num="15" id="713" />
+<TGConnectingPoint num="16" id="714" />
+<TGConnectingPoint num="17" id="715" />
+<TGConnectingPoint num="18" id="716" />
+<TGConnectingPoint num="19" id="717" />
+<TGConnectingPoint num="20" id="718" />
+<TGConnectingPoint num="21" id="719" />
+<TGConnectingPoint num="22" id="720" />
+<TGConnectingPoint num="23" id="721" />
+<TGConnectingPoint num="24" id="722" />
+<TGConnectingPoint num="25" id="723" />
+<TGConnectingPoint num="26" id="724" />
+<TGConnectingPoint num="27" id="725" />
+<TGConnectingPoint num="28" id="726" />
+<TGConnectingPoint num="29" id="727" />
+<TGConnectingPoint num="30" id="728" />
+<TGConnectingPoint num="31" id="729" />
+<TGConnectingPoint num="32" id="730" />
+<TGConnectingPoint num="33" id="731" />
+<TGConnectingPoint num="34" id="732" />
+<TGConnectingPoint num="35" id="733" />
+<TGConnectingPoint num="36" id="734" />
+<TGConnectingPoint num="37" id="735" />
+<TGConnectingPoint num="38" id="736" />
+<TGConnectingPoint num="39" id="737" />
+<extraparam>
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="5100" id="740" >
+<cdparam x="394" y="47" />
+<sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="start state" value="null" />
+<TGConnectingPoint num="0" id="739" />
+</COMPONENT>
+
+
+</AVATARStateMachineDiagramPanel>
+
+<AVATARStateMachineDiagramPanel name="MainController" minX="10" maxX="2500" minY="10" maxY="1500" >
+<CONNECTOR type="5102" id="747" >
+<cdparam x="700" y="471" />
+<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="746" />
+<P1  x="697" y="473" id="836" />
+<P2  x="697" y="481" id="857" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="745" >
+<father id="747" num="0" />
+<cdparam x="697" y="476" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="741" />
+<TGConnectingPoint num="1" id="742" />
+<TGConnectingPoint num="2" id="743" />
+<TGConnectingPoint num="3" id="744" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="762" >
+<cdparam x="699" y="595" />
+<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="757" />
+<TGConnectingPoint num="1" id="758" />
+<TGConnectingPoint num="2" id="759" />
+<TGConnectingPoint num="3" id="760" />
+<TGConnectingPoint num="4" id="761" />
+<P1  x="697" y="595" id="847" />
+<P2  x="649" y="209" id="945" />
+<Point x="697" y="615" />
+<Point x="857" y="615" />
+<Point x="857" y="189" />
+<Point x="669" y="189" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="748" >
+<father id="762" num="0" />
+<cdparam x="697" y="615" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="749" >
+<father id="762" num="1" />
+<cdparam x="857" y="615" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="750" >
+<father id="762" num="2" />
+<cdparam x="857" y="189" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="751" >
+<father id="762" num="3" />
+<cdparam x="669" y="189" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="756" >
+<father id="762" num="4" />
+<cdparam x="674" y="402" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="752" />
+<TGConnectingPoint num="1" id="753" />
+<TGConnectingPoint num="2" id="754" />
+<TGConnectingPoint num="3" id="755" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="777" >
+<cdparam x="666" y="506" />
+<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="772" />
+<TGConnectingPoint num="1" id="773" />
+<TGConnectingPoint num="2" id="774" />
+<TGConnectingPoint num="3" id="775" />
+<TGConnectingPoint num="4" id="776" />
+<P1  x="672" y="506" id="858" />
+<P2  x="418" y="190" id="961" />
+<Point x="672" y="526" />
+<Point x="225" y="526" />
+<Point x="225" y="170" />
+<Point x="398" y="170" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="763" >
+<father id="777" num="0" />
+<cdparam x="672" y="526" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="764" >
+<father id="777" num="1" />
+<cdparam x="225" y="526" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="765" >
+<father id="777" num="2" />
+<cdparam x="225" y="170" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="766" >
+<father id="777" num="3" />
+<cdparam x="398" y="170" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="771" >
+<father id="777" num="4" />
+<cdparam x="462" y="508" />
+<sizeparam width="194" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="767" />
+<TGConnectingPoint num="1" id="768" />
+<TGConnectingPoint num="2" id="769" />
+<TGConnectingPoint num="3" id="770" />
+<extraparam>
+<guard value="[ currentPressure &lt; threshold]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="792" >
+<cdparam x="536" y="337" />
+<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="787" />
+<TGConnectingPoint num="1" id="788" />
+<TGConnectingPoint num="2" id="789" />
+<TGConnectingPoint num="3" id="790" />
+<TGConnectingPoint num="4" id="791" />
+<P1  x="536" y="337" id="915" />
+<P2  x="418" y="202" id="962" />
+<Point x="536" y="357" />
+<Point x="278" y="357" />
+<Point x="278" y="182" />
+<Point x="398" y="182" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="778" >
+<father id="792" num="0" />
+<cdparam x="536" y="357" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="779" >
+<father id="792" num="1" />
+<cdparam x="278" y="357" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="780" >
+<father id="792" num="2" />
+<cdparam x="278" y="182" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="781" >
+<father id="792" num="3" />
+<cdparam x="398" y="182" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="786" >
+<father id="792" num="4" />
+<cdparam x="328" y="345" />
+<sizeparam width="194" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="782" />
+<TGConnectingPoint num="1" id="783" />
+<TGConnectingPoint num="2" id="784" />
+<TGConnectingPoint num="3" id="785" />
+<extraparam>
+<guard value="[ currentPressure &lt; threshold]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="799" >
+<cdparam x="475" y="136" />
+<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="798" />
+<P1  x="475" y="136" id="982" />
+<P2  x="475" y="184" id="949" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="797" >
+<father id="799" num="0" />
+<cdparam x="474" y="146" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="793" />
+<TGConnectingPoint num="1" id="794" />
+<TGConnectingPoint num="2" id="795" />
+<TGConnectingPoint num="3" id="796" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="806" >
+<cdparam x="573" y="234" />
+<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="805" />
+<P1  x="561" y="234" id="971" />
+<P2  x="561" y="270" id="930" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="804" >
+<father id="806" num="0" />
+<cdparam x="566" y="247" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="800" />
+<TGConnectingPoint num="1" id="801" />
+<TGConnectingPoint num="2" id="802" />
+<TGConnectingPoint num="3" id="803" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="813" >
+<cdparam x="586" y="300" />
+<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="812" />
+<P1  x="561" y="300" id="931" />
+<P2  x="561" y="312" id="914" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="811" >
+<father id="813" num="0" />
+<cdparam x="590" y="304" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="807" />
+<TGConnectingPoint num="1" id="808" />
+<TGConnectingPoint num="2" id="809" />
+<TGConnectingPoint num="3" id="810" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="820" >
+<cdparam x="561" y="362" />
+<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="819" />
+<P1  x="561" y="362" id="920" />
+<P2  x="607" y="386" id="881" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="818" >
+<father id="820" num="0" />
+<cdparam x="600" y="349" />
+<sizeparam width="44" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="814" />
+<TGConnectingPoint num="1" id="815" />
+<TGConnectingPoint num="2" id="816" />
+<TGConnectingPoint num="3" id="817" />
+<extraparam>
+<guard value="[ else ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="827" >
+<cdparam x="694" y="456" />
+<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="826" />
+<P1  x="697" y="436" id="903" />
+<P2  x="697" y="443" id="835" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="825" >
+<father id="827" num="0" />
+<cdparam x="692" y="468" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="821" />
+<TGConnectingPoint num="1" id="822" />
+<TGConnectingPoint num="2" id="823" />
+<TGConnectingPoint num="3" id="824" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="834" >
+<cdparam x="691" y="531" />
+<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="833" />
+<P1  x="697" y="531" id="863" />
+<P2  x="697" y="565" id="846" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="832" >
+<father id="834" num="0" />
+<cdparam x="695" y="548" />
+<sizeparam width="44" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="828" />
+<TGConnectingPoint num="1" id="829" />
+<TGConnectingPoint num="2" id="830" />
+<TGConnectingPoint num="3" id="831" />
+<extraparam>
+<guard value="[ else ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<COMPONENT type="5104" id="845" >
+<cdparam x="587" y="448" />
+<sizeparam width="221" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Receive signal" value="pressureValue(currentPressure)" />
+<TGConnectingPoint num="0" id="835" />
+<TGConnectingPoint num="1" id="836" />
+<TGConnectingPoint num="2" id="837" />
+<TGConnectingPoint num="3" id="838" />
+<TGConnectingPoint num="4" id="839" />
+<TGConnectingPoint num="5" id="840" />
+<TGConnectingPoint num="6" id="841" />
+<TGConnectingPoint num="7" id="842" />
+<TGConnectingPoint num="8" id="843" />
+<TGConnectingPoint num="9" id="844" />
+</COMPONENT>
+
+<COMPONENT type="5103" id="856" >
+<cdparam x="646" y="570" />
+<sizeparam width="103" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Send signal" value="highPressure()" />
+<TGConnectingPoint num="0" id="846" />
+<TGConnectingPoint num="1" id="847" />
+<TGConnectingPoint num="2" id="848" />
+<TGConnectingPoint num="3" id="849" />
+<TGConnectingPoint num="4" id="850" />
+<TGConnectingPoint num="5" id="851" />
+<TGConnectingPoint num="6" id="852" />
+<TGConnectingPoint num="7" id="853" />
+<TGConnectingPoint num="8" id="854" />
+<TGConnectingPoint num="9" id="855" />
+</COMPONENT>
+
+<COMPONENT type="5107" id="872" >
+<cdparam x="682" y="491" />
+<sizeparam width="30" height="30" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="choice" value="null" />
+<TGConnectingPoint num="0" id="857" />
+<TGConnectingPoint num="1" id="858" />
+<TGConnectingPoint num="2" id="859" />
+<TGConnectingPoint num="3" id="860" />
+<TGConnectingPoint num="4" id="861" />
+<TGConnectingPoint num="5" id="862" />
+<TGConnectingPoint num="6" id="863" />
+<TGConnectingPoint num="7" id="864" />
+<TGConnectingPoint num="8" id="865" />
+<TGConnectingPoint num="9" id="866" />
+<TGConnectingPoint num="10" id="867" />
+<TGConnectingPoint num="11" id="868" />
+<TGConnectingPoint num="12" id="869" />
+<TGConnectingPoint num="13" id="870" />
+<TGConnectingPoint num="14" id="871" />
+</COMPONENT>
+
+<COMPONENT type="5106" id="913" >
+<cdparam x="547" y="386" />
+<sizeparam width="242" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="State" value="WaitSecondHighPressure" />
+<TGConnectingPoint num="0" id="873" />
+<TGConnectingPoint num="1" id="874" />
+<TGConnectingPoint num="2" id="875" />
+<TGConnectingPoint num="3" id="876" />
+<TGConnectingPoint num="4" id="877" />
+<TGConnectingPoint num="5" id="878" />
+<TGConnectingPoint num="6" id="879" />
+<TGConnectingPoint num="7" id="880" />
+<TGConnectingPoint num="8" id="881" />
+<TGConnectingPoint num="9" id="882" />
+<TGConnectingPoint num="10" id="883" />
+<TGConnectingPoint num="11" id="884" />
+<TGConnectingPoint num="12" id="885" />
+<TGConnectingPoint num="13" id="886" />
+<TGConnectingPoint num="14" id="887" />
+<TGConnectingPoint num="15" id="888" />
+<TGConnectingPoint num="16" id="889" />
+<TGConnectingPoint num="17" id="890" />
+<TGConnectingPoint num="18" id="891" />
+<TGConnectingPoint num="19" id="892" />
+<TGConnectingPoint num="20" id="893" />
+<TGConnectingPoint num="21" id="894" />
+<TGConnectingPoint num="22" id="895" />
+<TGConnectingPoint num="23" id="896" />
+<TGConnectingPoint num="24" id="897" />
+<TGConnectingPoint num="25" id="898" />
+<TGConnectingPoint num="26" id="899" />
+<TGConnectingPoint num="27" id="900" />
+<TGConnectingPoint num="28" id="901" />
+<TGConnectingPoint num="29" id="902" />
+<TGConnectingPoint num="30" id="903" />
+<TGConnectingPoint num="31" id="904" />
+<TGConnectingPoint num="32" id="905" />
+<TGConnectingPoint num="33" id="906" />
+<TGConnectingPoint num="34" id="907" />
+<TGConnectingPoint num="35" id="908" />
+<TGConnectingPoint num="36" id="909" />
+<TGConnectingPoint num="37" id="910" />
+<TGConnectingPoint num="38" id="911" />
+<TGConnectingPoint num="39" id="912" />
+<extraparam>
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="5107" id="929" >
+<cdparam x="546" y="322" />
+<sizeparam width="30" height="30" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="choice" value="null" />
+<TGConnectingPoint num="0" id="914" />
+<TGConnectingPoint num="1" id="915" />
+<TGConnectingPoint num="2" id="916" />
+<TGConnectingPoint num="3" id="917" />
+<TGConnectingPoint num="4" id="918" />
+<TGConnectingPoint num="5" id="919" />
+<TGConnectingPoint num="6" id="920" />
+<TGConnectingPoint num="7" id="921" />
+<TGConnectingPoint num="8" id="922" />
+<TGConnectingPoint num="9" id="923" />
+<TGConnectingPoint num="10" id="924" />
+<TGConnectingPoint num="11" id="925" />
+<TGConnectingPoint num="12" id="926" />
+<TGConnectingPoint num="13" id="927" />
+<TGConnectingPoint num="14" id="928" />
+</COMPONENT>
+
+<COMPONENT type="5104" id="940" >
+<cdparam x="451" y="275" />
+<sizeparam width="221" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Receive signal" value="pressureValue(currentPressure)" />
+<TGConnectingPoint num="0" id="930" />
+<TGConnectingPoint num="1" id="931" />
+<TGConnectingPoint num="2" id="932" />
+<TGConnectingPoint num="3" id="933" />
+<TGConnectingPoint num="4" id="934" />
+<TGConnectingPoint num="5" id="935" />
+<TGConnectingPoint num="6" id="936" />
+<TGConnectingPoint num="7" id="937" />
+<TGConnectingPoint num="8" id="938" />
+<TGConnectingPoint num="9" id="939" />
+</COMPONENT>
+
+<COMPONENT type="5106" id="981" >
+<cdparam x="418" y="184" />
+<sizeparam width="231" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="State" value="WaitFirstHighPressure" />
+<TGConnectingPoint num="0" id="941" />
+<TGConnectingPoint num="1" id="942" />
+<TGConnectingPoint num="2" id="943" />
+<TGConnectingPoint num="3" id="944" />
+<TGConnectingPoint num="4" id="945" />
+<TGConnectingPoint num="5" id="946" />
+<TGConnectingPoint num="6" id="947" />
+<TGConnectingPoint num="7" id="948" />
+<TGConnectingPoint num="8" id="949" />
+<TGConnectingPoint num="9" id="950" />
+<TGConnectingPoint num="10" id="951" />
+<TGConnectingPoint num="11" id="952" />
+<TGConnectingPoint num="12" id="953" />
+<TGConnectingPoint num="13" id="954" />
+<TGConnectingPoint num="14" id="955" />
+<TGConnectingPoint num="15" id="956" />
+<TGConnectingPoint num="16" id="957" />
+<TGConnectingPoint num="17" id="958" />
+<TGConnectingPoint num="18" id="959" />
+<TGConnectingPoint num="19" id="960" />
+<TGConnectingPoint num="20" id="961" />
+<TGConnectingPoint num="21" id="962" />
+<TGConnectingPoint num="22" id="963" />
+<TGConnectingPoint num="23" id="964" />
+<TGConnectingPoint num="24" id="965" />
+<TGConnectingPoint num="25" id="966" />
+<TGConnectingPoint num="26" id="967" />
+<TGConnectingPoint num="27" id="968" />
+<TGConnectingPoint num="28" id="969" />
+<TGConnectingPoint num="29" id="970" />
+<TGConnectingPoint num="30" id="971" />
+<TGConnectingPoint num="31" id="972" />
+<TGConnectingPoint num="32" id="973" />
+<TGConnectingPoint num="33" id="974" />
+<TGConnectingPoint num="34" id="975" />
+<TGConnectingPoint num="35" id="976" />
+<TGConnectingPoint num="36" id="977" />
+<TGConnectingPoint num="37" id="978" />
+<TGConnectingPoint num="38" id="979" />
+<TGConnectingPoint num="39" id="980" />
+<extraparam>
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="5100" id="983" >
+<cdparam x="468" y="116" />
+<sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="start state" value="null" />
+<TGConnectingPoint num="0" id="982" />
+</COMPONENT>
+
+
+</AVATARStateMachineDiagramPanel>
+
+</Modeling>
+
+
+
+
+</TURTLEGMODELING>
\ No newline at end of file
diff --git a/modeling/PressureController.ttool/project_config.xml b/modeling/PressureController.ttool/project_config.xml
new file mode 100644
index 0000000000000000000000000000000000000000..af16091e2363455364258ba7c54cec415551f2c0
--- /dev/null
+++ b/modeling/PressureController.ttool/project_config.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<PROJECTCONFIGURATION>
+<LastVCD data=""/>
+<LastOpenDiagram tab="0" panel="0"/>
+</PROJECTCONFIGURATION>
diff --git a/modeling/PressureController.xml b/modeling/PressureController.xml
new file mode 100644
index 0000000000000000000000000000000000000000..444aec44cdabdd11e8eda0f4f2dd41a9f97117c1
--- /dev/null
+++ b/modeling/PressureController.xml
@@ -0,0 +1,2565 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<TURTLEGMODELING version="1.0beta">
+
+<Modeling type="AVATAR Design" nameTab="Design" >
+<AVATARBlockDiagramPanel name="Block Diagram" minX="10" maxX="2500" minY="10" maxY="1500" zoom="1.0" >
+<MainCode value="#include &lt;sys/types.h&gt;"/>
+<MainCode value="#include &lt;sys/socket.h&gt;"/>
+<MainCode value="#include &lt;netinet/in.h&gt;"/>
+<MainCode value="#include &lt;netdb.h&gt;"/>
+<MainCode value="#include &lt;stdio.h&gt;"/>
+<MainCode value="#include &lt;strings.h&gt;"/>
+<MainCode value="#include &lt;string.h&gt;"/>
+<MainCode value="#include &lt;errno.h&gt;"/>
+<MainCode value=""/>
+<MainCode value="const char* hostname=&quot;localhost&quot;;"/>
+<MainCode value="const char* portname=&quot;8374&quot;;"/>
+<MainCode value="int fd;"/>
+<MainCode value="struct addrinfo* res;"/>
+<MainCode value=""/>
+<MainCode value="#define MAX_DGRAM_SIZE  549"/>
+<MainCode value=""/>
+<MainCode value="pthread_t thread__Datagram;"/>
+<MainCode value=""/>
+<MainCode value="// Handling pressure datagrams"/>
+<MainCode value="int pressure = 1;"/>
+<MainCode value=""/>
+<MainCode value="void pressureDatagram(char *buf) {"/>
+<MainCode value="  pressure = atoi(buf);"/>
+<MainCode value="printf(&quot;Pressure=%d\n&quot;, atoi(buf));"/>
+<MainCode value="}"/>
+<MainCode value=""/>
+<MainCode value="// Assumes fd is valid"/>
+<MainCode value="void* receiveDatagram(void *arg) {"/>
+<MainCode value="  printf(&quot;Thread receive datagram started\n&quot;);"/>
+<MainCode value=""/>
+<MainCode value="  char buffer[MAX_DGRAM_SIZE];"/>
+<MainCode value="  struct sockaddr_storage src_addr;"/>
+<MainCode value="  socklen_t src_addr_len=sizeof(src_addr);"/>
+<MainCode value=""/>
+<MainCode value="  while(1) {"/>
+<MainCode value="    printf(&quot;Waiting for datagram packet\n&quot;);"/>
+<MainCode value="    ssize_t count=recvfrom(fd,buffer,sizeof(buffer),0,(struct sockaddr*)&amp;src_addr,&amp;src_addr_len);"/>
+<MainCode value="    if (count==-1) {"/>
+<MainCode value="      perror(&quot;recv failed&quot;);"/>
+<MainCode value="    } else if (count==sizeof(buffer)) {"/>
+<MainCode value="      perror(&quot;datagram too large for buffer: truncated&quot;);"/>
+<MainCode value="    } else {"/>
+<MainCode value="      //printf(&quot;Datagram size: %d.\n&quot;, (int)(count));"/>
+<MainCode value="      if (strncmp(buffer, &quot;PRESSURE=&quot;, 9) == 0) {"/>
+<MainCode value="        printf(&quot;+++++++++++++++++++++++ PRESSURE\n&quot;);"/>
+<MainCode value="        pressureDatagram(buffer+9);"/>
+<MainCode value="      }"/>
+<MainCode value="    }"/>
+<MainCode value="  }"/>
+<MainCode value="}"/>
+<MainCode value=""/>
+<MainCode value="void sendDatagram(char * data, int size) {"/>
+<MainCode value="  printf(&quot;data=%s fd=%d size=%d\n&quot;, data, fd, size);"/>
+<MainCode value="  if (sendto(fd,data,size, 0, res-&gt;ai_addr,res-&gt;ai_addrlen)==-1) {"/>
+<MainCode value="        printf(&quot;Error when sending datagram&quot;);"/>
+<MainCode value="        exit(-1);"/>
+<MainCode value="    }"/>
+<MainCode value="}"/>
+<MainCode value=""/>
+<MainCode value="void __user_init() { "/>
+<MainCode value="  const char* content = &quot;salut&quot;;"/>
+<MainCode value="  struct addrinfo hints;"/>
+<MainCode value=""/>
+<MainCode value="  memset(&amp;hints,0,sizeof(hints));"/>
+<MainCode value="  hints.ai_family=AF_UNSPEC;"/>
+<MainCode value="  hints.ai_socktype=SOCK_DGRAM;"/>
+<MainCode value="  hints.ai_protocol=0;"/>
+<MainCode value="  hints.ai_flags=AI_ADDRCONFIG;"/>
+<MainCode value=" "/>
+<MainCode value="  int err=getaddrinfo(hostname,portname,&amp;hints,&amp;res);"/>
+<MainCode value="  if (err!=0) {"/>
+<MainCode value="    printf(&quot;failed to resolve remote socket address (err=%d)&quot;,err);"/>
+<MainCode value="    exit(-1);"/>
+<MainCode value="  }"/>
+<MainCode value="  fd=socket(res-&gt;ai_family,res-&gt;ai_socktype,res-&gt;ai_protocol);"/>
+<MainCode value="  if (fd==-1) {"/>
+<MainCode value="    printf(&quot;%s&quot;,strerror(errno));"/>
+<MainCode value="    exit(-1);"/>
+<MainCode value="  }"/>
+<MainCode value="  if (sendto(fd,content,sizeof(content),0,"/>
+<MainCode value="      res-&gt;ai_addr,res-&gt;ai_addrlen)==-1) {"/>
+<MainCode value="    printf(&quot;%s&quot;,strerror(errno));"/>
+<MainCode value="    exit(-1);"/>
+<MainCode value="  }"/>
+<MainCode value=""/>
+<MainCode value="// Start a thread to receive datagrams"/>
+<MainCode value="  pthread_create(&amp;thread__Datagram, NULL, receiveDatagram, NULL);"/>
+<MainCode value=""/>
+<MainCode value="}"/>
+<Optimized value="true" />
+<Validated value="AlarmActuator;PressureSensor;PressureController;AlarmManager;MainController;" />
+<Ignored value="" />
+
+<CONNECTOR type="5002" id="2" >
+<cdparam x="964" y="240" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<infoparam name="connector" value="" />
+<TGConnectingPoint num="0" id="1" />
+<P1  x="964" y="240" id="86" />
+<P2  x="1088" y="240" id="10" />
+<AutomaticDrawing  data="true" />
+<extraparam>
+<isd value="in alarmOff()" />
+<isd value="in alarmOn()" />
+<oso value="out alarmOff()" />
+<oso value="out alarmOn()" />
+<FIFOType asynchronous="false" size="1" blocking="false" private="true" broadcast="false" lossy="false" />
+</extraparam>
+</CONNECTOR>
+<CONNECTOR type="5002" id="4" >
+<cdparam x="659" y="240" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<infoparam name="connector" value="" />
+<TGConnectingPoint num="0" id="3" />
+<P1  x="659" y="240" id="61" />
+<P2  x="714" y="240" id="85" />
+<AutomaticDrawing  data="true" />
+<extraparam>
+<isd value="in highPressure()" />
+<oso value="out highPressure()" />
+<FIFOType asynchronous="false" size="1" blocking="false" private="true" broadcast="false" lossy="false" />
+</extraparam>
+</CONNECTOR>
+<CONNECTOR type="5002" id="6" >
+<cdparam x="297" y="232" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<infoparam name="connector" value="" />
+<TGConnectingPoint num="0" id="5" />
+<P1  x="325" y="241" id="36" />
+<P2  x="409" y="240" id="60" />
+<AutomaticDrawing  data="true" />
+<extraparam>
+<isd value="in pressureValue(int value)" />
+<oso value="out pressureValue(int value)" />
+<FIFOType asynchronous="false" size="1" blocking="false" private="true" broadcast="false" lossy="false" />
+</extraparam>
+</CONNECTOR>
+<COMPONENT type="5000" id="31" >
+<cdparam x="1088" y="140" />
+<sizeparam width="250" height="200" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Block0" value="AlarmActuator" />
+<TGConnectingPoint num="0" id="7" />
+<TGConnectingPoint num="1" id="8" />
+<TGConnectingPoint num="2" id="9" />
+<TGConnectingPoint num="3" id="10" />
+<TGConnectingPoint num="4" id="11" />
+<TGConnectingPoint num="5" id="12" />
+<TGConnectingPoint num="6" id="13" />
+<TGConnectingPoint num="7" id="14" />
+<TGConnectingPoint num="8" id="15" />
+<TGConnectingPoint num="9" id="16" />
+<TGConnectingPoint num="10" id="17" />
+<TGConnectingPoint num="11" id="18" />
+<TGConnectingPoint num="12" id="19" />
+<TGConnectingPoint num="13" id="20" />
+<TGConnectingPoint num="14" id="21" />
+<TGConnectingPoint num="15" id="22" />
+<TGConnectingPoint num="16" id="23" />
+<TGConnectingPoint num="17" id="24" />
+<TGConnectingPoint num="18" id="25" />
+<TGConnectingPoint num="19" id="26" />
+<TGConnectingPoint num="20" id="27" />
+<TGConnectingPoint num="21" id="28" />
+<TGConnectingPoint num="22" id="29" />
+<TGConnectingPoint num="23" id="30" />
+<extraparam>
+<blockType data="block" color="-4072719" />
+<CryptoBlock value="false" />
+<Method value="setAlarm(bool onoff)" />
+<Signal value="in alarmOn()" attached="true" />
+<Signal value="in alarmOff()" attached="true" />
+<globalCode value="" />
+<globalCode value="" />
+<globalCode value="void __userImplemented__AlarmActuator__setAlarm(bool att1) {" />
+<globalCode value="  if (att1) {" />
+<globalCode value="    printf(&quot;Alarm ON\n&quot;);" />
+<globalCode value="    sendDatagram(&quot;+&quot;, 1);" />
+<globalCode value="  } else {" />
+<globalCode value="    printf(&quot;Alarm OFF\n&quot;);" />
+<globalCode value="    sendDatagram(&quot;-&quot;, 1);" />
+<globalCode value="  }" />
+<globalCode value="}" />
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="5000" id="56" >
+<cdparam x="90" y="141" />
+<sizeparam width="235" height="200" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Block0" value="PressureSensor" />
+<TGConnectingPoint num="0" id="32" />
+<TGConnectingPoint num="1" id="33" />
+<TGConnectingPoint num="2" id="34" />
+<TGConnectingPoint num="3" id="35" />
+<TGConnectingPoint num="4" id="36" />
+<TGConnectingPoint num="5" id="37" />
+<TGConnectingPoint num="6" id="38" />
+<TGConnectingPoint num="7" id="39" />
+<TGConnectingPoint num="8" id="40" />
+<TGConnectingPoint num="9" id="41" />
+<TGConnectingPoint num="10" id="42" />
+<TGConnectingPoint num="11" id="43" />
+<TGConnectingPoint num="12" id="44" />
+<TGConnectingPoint num="13" id="45" />
+<TGConnectingPoint num="14" id="46" />
+<TGConnectingPoint num="15" id="47" />
+<TGConnectingPoint num="16" id="48" />
+<TGConnectingPoint num="17" id="49" />
+<TGConnectingPoint num="18" id="50" />
+<TGConnectingPoint num="19" id="51" />
+<TGConnectingPoint num="20" id="52" />
+<TGConnectingPoint num="21" id="53" />
+<TGConnectingPoint num="22" id="54" />
+<TGConnectingPoint num="23" id="55" />
+<extraparam>
+<blockType data="block" color="-4072719" />
+<CryptoBlock value="false" />
+<Attribute access="0" id="pressure" value="" type="8" typeOther="" />
+<Attribute access="0" id="branchToUse" value="false" type="4" typeOther="" />
+<Method value="$int readingPressure()" />
+<Method value="$bool isInCode()" />
+<Signal value="out pressureValue(int value)" attached="true" />
+<globalCode value="extern int pressure;" />
+<globalCode value="" />
+<globalCode value="int __userImplemented__PressureSensor__readingPressure() {" />
+<globalCode value="  return pressure;" />
+<globalCode value="}" />
+<globalCode value="" />
+<globalCode value="bool __userImplemented__PressureSensor__isInCode() {" />
+<globalCode value="  return 1;" />
+<globalCode value="}" />
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="5000" id="131" >
+<cdparam x="376" y="69" />
+<sizeparam width="605" height="338" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Block0" value="PressureController" />
+<TGConnectingPoint num="0" id="107" />
+<TGConnectingPoint num="1" id="108" />
+<TGConnectingPoint num="2" id="109" />
+<TGConnectingPoint num="3" id="110" />
+<TGConnectingPoint num="4" id="111" />
+<TGConnectingPoint num="5" id="112" />
+<TGConnectingPoint num="6" id="113" />
+<TGConnectingPoint num="7" id="114" />
+<TGConnectingPoint num="8" id="115" />
+<TGConnectingPoint num="9" id="116" />
+<TGConnectingPoint num="10" id="117" />
+<TGConnectingPoint num="11" id="118" />
+<TGConnectingPoint num="12" id="119" />
+<TGConnectingPoint num="13" id="120" />
+<TGConnectingPoint num="14" id="121" />
+<TGConnectingPoint num="15" id="122" />
+<TGConnectingPoint num="16" id="123" />
+<TGConnectingPoint num="17" id="124" />
+<TGConnectingPoint num="18" id="125" />
+<TGConnectingPoint num="19" id="126" />
+<TGConnectingPoint num="20" id="127" />
+<TGConnectingPoint num="21" id="128" />
+<TGConnectingPoint num="22" id="129" />
+<TGConnectingPoint num="23" id="130" />
+<extraparam>
+<blockType data="block" color="-4072719" />
+<CryptoBlock value="false" />
+</extraparam>
+</COMPONENT>
+<SUBCOMPONENT type="5000" id="81" >
+<father id="131" num="0" />
+<cdparam x="409" y="140" />
+<sizeparam width="250" height="200" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="0" maxX="355" minY="0" maxY="138" />
+<infoparam name="Block0" value="MainController" />
+<TGConnectingPoint num="0" id="57" />
+<TGConnectingPoint num="1" id="58" />
+<TGConnectingPoint num="2" id="59" />
+<TGConnectingPoint num="3" id="60" />
+<TGConnectingPoint num="4" id="61" />
+<TGConnectingPoint num="5" id="62" />
+<TGConnectingPoint num="6" id="63" />
+<TGConnectingPoint num="7" id="64" />
+<TGConnectingPoint num="8" id="65" />
+<TGConnectingPoint num="9" id="66" />
+<TGConnectingPoint num="10" id="67" />
+<TGConnectingPoint num="11" id="68" />
+<TGConnectingPoint num="12" id="69" />
+<TGConnectingPoint num="13" id="70" />
+<TGConnectingPoint num="14" id="71" />
+<TGConnectingPoint num="15" id="72" />
+<TGConnectingPoint num="16" id="73" />
+<TGConnectingPoint num="17" id="74" />
+<TGConnectingPoint num="18" id="75" />
+<TGConnectingPoint num="19" id="76" />
+<TGConnectingPoint num="20" id="77" />
+<TGConnectingPoint num="21" id="78" />
+<TGConnectingPoint num="22" id="79" />
+<TGConnectingPoint num="23" id="80" />
+<extraparam>
+<blockType data="block" color="-4072719" />
+<CryptoBlock value="false" />
+<Attribute access="0" id="threshold" value="20" type="8" typeOther="" />
+<Attribute access="0" id="currentPressure" value="0" type="8" typeOther="" />
+<Signal value="in pressureValue(int value)" attached="true" />
+<Signal value="out highPressure()" attached="true" />
+</extraparam>
+</SUBCOMPONENT>
+<SUBCOMPONENT type="5000" id="106" >
+<father id="131" num="1" />
+<cdparam x="714" y="140" />
+<sizeparam width="250" height="200" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="0" maxX="355" minY="0" maxY="138" />
+<infoparam name="Block0" value="AlarmManager" />
+<TGConnectingPoint num="0" id="82" />
+<TGConnectingPoint num="1" id="83" />
+<TGConnectingPoint num="2" id="84" />
+<TGConnectingPoint num="3" id="85" />
+<TGConnectingPoint num="4" id="86" />
+<TGConnectingPoint num="5" id="87" />
+<TGConnectingPoint num="6" id="88" />
+<TGConnectingPoint num="7" id="89" />
+<TGConnectingPoint num="8" id="90" />
+<TGConnectingPoint num="9" id="91" />
+<TGConnectingPoint num="10" id="92" />
+<TGConnectingPoint num="11" id="93" />
+<TGConnectingPoint num="12" id="94" />
+<TGConnectingPoint num="13" id="95" />
+<TGConnectingPoint num="14" id="96" />
+<TGConnectingPoint num="15" id="97" />
+<TGConnectingPoint num="16" id="98" />
+<TGConnectingPoint num="17" id="99" />
+<TGConnectingPoint num="18" id="100" />
+<TGConnectingPoint num="19" id="101" />
+<TGConnectingPoint num="20" id="102" />
+<TGConnectingPoint num="21" id="103" />
+<TGConnectingPoint num="22" id="104" />
+<TGConnectingPoint num="23" id="105" />
+<extraparam>
+<blockType data="block" color="-4072719" />
+<CryptoBlock value="false" />
+<Attribute access="0" id="alarmDuration" value="5" type="8" typeOther="" />
+<Attribute access="0" id="alarmTimer" value="" type="9" typeOther="" />
+<Signal value="in highPressure()" attached="true" />
+<Signal value="out alarmOff()" attached="true" />
+<Signal value="out alarmOn()" attached="true" />
+</extraparam>
+</SUBCOMPONENT>
+
+
+</AVATARBlockDiagramPanel>
+
+<AVATARStateMachineDiagramPanel name="AlarmActuator" minX="10" maxX="2500" minY="10" maxY="1500" >
+<CONNECTOR type="5102" id="146" >
+<cdparam x="582" y="231" />
+<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="141" />
+<TGConnectingPoint num="1" id="142" />
+<TGConnectingPoint num="2" id="143" />
+<TGConnectingPoint num="3" id="144" />
+<TGConnectingPoint num="4" id="145" />
+<P1  x="578" y="231" id="184" />
+<P2  x="610" y="133" id="209" />
+<Point x="578" y="251" />
+<Point x="658" y="251" />
+<Point x="658" y="113" />
+<Point x="630" y="113" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="132" >
+<father id="146" num="0" />
+<cdparam x="578" y="251" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="133" >
+<father id="146" num="1" />
+<cdparam x="658" y="251" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="134" >
+<father id="146" num="2" />
+<cdparam x="658" y="113" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="135" >
+<father id="146" num="3" />
+<cdparam x="630" y="113" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="140" >
+<father id="146" num="4" />
+<cdparam x="666" y="183" />
+<sizeparam width="99" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="136" />
+<TGConnectingPoint num="1" id="137" />
+<TGConnectingPoint num="2" id="138" />
+<TGConnectingPoint num="3" id="139" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+<actions value="setAlarm(false) " enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="161" >
+<cdparam x="363" y="233" />
+<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="156" />
+<TGConnectingPoint num="1" id="157" />
+<TGConnectingPoint num="2" id="158" />
+<TGConnectingPoint num="3" id="159" />
+<TGConnectingPoint num="4" id="160" />
+<P1  x="363" y="233" id="195" />
+<P2  x="368" y="139" id="229" />
+<Point x="363" y="253" />
+<Point x="277" y="253" />
+<Point x="277" y="119" />
+<Point x="348" y="119" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="147" >
+<father id="161" num="0" />
+<cdparam x="363" y="253" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="148" >
+<father id="161" num="1" />
+<cdparam x="277" y="253" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="149" >
+<father id="161" num="2" />
+<cdparam x="277" y="119" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="150" >
+<father id="161" num="3" />
+<cdparam x="348" y="119" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="155" >
+<father id="161" num="4" />
+<cdparam x="170" y="206" />
+<sizeparam width="95" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="151" />
+<TGConnectingPoint num="1" id="152" />
+<TGConnectingPoint num="2" id="153" />
+<TGConnectingPoint num="3" id="154" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+<actions value="setAlarm(true) " enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="168" >
+<cdparam x="407" y="70" />
+<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="167" />
+<P1  x="407" y="70" id="246" />
+<P2  x="457" y="108" id="222" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="166" >
+<father id="168" num="0" />
+<cdparam x="406" y="89" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="162" />
+<TGConnectingPoint num="1" id="163" />
+<TGConnectingPoint num="2" id="164" />
+<TGConnectingPoint num="3" id="165" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="175" >
+<cdparam x="397" y="158" />
+<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="174" />
+<P1  x="397" y="158" id="233" />
+<P2  x="363" y="203" id="194" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="173" >
+<father id="175" num="0" />
+<cdparam x="403" y="179" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="169" />
+<TGConnectingPoint num="1" id="170" />
+<TGConnectingPoint num="2" id="171" />
+<TGConnectingPoint num="3" id="172" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="182" >
+<cdparam x="578" y="158" />
+<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="181" />
+<P1  x="578" y="158" id="236" />
+<P2  x="578" y="201" id="183" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="180" >
+<father id="182" num="0" />
+<cdparam x="580" y="179" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="176" />
+<TGConnectingPoint num="1" id="177" />
+<TGConnectingPoint num="2" id="178" />
+<TGConnectingPoint num="3" id="179" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<COMPONENT type="5104" id="193" >
+<cdparam x="538" y="206" />
+<sizeparam width="80" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Receive signal" value="alarmOff()" />
+<TGConnectingPoint num="0" id="183" />
+<TGConnectingPoint num="1" id="184" />
+<TGConnectingPoint num="2" id="185" />
+<TGConnectingPoint num="3" id="186" />
+<TGConnectingPoint num="4" id="187" />
+<TGConnectingPoint num="5" id="188" />
+<TGConnectingPoint num="6" id="189" />
+<TGConnectingPoint num="7" id="190" />
+<TGConnectingPoint num="8" id="191" />
+<TGConnectingPoint num="9" id="192" />
+</COMPONENT>
+
+<COMPONENT type="5104" id="204" >
+<cdparam x="323" y="208" />
+<sizeparam width="80" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Receive signal" value="alarmOn()" />
+<TGConnectingPoint num="0" id="194" />
+<TGConnectingPoint num="1" id="195" />
+<TGConnectingPoint num="2" id="196" />
+<TGConnectingPoint num="3" id="197" />
+<TGConnectingPoint num="4" id="198" />
+<TGConnectingPoint num="5" id="199" />
+<TGConnectingPoint num="6" id="200" />
+<TGConnectingPoint num="7" id="201" />
+<TGConnectingPoint num="8" id="202" />
+<TGConnectingPoint num="9" id="203" />
+</COMPONENT>
+
+<COMPONENT type="5106" id="245" >
+<cdparam x="368" y="108" />
+<sizeparam width="242" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="State" value="WaitingForAlarmCommand" />
+<TGConnectingPoint num="0" id="205" />
+<TGConnectingPoint num="1" id="206" />
+<TGConnectingPoint num="2" id="207" />
+<TGConnectingPoint num="3" id="208" />
+<TGConnectingPoint num="4" id="209" />
+<TGConnectingPoint num="5" id="210" />
+<TGConnectingPoint num="6" id="211" />
+<TGConnectingPoint num="7" id="212" />
+<TGConnectingPoint num="8" id="213" />
+<TGConnectingPoint num="9" id="214" />
+<TGConnectingPoint num="10" id="215" />
+<TGConnectingPoint num="11" id="216" />
+<TGConnectingPoint num="12" id="217" />
+<TGConnectingPoint num="13" id="218" />
+<TGConnectingPoint num="14" id="219" />
+<TGConnectingPoint num="15" id="220" />
+<TGConnectingPoint num="16" id="221" />
+<TGConnectingPoint num="17" id="222" />
+<TGConnectingPoint num="18" id="223" />
+<TGConnectingPoint num="19" id="224" />
+<TGConnectingPoint num="20" id="225" />
+<TGConnectingPoint num="21" id="226" />
+<TGConnectingPoint num="22" id="227" />
+<TGConnectingPoint num="23" id="228" />
+<TGConnectingPoint num="24" id="229" />
+<TGConnectingPoint num="25" id="230" />
+<TGConnectingPoint num="26" id="231" />
+<TGConnectingPoint num="27" id="232" />
+<TGConnectingPoint num="28" id="233" />
+<TGConnectingPoint num="29" id="234" />
+<TGConnectingPoint num="30" id="235" />
+<TGConnectingPoint num="31" id="236" />
+<TGConnectingPoint num="32" id="237" />
+<TGConnectingPoint num="33" id="238" />
+<TGConnectingPoint num="34" id="239" />
+<TGConnectingPoint num="35" id="240" />
+<TGConnectingPoint num="36" id="241" />
+<TGConnectingPoint num="37" id="242" />
+<TGConnectingPoint num="38" id="243" />
+<TGConnectingPoint num="39" id="244" />
+<extraparam>
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="5100" id="247" >
+<cdparam x="400" y="50" />
+<sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="start state" value="null" />
+<TGConnectingPoint num="0" id="246" />
+</COMPONENT>
+
+
+</AVATARStateMachineDiagramPanel>
+
+<AVATARStateMachineDiagramPanel name="PressureSensor" minX="10" maxX="2500" minY="10" maxY="1500" >
+<CONNECTOR type="5102" id="254" >
+<cdparam x="534" y="553" />
+<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="253" />
+<P1  x="547" y="553" id="318" />
+<P2  x="547" y="573" id="372" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="252" >
+<father id="254" num="0" />
+<cdparam x="534" y="563" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="248" />
+<TGConnectingPoint num="1" id="249" />
+<TGConnectingPoint num="2" id="250" />
+<TGConnectingPoint num="3" id="251" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="261" >
+<cdparam x="624" y="474" />
+<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="260" />
+<P1  x="624" y="474" id="370" />
+<P2  x="567" y="503" id="330" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="259" >
+<father id="261" num="0" />
+<cdparam x="603" y="490" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="255" />
+<TGConnectingPoint num="1" id="256" />
+<TGConnectingPoint num="2" id="257" />
+<TGConnectingPoint num="3" id="258" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="268" >
+<cdparam x="531" y="340" />
+<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="267" />
+<P1  x="556" y="401" id="355" />
+<P2  x="624" y="444" id="369" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="266" >
+<father id="268" num="0" />
+<cdparam x="581" y="397" />
+<sizeparam width="44" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="262" />
+<TGConnectingPoint num="1" id="263" />
+<TGConnectingPoint num="2" id="264" />
+<TGConnectingPoint num="3" id="265" />
+<extraparam>
+<guard value="[ else ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="283" >
+<cdparam x="551" y="444" />
+<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="278" />
+<TGConnectingPoint num="1" id="279" />
+<TGConnectingPoint num="2" id="280" />
+<TGConnectingPoint num="3" id="281" />
+<TGConnectingPoint num="4" id="282" />
+<P1  x="547" y="603" id="373" />
+<P2  x="532" y="185" id="406" />
+<Point x="547" y="623" />
+<Point x="755" y="623" />
+<Point x="755" y="165" />
+<Point x="552" y="165" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="269" >
+<father id="283" num="0" />
+<cdparam x="547" y="623" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="270" >
+<father id="283" num="1" />
+<cdparam x="755" y="623" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="271" >
+<father id="283" num="2" />
+<cdparam x="755" y="165" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="272" >
+<father id="283" num="3" />
+<cdparam x="552" y="165" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="277" >
+<father id="283" num="4" />
+<cdparam x="551" y="314" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="273" />
+<TGConnectingPoint num="1" id="274" />
+<TGConnectingPoint num="2" id="275" />
+<TGConnectingPoint num="3" id="276" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="290" >
+<cdparam x="440" y="144" />
+<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="289" />
+<P1  x="323" y="133" id="465" />
+<P2  x="323" y="167" id="383" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="288" >
+<father id="290" num="0" />
+<cdparam x="446" y="169" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="284" />
+<TGConnectingPoint num="1" id="285" />
+<TGConnectingPoint num="2" id="286" />
+<TGConnectingPoint num="3" id="287" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="297" >
+<cdparam x="502" y="244" />
+<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="296" />
+<P1  x="427" y="217" id="389" />
+<P2  x="510" y="290" id="441" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="295" >
+<father id="297" num="0" />
+<cdparam x="498" y="267" />
+<sizeparam width="68" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="291" />
+<TGConnectingPoint num="1" id="292" />
+<TGConnectingPoint num="2" id="293" />
+<TGConnectingPoint num="3" id="294" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="1" enabled="true"/>
+<afterMax value="1" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="304" >
+<cdparam x="560" y="479" />
+<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="303" />
+<P1  x="506" y="401" id="354" />
+<P2  x="506" y="503" id="320" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="302" >
+<father id="304" num="0" />
+<cdparam x="303" y="451" />
+<sizeparam width="192" height="30" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="298" />
+<TGConnectingPoint num="1" id="299" />
+<TGConnectingPoint num="2" id="300" />
+<TGConnectingPoint num="3" id="301" />
+<extraparam>
+<guard value="[ branchToUse ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+<actions value="pressure = readingPressure() " enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="311" >
+<cdparam x="468" y="340" />
+<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="310" />
+<P1  x="531" y="340" id="430" />
+<P2  x="531" y="376" id="353" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="309" >
+<father id="311" num="0" />
+<cdparam x="351" y="370" />
+<sizeparam width="168" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="305" />
+<TGConnectingPoint num="1" id="306" />
+<TGConnectingPoint num="2" id="307" />
+<TGConnectingPoint num="3" id="308" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+<actions value="branchToUse = isInCode() " enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<COMPONENT type="5106" id="352" >
+<cdparam x="465" y="503" />
+<sizeparam width="165" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="State" value="SendingPressure" />
+<TGConnectingPoint num="0" id="312" />
+<TGConnectingPoint num="1" id="313" />
+<TGConnectingPoint num="2" id="314" />
+<TGConnectingPoint num="3" id="315" />
+<TGConnectingPoint num="4" id="316" />
+<TGConnectingPoint num="5" id="317" />
+<TGConnectingPoint num="6" id="318" />
+<TGConnectingPoint num="7" id="319" />
+<TGConnectingPoint num="8" id="320" />
+<TGConnectingPoint num="9" id="321" />
+<TGConnectingPoint num="10" id="322" />
+<TGConnectingPoint num="11" id="323" />
+<TGConnectingPoint num="12" id="324" />
+<TGConnectingPoint num="13" id="325" />
+<TGConnectingPoint num="14" id="326" />
+<TGConnectingPoint num="15" id="327" />
+<TGConnectingPoint num="16" id="328" />
+<TGConnectingPoint num="17" id="329" />
+<TGConnectingPoint num="18" id="330" />
+<TGConnectingPoint num="19" id="331" />
+<TGConnectingPoint num="20" id="332" />
+<TGConnectingPoint num="21" id="333" />
+<TGConnectingPoint num="22" id="334" />
+<TGConnectingPoint num="23" id="335" />
+<TGConnectingPoint num="24" id="336" />
+<TGConnectingPoint num="25" id="337" />
+<TGConnectingPoint num="26" id="338" />
+<TGConnectingPoint num="27" id="339" />
+<TGConnectingPoint num="28" id="340" />
+<TGConnectingPoint num="29" id="341" />
+<TGConnectingPoint num="30" id="342" />
+<TGConnectingPoint num="31" id="343" />
+<TGConnectingPoint num="32" id="344" />
+<TGConnectingPoint num="33" id="345" />
+<TGConnectingPoint num="34" id="346" />
+<TGConnectingPoint num="35" id="347" />
+<TGConnectingPoint num="36" id="348" />
+<TGConnectingPoint num="37" id="349" />
+<TGConnectingPoint num="38" id="350" />
+<TGConnectingPoint num="39" id="351" />
+<extraparam>
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="5107" id="368" >
+<cdparam x="516" y="386" />
+<sizeparam width="30" height="30" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="choice" value="null" />
+<TGConnectingPoint num="0" id="353" />
+<TGConnectingPoint num="1" id="354" />
+<TGConnectingPoint num="2" id="355" />
+<TGConnectingPoint num="3" id="356" />
+<TGConnectingPoint num="4" id="357" />
+<TGConnectingPoint num="5" id="358" />
+<TGConnectingPoint num="6" id="359" />
+<TGConnectingPoint num="7" id="360" />
+<TGConnectingPoint num="8" id="361" />
+<TGConnectingPoint num="9" id="362" />
+<TGConnectingPoint num="10" id="363" />
+<TGConnectingPoint num="11" id="364" />
+<TGConnectingPoint num="12" id="365" />
+<TGConnectingPoint num="13" id="366" />
+<TGConnectingPoint num="14" id="367" />
+</COMPONENT>
+
+<COMPONENT type="5108" id="371" >
+<cdparam x="527" y="449" />
+<sizeparam width="195" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="TGComponent" value="null" />
+<TGConnectingPoint num="0" id="369" />
+<TGConnectingPoint num="1" id="370" />
+<extraparam>
+<Data variable="pressure" minValue="19" maxValue="21" functionId="0" />
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="5103" id="382" >
+<cdparam x="464" y="578" />
+<sizeparam width="167" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Send signal" value="pressureValue(pressure)" />
+<TGConnectingPoint num="0" id="372" />
+<TGConnectingPoint num="1" id="373" />
+<TGConnectingPoint num="2" id="374" />
+<TGConnectingPoint num="3" id="375" />
+<TGConnectingPoint num="4" id="376" />
+<TGConnectingPoint num="5" id="377" />
+<TGConnectingPoint num="6" id="378" />
+<TGConnectingPoint num="7" id="379" />
+<TGConnectingPoint num="8" id="380" />
+<TGConnectingPoint num="9" id="381" />
+</COMPONENT>
+
+<COMPONENT type="5106" id="423" >
+<cdparam x="323" y="167" />
+<sizeparam width="209" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="State" value="WaitingForNextCycle" />
+<TGConnectingPoint num="0" id="383" />
+<TGConnectingPoint num="1" id="384" />
+<TGConnectingPoint num="2" id="385" />
+<TGConnectingPoint num="3" id="386" />
+<TGConnectingPoint num="4" id="387" />
+<TGConnectingPoint num="5" id="388" />
+<TGConnectingPoint num="6" id="389" />
+<TGConnectingPoint num="7" id="390" />
+<TGConnectingPoint num="8" id="391" />
+<TGConnectingPoint num="9" id="392" />
+<TGConnectingPoint num="10" id="393" />
+<TGConnectingPoint num="11" id="394" />
+<TGConnectingPoint num="12" id="395" />
+<TGConnectingPoint num="13" id="396" />
+<TGConnectingPoint num="14" id="397" />
+<TGConnectingPoint num="15" id="398" />
+<TGConnectingPoint num="16" id="399" />
+<TGConnectingPoint num="17" id="400" />
+<TGConnectingPoint num="18" id="401" />
+<TGConnectingPoint num="19" id="402" />
+<TGConnectingPoint num="20" id="403" />
+<TGConnectingPoint num="21" id="404" />
+<TGConnectingPoint num="22" id="405" />
+<TGConnectingPoint num="23" id="406" />
+<TGConnectingPoint num="24" id="407" />
+<TGConnectingPoint num="25" id="408" />
+<TGConnectingPoint num="26" id="409" />
+<TGConnectingPoint num="27" id="410" />
+<TGConnectingPoint num="28" id="411" />
+<TGConnectingPoint num="29" id="412" />
+<TGConnectingPoint num="30" id="413" />
+<TGConnectingPoint num="31" id="414" />
+<TGConnectingPoint num="32" id="415" />
+<TGConnectingPoint num="33" id="416" />
+<TGConnectingPoint num="34" id="417" />
+<TGConnectingPoint num="35" id="418" />
+<TGConnectingPoint num="36" id="419" />
+<TGConnectingPoint num="37" id="420" />
+<TGConnectingPoint num="38" id="421" />
+<TGConnectingPoint num="39" id="422" />
+<extraparam>
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="5106" id="464" >
+<cdparam x="449" y="290" />
+<sizeparam width="165" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="State" value="SensingPressure" />
+<TGConnectingPoint num="0" id="424" />
+<TGConnectingPoint num="1" id="425" />
+<TGConnectingPoint num="2" id="426" />
+<TGConnectingPoint num="3" id="427" />
+<TGConnectingPoint num="4" id="428" />
+<TGConnectingPoint num="5" id="429" />
+<TGConnectingPoint num="6" id="430" />
+<TGConnectingPoint num="7" id="431" />
+<TGConnectingPoint num="8" id="432" />
+<TGConnectingPoint num="9" id="433" />
+<TGConnectingPoint num="10" id="434" />
+<TGConnectingPoint num="11" id="435" />
+<TGConnectingPoint num="12" id="436" />
+<TGConnectingPoint num="13" id="437" />
+<TGConnectingPoint num="14" id="438" />
+<TGConnectingPoint num="15" id="439" />
+<TGConnectingPoint num="16" id="440" />
+<TGConnectingPoint num="17" id="441" />
+<TGConnectingPoint num="18" id="442" />
+<TGConnectingPoint num="19" id="443" />
+<TGConnectingPoint num="20" id="444" />
+<TGConnectingPoint num="21" id="445" />
+<TGConnectingPoint num="22" id="446" />
+<TGConnectingPoint num="23" id="447" />
+<TGConnectingPoint num="24" id="448" />
+<TGConnectingPoint num="25" id="449" />
+<TGConnectingPoint num="26" id="450" />
+<TGConnectingPoint num="27" id="451" />
+<TGConnectingPoint num="28" id="452" />
+<TGConnectingPoint num="29" id="453" />
+<TGConnectingPoint num="30" id="454" />
+<TGConnectingPoint num="31" id="455" />
+<TGConnectingPoint num="32" id="456" />
+<TGConnectingPoint num="33" id="457" />
+<TGConnectingPoint num="34" id="458" />
+<TGConnectingPoint num="35" id="459" />
+<TGConnectingPoint num="36" id="460" />
+<TGConnectingPoint num="37" id="461" />
+<TGConnectingPoint num="38" id="462" />
+<TGConnectingPoint num="39" id="463" />
+<extraparam>
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="5100" id="466" >
+<cdparam x="316" y="113" />
+<sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="start state" value="null" />
+<TGConnectingPoint num="0" id="465" />
+</COMPONENT>
+
+
+</AVATARStateMachineDiagramPanel>
+
+<AVATARStateMachineDiagramPanel name="PressureController" minX="10" maxX="2500" minY="10" maxY="1500" >
+<COMPONENT type="5100" id="468" >
+<cdparam x="400" y="50" />
+<sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="start state" value="null" />
+<TGConnectingPoint num="0" id="467" />
+</COMPONENT>
+
+
+</AVATARStateMachineDiagramPanel>
+
+<AVATARStateMachineDiagramPanel name="AlarmManager" minX="10" maxX="2500" minY="10" maxY="1500" >
+<CONNECTOR type="5102" id="475" >
+<cdparam x="574" y="423" />
+<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="474" />
+<P1  x="574" y="423" id="625" />
+<P2  x="574" y="472" id="580" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="473" >
+<father id="475" num="0" />
+<cdparam x="577" y="447" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="469" />
+<TGConnectingPoint num="1" id="470" />
+<TGConnectingPoint num="2" id="471" />
+<TGConnectingPoint num="3" id="472" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="490" >
+<cdparam x="327" y="531" />
+<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="485" />
+<TGConnectingPoint num="1" id="486" />
+<TGConnectingPoint num="2" id="487" />
+<TGConnectingPoint num="3" id="488" />
+<TGConnectingPoint num="4" id="489" />
+<P1  x="326" y="531" id="592" />
+<P2  x="368" y="318" id="656" />
+<Point x="326" y="551" />
+<Point x="178" y="551" />
+<Point x="178" y="298" />
+<Point x="348" y="298" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="476" >
+<father id="490" num="0" />
+<cdparam x="326" y="551" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="477" >
+<father id="490" num="1" />
+<cdparam x="178" y="551" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="478" >
+<father id="490" num="2" />
+<cdparam x="178" y="298" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="479" >
+<father id="490" num="3" />
+<cdparam x="348" y="298" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="484" >
+<father id="490" num="4" />
+<cdparam x="347" y="424" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="480" />
+<TGConnectingPoint num="1" id="481" />
+<TGConnectingPoint num="2" id="482" />
+<TGConnectingPoint num="3" id="483" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="505" >
+<cdparam x="590" y="423" />
+<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="500" />
+<TGConnectingPoint num="1" id="501" />
+<TGConnectingPoint num="2" id="502" />
+<TGConnectingPoint num="3" id="503" />
+<TGConnectingPoint num="4" id="504" />
+<P1  x="574" y="502" id="581" />
+<P2  x="563" y="133" id="702" />
+<Point x="574" y="522" />
+<Point x="726" y="522" />
+<Point x="726" y="113" />
+<Point x="583" y="113" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="491" >
+<father id="505" num="0" />
+<cdparam x="574" y="522" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="492" >
+<father id="505" num="1" />
+<cdparam x="726" y="522" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="493" >
+<father id="505" num="2" />
+<cdparam x="726" y="113" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="494" >
+<father id="505" num="3" />
+<cdparam x="583" y="113" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="499" >
+<father id="505" num="4" />
+<cdparam x="576" y="278" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="495" />
+<TGConnectingPoint num="1" id="496" />
+<TGConnectingPoint num="2" id="497" />
+<TGConnectingPoint num="3" id="498" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="512" >
+<cdparam x="407" y="70" />
+<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="511" />
+<P1  x="401" y="67" id="739" />
+<P2  x="401" y="113" id="714" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="510" >
+<father id="512" num="0" />
+<cdparam x="411" y="91" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="506" />
+<TGConnectingPoint num="1" id="507" />
+<TGConnectingPoint num="2" id="508" />
+<TGConnectingPoint num="3" id="509" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="519" >
+<cdparam x="425" y="154" />
+<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="518" />
+<P1  x="471" y="154" id="704" />
+<P2  x="471" y="177" id="687" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="517" >
+<father id="519" num="0" />
+<cdparam x="423" y="179" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="513" />
+<TGConnectingPoint num="1" id="514" />
+<TGConnectingPoint num="2" id="515" />
+<TGConnectingPoint num="3" id="516" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="526" >
+<cdparam x="400" y="252" />
+<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="525" />
+<P1  x="471" y="207" id="688" />
+<P2  x="471" y="210" id="676" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="524" >
+<father id="526" num="0" />
+<cdparam x="400" y="265" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="520" />
+<TGConnectingPoint num="1" id="521" />
+<TGConnectingPoint num="2" id="522" />
+<TGConnectingPoint num="3" id="523" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="533" >
+<cdparam x="574" y="350" />
+<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="532" />
+<P1  x="574" y="350" id="642" />
+<P2  x="574" y="393" id="624" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="531" >
+<father id="533" num="0" />
+<cdparam x="574" y="364" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="527" />
+<TGConnectingPoint num="1" id="528" />
+<TGConnectingPoint num="2" id="529" />
+<TGConnectingPoint num="3" id="530" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="540" >
+<cdparam x="368" y="350" />
+<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="539" />
+<P1  x="368" y="350" id="640" />
+<P2  x="326" y="392" id="613" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="538" >
+<father id="540" num="0" />
+<cdparam x="371" y="375" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="534" />
+<TGConnectingPoint num="1" id="535" />
+<TGConnectingPoint num="2" id="536" />
+<TGConnectingPoint num="3" id="537" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="547" >
+<cdparam x="326" y="422" />
+<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="546" />
+<P1  x="326" y="422" id="614" />
+<P2  x="326" y="444" id="602" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="545" >
+<father id="547" num="0" />
+<cdparam x="329" y="430" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="541" />
+<TGConnectingPoint num="1" id="542" />
+<TGConnectingPoint num="2" id="543" />
+<TGConnectingPoint num="3" id="544" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="554" >
+<cdparam x="326" y="474" />
+<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="553" />
+<P1  x="326" y="474" id="603" />
+<P2  x="326" y="501" id="591" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="552" >
+<father id="554" num="0" />
+<cdparam x="326" y="487" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="548" />
+<TGConnectingPoint num="1" id="549" />
+<TGConnectingPoint num="2" id="550" />
+<TGConnectingPoint num="3" id="551" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="561" >
+<cdparam x="471" y="240" />
+<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="560" />
+<P1  x="471" y="240" id="677" />
+<P2  x="471" y="252" id="569" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="559" >
+<father id="561" num="0" />
+<cdparam x="474" y="246" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="555" />
+<TGConnectingPoint num="1" id="556" />
+<TGConnectingPoint num="2" id="557" />
+<TGConnectingPoint num="3" id="558" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="568" >
+<cdparam x="478" y="282" />
+<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="567" />
+<P1  x="471" y="282" id="570" />
+<P2  x="471" y="300" id="636" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="566" >
+<father id="568" num="0" />
+<cdparam x="474" y="291" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="562" />
+<TGConnectingPoint num="1" id="563" />
+<TGConnectingPoint num="2" id="564" />
+<TGConnectingPoint num="3" id="565" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<COMPONENT type="5103" id="579" >
+<cdparam x="435" y="257" />
+<sizeparam width="72" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Send signal" value="alarmOn()" />
+<TGConnectingPoint num="0" id="569" />
+<TGConnectingPoint num="1" id="570" />
+<TGConnectingPoint num="2" id="571" />
+<TGConnectingPoint num="3" id="572" />
+<TGConnectingPoint num="4" id="573" />
+<TGConnectingPoint num="5" id="574" />
+<TGConnectingPoint num="6" id="575" />
+<TGConnectingPoint num="7" id="576" />
+<TGConnectingPoint num="8" id="577" />
+<TGConnectingPoint num="9" id="578" />
+</COMPONENT>
+
+<COMPONENT type="5103" id="590" >
+<cdparam x="538" y="477" />
+<sizeparam width="72" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Send signal" value="alarmOff()" />
+<TGConnectingPoint num="0" id="580" />
+<TGConnectingPoint num="1" id="581" />
+<TGConnectingPoint num="2" id="582" />
+<TGConnectingPoint num="3" id="583" />
+<TGConnectingPoint num="4" id="584" />
+<TGConnectingPoint num="5" id="585" />
+<TGConnectingPoint num="6" id="586" />
+<TGConnectingPoint num="7" id="587" />
+<TGConnectingPoint num="8" id="588" />
+<TGConnectingPoint num="9" id="589" />
+</COMPONENT>
+
+<COMPONENT type="5109" id="601" >
+<cdparam x="208" y="506" />
+<sizeparam width="236" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Set timer" value="setTimer(alarmTimer,alarmDuration)" />
+<TGConnectingPoint num="0" id="591" />
+<TGConnectingPoint num="1" id="592" />
+<TGConnectingPoint num="2" id="593" />
+<TGConnectingPoint num="3" id="594" />
+<TGConnectingPoint num="4" id="595" />
+<TGConnectingPoint num="5" id="596" />
+<TGConnectingPoint num="6" id="597" />
+<TGConnectingPoint num="7" id="598" />
+<TGConnectingPoint num="8" id="599" />
+<TGConnectingPoint num="9" id="600" />
+</COMPONENT>
+
+<COMPONENT type="5110" id="612" >
+<cdparam x="265" y="449" />
+<sizeparam width="122" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Reset timer" value="reset(alarmTimer)" />
+<TGConnectingPoint num="0" id="602" />
+<TGConnectingPoint num="1" id="603" />
+<TGConnectingPoint num="2" id="604" />
+<TGConnectingPoint num="3" id="605" />
+<TGConnectingPoint num="4" id="606" />
+<TGConnectingPoint num="5" id="607" />
+<TGConnectingPoint num="6" id="608" />
+<TGConnectingPoint num="7" id="609" />
+<TGConnectingPoint num="8" id="610" />
+<TGConnectingPoint num="9" id="611" />
+</COMPONENT>
+
+<COMPONENT type="5104" id="623" >
+<cdparam x="271" y="397" />
+<sizeparam width="111" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Receive signal" value="highPressure()" />
+<TGConnectingPoint num="0" id="613" />
+<TGConnectingPoint num="1" id="614" />
+<TGConnectingPoint num="2" id="615" />
+<TGConnectingPoint num="3" id="616" />
+<TGConnectingPoint num="4" id="617" />
+<TGConnectingPoint num="5" id="618" />
+<TGConnectingPoint num="6" id="619" />
+<TGConnectingPoint num="7" id="620" />
+<TGConnectingPoint num="8" id="621" />
+<TGConnectingPoint num="9" id="622" />
+</COMPONENT>
+
+<COMPONENT type="5111" id="634" >
+<cdparam x="506" y="398" />
+<sizeparam width="137" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Reset timer" value="expire(alarmTimer)" />
+<TGConnectingPoint num="0" id="624" />
+<TGConnectingPoint num="1" id="625" />
+<TGConnectingPoint num="2" id="626" />
+<TGConnectingPoint num="3" id="627" />
+<TGConnectingPoint num="4" id="628" />
+<TGConnectingPoint num="5" id="629" />
+<TGConnectingPoint num="6" id="630" />
+<TGConnectingPoint num="7" id="631" />
+<TGConnectingPoint num="8" id="632" />
+<TGConnectingPoint num="9" id="633" />
+</COMPONENT>
+
+<COMPONENT type="5106" id="675" >
+<cdparam x="368" y="300" />
+<sizeparam width="206" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="State" value="AlarmIsOn" />
+<TGConnectingPoint num="0" id="635" />
+<TGConnectingPoint num="1" id="636" />
+<TGConnectingPoint num="2" id="637" />
+<TGConnectingPoint num="3" id="638" />
+<TGConnectingPoint num="4" id="639" />
+<TGConnectingPoint num="5" id="640" />
+<TGConnectingPoint num="6" id="641" />
+<TGConnectingPoint num="7" id="642" />
+<TGConnectingPoint num="8" id="643" />
+<TGConnectingPoint num="9" id="644" />
+<TGConnectingPoint num="10" id="645" />
+<TGConnectingPoint num="11" id="646" />
+<TGConnectingPoint num="12" id="647" />
+<TGConnectingPoint num="13" id="648" />
+<TGConnectingPoint num="14" id="649" />
+<TGConnectingPoint num="15" id="650" />
+<TGConnectingPoint num="16" id="651" />
+<TGConnectingPoint num="17" id="652" />
+<TGConnectingPoint num="18" id="653" />
+<TGConnectingPoint num="19" id="654" />
+<TGConnectingPoint num="20" id="655" />
+<TGConnectingPoint num="21" id="656" />
+<TGConnectingPoint num="22" id="657" />
+<TGConnectingPoint num="23" id="658" />
+<TGConnectingPoint num="24" id="659" />
+<TGConnectingPoint num="25" id="660" />
+<TGConnectingPoint num="26" id="661" />
+<TGConnectingPoint num="27" id="662" />
+<TGConnectingPoint num="28" id="663" />
+<TGConnectingPoint num="29" id="664" />
+<TGConnectingPoint num="30" id="665" />
+<TGConnectingPoint num="31" id="666" />
+<TGConnectingPoint num="32" id="667" />
+<TGConnectingPoint num="33" id="668" />
+<TGConnectingPoint num="34" id="669" />
+<TGConnectingPoint num="35" id="670" />
+<TGConnectingPoint num="36" id="671" />
+<TGConnectingPoint num="37" id="672" />
+<TGConnectingPoint num="38" id="673" />
+<TGConnectingPoint num="39" id="674" />
+<extraparam>
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="5109" id="686" >
+<cdparam x="353" y="215" />
+<sizeparam width="236" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Set timer" value="setTimer(alarmTimer,alarmDuration)" />
+<TGConnectingPoint num="0" id="676" />
+<TGConnectingPoint num="1" id="677" />
+<TGConnectingPoint num="2" id="678" />
+<TGConnectingPoint num="3" id="679" />
+<TGConnectingPoint num="4" id="680" />
+<TGConnectingPoint num="5" id="681" />
+<TGConnectingPoint num="6" id="682" />
+<TGConnectingPoint num="7" id="683" />
+<TGConnectingPoint num="8" id="684" />
+<TGConnectingPoint num="9" id="685" />
+</COMPONENT>
+
+<COMPONENT type="5104" id="697" >
+<cdparam x="416" y="182" />
+<sizeparam width="111" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Receive signal" value="highPressure()" />
+<TGConnectingPoint num="0" id="687" />
+<TGConnectingPoint num="1" id="688" />
+<TGConnectingPoint num="2" id="689" />
+<TGConnectingPoint num="3" id="690" />
+<TGConnectingPoint num="4" id="691" />
+<TGConnectingPoint num="5" id="692" />
+<TGConnectingPoint num="6" id="693" />
+<TGConnectingPoint num="7" id="694" />
+<TGConnectingPoint num="8" id="695" />
+<TGConnectingPoint num="9" id="696" />
+</COMPONENT>
+
+<COMPONENT type="5106" id="738" >
+<cdparam x="380" y="113" />
+<sizeparam width="183" height="41" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="State" value="AlarmIsOff" />
+<TGConnectingPoint num="0" id="698" />
+<TGConnectingPoint num="1" id="699" />
+<TGConnectingPoint num="2" id="700" />
+<TGConnectingPoint num="3" id="701" />
+<TGConnectingPoint num="4" id="702" />
+<TGConnectingPoint num="5" id="703" />
+<TGConnectingPoint num="6" id="704" />
+<TGConnectingPoint num="7" id="705" />
+<TGConnectingPoint num="8" id="706" />
+<TGConnectingPoint num="9" id="707" />
+<TGConnectingPoint num="10" id="708" />
+<TGConnectingPoint num="11" id="709" />
+<TGConnectingPoint num="12" id="710" />
+<TGConnectingPoint num="13" id="711" />
+<TGConnectingPoint num="14" id="712" />
+<TGConnectingPoint num="15" id="713" />
+<TGConnectingPoint num="16" id="714" />
+<TGConnectingPoint num="17" id="715" />
+<TGConnectingPoint num="18" id="716" />
+<TGConnectingPoint num="19" id="717" />
+<TGConnectingPoint num="20" id="718" />
+<TGConnectingPoint num="21" id="719" />
+<TGConnectingPoint num="22" id="720" />
+<TGConnectingPoint num="23" id="721" />
+<TGConnectingPoint num="24" id="722" />
+<TGConnectingPoint num="25" id="723" />
+<TGConnectingPoint num="26" id="724" />
+<TGConnectingPoint num="27" id="725" />
+<TGConnectingPoint num="28" id="726" />
+<TGConnectingPoint num="29" id="727" />
+<TGConnectingPoint num="30" id="728" />
+<TGConnectingPoint num="31" id="729" />
+<TGConnectingPoint num="32" id="730" />
+<TGConnectingPoint num="33" id="731" />
+<TGConnectingPoint num="34" id="732" />
+<TGConnectingPoint num="35" id="733" />
+<TGConnectingPoint num="36" id="734" />
+<TGConnectingPoint num="37" id="735" />
+<TGConnectingPoint num="38" id="736" />
+<TGConnectingPoint num="39" id="737" />
+<extraparam>
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="5100" id="740" >
+<cdparam x="394" y="47" />
+<sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="start state" value="null" />
+<TGConnectingPoint num="0" id="739" />
+</COMPONENT>
+
+
+</AVATARStateMachineDiagramPanel>
+
+<AVATARStateMachineDiagramPanel name="MainController" minX="10" maxX="2500" minY="10" maxY="1500" >
+<CONNECTOR type="5102" id="747" >
+<cdparam x="700" y="471" />
+<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="746" />
+<P1  x="697" y="473" id="836" />
+<P2  x="697" y="481" id="857" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="745" >
+<father id="747" num="0" />
+<cdparam x="697" y="476" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="741" />
+<TGConnectingPoint num="1" id="742" />
+<TGConnectingPoint num="2" id="743" />
+<TGConnectingPoint num="3" id="744" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="762" >
+<cdparam x="699" y="595" />
+<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="757" />
+<TGConnectingPoint num="1" id="758" />
+<TGConnectingPoint num="2" id="759" />
+<TGConnectingPoint num="3" id="760" />
+<TGConnectingPoint num="4" id="761" />
+<P1  x="697" y="595" id="847" />
+<P2  x="649" y="209" id="945" />
+<Point x="697" y="615" />
+<Point x="857" y="615" />
+<Point x="857" y="189" />
+<Point x="669" y="189" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="748" >
+<father id="762" num="0" />
+<cdparam x="697" y="615" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="749" >
+<father id="762" num="1" />
+<cdparam x="857" y="615" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="750" >
+<father id="762" num="2" />
+<cdparam x="857" y="189" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="751" >
+<father id="762" num="3" />
+<cdparam x="669" y="189" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="756" >
+<father id="762" num="4" />
+<cdparam x="674" y="402" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="752" />
+<TGConnectingPoint num="1" id="753" />
+<TGConnectingPoint num="2" id="754" />
+<TGConnectingPoint num="3" id="755" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="777" >
+<cdparam x="666" y="506" />
+<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="772" />
+<TGConnectingPoint num="1" id="773" />
+<TGConnectingPoint num="2" id="774" />
+<TGConnectingPoint num="3" id="775" />
+<TGConnectingPoint num="4" id="776" />
+<P1  x="672" y="506" id="858" />
+<P2  x="418" y="190" id="961" />
+<Point x="672" y="526" />
+<Point x="225" y="526" />
+<Point x="225" y="170" />
+<Point x="398" y="170" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="763" >
+<father id="777" num="0" />
+<cdparam x="672" y="526" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="764" >
+<father id="777" num="1" />
+<cdparam x="225" y="526" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="765" >
+<father id="777" num="2" />
+<cdparam x="225" y="170" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="766" >
+<father id="777" num="3" />
+<cdparam x="398" y="170" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="771" >
+<father id="777" num="4" />
+<cdparam x="462" y="508" />
+<sizeparam width="194" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="767" />
+<TGConnectingPoint num="1" id="768" />
+<TGConnectingPoint num="2" id="769" />
+<TGConnectingPoint num="3" id="770" />
+<extraparam>
+<guard value="[ currentPressure &lt; threshold]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="792" >
+<cdparam x="536" y="337" />
+<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="787" />
+<TGConnectingPoint num="1" id="788" />
+<TGConnectingPoint num="2" id="789" />
+<TGConnectingPoint num="3" id="790" />
+<TGConnectingPoint num="4" id="791" />
+<P1  x="536" y="337" id="915" />
+<P2  x="418" y="202" id="962" />
+<Point x="536" y="357" />
+<Point x="278" y="357" />
+<Point x="278" y="182" />
+<Point x="398" y="182" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="778" >
+<father id="792" num="0" />
+<cdparam x="536" y="357" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="779" >
+<father id="792" num="1" />
+<cdparam x="278" y="357" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="780" >
+<father id="792" num="2" />
+<cdparam x="278" y="182" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="781" >
+<father id="792" num="3" />
+<cdparam x="398" y="182" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="point " value="null" />
+</SUBCOMPONENT>
+<SUBCOMPONENT type="-1" id="786" >
+<father id="792" num="4" />
+<cdparam x="328" y="345" />
+<sizeparam width="194" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="782" />
+<TGConnectingPoint num="1" id="783" />
+<TGConnectingPoint num="2" id="784" />
+<TGConnectingPoint num="3" id="785" />
+<extraparam>
+<guard value="[ currentPressure &lt; threshold]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="799" >
+<cdparam x="475" y="136" />
+<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="798" />
+<P1  x="475" y="136" id="982" />
+<P2  x="475" y="184" id="949" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="797" >
+<father id="799" num="0" />
+<cdparam x="474" y="146" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="793" />
+<TGConnectingPoint num="1" id="794" />
+<TGConnectingPoint num="2" id="795" />
+<TGConnectingPoint num="3" id="796" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="806" >
+<cdparam x="573" y="234" />
+<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="805" />
+<P1  x="561" y="234" id="971" />
+<P2  x="561" y="270" id="930" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="804" >
+<father id="806" num="0" />
+<cdparam x="566" y="247" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="800" />
+<TGConnectingPoint num="1" id="801" />
+<TGConnectingPoint num="2" id="802" />
+<TGConnectingPoint num="3" id="803" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="813" >
+<cdparam x="586" y="300" />
+<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="812" />
+<P1  x="561" y="300" id="931" />
+<P2  x="561" y="312" id="914" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="811" >
+<father id="813" num="0" />
+<cdparam x="590" y="304" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="807" />
+<TGConnectingPoint num="1" id="808" />
+<TGConnectingPoint num="2" id="809" />
+<TGConnectingPoint num="3" id="810" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="820" >
+<cdparam x="561" y="362" />
+<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="819" />
+<P1  x="561" y="362" id="920" />
+<P2  x="607" y="386" id="881" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="818" >
+<father id="820" num="0" />
+<cdparam x="600" y="349" />
+<sizeparam width="44" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="814" />
+<TGConnectingPoint num="1" id="815" />
+<TGConnectingPoint num="2" id="816" />
+<TGConnectingPoint num="3" id="817" />
+<extraparam>
+<guard value="[ else ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="827" >
+<cdparam x="694" y="456" />
+<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="826" />
+<P1  x="697" y="436" id="903" />
+<P2  x="697" y="443" id="835" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="825" >
+<father id="827" num="0" />
+<cdparam x="692" y="468" />
+<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="821" />
+<TGConnectingPoint num="1" id="822" />
+<TGConnectingPoint num="2" id="823" />
+<TGConnectingPoint num="3" id="824" />
+<extraparam>
+<guard value="[ ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<CONNECTOR type="5102" id="834" >
+<cdparam x="691" y="531" />
+<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="833" />
+<P1  x="697" y="531" id="863" />
+<P2  x="697" y="565" id="846" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="832" >
+<father id="834" num="0" />
+<cdparam x="695" y="548" />
+<sizeparam width="44" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="List of all parameters of an Avatar SMD transition" value="" />
+<TGConnectingPoint num="0" id="828" />
+<TGConnectingPoint num="1" id="829" />
+<TGConnectingPoint num="2" id="830" />
+<TGConnectingPoint num="3" id="831" />
+<extraparam>
+<guard value="[ else ]" enabled="true"/>
+<afterMin value="" enabled="true"/>
+<afterMax value="" enabled="true"/>
+<computeMin value="" enabled="true"/>
+<computeMax value="" enabled="true"/>
+<probability value="" enabled="true"/>
+</extraparam>
+</SUBCOMPONENT>
+
+<COMPONENT type="5104" id="845" >
+<cdparam x="587" y="448" />
+<sizeparam width="221" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Receive signal" value="pressureValue(currentPressure)" />
+<TGConnectingPoint num="0" id="835" />
+<TGConnectingPoint num="1" id="836" />
+<TGConnectingPoint num="2" id="837" />
+<TGConnectingPoint num="3" id="838" />
+<TGConnectingPoint num="4" id="839" />
+<TGConnectingPoint num="5" id="840" />
+<TGConnectingPoint num="6" id="841" />
+<TGConnectingPoint num="7" id="842" />
+<TGConnectingPoint num="8" id="843" />
+<TGConnectingPoint num="9" id="844" />
+</COMPONENT>
+
+<COMPONENT type="5103" id="856" >
+<cdparam x="646" y="570" />
+<sizeparam width="103" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Send signal" value="highPressure()" />
+<TGConnectingPoint num="0" id="846" />
+<TGConnectingPoint num="1" id="847" />
+<TGConnectingPoint num="2" id="848" />
+<TGConnectingPoint num="3" id="849" />
+<TGConnectingPoint num="4" id="850" />
+<TGConnectingPoint num="5" id="851" />
+<TGConnectingPoint num="6" id="852" />
+<TGConnectingPoint num="7" id="853" />
+<TGConnectingPoint num="8" id="854" />
+<TGConnectingPoint num="9" id="855" />
+</COMPONENT>
+
+<COMPONENT type="5107" id="872" >
+<cdparam x="682" y="491" />
+<sizeparam width="30" height="30" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="choice" value="null" />
+<TGConnectingPoint num="0" id="857" />
+<TGConnectingPoint num="1" id="858" />
+<TGConnectingPoint num="2" id="859" />
+<TGConnectingPoint num="3" id="860" />
+<TGConnectingPoint num="4" id="861" />
+<TGConnectingPoint num="5" id="862" />
+<TGConnectingPoint num="6" id="863" />
+<TGConnectingPoint num="7" id="864" />
+<TGConnectingPoint num="8" id="865" />
+<TGConnectingPoint num="9" id="866" />
+<TGConnectingPoint num="10" id="867" />
+<TGConnectingPoint num="11" id="868" />
+<TGConnectingPoint num="12" id="869" />
+<TGConnectingPoint num="13" id="870" />
+<TGConnectingPoint num="14" id="871" />
+</COMPONENT>
+
+<COMPONENT type="5106" id="913" >
+<cdparam x="547" y="386" />
+<sizeparam width="242" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="State" value="WaitSecondHighPressure" />
+<TGConnectingPoint num="0" id="873" />
+<TGConnectingPoint num="1" id="874" />
+<TGConnectingPoint num="2" id="875" />
+<TGConnectingPoint num="3" id="876" />
+<TGConnectingPoint num="4" id="877" />
+<TGConnectingPoint num="5" id="878" />
+<TGConnectingPoint num="6" id="879" />
+<TGConnectingPoint num="7" id="880" />
+<TGConnectingPoint num="8" id="881" />
+<TGConnectingPoint num="9" id="882" />
+<TGConnectingPoint num="10" id="883" />
+<TGConnectingPoint num="11" id="884" />
+<TGConnectingPoint num="12" id="885" />
+<TGConnectingPoint num="13" id="886" />
+<TGConnectingPoint num="14" id="887" />
+<TGConnectingPoint num="15" id="888" />
+<TGConnectingPoint num="16" id="889" />
+<TGConnectingPoint num="17" id="890" />
+<TGConnectingPoint num="18" id="891" />
+<TGConnectingPoint num="19" id="892" />
+<TGConnectingPoint num="20" id="893" />
+<TGConnectingPoint num="21" id="894" />
+<TGConnectingPoint num="22" id="895" />
+<TGConnectingPoint num="23" id="896" />
+<TGConnectingPoint num="24" id="897" />
+<TGConnectingPoint num="25" id="898" />
+<TGConnectingPoint num="26" id="899" />
+<TGConnectingPoint num="27" id="900" />
+<TGConnectingPoint num="28" id="901" />
+<TGConnectingPoint num="29" id="902" />
+<TGConnectingPoint num="30" id="903" />
+<TGConnectingPoint num="31" id="904" />
+<TGConnectingPoint num="32" id="905" />
+<TGConnectingPoint num="33" id="906" />
+<TGConnectingPoint num="34" id="907" />
+<TGConnectingPoint num="35" id="908" />
+<TGConnectingPoint num="36" id="909" />
+<TGConnectingPoint num="37" id="910" />
+<TGConnectingPoint num="38" id="911" />
+<TGConnectingPoint num="39" id="912" />
+<extraparam>
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="5107" id="929" >
+<cdparam x="546" y="322" />
+<sizeparam width="30" height="30" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="choice" value="null" />
+<TGConnectingPoint num="0" id="914" />
+<TGConnectingPoint num="1" id="915" />
+<TGConnectingPoint num="2" id="916" />
+<TGConnectingPoint num="3" id="917" />
+<TGConnectingPoint num="4" id="918" />
+<TGConnectingPoint num="5" id="919" />
+<TGConnectingPoint num="6" id="920" />
+<TGConnectingPoint num="7" id="921" />
+<TGConnectingPoint num="8" id="922" />
+<TGConnectingPoint num="9" id="923" />
+<TGConnectingPoint num="10" id="924" />
+<TGConnectingPoint num="11" id="925" />
+<TGConnectingPoint num="12" id="926" />
+<TGConnectingPoint num="13" id="927" />
+<TGConnectingPoint num="14" id="928" />
+</COMPONENT>
+
+<COMPONENT type="5104" id="940" >
+<cdparam x="451" y="275" />
+<sizeparam width="221" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Receive signal" value="pressureValue(currentPressure)" />
+<TGConnectingPoint num="0" id="930" />
+<TGConnectingPoint num="1" id="931" />
+<TGConnectingPoint num="2" id="932" />
+<TGConnectingPoint num="3" id="933" />
+<TGConnectingPoint num="4" id="934" />
+<TGConnectingPoint num="5" id="935" />
+<TGConnectingPoint num="6" id="936" />
+<TGConnectingPoint num="7" id="937" />
+<TGConnectingPoint num="8" id="938" />
+<TGConnectingPoint num="9" id="939" />
+</COMPONENT>
+
+<COMPONENT type="5106" id="981" >
+<cdparam x="418" y="184" />
+<sizeparam width="231" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="State" value="WaitFirstHighPressure" />
+<TGConnectingPoint num="0" id="941" />
+<TGConnectingPoint num="1" id="942" />
+<TGConnectingPoint num="2" id="943" />
+<TGConnectingPoint num="3" id="944" />
+<TGConnectingPoint num="4" id="945" />
+<TGConnectingPoint num="5" id="946" />
+<TGConnectingPoint num="6" id="947" />
+<TGConnectingPoint num="7" id="948" />
+<TGConnectingPoint num="8" id="949" />
+<TGConnectingPoint num="9" id="950" />
+<TGConnectingPoint num="10" id="951" />
+<TGConnectingPoint num="11" id="952" />
+<TGConnectingPoint num="12" id="953" />
+<TGConnectingPoint num="13" id="954" />
+<TGConnectingPoint num="14" id="955" />
+<TGConnectingPoint num="15" id="956" />
+<TGConnectingPoint num="16" id="957" />
+<TGConnectingPoint num="17" id="958" />
+<TGConnectingPoint num="18" id="959" />
+<TGConnectingPoint num="19" id="960" />
+<TGConnectingPoint num="20" id="961" />
+<TGConnectingPoint num="21" id="962" />
+<TGConnectingPoint num="22" id="963" />
+<TGConnectingPoint num="23" id="964" />
+<TGConnectingPoint num="24" id="965" />
+<TGConnectingPoint num="25" id="966" />
+<TGConnectingPoint num="26" id="967" />
+<TGConnectingPoint num="27" id="968" />
+<TGConnectingPoint num="28" id="969" />
+<TGConnectingPoint num="29" id="970" />
+<TGConnectingPoint num="30" id="971" />
+<TGConnectingPoint num="31" id="972" />
+<TGConnectingPoint num="32" id="973" />
+<TGConnectingPoint num="33" id="974" />
+<TGConnectingPoint num="34" id="975" />
+<TGConnectingPoint num="35" id="976" />
+<TGConnectingPoint num="36" id="977" />
+<TGConnectingPoint num="37" id="978" />
+<TGConnectingPoint num="38" id="979" />
+<TGConnectingPoint num="39" id="980" />
+<extraparam>
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="5100" id="983" >
+<cdparam x="468" y="116" />
+<sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="start state" value="null" />
+<TGConnectingPoint num="0" id="982" />
+</COMPONENT>
+
+
+</AVATARStateMachineDiagramPanel>
+
+</Modeling>
+
+
+
+
+</TURTLEGMODELING>
\ No newline at end of file
diff --git a/src/main/java/avatartranslator/toexecutable/AVATAR2CMBED.java b/src/main/java/avatartranslator/toexecutable/AVATAR2CMBED.java
index 8fe02d29f1580d49f5c0ae064d5f34cbe63c558b..54ff85b5f2f39e13362dfc623b778e660d6a6745 100755
--- a/src/main/java/avatartranslator/toexecutable/AVATAR2CMBED.java
+++ b/src/main/java/avatartranslator/toexecutable/AVATAR2CMBED.java
@@ -168,9 +168,9 @@ public class AVATAR2CMBED {
 
 		makeConcurrencyMutex();
 		
-        //makeSynchronousChannels();
+        makeSynchronousChannels();
 
-        //makeAsynchronousChannels();
+        makeAsynchronousChannels();
 
         makeTasks();
 
@@ -366,9 +366,9 @@ public class AVATAR2CMBED {
                     cpt ++;
                 }
                 ret += "\"," + tr + ");" + CR;
-                //ret += traceFunctionCall(_block.getName(), _am.getName(), "my__attr");
+                ret += traceFunctionCall(_block.getName(), _am.getName(), "my__attr");
             }  else {
-                //ret += traceFunctionCall(_block.getName(), _am.getName(), null);
+                ret += traceFunctionCall(_block.getName(), _am.getName(), null);
             }
         }
 
@@ -452,7 +452,7 @@ public class AVATAR2CMBED {
         int nbOfMaxParams = _block.getMaxNbOfParams();
         //s+= "request *__req;" + CR;
         //Comentamos todos los unused atributes
-        /*
+
         for(i=0; i<_block.getMaxNbOfMultipleBranches(); i++) {
             s+= UNUSED_ATTR + " request __req" + i + ";" + CR;
             s+= UNUSED_ATTR + "int *__params" + i + "[" + nbOfMaxParams + "];" + CR;
@@ -460,21 +460,22 @@ public class AVATAR2CMBED {
         s+= UNUSED_ATTR + "setOfRequests __list;" + CR;
 
         s+= UNUSED_ATTR + "size_t __myCond;" + CR;
+        //s+= UNUSED_ATTR + "rtos::ConditionVariable __myCond(&__mainMutex)" + CR;
         s+= UNUSED_ATTR + "request *__returnRequest;" + CR;
 
-        s+= CR + "char * __myname = ((owner*)arg)->ownerName;" + CR;
-		s+= "rtos::Thread * __myself = ((owner*)arg)->ownerThread;" + CR;
-		*/
-        /*if (tracing) {
+        s+= CR + "char * __myname = \"mainFunc__" + _block.getName() + "\";" + CR;
+		//s+= "rtos::Thread * __myself = ((owner*)arg)->ownerThread;" + CR;
+        /*
+        if (tracing) {
           s+= CR + "char __value[CHAR_ALLOC_SIZE];" + CR;
-          }*/
-
+          }
+        */
         //s+= CR + "pthread_cond_init(&__myCond, NULL);" + CR;
-        /*
-        s+= CR + "fillListOfRequests(&__list, __myname, __myself, &__myCond, &__mainMutex);" + CR;
+
+        s+= CR + "fillListOfRequests(&__list, __myname, NULL, __myCond, &__mainMutex);" + CR;
 
         s+= "//printf(\"my name = %s\\n\", __myname);" + CR;
-        */
+
         s+= CR + "/* Main loop on states */" + CR;
         s+= "while(__currentState != STATE__STOP__STATE) {" + CR;
 
@@ -484,7 +485,7 @@ public class AVATAR2CMBED {
         // Making start state
         AvatarStateMachine asm = _block.getStateMachine();
         s += "case STATE__START__STATE: " + CR;
-        //s += traceStateEntering("__myname", "__StartState");
+        s += traceStateEntering("__myname", "__StartState");
         s += makeBehaviourFromElement(_block, asm.getStartState(), true);
         s += "break;" + CR + CR;
 
@@ -493,7 +494,7 @@ public class AVATAR2CMBED {
         for(AvatarStateMachineElement asme: asm.getListOfElements()) {
             if (asme instanceof AvatarState) {
                 s += "case STATE__" + asme.getName() + ": " + CR;
-                //s += traceStateEntering("__myname", asme.getName());
+                s += traceStateEntering("__myname", asme.getName());
 
                 if (includeUserCode) {
                     tmp = ((AvatarState)asme).getEntryCode();
@@ -551,7 +552,7 @@ public class AVATAR2CMBED {
             }
 
             if (at.hasDelay()) {
-                ret+= "wait_us(" + reworkDelay(at.getMaxDelay()) + ");" + CR;
+                ret += "wait_us(" + reworkDelay(at.getMinDelay()) +");" + CR;
             }
 
             String act;
@@ -836,10 +837,10 @@ public class AVATAR2CMBED {
 			//mainFileMbed.appendToMainCode(CR + "owner __" + taskFileMbed.getName() + ";" + CR);
 			//mainFileMbed.appendToMainCode("__" + taskFileMbed.getName() + ".ownerName = \"" + taskFileMbed.getName() + "\";" + CR);
 			//mainFileMbed.appendToMainCode("__" + taskFileMbed.getName() + ".ownerThread = &thread__" + taskFileMbed.getName() + ";" + CR);
+            //mainFileMbed.appendToMainCode("thread__" + taskFileMbed.getName() + ".start(mainFunc__" + taskFileMbed.getName() + ");"  + CR);
+
             mainFileMbed.appendToMainCode("thread__" + taskFileMbed.getName() + ".start(mainFunc__" + taskFileMbed.getName() + ");"  + CR);
-            /*
-            mainFileMbed.appendToMainCode("thread__" + taskFileMbed.getName() + ".start(mainFunc__" + taskFileMbed.getName() + ", (void*)&__" + taskFileMbed.getName() + ");"  + CR);
-            */
+
 			//mainFileMbed.appendToMainCode("pthread_create(&thread__" + taskFileMbed.getName() + ", NULL, mainFunc__" + taskFileMbed.getName() + ", (void *)\"" + taskFileMbed.getName() + "\");" + CR);
         }
 
diff --git a/src/main/java/avatartranslator/toexecutable/AVATAR2CPOSIX.java b/src/main/java/avatartranslator/toexecutable/AVATAR2CPOSIX.java
index 2b66923be93a465a562185a01b8985f798edcb32..cdbf0db534c94954479c3e619c26fc8a6c1e87d6 100755
--- a/src/main/java/avatartranslator/toexecutable/AVATAR2CPOSIX.java
+++ b/src/main/java/avatartranslator/toexecutable/AVATAR2CPOSIX.java
@@ -675,7 +675,7 @@ public class AVATAR2CPOSIX {
             AvatarActionOnSignal aaos = (AvatarActionOnSignal) _asme;
             ret += makeSignalAction(aaos, 0, false, "", "");
             AvatarSignal as = aaos.getSignal();
-            //AvatarRelation ar = avspec.getAvatarRelationWithSignal(as);
+            AvatarRelation ar = avspec.getAvatarRelationWithSignal(as);
             ret += executeOneRequest("__req0");
             ret += traceRequest();
         }
diff --git a/src/main/java/avatartranslator/toexecutable/MainFileMbed.java b/src/main/java/avatartranslator/toexecutable/MainFileMbed.java
index 51fb62ff6906871bf04322d7f8e3a0dafa92b9d7..773e51f41e9b44b55b7e2ddd4dddef321bdf6770 100644
--- a/src/main/java/avatartranslator/toexecutable/MainFileMbed.java
+++ b/src/main/java/avatartranslator/toexecutable/MainFileMbed.java
@@ -55,11 +55,12 @@ public class MainFileMbed {
     private final static String H_END_DEF = "#endif\n";
 
     private final static String INCLUDE_HEADER = "#include <mbed.h>\n#include <rtos.h>\n";//"#include <stdio.h>\n#include <pthread.h>\n#include <unistd.h>\n#include <stdlib.h>\n";
-    private final static String LOCAL_INCLUDE_HEADER = "";
+    //private final static String LOCAL_INCLUDE_HEADER = "";
     //Quitamos las librerias que causan problemas
-    /*private final static String LOCAL_INCLUDE_HEADER = "#include \"request.h\"\n#include \"syncchannel.h\"\n#include \"request_manager" +
+
+    private final static String LOCAL_INCLUDE_HEADER = "#include \"request.h\"\n#include \"syncchannel.h\"\n#include \"request_manager" +
             ".h\"\n#include \"debug.h\"\n#include \"random.h\"\n#include \"tracemanager.h\"";
-    */
+
     private final static String MAIN_DEC = "int main(int argc, char *argv[]) {\n";
     private final static String DISABLE_BUFFERING = "/* disable buffering on stdout */\nsetvbuf(stdout, (char*)NULL, _IONBF, 0);\n";
 
diff --git a/src/main/java/avatartranslator/toexecutable/TaskFileMbed.java b/src/main/java/avatartranslator/toexecutable/TaskFileMbed.java
index 537565ba0950286d4b7ce5d98901c072eff493f7..76b709614c22d7709cc807ed4b083c18ed6657b7 100644
--- a/src/main/java/avatartranslator/toexecutable/TaskFileMbed.java
+++ b/src/main/java/avatartranslator/toexecutable/TaskFileMbed.java
@@ -52,16 +52,17 @@ public class TaskFileMbed {
     //1) enlever pthread.h
     //2) ajouter : srl.h et mwmr.h
     private final static String INCLUDE_HEADER = "#include <mbed.h>\n#include <rtos.h>\n";//"#include <stdio.h>\n#include <pthread.h>\n#include <unistd.h>\n#include <stdlib.h>\n";
-    private final static String LOCAL_INCLUDE_HEADER = "#include \"main.h\"";
+    //private final static String LOCAL_INCLUDE_HEADER = "#include \"main.h\"";
     //Quitamos de nuestros task files las librerias que causan errores.
-    /*private final static String LOCAL_INCLUDE_HEADER = "#include \"request.h\"\n#include \"syncchannel.h\"\n#include \"request_manager" +
-            ".h\"\n#include \"debug.h\"\n#include \"defs.h\"\n#include \"mytimelib.h\"\n#include \"random.h\"\n#include \"tracemanager.h\"\n#include \"main.h\"";
-    */
+    private final static String LOCAL_INCLUDE_HEADER = "#include \"request.h\"\n#include \"syncchannel.h\"\n#include \"asyncchannel.h\"\n#include " +
+            "\"message.h\"\n#include \"request_manager.h\"\n#include \"debug.h\"\n#include \"defs.h\"\n#include \"mytimelib.h\"\n#include \"random" +
+            ".h\"\n#include \"tracemanager.h\"\n#include \"main.h\"";
+
     private final static String INCLUDE_HEADER_SOCLIB = "#include <mbed.h>\n#include <rtos.h>\n";//"#include <stdio.h>\n#include <unistd.h>\n#include <stdlib.h>\n";
-    private final static String LOCAL_INCLUDE_HEADER_SOCLIB = "#include \"main.h\"";
-    /*
+    //private final static String LOCAL_INCLUDE_HEADER_SOCLIB = "#include \"main.h\"";
+
     private final static String LOCAL_INCLUDE_HEADER_SOCLIB = "#include \"request.h\"\n#include \"syncchannel.h\"\n#include \"request_manager.h\"\n#include \"debug.h\"\n#include \"defs.h\"\n#include \"mytimelib.h\"\n#include \"random.h\"\n#include \"tracemanager.h\"\n#include \"main.h\"\n#include \"/Users/ludovicapvrille/Prog/mutekh/libmwmr/include/mwmr/mwmr.h\"\n ";
-    */
+
     private final static String CR = "\n";
 
     private String name;
diff --git a/src/main/java/common/SpecConfigTTool.java b/src/main/java/common/SpecConfigTTool.java
index e1d839a528b294ae9331924ecaf981bf889ea715..93e80122cd2bd27035d2c5b003bc36c539c1fda8 100644
--- a/src/main/java/common/SpecConfigTTool.java
+++ b/src/main/java/common/SpecConfigTTool.java
@@ -460,6 +460,7 @@ public class SpecConfigTTool {
      * @throws FileException
      * @author Javier Errea
      */
+
     public static boolean checkAndCreateAVATARCodeDirMBED(String s) throws FileException {
         //TraceManager.addDev("Trying to create the dir:" + s);
         File f = new File(s);
diff --git a/ttool-cli/build/classes/java/main/avatartranslator/toexecutable/AVATAR2CMBED.class b/ttool-cli/build/classes/java/main/avatartranslator/toexecutable/AVATAR2CMBED.class
index 10a6c56f71f3de8f28544a4e823e0be5b441c1e7..71d9843072d50bb06a20112b7f0922e88117ca42 100644
Binary files a/ttool-cli/build/classes/java/main/avatartranslator/toexecutable/AVATAR2CMBED.class and b/ttool-cli/build/classes/java/main/avatartranslator/toexecutable/AVATAR2CMBED.class differ
diff --git a/ttool-cli/build/classes/java/main/avatartranslator/toexecutable/AVATAR2CPOSIX.class b/ttool-cli/build/classes/java/main/avatartranslator/toexecutable/AVATAR2CPOSIX.class
index 546f333e5936e8679532541e257de59cf3229d46..f841f10466a229d8f5187cfb100d779ed33fdca7 100644
Binary files a/ttool-cli/build/classes/java/main/avatartranslator/toexecutable/AVATAR2CPOSIX.class and b/ttool-cli/build/classes/java/main/avatartranslator/toexecutable/AVATAR2CPOSIX.class differ
diff --git a/ttool-cli/build/classes/java/main/avatartranslator/toexecutable/MainFileMbed.class b/ttool-cli/build/classes/java/main/avatartranslator/toexecutable/MainFileMbed.class
index ea5699f82f1366d2c8e1ac01dc01fecb421991eb..cae71c5bfd4d524a71038272f3880fa6af4f39c5 100644
Binary files a/ttool-cli/build/classes/java/main/avatartranslator/toexecutable/MainFileMbed.class and b/ttool-cli/build/classes/java/main/avatartranslator/toexecutable/MainFileMbed.class differ
diff --git a/ttool-cli/build/classes/java/main/avatartranslator/toexecutable/TaskFileMbed.class b/ttool-cli/build/classes/java/main/avatartranslator/toexecutable/TaskFileMbed.class
index 413d1b7c50fb8c069ba5e9f29ecebe22ae5caeed..94e311827c37ed2712748b874f604be6f6a3108c 100644
Binary files a/ttool-cli/build/classes/java/main/avatartranslator/toexecutable/TaskFileMbed.class and b/ttool-cli/build/classes/java/main/avatartranslator/toexecutable/TaskFileMbed.class differ
diff --git a/ttool-cli/build/distributions/ttool-cli.tar b/ttool-cli/build/distributions/ttool-cli.tar
index a9b2ecbdddaeb0ee68f3f1a9cb6a35cf843d10db..10e23d198b467f102694a7e74b42eb8450f6219a 100644
Binary files a/ttool-cli/build/distributions/ttool-cli.tar and b/ttool-cli/build/distributions/ttool-cli.tar differ
diff --git a/ttool-cli/build/distributions/ttool-cli.zip b/ttool-cli/build/distributions/ttool-cli.zip
index ded47f973a998b7f80f6d51e750f9b72f38c1414..4b219b98d93c8392ff914d47a05964cd67fd8daf 100644
Binary files a/ttool-cli/build/distributions/ttool-cli.zip and b/ttool-cli/build/distributions/ttool-cli.zip differ