home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 349_01 / sss.arc / GUIDE.SSS < prev    next >
Text File  |  1991-03-18  |  8KB  |  177 lines

  1.  
  2.  
  3.                                  SSS
  4.                       Simulation Subroutine Set.
  5.                              Version 1.00
  6.  
  7.                 Copyright (C) M. A. Pollatschek 1990.
  8.                          All rights reserved.
  9.  
  10.  
  11.                         SHORT REFERENCE GUIDE
  12.                         =====================
  13.  
  14.                                GENERAL
  15.  
  16. This Guide describes the purpose of SSS routines, their arguments, and the
  17. debug options.
  18.  
  19. Consult the following files for further information:
  20.  
  21. Types of functions and arguments - *.H
  22. Use of routines in context       - EX_*.*
  23. Explanation of examples EX_*.*   - EX_*.DOC
  24. Fuller descriptions of routines  - MANUAL.SSS
  25. Concepts                         - GLOSSARY.SSS
  26. Index                            - INDEX.SSS
  27.  
  28.  
  29.                         LIST OF ROUTINES
  30.                   and where they are described
  31.  
  32.   for    look     for    look     for    look     for    look
  33. routine  under  routine  under  routine  under  routine  under
  34. A....... 7      IDIC.... 8      QNUM....10      SETSEE..12
  35. AIC..... 8      IDIQ.... 9      QSTD....10      SETT.... 3
  36. AIQ..... 9      INIQUE.. 2      QUEUE... 6      SHOWQ...11
  37. BE...... 1      INISTA.. 2      RA...... 1      SIMEND.. 4
  38. BI...... 1      NC...... 8      REMVFQ.. 5      SIMERR..11
  39. CD...... 1      NCEN.... 3      REMVFQ.. 5      SMAX....10
  40. CLEARQ..10      NEIC.... 8      RL...... 1      SMIN....10
  41. CLEARS..10      NEXTEV   5      RN...... 1      SNUM....10
  42. CREATE.. 2, 4   NP...... 1      SAVG....10      SSTD....10
  43. DISPOS.. 6      NQ...... 9      SCHED... 4, 6   SUMRY...10
  44. DP...... 1      PRIQ.... 9      SETA.... 7      T....... 3
  45. ER...... 1      QAVG....10      SETANT..12      TALLY...10
  46. EX...... 1      QDC..... 3      SETDEB..11      TIC..... 8
  47. GA...... 1      QMAX....10      SETIDE.. 7      TR...... 1
  48. IDE..... 7      QMIN....10      SETQDC.. 3      UN...... 1
  49.                                                 WE...... 1
  50.  
  51.  
  52.  
  53.                     1. Random variates
  54. Remarks: all of them return a value depending on distribution law.
  55.  
  56. BE(W,U)    Beta with mean W/(U+W)
  57. BI(N,P)    Binomial, P probability of success in each of N trilas
  58. CD(X,V,N)  User defined continuous, V=array of N probabilities,
  59.            X=array of N values
  60. DP(V,N)    User defined discrete, V=array of N probabilities,
  61. ER(M,K)    Erlang with K stages and mean K*M
  62. EX(M)      Exponential with mean M
  63. GA(M,K)    Gamma, GA(M,K) is same as ER(M,K) for integer K
  64. NP(M)      Poisson with mean M
  65. RA()       Random, uniform between 0 and 1
  66. RL(M,S)    Log-normal, after natural log: M=mean, S=standard deviation
  67. RN(M,S)    Normal, M=mean, S=standard deviation
  68. TR(I,B,C)  Triangular between I and C with mode B
  69. UN(I,C)    Uniform between I and C
  70. WE(M,U)    Weibull, WE(M,1) is the same as EX(M)
  71.  
  72.                  2. Initialization routines
  73.  
  74. Remarks: INIQUE and CREATE must be called in the beginning of a simulation
  75.          INIQUE and INISTA must not be called twice, CREATE can be called
  76.            more
  77.  
  78. CREATE(g,i)         Creates an arrival in time g from present time with id i
  79. INIQUE(q,b,s)       Initializes q queues, b attributes and s statistics
  80. INISTA(j,h,k,l,f,w) Initializes statistic # j where h:title of a statistic
  81.                     (str20), k:1=time persistent statistic, 0=ordinary,
  82.                     l:number of cells l=0 if no frequency table is required,
  83.                     f:lower bound of first cell in a frequency table,
  84.                     w:width of a cell in frequency table
  85.  
  86.                    3. State of the system
  87.  
  88. NCEN()       Returns the number of current entities ( 1 or 0)
  89. QDC(m)       Returns first letter of m-th queue's discipline (L/F/S/B)
  90. SETQDC(m,d)  Sets discipline d in queue number #m, d is one of:
  91.              FIFO,LIFO,SVF,BVF - must be capital as str6.
  92. SETT(g)      Sets current simulated time to g
  93. T()          Returns the current simulated time
  94.  
  95.                  4. Placing an event on calendar
  96.  
  97. CREATE(g,i)   Creates an arrival in time g from present time with id i
  98. SCHED(g,e,i)  Schedules event e>1 for time g from present time with id i
  99. SIMEND(g)     Ends simulation at time g (absolute) or immidiately if g=0
  100.  
  101.              5. Routines making an entity be current
  102.     Remark: Previous to calling, there must be no current entity
  103.  
  104. NEXTEV()    Returns event code of following event
  105. REMVFC(r)   Removes r-th entity from calendar
  106. REMVFQ(m,r) Removes r-th entity from queue m
  107.  
  108.  
  109.  
  110.         6. Routines making the current entity to disappear
  111. Remarks:previous to calling there must be a current entity except
  112.         for DISPOS, which works well in any case
  113.  
  114. DISPOS()     Destroys current entity if exists
  115. QUEUE(m,p)   Enters the current entity to queue m with priority p
  116. SCHED(g,e,i) Schedules event e>1 for time g from present time with id i
  117.  
  118.                    7. Concerning current entity
  119. Remark: previous to calling there must be a current entity
  120.  
  121. A(n)      Returns the n-th attribute of current entity
  122. IDE()     Returns id of current entity
  123. SETA(n,v) Sets attribute n of current entity to v
  124. SETIDE(i) Sets identity of current entity to i
  125.  
  126.                   8. Concerning scheduled entities
  127.  
  128. AIC(r,n) Returns the n-th attribute of the r-th entity in calendar
  129. IDIC(r)  Returns the id of r-th entity in calendar
  130. NC()     Returns the number of scheduled items in calendar
  131. NEIC(r)  Returns the event code of r-th entity in calendar
  132. TIC(r)   Returns scheduled time of r-th enitity's event in calendar
  133.  
  134.                   9. Concerning entities in queues
  135.  
  136. AIQ(m,r,n) Returns the n-th attribute of the r-th entity in queue m
  137. IDIQ(m,r)  Returns the id of r-th entity in queue m
  138. NQ(m)      Returns number of entities in queue m
  139. PRIQ(m,r)  Returns the priority of r-th entity in queue m
  140.  
  141.                    10. Statistical routines
  142.  
  143. CLEARQ(m)           Clears queue statistic of queue m, if m=0 clears all m
  144. CLEARS(j)           Clears statistic # j, if j=0 clears all j
  145. QAVG(m)             Returns average of queue # m
  146. QMAX(m)             Returns maximum of queue # m
  147. QMIN(m)             Returns minimum of queue # m
  148. QNUM(m)             Returns time duration for collecting queue statistics
  149. QSTD(m)             Returns standard deviation of queue # m
  150. SAVG(j)             Returns average of variable # j
  151. SMAX(j)             Returns maximum of variable # j
  152. SMIN(j)             Returns minimum of variable # j
  153. SNUM(j)             Returns sample size of variable # j
  154. SSTD(j)             Returns standard deviation of variable # j
  155. SUMRY(u)            Prints out statistics to file named u
  156. TALLY(j,v)          Collects statistic j for value v
  157.  
  158.  
  159.  
  160.                           11. Debugging aids
  161.  
  162. SETDEB(o) Sets debug option o (3 is default). o has the following effect:
  163.           ╔══════════════════════════════════════════════════════════════╗
  164.           ║o =             0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15║
  165.           ║stop on error?  N  Y  N  Y  N  Y  N  Y  N  Y  N  Y  N  Y  N  Y║
  166.           ║print error?    N  N  Y  Y  N  N  Y  Y  N  N  Y  Y  N  N  Y  Y║
  167.           ║print calendar? N  N  N  N  Y  Y  Y  Y  N  N  N  N  Y  Y  Y  Y║
  168.           ║print queues?   N  N  N  N  N  N  N  N  Y  Y  Y  Y  Y  Y  Y  Y║
  169.           ╚══════════════════════════════════════════════════════════════╝
  170. SIMERR()  Returns and clears error code, effective for even o above
  171. SHOWQ(m)  Prints out contents of queue m>0 or calendar if m=0
  172.  
  173.                    12. Manipulation of random number stream
  174.  
  175. SETANT(y)  Sets (y > 0)/clears (y = 0) antitethic variables
  176. SETSEE(x)  Sets the random seed to value x (x is odd positive integer)
  177.