Hello Athanassios,
Oh, I see... thanks very much for the hint, here I modified the code as you suggested and yes it seems fine at least to me:)
.............
initialization :
packet_rate = hasPar("packet_rate") ? par("packet_rate") : 5;
sample_interval = packet_rate > 0 ? 1/float(packet_rate) : -1;
........................................
case APP_NODE_STARTUP:
{
disabled = 0;
// Only node0 and node1 samples packets
if (self<=1) {
scheduleAt(simTime(), new App_ControlMessage("Application self message (request sample)", APP_SELF_REQUEST_SAMPLE));
break;
}
...................................................................................................
case APP_SELF_REQUEST_SAMPLE:
{
requestSampleFromSensorManager();
scheduleAt(simTime()+ DRIFTED_TIME(sample_interval), new App_ControlMessage("Application self message (request sample)", APP_SELF_REQUEST_SAMPLE));
break;
}
then in the omnet.ini I have:
SN.node[0].nodeApplication.packet_rate = 1.4
SN.node[1].nodeApplication.packet_rate = 0.2
SN.node[2..4].nodeApplication.packet_rate = 0 # they do not sample
In my example, I only have node0 and node1 sampling with different rates and the other nodes are just receivers!
Does this look ok :) if yes then I start to do Castalia....
My supervisor asked my, Why do you named the simulator Castalia ?? is there a reason??
Thank you
Reham