Dynamic Map Function for the Discrete Event Domain



Introduction

Using the stars


In Ptolemy 0.7 and earlier the DE domain did not support a mutable system configuration. The map function in Ptolemy's  HOF domain allows for instantiating as many objects of a block as one needs. But, all these objects will be in the system configuration for the entire simulation's runtime. Moreover, one has to specify the number of objects before the simulation starts. So, the common map function does not support a mutable system configuration.

In the following, a group of stars which implement a dynamic map function is introduced. These stars look form the outside pretty much like the common map stars in the HOF domain. However, the DEDynMap star does not have a parameter for the number of multiplications - as it is the buswidth in the HOF domain -, but two additional inputs. These inputs expect events when a new copy of a block is to be put into the topology or is to be taken out of it. So, these stars allow for instantiation and deletion of any block during runtime on demand. Hence, they give the chance to change the topology during the runtime of a simulation.

In the contrary to Ptolemy's HOF stars, these stars have heavily to work and to interact with the scheduler. So, they are only implemented for the DE-domain.

All icons for the stars which are explained below are in a palette mutable.pal, which can be found in $PTOLEMY/src/domains/de/contrib/demo.



The DEDynMap star and derived types allow for runtime creation and deletion on demand of any block (star, galaxy, source, sink) in the DE domain. The block, which is to be multiplied at runtime, is in the following called the master block. It is the equivalent of the replacement block in the HOF domain. The master block can itself contain dynamic map functions, thus allowing cascaded mutations.

The DEDynMap star is always to be used together with DEDynMerge and/or DEDynFork stars in order to adapt the number of portholes and connections automatically during runtime. The master block itself is to be specified textually in the parameters of the DEDynMap star. Alternatively, a graphical version DEDynMapGr is also provided.

The DEDynMap star creates or deletes instances of the master block and connects their portholes to the multiportholes in DEDynFork and DEDynMerge. So, these stars separate the runtime mutations from their outside: All mutations take place between the DEDynFork and the DEDynMerge stars. The DEDynMap star creates a new copy of the master block and puts it into the topology each time it gets fired at the newBlock porthole. It takes a copy out of the topology and deletes it each time it gets fired at the delBlock porthole. The copies are identified by an instancenumber. These stars perform everything needed to mutate the topology, like changing the number of portholes in DEDynMerge and DEDynFork or setting up new connections. The user does not need to program anything. These stars can be used in Ptolemy schematics in the common way: they just are to be connected with other stars and their states are to be set.
 


Last changed on 5/13/98. Please, send comments to: voigtje@ifn.et.tu-dresden.