nextupprevious
Next:STAT displays the statisticsUp:PROCEDURESPrevious:RETARD produces a delayed

SORT sorts a list of messages

Syntax:
    SORT(<list name>, <field>,| A | D|);
It is used to order an EL or IL by the ascending (A) or descending (D) values of o field of the messages.

 This procedure can be used in nodes of any type.

 Example:

    OrdBatch (G) :: IF (LL(EL_OrdBatch) >= 10) and (F_Process > 0) 
                    THEN BEGIN SORT(EL_OrdBatch, ProcTime, A);
                               SCAN(EL_OrdBatch) SENDTO(Process);
                         END;
    Process (R) :: STAY := ProcTime;
    INIT TSIM := 200; ACT(Arrival, 0); Process := 10;
    DECL MESSAGES Arrival(ProcTime: REAL);
Messages (parts), that need different times to be processed at Process (field ProcTime), must be ordered in increasing order of the process time to optimize the processing. This have to be done by batches of 10 parts. The node OrdBatch produces this ordering. When the arriving messages make a queue of 10 and Process is idle, the queue is sorted in ascending order of ProcTime and it is send, in the attained order, to the node Process.
 


domingo c

Mon Mar 20 17:37:52 PST 2000