1

I am trying to collect the following data using Veins towards each single lane, including throughput, density, mean speed, delay and collision. I know TraCI has the Simulation Value Retrieval, which can provide some information that I need. Also, the Lane Value Retrieval can help. But I have no clue where should I put the customized codes, so that the statistics can be recorded properly. For example, I want to collect the density and the mean speed of each lane every minute of the simulation time, which class should I put my codes to? TraCISenarioManager?

Any suggestion is appreciated.

J.G
  • 190
  • 3
  • 13

1 Answers1

2

I think putting the code in TraCIScenarioManager is entirely reasonable. If you want per-vehicle statistics I'd recommend putting them in the vehicles' application code, the way VEINS already collects some statistics out of the box.

  • So, if I also want the `TraCIScenarioManager` to be able to send wsm message, would inheriting `BaseWaveApplLayer` be reasonable? Thanks. – J.G Apr 10 '18 at 03:59
  • No, that doesn't make any sense. WSM messages are sent by vehicles or infrastructure; what would be the sender of messages from `TraCIScenarioManager`? – Rens van der Heijden Apr 10 '18 at 05:29
  • That's correct. In the real world, the information of the road should be obtained from the vehicle. But from the simulation perspective, for example, there are 100 vehicles on the target road, in order to get the information of the road, I actually do not have to let all of the vehicles do the computing work. Rather, if I can get the lane info in `TraCIScenarioManager`, then I can save much computing work, and I might be able to disseminate to the target vehicles in this module. I know it does not make sense from the real world perspective, but is it possible from the simulation perspective? – J.G Apr 11 '18 at 00:37