Hi brianmc95,
I found an error in calculation of “duration ”and “remainingTime ”in LteMacVUeMode4.cc file.

Here I think the calculation of the "remainingtime" should be the "lteInfo->getDuration()" minus "elapsedTime".
For example:
When elapsedTime = 1ms and lteInfo->getDuration()=1000ms,
after the calculation on line 635, duration=1000ms-1ms = 999ms,
and after the calculation on line 637, remainingTime_=1000ms-999ms=1ms=elapsedTime.
Also, there are some problems with the conversion of time units. Line 636 is a conversion in seconds.
According to the Settings in operation, the actual running results are as follows:
ElapsedTime is usually equal to 0.
after the calculation on line 635, duration=1000ms-0ms = 1000ms=1s,
and after line 636, dur=1; Because.dbl() is converted in seconds.
But lteInfo->getDuration() gets the result in milliseconds.
So the final calculation result is: remainingTime_=1000-1=999. This is clearly wrong.
In addition, I wonder what the purpose of the if statement in lines 643-649 is.
Is the purpose here as I understand it? For messages of different periods, if the RRI of the existing reserved resources cannot meet the shorter period (or smaller tolerable delay), resource reselection will be performed.
I noticed that the "duration" is set to a fixed value of 1000ms in Mode4App.cc in the application layer program. But it is defined in the 3GPP standard as 20ms<=T<=100ms, and it should be changed according to different message periods. For example, when the period of the message is 50ms, its maximum tolerated delay is also 50ms.Is that what "duration" means?

In line 538-546 of the physical layer file "ltephyvuemode4.cc", the maximum delay is configured again according to the period. Is there a bug in this part of the if statement? What is the purpose of line 538? Is it redundant?
Looking forward to your reply.
Hi brianmc95,
I found an error in calculation of “duration ”and “remainingTime ”in LteMacVUeMode4.cc file.

Here I think the calculation of the "remainingtime" should be the "lteInfo->getDuration()" minus "elapsedTime".
For example:
When elapsedTime = 1ms and lteInfo->getDuration()=1000ms,
after the calculation on line 635, duration=1000ms-1ms = 999ms,
and after the calculation on line 637, remainingTime_=1000ms-999ms=1ms=elapsedTime.
Also, there are some problems with the conversion of time units. Line 636 is a conversion in seconds.
According to the Settings in operation, the actual running results are as follows:
ElapsedTime is usually equal to 0.
after the calculation on line 635, duration=1000ms-0ms = 1000ms=1s,
and after line 636, dur=1; Because.dbl() is converted in seconds.
But lteInfo->getDuration() gets the result in milliseconds.
So the final calculation result is: remainingTime_=1000-1=999. This is clearly wrong.
In addition, I wonder what the purpose of the if statement in lines 643-649 is.
Is the purpose here as I understand it? For messages of different periods, if the RRI of the existing reserved resources cannot meet the shorter period (or smaller tolerable delay), resource reselection will be performed.
I noticed that the "duration" is set to a fixed value of 1000ms in Mode4App.cc in the application layer program. But it is defined in the 3GPP standard as 20ms<=T<=100ms, and it should be changed according to different message periods. For example, when the period of the message is 50ms, its maximum tolerated delay is also 50ms.Is that what "duration" means?
In line 538-546 of the physical layer file "ltephyvuemode4.cc", the maximum delay is configured again according to the period. Is there a bug in this part of the if statement? What is the purpose of line 538? Is it redundant?
Looking forward to your reply.