Initializing MTK Parameters

Motivated by the need to initialize the MTK objects before the start of the simulation, a special event parameter, called INIT, was created. Any event whose parameter is set to INIT is scheduled just one time, when the simulation time is equal to zero. This allows the user to execute an action, or a group of actions, before the simulation actually starts.

The INIT keyword is used in the same way as any event distribution name keyword is:

Example:

Events=
event = event_name( INIT )
condition = ( TRUE )
action = 
{    
    ...
    /* Actions */
    ...
};
The only difference is that each Tangram-II object can have only one event of this type (with this parameter).

Special care should be taken with the messages sent during these events, since no assumptions can be made on the order of their execution and, consequently, no order of message delivery is guaranteed. Finally, even if a user defines an event of this kind, he is still obeyed to initialize the model variables and constants in Initialization section, but nothing hinders the user from overwriting these values inside the event code.

As stated above, an event of this type is useful to bootstrap a MTK object before simulation starts, reading a trace or setting its parameters. It is also helpful to initialize a long Tangram-II vector, eventually with a special logic, and it allows users to initialize model variables with mathematical expressions, possibly based on other model parameters, which cannot be done in Initialization section.

Guilherme Dutra Gonzaga Jaime 2010-10-27