next up previous
Next: PREEMPTION allows a message Up: INSTRUCTIONS Previous: NT schedules a new

OUTG writes variable and array values with titles

Syntax:

    OUTG <variable>: <file>: <format>: <name>;
It is used to write values of a single or indexed variable (with only one index) preceded by a written name. The output is always made for the screen.

This instruction can be used in nodes of any type.

See instruction REPORT (6.20).

Example:

    Lock  (R) :: STAY := 3.2;
    -------------------------------------------
    Results (A) :: Ttcs := MSTL(EL_Lock);
       OUTG Ttcs: WaitFile: 6: 2: Mean waiting at lock entrance ;
       PAUSE; CLOSE(WaitFile); ENDSIMUL;
    -------------------------------------------
    INIT
    -------------------------------------------
       ACT(Results, 40);
       ASSIGN(WaitFile, 'Waitf.Pas'); REWRITE(WaitFile);
    -------------------------------------------
   DECL VAR Ttcs: REAL; WaitFile: TEXT;
If the mean permanence of messages (ships) queue at the entrance (EL) of the node Lock was 7.177, then, when this instruction is executed, the following is written in the screen and in the file Waitf.Pas:
  Mean waiting at lock entrance     7.18

The procedure PAUSE stops the process to allow to read the output.

       OUTG Pass_Number[1..6]: 5: Number of passengers at each bus stop;
If the content of the array Pass_Number is 2, 4, 12, 7, 5, 16, then the following is written in the screen:
  Number of passengers at each bus stop
      1    2    3    4    5    6

      2    4   12    7    5   16
See examples 1, 6, 18 (GLIDER examples book).



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