next up previous
Next: EXTR extracts a message Up: INSTRUCTIONS Previous: DOEVENT permits instruction execution

DONODE prevents instruction execution during network scanning

Syntax:

    DONODE <associated instruction>;
DONODE is used when an instruction or a set of instructions must be executed only in the event that activates the node, where the instruction appears, and only in the first activation of the node. When the node with this instruction is activated as the first in the execution of an event, the <associated instruction> is executed. Execution is skipped in the activations produced by scanning of the network. In a multiple node the effect occurs for all the nodes.
See instruction DOEVENT (6.7)

This instruction can be used in any type of node.

Examples:

  1.       Road_Entr (I)     ::  IT := EXPO(1.5);
          Traffic_Contr (G) ::  DONODE BEGIN SENDTO(Road); IT := 20 END;
    Messages (cars) leaving the node Road_Entr are stopped at Traffic_Control. Each 20 time units the accumulated messages are sent to Road. It is assumed that the messages are not recycled to Traffic_Contr in the event that activates that node.
  2.       Road_Entr (I)     :: IT := EXPO(1.5);
          Traffic_Contr (G) :: STATE BEGIN N := 0; IT := 20 END;
                                     DONODE
                                     IF N < 3
                                     THEN BEGIN N := N + 1; SENDTO(Road) END
                                     ELSE STOPSCAN;
    Messages (cars) leaving the node Road_Entr are stopped at Traffic_Control. Each 20 time units the node is activated and the instruction associated to STATE is executed. This instruction puts N to 0 and schedules a new activation 20 units of time later. It is executed only one time regardless the messages in the EL. The DONODE is then executed for the messages accumulated in the EL of Traffic_Control. The associated instruction sends up to three messages to Road.


domingo c
Mon Mar 20 17:36:19 PST 2000