Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Data Structures   File List   Namespace Members   Data Fields   Globals   Related Pages   Examples  

ODEMx - An Overview

In this chapter we will give an overview of ODEMx.

The Structure

ODEMx is divided into the six modules Base, Utilities, Random, Synchronisation, Statistic and Coroutine. All modules depend on Utilities. The Base module additionally depends on Coroutine and Random, while the Synchronisation module depends on Base. Utilities contains utility classes and interfaces of ODEMx. Coroutine provides a coroutine implementation. Base contains basic modelling concepts. The Random module is a collection of random number generators. Synchronisation and Statistic provide classes for synchronisation and statistical analysis.

Base

Base contains classes for the basic modelling concepts of process simulation and three important output classes. Not all classes in this module are for public use. Those of immediate relevance to a user of ODEMx are: Simulation, Process, Continuous, HtmlTrace, HtmlReport and ContuTrace which are declared and implemented in the files Simulation.h, Simulation.cpp, Process.h, Process.cpp, Continuous.h, Continuous.cpp, HtmlTrace.h, HtmlTrace.cpp, and finally HtmlReport.h along with HtmlReport.cpp.

Simulation

For every simulation with ODEMx a class derived form the abstract base class Simulation is necessary. The Simulation class provides a context for all the other model components like processes, synchronisation classes and random number generators. In the user defined classes the initSimulation() method has to be implemented to create and initialise model components.
For convenience ODEMx also provides the class DefaultSimulation with an empty implementation of initSimulation(). If the user does not want to define a specific simulation class, this default implementation can be used. A pointer to an object of this class is returned by the function getDefaultSimulation(). This function creates the object if required. ODEMx provides at most one object of DefaultSimulation in a program.
If a user defines their own simulation classes, several simulations in one program are possible. This includes simulations inside simulations and parallel simulations.
Documentation:

Process

Process is the base class for all user defined classes of discrete processes. For every process in a simulation the user has to specify a process class. This class has to provide the behaviour (the sequence of actions, synchronisation and idle periods) of its objects as an implementation of the function main(). While a process class is not necessarily associated to a simulation class, every process is linked to one simulation. (The constructor of the base class Process requires a pointer to a simulation.)
Documentation:

Continuous

As Process is the base class for discrete processes, Continuous is the base class for continuous processes. Continuous itself is derived from Process, but provides additional functions to define time continuous behaviour. Time continuous behaviour can only be approximated by ODEMx. This is done through a step by step computation of state changes, which of course introduces an inherent error. ODEMx is observing this error to keep it in defined boundaries.
A user defined class of continuous processes has to provide an implementation of the function derivatives() in addition to its implementation of main(). In this function the continuous state changes are coded by setting the change rates for each state variable. A continuous phase is than started in main() by a call of integrate().
Documentation:

HtmlTrace

During development it is often required to take a closer look at what actually happened during a simulation. HtmlTrace logs simulation events for this and other reasons. The backbone of HtmlTrace actually is a sophisticated trace system which supports multiple trace clients (like HtmlTrace) with different outputs (for example Xml instead of Html) fed by arbitrary trace producers. A user can define its own trace producers and add its specific events to the trace. The amount of events during a simulation is usually enormous. To reduce the number of logged events HtmlTrace provides a simple filter.
Documentation:

HtmlReport

Like HtmlTrace, HtmlReport is used to gather information about a simulation. Instead of logging all simulation events, HtmlReport is used to report summaries of a simulation. Such summaries are often statistical analysis of samples from model components. A summary could for instance include the number of uses of a random number generator, the maximum time of processes spent in a queue or the average number of free token in a resource. ODEMx also supports multiple reports about different sets of model components.
Documentation:

ContuTrace

ContuTrace finally is a class for observing Continuous objects. It logs the state changes of continuous processes. The output is written in a text file. An object of the type ContuTrace is always linked to exactly one object of the type Continuous.
Documentation:

Utilities

This module contains utility classes and interfaces for concepts of ODEMx. The Trace system as well as the base classes for HtmlReport can be found in this module. But many classes in Utilities are not used directly. A user might be interested in the functions in ErrorHandling.h and in odemx::Version. For background information it will be necessary to take a closer look at this module.

Random

Random provides a set of random number generators (RNGs). There are RNGs of different distributions for discrete and for continuous random numbers. This module is further divided into a module for Integer distributions and a module for Continuous distributions. The usage of all RNGs from these modules is quite similar. All RNGs provide a function sample() which returns the next random number. The parameters for the generator are set in the constructors.

Synchronisation

An important part of process simulation is to synchronise different processes with certain situations during a simulation. Synchronisation is a collection of classes which provide model components for synchronisation tasks. There are two resource-type synchronisation classes: Bin and Res, two queue-like synchronisation components Waitq and Condq and finally one synchronisation-point-type class Wait.

Bin and Res

Bin and Res are both used to model resource-like synchronisation. A process is blocked if the resource is exhausted otherwise it continuous its actions. Bin and Res use tokens to simulate real resources. A process takes and gives, or acquires and returns tokens.
Documentation:

Waitq

Waitq provides a master-slave-synchronisation (MSS). A MSS is a synchronisation between two processes. One of them (the master) takes control after a successful synchronisation. The other (the slave) is delivered to the master.
Documentation:

Condq

Condq is used to wait for an arbitrary condition. A process provides a function which implements the condition check. The condition is checked every time a process signals a Condq object. The user is responsible to signal a Condq when the situation has changed.
Documentation:

Wait

The class Wait synchronises a process with a set of partner processes. The process that creates the Wait class is blocked until one or all of its partner processes are terminated.
Documentation:

Statistics

An important part of every simulation is to analyse the results. ODEMx supports this with six classes in the module Statistic: Count, Sum, Tally, Accum, Histo and finally Regress. These classes are used to collect and analyse samples. All of them have a usage counter and allow to reset their statistics.

Coroutine

Unlike the others this module is not meant to be used by the user directly. It contains an implementation of coroutines which fits the needs of ODEMx. The implementation is independent of Base and the other modules with the exception of some classes in Utilities.
Generated on Mon Aug 11 10:36:06 2003 for ODEMx by doxygen1.3