Question about scheduling implementation for baselineBANMAC
billryan opened this issue · 2 comments
LIne 449 to line 504 of the file BaselineBANMac.cc
:
// if we have a schedule that does not start after RAP, or our schedule
// is not assigned yet, then go to sleep after RAP.
if ((scheduledTxAccessStart == UNCONNECTED && RAP1Length < beaconPeriodLength)
|| (scheduledTxAccessStart-1 > RAP1Length)) {
setTimer(START_SLEEPING, RAP1Length * allocationSlotLength - beaconTxTime);
trace() << " --- start sleeping in: " << RAP1Length * allocationSlotLength - beaconTxTime << " secs";
}
if (scheduledTxAccessStart-1 > RAP1Length) == True
It means that we have scheduling slots after RAP1, but what we need is "does not start after RAP".
Does the line 502 (scheduledTxAccessStart-1 > RAP1Length)
should be (scheduledTxAccessStart-1 < RAP1Length)
?
Is it a bug or my wrong understanding?
Hi Bill,
I guess the comment is wrong in this case, or at least it contributes to
the confusion.
"After RAP1" can mean immediately after RAP or much later than RAP1 (with
other things happening in between)
The comment wants to use the meaning "immediately after RAP1"
What we check in the code, is whether the scheduled slots happen much later
than the end of RAP1. If not, it means that
the happen immediately after.
I hope this clears things. I'll update the comment to make it more clear.
On 27 June 2014 18:50, Bill Ryan notifications@github.com wrote:
LIne 449 to line 504 of the file BaselineBANMac.cc:
// if we have a schedule that does not start after RAP, or our schedule // is not assigned yet, then go to sleep after RAP. if ((scheduledTxAccessStart == UNCONNECTED && RAP1Length < beaconPeriodLength) || (scheduledTxAccessStart-1 > RAP1Length)) { setTimer(START_SLEEPING, RAP1Length * allocationSlotLength - beaconTxTime); trace() << " --- start sleeping in: " << RAP1Length * allocationSlotLength - beaconTxTime << " secs"; }
if (scheduledTxAccessStart-1 > RAP1Length) == True
It means that we have scheduling slots after RAP1, but what we need is
"does not start after RAP".Does the line 502 (scheduledTxAccessStart-1 > RAP1Length) should be (scheduledTxAccessStart-1
< RAP1Length)?Is it a bug or my wrong understanding?
—
Reply to this email directly or view it on GitHub
#4.
Thanks for your clarification!
Now I clearly understand that if (scheduledTxAccessStart-1 == RAP1Length)
is True, it means the node get the scheduled slots immediately after RAP and should not enter into sleep status. if (scheduledTxAccessStart-1 > RAP1Length)
is True, it means that the node should enter into sleep mode before the scheduled slots for it.