Copied the test code from the sky_shell_collect test, which correctly counts packet receptions and duplicates. Test code is much leaner and meaner now.

This commit is contained in:
adamdunkels 2011-01-09 23:51:30 +00:00
parent 148bd60fe1
commit d5851423fd

View file

@ -4,6 +4,11 @@
<project EXPORT="discard">[CONTIKI_DIR]/tools/cooja/apps/mspsim</project> <project EXPORT="discard">[CONTIKI_DIR]/tools/cooja/apps/mspsim</project>
<project EXPORT="discard">[CONTIKI_DIR]/tools/cooja/apps/avrora</project> <project EXPORT="discard">[CONTIKI_DIR]/tools/cooja/apps/avrora</project>
<project EXPORT="discard">[CONTIKI_DIR]/tools/cooja/apps/native_gateway</project> <project EXPORT="discard">[CONTIKI_DIR]/tools/cooja/apps/native_gateway</project>
<project EXPORT="discard">[CONTIKI_DIR]/tools/cooja/apps/serial_socket</project>
<project EXPORT="discard">/home/user/contikiprojects/sics.se/mobility</project>
<project EXPORT="discard">[CONTIKI_DIR]/tools/cooja/apps/collect-view</project>
<project EXPORT="discard">/home/user/contikiprojects/sics.se/powertracker</project>
<project EXPORT="discard">/home/user/nes/papers/smartip-paper/code/cooja_qr</project>
<simulation> <simulation>
<title>Rime collect test</title> <title>Rime collect test</title>
<delaytime>0</delaytime> <delaytime>0</delaytime>
@ -21,7 +26,7 @@
</events> </events>
<motetype> <motetype>
se.sics.cooja.contikimote.ContikiMoteType se.sics.cooja.contikimote.ContikiMoteType
<identifier>mtype98</identifier> <identifier>mtype374</identifier>
<description>Contiki Mote Type #1</description> <description>Contiki Mote Type #1</description>
<contikiapp>[CONTIKI_DIR]/examples/rime/example-collect.c</contikiapp> <contikiapp>[CONTIKI_DIR]/examples/rime/example-collect.c</contikiapp>
<commands>make example-collect.cooja TARGET=cooja</commands> <commands>make example-collect.cooja TARGET=cooja</commands>
@ -54,7 +59,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>1</id> <id>1</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -67,7 +72,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>2</id> <id>2</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -80,7 +85,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>3</id> <id>3</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -93,7 +98,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>4</id> <id>4</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -106,7 +111,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>5</id> <id>5</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -119,7 +124,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>6</id> <id>6</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -132,7 +137,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>7</id> <id>7</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -145,7 +150,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>8</id> <id>8</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -158,7 +163,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>9</id> <id>9</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -171,7 +176,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>10</id> <id>10</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -184,7 +189,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>11</id> <id>11</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -197,7 +202,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>12</id> <id>12</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -210,7 +215,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>13</id> <id>13</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -223,7 +228,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>14</id> <id>14</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -236,7 +241,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>15</id> <id>15</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -249,7 +254,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>16</id> <id>16</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -262,7 +267,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>17</id> <id>17</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -275,7 +280,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>18</id> <id>18</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -288,7 +293,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>19</id> <id>19</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -301,7 +306,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>20</id> <id>20</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -314,7 +319,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>21</id> <id>21</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -327,7 +332,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>22</id> <id>22</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -340,7 +345,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>23</id> <id>23</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -353,7 +358,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>24</id> <id>24</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -366,7 +371,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>25</id> <id>25</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -379,7 +384,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>26</id> <id>26</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -392,7 +397,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>27</id> <id>27</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -405,7 +410,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>28</id> <id>28</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -418,7 +423,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>29</id> <id>29</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -431,7 +436,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>30</id> <id>30</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -444,7 +449,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>31</id> <id>31</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -457,7 +462,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>32</id> <id>32</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -470,7 +475,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>33</id> <id>33</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -483,7 +488,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>34</id> <id>34</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -496,7 +501,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>35</id> <id>35</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -509,7 +514,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>36</id> <id>36</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -522,7 +527,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>37</id> <id>37</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -535,7 +540,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>38</id> <id>38</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -548,7 +553,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>39</id> <id>39</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -561,7 +566,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>40</id> <id>40</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -574,7 +579,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>41</id> <id>41</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -587,7 +592,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>42</id> <id>42</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -600,7 +605,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>43</id> <id>43</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -613,7 +618,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>44</id> <id>44</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -626,7 +631,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>45</id> <id>45</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -639,7 +644,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>46</id> <id>46</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -652,7 +657,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>47</id> <id>47</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -665,7 +670,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>48</id> <id>48</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -678,7 +683,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>49</id> <id>49</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
<mote> <mote>
<interface_config> <interface_config>
@ -691,7 +696,7 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>50</id> <id>50</id>
</interface_config> </interface_config>
<motetype_identifier>mtype98</motetype_identifier> <motetype_identifier>mtype374</motetype_identifier>
</mote> </mote>
</simulation> </simulation>
<plugin> <plugin>
@ -701,23 +706,19 @@
<height>185</height> <height>185</height>
<location_x>0</location_x> <location_x>0</location_x>
<location_y>0</location_y> <location_y>0</location_y>
<minimized>false</minimized>
</plugin> </plugin>
<plugin> <plugin>
se.sics.cooja.plugins.Visualizer se.sics.cooja.plugins.Visualizer
<plugin_config> <plugin_config>
<skin>se.sics.cooja.plugins.skins.IDVisualizerSkin</skin> <skin>se.sics.cooja.plugins.skins.IDVisualizerSkin</skin>
<skin>se.sics.cooja.plugins.skins.UDGMVisualizerSkin</skin> <skin>se.sics.cooja.plugins.skins.UDGMVisualizerSkin</skin>
<skin>se.sics.cooja.plugins.skins.TrafficVisualizerSkin</skin> <viewport>1.283542488892569 0.0 0.0 1.283542488892569 56.0530822138472 6.888296017222324</viewport>
<viewport>1.283542488892569 0.0 0.0 1.283542488892569 57.05308221384719 36.88829601722232</viewport>
<hidden />
</plugin_config> </plugin_config>
<width>496</width> <width>496</width>
<z>0</z> <z>0</z>
<height>198</height> <height>198</height>
<location_x>1</location_x> <location_x>1</location_x>
<location_y>184</location_y> <location_y>184</location_y>
<minimized>false</minimized>
</plugin> </plugin>
<plugin> <plugin>
se.sics.cooja.plugins.LogListener se.sics.cooja.plugins.LogListener
@ -729,85 +730,52 @@
<height>333</height> <height>333</height>
<location_x>0</location_x> <location_x>0</location_x>
<location_y>381</location_y> <location_y>381</location_y>
<minimized>false</minimized>
</plugin> </plugin>
<plugin> <plugin>
se.sics.cooja.plugins.ScriptRunner se.sics.cooja.plugins.ScriptRunner
<plugin_config> <plugin_config>
<script>TIMEOUT(600000, log.log(last_stats)); <script>TIMEOUT(600000, log.log(last_stats));
NR_NODES = mote.getSimulation().getMotesCount(); num_nodes = mote.getSimulation().getMotesCount();
MIN_PACKETS = 8;
MAX_PACKETS = 15;/* seq is 4 bits */
function function print_stats() {
print_stats() log.log("Received:\n");
{ for(i = 1; i &lt;= num_nodes; i++) {
stats = ""; log.log("Node " + i + " ");
stats += "---- " + total_received + " messages, " + if(i == sink) {
doubleFormat.format(total_received / NR_NODES) + " messages/node, " + log.log("sink\n");
total_dups + " dups, " + } else {
doubleFormat.format(total_dups / NR_NODES) + " dups/node, " + log.log("received: " + received[i] + " hops: " + hops[i] + "\n");
doubleFormat.format(total_hops / total_received) + " hops/message\n";
stats += "Seqnos: ";
for(i = 1; i &lt;= NR_NODES; i++) {
stats += integerFormat.format(seqnos[i]) + " ";
} }
stats += "\n";
stats += "Dups: ";
for(i = 1; i &lt;= NR_NODES; i++) {
stats += integerFormat.format(dups[i]) + " ";
} }
stats += "\n";
stats += "Hops: ";
for(i = 1; i &lt;= NR_NODES; i++) {
stats += integerFormat.format(hops[i]) + " ";
}
stats += "\n";
stats += "Received: ";
for(i = 1; i &lt;= NR_NODES; i++) {
stats += integerFormat.format(count[i]) + " ";
}
stats += "\n";
return stats;
} }
/* Init */ /* Init */
sink = 0;
booted = new Array(); booted = new Array();
count = new Array();
hops = new Array(); hops = new Array();
seqnos = new Array();
dups = new Array(); dups = new Array();
total_received = 0; received = new Array();
total_hops = 0;
total_dups = 0; doubleFormat = new java.text.DecimalFormat("0.00");
last_total_received = 0; integerFormat = new java.text.DecimalFormat("00");
last_total_dups = 0; for(i = 1; i &lt;= num_nodes; i++) {
last_stats = "No stats collected!\n";
doubleFormat = new java.text.DecimalFormat("0.00")
integerFormat = new java.text.DecimalFormat("00")
for(i = 1; i &lt;= NR_NODES; i++) {
booted[i] = false; booted[i] = false;
count[i] = 0; received[i] = "__________";
hops[i] = 0; hops[i] = received[i];
seqnos[i] = -1;
dups[i] = 0;
} }
/* Wait until all nodes have started */ /* Wait until all nodes have started */
log.log("Simulation has " + NR_NODES + " nodes\n"); log.log("Simulation has " + num_nodes + " nodes\n");
for(i = 1; i &lt;= NR_NODES; i++) { for(i = 1; i &lt;= num_nodes; i++) {
YIELD_THEN_WAIT_UNTIL(msg.startsWith('Starting')); YIELD_THEN_WAIT_UNTIL(msg.startsWith('Starting'));
/* log.log("Node " + id + " booted\n");*/ /* log.log("Node " + id + " booted\n");*/
} }
/* Create sink */ /* Create sink */
log.log("All nodes booted, creating sink at node " + id + "\n\n"); log.log("All nodes booted, sink is node 1\n\n");
mote.getInterfaces().getButton().clickButton() sink = 1;
mote.getInterfaces().getButton().clickButton();
GENERATE_MSG(5000, "PERIODIC_STATUS");
log.log("LINE:5s, DOT:sink packet (excl. dups), COMMA:sink dup\n");
while(true) { while(true) {
YIELD(); YIELD();
@ -821,64 +789,37 @@ while(true) {
source = parseInt(node_text); source = parseInt(node_text);
seqno = parseInt(seqno_text); seqno = parseInt(seqno_text);
hop = parseInt(hops_text); hop = parseInt(hops_text);
if (seqno &gt; seqnos[source]) { dups = received[source].substr(seqno, 1);
seqnos[source] = seqno; if(dups == "_") {
count[source]++; dups = 1;
hops[source] = hop; } else if(dups &lt; 9) {
total_received++; dups++;
total_hops += hop; }
} else { received[source] = received[source].substr(0, seqno) + dups +
/*log.log("Warning: Duplicate: " + msg + "\n");*/ received[source].substr(seqno + 1, 10 - seqno);
dups[source] += 1;
total_dups += 1; if(hop &gt; 9) {
hop = "+";
}
hops[source] = hops[source].substr(0, seqno) + hop +
hops[source].substr(seqno + 1, 10 - seqno);
print_stats();
}
}
/* Signal OK if all nodes have reported 10 messages. */
num_reported = 0;
for(i = 1; i &lt;= num_nodes; i++) {
if(i != sink) {
if(!isNaN(received[i])) {
num_reported++;
}
} }
} }
/* Fail if the sink has received more than MAX_PACKETS messages from any node. */ if(num_reported == num_nodes - 1) {
for(i = 1; i &lt;= NR_NODES; i++) { print_stats();
if(count[i] &gt;= MAX_PACKETS) {
log.log(print_stats());
log.testFailed(); /* We are done! */
}
}
/* Success if the sink has received more than MIN_PACKETS messages from all nodes */
for(i = 1; i &lt;= NR_NODES; i++) {
if(count[i] &lt; MIN_PACKETS) {
break;
}
if(i == NR_NODES) {
log.log(print_stats());
log.testOK(); log.testOK();
} }
}
/*print_stats();*/
last_stats = print_stats();
}
if (msg.equals("PERIODIC_STATUS")) {
diff = total_received - last_total_received;
last_total_received = total_received;
diffStr = "";
while (diff &gt; 0) {
diff--;
diffStr += ".";
}
log.log(diffStr);
diff = total_dups - last_total_dups;
last_total_dups = total_dups;
diffStr = "";
while (diff &gt; 0) {
diff--;
diffStr += ",";
}
log.log(diffStr);
log.log("\n");
GENERATE_MSG(5000, "PERIODIC_STATUS");
}
}</script> }</script>
<active>true</active> <active>true</active>
</plugin_config> </plugin_config>
@ -887,7 +828,6 @@ while(true) {
<height>714</height> <height>714</height>
<location_x>497</location_x> <location_x>497</location_x>
<location_y>0</location_y> <location_y>0</location_y>
<minimized>false</minimized>
</plugin> </plugin>
</simconf> </simconf>