How to Speed Up Simulation Time

32 views
Skip to first unread message

Patrick Hammond

unread,
Jun 15, 2017, 4:08:19 PM6/15/17
to OpenEaagles
A colleague and I have made some pretty significant modifications to the Example mainSim3 in order to test modeling STK scenarios in OpenEaagles. Everything is working well, but we're running into a problem with the simulation time. Our whole scenario takes about 30 minutes in real-time to complete, and it is not practical to wait that long while debugging our setup. We tried the following modification to timerFunc in main.cpp as a potential solution:

const unsigned int frameRate = 20;

void timerFunc(int) {
    const double dt = 1.0 / static_cast<double>(frameRate);
    const auto millis = static_cast<unsigned int>((dt0 * 1000) / 2);  // millis = 25
    glutTimerFunc(millis, timerFunc, 1);

    oe::base::Timer::updateTimers(dt);
    oe::graphics::Graphic::flashTimer(dt);
    station->updateData(dt);
}

The idea is to double the rate of update while still reporting a delta time of 1/20 to the simulation. Not only did this not increase the speed of our simulation, but it doesn't seem to have had any effect at all. Does anyone have any suggestions? I feel there must be a way to run the simulation faster than real-time.

Thanks for your help.

Doug

unread,
Jun 16, 2017, 9:49:36 AM6/16/17
to OpenEaagles
You need to call updateTc() !!

In mainSim3 there is a call to "station->createTimeCriticalProcess()" -- that is calling updateTc() in sync with wallclock.  You don't want to do that.

See the mainNonRT1 example for how to call things.

I'd be really interested in seeing what you are doing -- did you add satellite propagation routines (SGP4)? I know they are open-source and many projects on GitHub have them -- just haven't had to the time to add/include them within framework.

If you have something that can be contributed back, I'd love to see it.

Doug


Message has been deleted

Patrick Hammond

unread,
Jun 16, 2017, 10:18:03 AM6/16/17
to OpenEaagles
Thank you for your prompt reply! We'll look into that example.
We haven't gone so far as to include satellites yet. We are currently only using aircraft and ground vehicles in our scenario. We would definitely like to contribute. We'll keep you updated on our progress.
Reply all
Reply to author
Forward
0 new messages