I am attempting to modify the RPL algorithm in Contiki using Cooja for the simulations. Basically what I'm trying to do is to assess the efficiency of my algorithm by adding nodes to the network randomly by a certain distribution (like Gamma distribution). To do this I've written a script. The problem is, I can't add more than one mote using this script. Here is what I have so far:
var motes_array = new Array();
moteType = mote.getType();
for (i = 0; i < 5; i++) {
motes_array[i] = moteType.generateMote(mote.getSimulation());
mote.getSimulation().addMote(motes_array[i]);
}
log.testOK();
The above code adds only one mote, although the loop is executed 5 times as expected.
Can anyone help me out?
Thanks.