Index 4 . Simulation object code assembly To maximize the interactivity of the system, it had to be possible not only to modify existing simulation entity objects on the fly by adding new attributes, but also to allow for runtime-creation of corresponding new simulation events affecting them. Instead of developing yet another general purpose simulation library, and intrigued by the possibility of importing arbitrary Python code into the running interpreter, I decided to take on a slightly different approach using what could be called assembly from composite templates . In the inter-site simulator, templates are composite structures that consist of a prototype , one or several modules and a profile .
Prototypes implement the builtin-functionality of simulation objects.
The Python code implementing the simulation objects is then assembled automatically from these template definitions and loaded into the running interpreter. Before the actual source code assembly of a user-composed template can take place, its runtime relationships to other templates used for a particular simulation run have to be specified in a structure called template set . A simple example should clarify the procedure. The same scheme is used for assembling the simulation event template Move, which implements simple straight-line movements for the corresponding entity. Neither of the two templates uses any modules.