Let $Simulator and $Configurations denote the directories in which the compiled code of the building simulator and building configurations reside, respectively.
To start, ERLANG has to be told where the code of the building simulator resides and which building configuration shall be used in simulation. Telling ERLANG where the code resides can be done either by starting ERLANG in the directory $Simulator or by providing $Simulator as a command line option:
These functions can be called from the ERLANG-shell or by using one of the following command-line options:
-s simulator start $Dir $Conf |
-s simulator start $Conf |
-s simulator start |
-s simulator |
To stop ERLANG automatically after finishing simulation one can append the command-line option -s erlang halt to the call of ERLANG. The complete call can have the following form:2
A running ERLANG-process can be interrupted by pressing ^C and then left by pressing a. If the ERLANG-shell is active calling the function halt(). stops ERLANG and the building simulator. Note the period after the parentheses!
When starting the building simulator a configuration file is read which contains information on where to find a description of the simulation objects and on the eventstreams to be started. Its file extension is .cfg. The entries in the file consist of valid ERLANG-terms, their syntax is described in the subsequent sections.
The files accessed by the building simulator are depicted in
figure 1. Solid lines denote dataflow, whereas the dotted
lines denote that which files are actually used depend on the configuration
file. The file extensions used are also shown in this diagram.