User guide
7 / 18
UZL-Testbed User Guide
Foundations of Adaptive Networked Societies of Tiny Artefacts
offers scripting functionality and the use of local variables we use JShawn to configure the simulation.
Refer to [7] for detailed information.
The testbed topology is described by /scenario_fronts.xml. The xml-file defines the real positions of
the nodes as well as the link properties between nodes.
As the simulator uses increasing numbers from 0 to n as ids for n+1 nodes for an efficient algorithmic
processing we added functionality in iSense enabling the usage of arbitrary ids. Setting the global
variable use_tag_ids to “true” in your configuration file like
shawn.setGlobalVariable("use_tag_ids", "true");
causes that iSense ids are read from a node tag called “isense_id” which is also defined in the xml-file.
Note, that os().id() has not necessarily the same value as os().proc().owner().id() in this case!!
To find a Shawn::Node by its iSense MAC address (os().id()) use the method
class ShawnGlueProcessor
{
static shawn::Node* find_node_by_id_w(shawn::World& w_,uint16 i)throw();
}
instead of owner().world().find_node_by_id( 1234 ).
Example: ShawnGlueProcessor::find_node_by_id_w((ShawnOs* &os_)->proc().
owner_w().world_w(), 0x060d);
The above mentioned xml-file contains these ids additionally to the positions:
<scenario>
<snapshot id="0">
…
<node id="19"><location x="3.0" y="2.6" z="0.0"/>
<tag type="int" name="isense_id" value="38048"/>
<!-- Hex: 94 a0 -->
</node>
…
</snapshot>
</scenario>
You can load this snapshot by using the shawn command load_world:
shawn.runCommand("load_world", "world_in_file=scenario_fronts.xml
snapshot=0 processors=isense");