V2Xgithub / WiLabV2Xsim

V2X simulator
GNU General Public License v3.0
79 stars 32 forks source link

A question about aperiodic traffic #6

Closed joshsmith1999 closed 1 year ago

joshsmith1999 commented 2 years ago

I wanna simulate aperiodic traffic in the simulator, and I set the "generationIntervalAverageRandomPart" parameter with non-zero in the command line. Then I run the 'Simulations.m' and after running and I look up 'MainOut.xls'. However I find that the result changed little. I wanna ask if I need to change other parameters for simulating aperiodic traffic. I would appreciate a lot if you would give me the reply as soon as possible.

wzf-cn commented 2 years ago

There are some parameters controlling the packet generation interval:

  1. param_1: generationInterval, packet generation interval per each vehicles [s]
  2. param_2: variabilityGenerationInterval, Variability of beacon period per vehicle [s]
  3. param_3: generationIntervalAverageRandomPart, Average Random part Packet generation interval [s]

You could check the following position in the code to see it logic. I think it should be understood easily. If not, please let me know:

  1. parameter generationInterval in file "mainV2X.m";
  2. section (start with "%%") Packet generation in file "mainInit.m"
joshsmith1999 commented 2 years ago

Thank you for your reply! For param_2(variabilityGenerationInterval): Variability of beacon period per vehicle (s) (only 11p). Because it applies only to 11p nodes, I don't consider this parameter temporarily. However, as for C-V2X, it's generation interval: https://github.com/V2Xgithub/WiLabV2Xsim/blob/fb4eabcf5ab28c7854fd943d02499cfae00f35dc/MainFiles/mainV2X.m#L248 The first term on the right of the equation could be found in "mainInit.m" when variabilityGenerationInterval equals zero: https://github.com/V2Xgithub/WiLabV2Xsim/blob/fb4eabcf5ab28c7854fd943d02499cfae00f35dc/MainFiles/mainInit.m#L118 The second term on the right of the equation means that it's a variable part. Therfore I changed the param_3(example, '0'->'1') and didn't changed param_2 for C-V2X aperiodic traffic simulations, and the results index PRR don't decline. 1663425811505 The first two groups are periodic traffic, the last group group is aperiodic traffic.

joshsmith1999 commented 2 years ago

I just changed the param generationIntervalAverageRandomPart 。 According to my understanding, as for C-V2X aperiodic traffic, I just need to change generationIntervalAverageRandomPart. So I have a little trouble with it. Hope to get your reply! Thank you~/谢谢~

wzf-cn commented 2 years ago

L118 overwrites L177 to set periodic traffic. So in your case, you could comment line 118, then line 117 could use the param_2 to set aperiodic traffic for LTE-V2X: https://github.com/V2Xgithub/WiLabV2Xsim/blob/fb4eabcf5ab28c7854fd943d02499cfae00f35dc/MainFiles/mainInit.m#L117-L118

I think the aperiodic traffic may not always decline the PRR. In your simulation, the random part equals exprnd(params_3) (you may want to change this function to fit your case), which is a non-negative value. That means the generationInterval would be larger than the one without a random part, which could decrease the traffic. If the channel is not busy enough, an increasing PRR is possible.

wzf-cn commented 1 year ago

More details could be found in the Wiki page

joshsmith1999 commented 1 year ago

More details could be found in the Wiki page

Thank you for your contribution and update~