Package ikr.simlib.parameters

Simulation Parameters

See: Description

Package ikr.simlib.parameters Description

Simulation Parameters

The IKR Simulation Library can read simulation parameters from a file, the so-called parameter file. How to write a parameter file and how to read parameters inside the simulation program will be explained in the following.

Parameter File Structure

The parameter file will be read on a per-line basis. Each line must have the following structure:

"key" = "value"

There are two principle for defining keys:

- The key may be any name, which the simulation program can query for. Organizing the name space must be done by the programmer.

- The key or the first part of the key is the fully qualified name of the SimNode that shall read the corresponding parameter(s). Names may contain wildcards to make the key match different queries.

The value will be interpreted as follows: You can use the # character to write comments. All characters of a line following the # character will be ignored. Empty lines will be ignored.

Example parameter file:
# Calls = 10000
TandemModel.*.NrOrGenerator = 42 # the answer
TandemModel.Node*.Generator = StdGenerator
TandemModel.Node*.Generator*.IATDist = NegExp
TandemModel.Node*.Generator*.IATDist.Mean = 50

Reading Parameter Values

Class Parameters
In every SimLib simulation program, there is one object of class Parameters. This object represents the content of the parameter file. The object provides a set of methods to query the parameters listed in this file. The methods, that can be used for querying, are the following ones: There are different variants for providing the query to the methods listed above:

Class Value

The class Value is the abstract base class of the classes Scalar and Array. These objects provide methods to return a parameter value in one of the following forms:

Parser Classes

With the help of the createInstance() method it is possible to create objects from classed defined in the parameter file.