home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / modula2 / library / queuem2 / quedata.def < prev    next >
Text File  |  1989-08-02  |  2KB  |  65 lines

  1. (* source: h:\modula\code\queues\QueData.DEF  v1.0a         revised: 88.07.19
  2.    author: G.Greene, AGCS D/429 (NS/TS), 312/681-7783       created: 88.07.19
  3.  
  4.    function:
  5.     This file has common declarations for main module QueuExam.  The
  6.     declarations here are shared by other, externally-compiled modules.
  7.  
  8.    history:
  9.     88.07.19  1.0a  initial release.
  10. *)
  11.  
  12. DEFINITION MODULE QueData;
  13.  
  14. FROM  QueueADT  IMPORT  (*TYPE*)  Queues;
  15.  
  16. CONST
  17.   MaxQueues  = 10;     (* maximum number of queues that may be allocated *)
  18.   MaxServers = 5;      (* maximum number of servers PER QUEUE *)
  19.  
  20. TYPE
  21.   ServerListIndices = [ 1 .. MaxServers ];
  22.   ServerNumbers     = [ 0 .. MaxServers ];
  23.   QueueListIndices  = [ 1 .. MaxQueues ];
  24.  
  25.   ServiceFunctions  = ( Exponential, Normal, Lognormal );
  26.   ProcessTimes      = CARDINAL;
  27.  
  28.   QueueEntryData =
  29.     RECORD
  30.       StartTime:   ProcessTimes;
  31.       ServiceTime: ProcessTimes;
  32.     END;   (* QueueEntryData *)
  33.  
  34.   QueueInfo =
  35.     RECORD
  36.       theQueue:      Queues;        (* the actual queue (abstract type) *)
  37.       CurrentSize:   CARDINAL;      (* length of the queue *)
  38.  
  39.       TotalWait:     LONGCARD;      (* total of customer delays in queue *)
  40.  
  41.       ServerCount:   ServerListIndices;
  42.       ServiceFcn:    ServiceFunctions;
  43.       ServiceTimeEV,
  44.       ServiceParm1,                 (* parameters to the service time ... *)
  45.       ServiceParm2:  REAL;          (*   interval probability distribution *)
  46.  
  47.       SinkOutputTo:  QueueListIndices;
  48.       ExternalInput: BOOLEAN;
  49.     END;   (* QueueInfo *)
  50.  
  51.   ServerInfo =
  52.     RECORD
  53.       TotIdleTime: ProcessTimes;  (* total time this server was idle *)
  54.       CustomerCnt: CARDINAL;      (* number of customers server processed *)
  55.  
  56.       IdleNow:     BOOLEAN;       (* true, if not currently serving *)
  57.       myCustomer:  QueueEntryData;
  58.       IdleSince:   ProcessTimes;
  59.     END;   (* ServerInfo *)
  60.  
  61.   QueueLists        = ARRAY  QueueListIndices  OF QueueInfo;
  62.   ServerLists       = ARRAY  QueueListIndices, ServerListIndices  OF ServerInfo;
  63.  
  64. END  QueData.
  65.