-3

I'm working in a project that include the interaction of Sumo 0.30.0, veins 4.7.1 and Omnet++ 5.4.1

In a C++ project with object oriented programing is possible to define many classes, some of them can inherit from others, but the order of execution of the program is defined in the main function. Omnet environment does not have a main function. We can implement modules, define its submodules and the behavior of these submodules is define by a .cc and .h

My question is:

If the Omnet has not a main function in which order is execute the simulation ?

Mario
  • 5
  • 3
  • 1
    You really want to do the OMNeT++ TicToc tutorial. It will answer many of the questions a typical newcomer to the OMNeT++ simulator has. – Christoph Sommer Feb 17 '19 at 19:59
  • OMNeT++ runs the initialize methods of all modules when they are created. These methods can then create events and schedule them for a certain (stimulation) time. OMNeT++ executes the code associated to these events in the order of this time value. – Christoph Sommer Feb 18 '19 at 00:03

1 Answers1

2

Well,

OMNeT++ has it's own main() function defined in the oppenvir library. That instantiates and executes all the components that are required by most of the simulations. If you want direct control over the execution, you can still not link with the envir lib and provide your own main() function. Tale a look at the samples/embedding example.

Rudi
  • 6,418
  • 1
  • 16
  • 20