0

In the TicToc tutorial it's stated, talking about statistics generation through signals (and not finish()), that: "As we do not have to save or store anything manually, the finish() method can be deleted. We no longer need it." 5.3 - Statistic collection

I had the idea to apply what I'm reading in the tutorial to the Veins example and guess what I did? I did cancel the finish() method in the TraCIDemo11p.cc source. I got the exit code 127. Could you explain why is this happening?

I'm writing this to understand the cause and for others who might save some time reading this. Also, couldn't find the same question or a similar one suggesting a solution close to this.

I checked the txc16.cc file of the TicToc example of course and there is no finish() method. The main difference I see is that in TicToc we are handling a simple module while in Veins we are defining a more complex one. From the manual I see this pseudocode:

callFinish()
{
   if (module is compound)
      for (each submodule)
         do callFinish() on submodule
   call to user-defined finish() function
}

So I imagine that if nobody on top is calling finish() on submodules then, nobody is calling it at all -> runtime error. Am I getting this right? Any explanation on the whole rationale is appreciated.

eugene
  • 68
  • 6
  • 1
    As you did not specify a Veins version I am assuming you are talking about the most recent one, Veins 5.2. This version of Veins does not define a `finish` method for `TraCIDemo11p` so I cannot see how you would have deleted it. See https://github.com/sommer/veins/blob/veins-5.2/src/veins/modules/application/traci/TraCIDemo11p.h#L45 for the source code – Christoph Sommer Jan 08 '22 at 14:42
  • 1
    You're right, I've probably added that while trying to build some statistics and applying what I learned in the TicToc tutorial. I put it in TraCIDemo11p.h as protected: "void finish() override;" but then I commented it out only on the TraCIDemo11p.cc. I should have commented in both the files or just left it empty. I'm new to all of this, C++, Omnet, Veins, my bad! Thanks for your comment Christoph. Regards – eugene Jan 08 '22 at 16:19
  • 1
    Glad to hear everything worked out! – Christoph Sommer Jan 09 '22 at 17:22

0 Answers0