0

I've been studying TraciDemo11p and couldn't clearly understand what does stage means.

void TraCIDemo11p::initialize(int stage)
{
    DemoBaseApplLayer::initialize(stage);
    if (stage == 0) {
        sentMessage = false;
        lastDroveAt = simTime();
        currentSubscribedServiceId = -1;
    }
}

1 Answer 1

6

This is explained in the OMNeT++ user manual, section 4.3.3.3 ("Multi-Stage Initialization"): Basically, OMNeT++ modules can be initialized in multiple stages. This allows modules to ensure that, first, all stage 0 initialization is performed for all modules, then all stage 1 initialization, and so on.

1
  • 4
    Init stage 0 is usually used to set up variables, allocate memory etc.
    – Rudi
    Commented Dec 10, 2020 at 14:25

Not the answer you're looking for? Browse other questions tagged or ask your own question.