Package ikr.simlib.control

Simulation Control

See: Description

Package ikr.simlib.control Description

Simulation Control

The sequence control is a summary of tasks, that take place in every simulation, which can be adapted to each problem in a flexible manner. It can also be applied to simple problems without change and without exact knowledge of the internal structures.
In order to control a sequence the abstract base class Simulation has been developed that defines functions for the individual steps, which are executed during a simulation. Most of these functions are empty and can be overridden in derived classes.

The class StdSimulation derived from Simulation has been pre-defined and will suffice for many simulations. One entity of this class is generally declared in the main() function of the simulation program and requires the following parameters upon constructor call:

Simulation Phases

The individual phases of a simulation - realized by methods of the class Simulation - are processed when the method run() from Simulation has been called. Normally, this occurs in the main() function of the simulation program.

In the derived class StdSimulation, the methods have been (partly) overridden so that they mirror a normal sequence of a simulation.

Besides this approach, there is another possibility to achieve simulation results, which makes use of batch parallelization. Here the intermediate results of each batch are written to a special file. In a second run, all these batch results are read in and the final results are calculated. Each parallelized run goes through all of the above mentioned phases. Thus there is a transient phase for each run, which means that in total more has to be simulated in comparison to a nonparallelized simulation. As consequence the usage of batch parallelization is only reasonable when having more CPUs or cores than simulations or when the time to execute the simulation needs to be reduced.