A DE primitive can be viewed as an event-processor; it receives events from the outside, processes them, and generates output events after some latency.
In a DE primitive, the management of the timestamps of the particles (events) is as important as the input/output mapping of particle values. Generating output values and timestamps are separable tasks. For greatest modularity, some DE primitives, so-called delay primitives, are dedicated to time management. Examples of such primitives are Delay and Server. These primitives, when fired, produce output events that typically have larger timestamps than the input events. They usually do not manipulate the value of the particles in any significant way. The other primitives, so-called functional primitives, avoid time management, usually by generating output events with the same timetamp as the input events. They, however, do manipulate the value of the particles.
For managing timestamps, the DEStar class has two DE-specific members: arrivalTime and completionTime, summarized in the table below. Before firing a primitive, a DE scheduler sets the value of the arrivalTime member equally to the timestamp of the event triggering the current firing. When the primitive fired, before returning, it typically sets the value of the completionTime member to the value of the timestamp of the latest event produced by the primitive. The schedulers do not use the completionTime member, however, so it can actually be used in any way the primitive writer wishes. DEStar also contains a field delayType and a method setMode that are used to signal the properties of the primitive, as described below.
Method |
Description |
---|---|
double completionTime |
store the completion time of the current execution, which in turn is equal to the next free time |
double arrivalTime |
is set by the scheduler to the timestamp of the event triggering the current firing |
int delayType |
flag to indicate whether it is a delay type primitive or not |
void setMode (FiringMode m) |
set the firing mode to PHASE or SIMPLE |