Commit 49c66c64 authored by Mirko Stoffers's avatar Mirko Stoffers

Moved context switching in main loop

Problem: The context was set in the main loop just prior to the event
offloading. This yielded the problem that it was not set correctly
during determination of event durations thus picking the duration from
wrong RNGs.

Solution: Moved context switching prior to duration determination.
parent e1750c09
......@@ -674,6 +674,10 @@ void cSimulation::doOneEvent(cMessage* msg)
throw cRuntimeError("Activity-Model not supported with Horizon.");
}
// set the context for sequential execution
setContext(mod);
setContextType(CTX_EVENT);
simtime_t duration = msg->getEventDuration();
bool sequentialExecution = (duration == SimTime::simTimeSequentialExecution);
......@@ -699,10 +703,6 @@ void cSimulation::doOneEvent(cMessage* msg)
}
else
{
// set the context for sequential execution
setContext(mod);
setContextType(CTX_EVENT);
EVCB.simulationEvent(msg);
msg->setPreviousEventNumber(event_num);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment