As part of a Masters Team Project, done by Esmée Bertens, Tim de Ridder and Herman de Vos, a framework for performing chi-simulation experiments within the SE Group has been developed. The framework is written in Python and is developed in order to:
From this page the required Python files for the framework can be downloaded (see Downloads section below). For a detailed description of the framework is referred to the report of the Masters Team Project that is mentioned above or to the slides of the presentation that was given at the SERR meeting on 3 May 2007.
The experimenting process is divided into three parts:
The framework contains three parallel processes in which these three parts of the experimenting process are executed. Data is exchanged between the processes by means of three buffers:
The figure below shows how the functionality described above, is implemented in five different files:
frame.py
run_*.py
calc_*.py
vis_*.py
main_*.py
In frame.py
a class called Frame
is defined. Frame
possesses three execution threads in which three Python functions, called run_func()
, calc_func()
and vis_func()
, are executed. These functions are defined in run_*.py
, calc_*.py
and vis_*.py
. An experiment is initialized and started by the script main_*.py
.
A documentation of the defined classes and functions is created from the Python code using Epydoc. This zip file consists of a number of html files. To read the documentation: Unzip the file and start index.html
.
frame.py
will soon be installed on the SE racks. Until then, use the frame.py file from the Downloads section.
frame.py
contains the fixed part of the framework, whereas the other files (the main script and the function files) are specific for each experiment. The latter files are supposed to be created and adapted by the end user.
Below, the interfaces of the Run, Calculation and Visualization functions are shown:
In each function, log information can be written by a command like:
log.write("RUN\tThis is log information.")
Data is written to and read from a buffer by:
r2c.write(data) data = r2c.read()
where data
is allowed to be any object except None
.
Optional parameters, which are set in the main script, are passed as a list (or a dictionary) through the pars
argument.
See the template and example files in the Downloads section to get an idea of how to build your own function from the elements that are described above.
The script main_*.py
performs the following actions:
Frame
and pass the required functions and parameters to it.
See the template and example files in the Downloads section to see how to build your own main script.
main_*.py
, run_*.py
, calc_*.py
and vis_*.py
file, which is most suitable to your experiment.my_run_script.py
my_calc_script.py
my_vis_script.py
my_main_script.py
. Make sure the functions called in this script are imported from the files created in step 3.$ python my_main_script.py
When Plots are created with for instance Gnuplot, make sure Exceed is started first.
From the table below, the Python files that are required to set up an experiment, can be downloaded. Users are encouraged to add there own function files to the list below, in order to get a more and more complete collection of function files in which all kind of functionality is implemented.
Python files: | Description: |
---|---|
templates | Templates for the main script and the function files. |
Example 1: Multiple parameters | Function files and main script of an example experiment in which simulations are run a fixed number of times with a chi-model that has multiple input and output parameters. Mean values of the simulation output are calculated and plotted in a graph. To view the plots from Gnuplot, first startup Exceed. |
Example 2: Feedback | Function files and main script of an example experiment in which the number of simulation runs is determined by the calculation process, based on the simulation output. To view the plots from Gnuplot, first startup Exceed. |
frame.py | With this file the framework is created for connecting the three processes run, calculation and visualization. This file will soon be installed on the SE rack. |
List of other information presented on this Wiki page:
Information | Description: |
---|---|
report | Final report of the masters team project. Including a preceding survey of the performing simulation experiments within the SE Group, Conceptual design and implementation details of the final product, clarification of the two examples and recommendations. |
presentation | Presentation of the masters team project that was given at the SERR meeting on 3 May 2007. |
documentation Python files | Documentation of the defined classes and functions is created from the Python code using Epydoc. |