Skip to content

Oscar Software Framework Manual Simulation Module

scs edited this page Jul 13, 2012 · 2 revisions

Go to Table of Contents.

Table of Contents

Simulation Module (sim)

Description

The simulation module is used to keep track of the current simulation progress on the host platform. It is generally not used directly by the application, but rather by other modules. But it is allowed for the application to directly register a callback every new time step.

Target Hardware Resource

Not hardware resource related.

Dependencies

None.

Usage

Following code segment demonstrates the usage of the sim module. For the sake of simplicity, error checking as well as framework creation and destruction are neglected.

 OscSimInitialize(); /* (2) */
 
 for( ever)
 {
     /* main loop */
     ... doAlgorithm .. 
     
     OscSimStep(); /* (3) */
 }
  1. Register a callback to be made every simulation time step. In this case, the function 'callback' should be called.
  2. Start the simulation process.
  3. Increment the time step every incrementation of the main loop.
Clone this wiki locally