Change sensor code variables at schedule time with BNF syntax
When you want to schedule a job on the w-iLab.t testbed with sensor code included, you can use our dynamic parameter utility.
This tool allows you to redefine global variables in your nesc code (TinyOS or Contiki) at schedule time using our BNF syntax. So you are not limited to just substituting one value, but have a powerful toolset to scan parameter ranges and schedule multiple experiments at once. More information on the Backus-Naur Form available on Wikipedia
To access this utility, click the parameters button on the w-iLab.t scheduling page.
In the table that appears, all global variables in the WSN images associated with the selected job are displayed. You can simply change the compiled value for each displayed variable, or you could use the more elaborate BNF syntax to create more powerful expressions that grant the following possibilities:
- schedule multiple experiments by using the pipe "|" character
- change variable for a specific node or a list of nodes by using a comma ","
- set a variable for a range of nodes using ".."
The available BNF syntax to utilize this functionality is given below, together with some examples:
<experiment>::=<paramlist>|<paramlist>"|"<experiment> |
<paramlist>::=<paramsublist>|<paramsublist>";"<paramlist> |
<paramsublist>::=<nodelist>":"<paramvalue>|<paramvalue> |
<nodelist>::=<nodeid>|<nodeid>".."<nodeid><nodelist>","<nodelist> |
<paramvalue>::=<number> |
Example:
For the parameter Q we define 4 experiments where we assign the values A, B, C and D for all the nodes.
The expression for Q will be: A|B|C|D
A more elaborate example:
For the parameter P we can define 3 experiments X|Y|Z. During experiment X we assign the value A for the nodes 1 to 10, the value B for the nodes 12,15 and 18 and the value C for all the other nodes. For experiment Y, the value A will be assigned to the parameter P. During the last experiment Z we will assign the value C for the nodes 10 to 20 and the value B for all the other nodes.
The expression for P will be: 1..10:A;12,15,18:B;C|A|10..20:C;B
When we now would schedule this job with parameters Q and P redefined, (3x4) 12 experiments will be generated!
NOTE: Be careful while writing expressions (NO SPACES,...) as there is no syntax check! Values (here A, B, C and D) are parsed as numbers, make sure that your data structure accepts your new input.