I am trying to write my own python script to compute the statistics calculated by UNET Stack. I have generated the.nam trace file for the ALOHA sample file and I am writing my script to do the following:
compute received packets
compute enqueued packets (sent)
compute dequeued packets (sent)
compute dropped packets
using what is written in the handbook (https://unetstack.net/handbook/unet-handbook_discrete_event_simulation.html), my script computes received packets by detecting if the line in the trace starts with 'r' and if it does, I increment my counter. Similarly, if a line starts with 'd', I increment the dropped packet count & similarly for enqueued & dequeued packets as well.
My statistics are not matching with the values shown by UNET Stack for each simulation.
I do not understand where the error lies and I would be very glad if anyone could help me out.
I expect to get a similar output to the results shown when I run the ALOHA file in UnetSim but I receive a different result using the logic stated above. I have attached the .nam file incase anyone wants to check it out.
.nam file -> https://drive.google.com/file/d/15LilwmV2uTOvDy76Y1ZRG2JR1qPa_0Cs/view?usp=sharing