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 >
Wrap
Text File
|
1991-03-18
|
8KB
|
177 lines
SSS
Simulation Subroutine Set.
Version 1.00
Copyright (C) M. A. Pollatschek 1990.
All rights reserved.
SHORT REFERENCE GUIDE
=====================
GENERAL
This Guide describes the purpose of SSS routines, their arguments, and the
debug options.
Consult the following files for further information:
Types of functions and arguments - *.H
Use of routines in context - EX_*.*
Explanation of examples EX_*.* - EX_*.DOC
Fuller descriptions of routines - MANUAL.SSS
Concepts - GLOSSARY.SSS
Index - INDEX.SSS
LIST OF ROUTINES
and where they are described
for look for look for look for look
routine under routine under routine under routine under
A....... 7 IDIC.... 8 QNUM....10 SETSEE..12
AIC..... 8 IDIQ.... 9 QSTD....10 SETT.... 3
AIQ..... 9 INIQUE.. 2 QUEUE... 6 SHOWQ...11
BE...... 1 INISTA.. 2 RA...... 1 SIMEND.. 4
BI...... 1 NC...... 8 REMVFQ.. 5 SIMERR..11
CD...... 1 NCEN.... 3 REMVFQ.. 5 SMAX....10
CLEARQ..10 NEIC.... 8 RL...... 1 SMIN....10
CLEARS..10 NEXTEV 5 RN...... 1 SNUM....10
CREATE.. 2, 4 NP...... 1 SAVG....10 SSTD....10
DISPOS.. 6 NQ...... 9 SCHED... 4, 6 SUMRY...10
DP...... 1 PRIQ.... 9 SETA.... 7 T....... 3
ER...... 1 QAVG....10 SETANT..12 TALLY...10
EX...... 1 QDC..... 3 SETDEB..11 TIC..... 8
GA...... 1 QMAX....10 SETIDE.. 7 TR...... 1
IDE..... 7 QMIN....10 SETQDC.. 3 UN...... 1
WE...... 1
1. Random variates
Remarks: all of them return a value depending on distribution law.
BE(W,U) Beta with mean W/(U+W)
BI(N,P) Binomial, P probability of success in each of N trilas
CD(X,V,N) User defined continuous, V=array of N probabilities,
X=array of N values
DP(V,N) User defined discrete, V=array of N probabilities,
ER(M,K) Erlang with K stages and mean K*M
EX(M) Exponential with mean M
GA(M,K) Gamma, GA(M,K) is same as ER(M,K) for integer K
NP(M) Poisson with mean M
RA() Random, uniform between 0 and 1
RL(M,S) Log-normal, after natural log: M=mean, S=standard deviation
RN(M,S) Normal, M=mean, S=standard deviation
TR(I,B,C) Triangular between I and C with mode B
UN(I,C) Uniform between I and C
WE(M,U) Weibull, WE(M,1) is the same as EX(M)
2. Initialization routines
Remarks: INIQUE and CREATE must be called in the beginning of a simulation
INIQUE and INISTA must not be called twice, CREATE can be called
more
CREATE(g,i) Creates an arrival in time g from present time with id i
INIQUE(q,b,s) Initializes q queues, b attributes and s statistics
INISTA(j,h,k,l,f,w) Initializes statistic # j where h:title of a statistic
(str20), k:1=time persistent statistic, 0=ordinary,
l:number of cells l=0 if no frequency table is required,
f:lower bound of first cell in a frequency table,
w:width of a cell in frequency table
3. State of the system
NCEN() Returns the number of current entities ( 1 or 0)
QDC(m) Returns first letter of m-th queue's discipline (L/F/S/B)
SETQDC(m,d) Sets discipline d in queue number #m, d is one of:
FIFO,LIFO,SVF,BVF - must be capital as str6.
SETT(g) Sets current simulated time to g
T() Returns the current simulated time
4. Placing an event on calendar
CREATE(g,i) Creates an arrival in time g from present time with id i
SCHED(g,e,i) Schedules event e>1 for time g from present time with id i
SIMEND(g) Ends simulation at time g (absolute) or immidiately if g=0
5. Routines making an entity be current
Remark: Previous to calling, there must be no current entity
NEXTEV() Returns event code of following event
REMVFC(r) Removes r-th entity from calendar
REMVFQ(m,r) Removes r-th entity from queue m
6. Routines making the current entity to disappear
Remarks:previous to calling there must be a current entity except
for DISPOS, which works well in any case
DISPOS() Destroys current entity if exists
QUEUE(m,p) Enters the current entity to queue m with priority p
SCHED(g,e,i) Schedules event e>1 for time g from present time with id i
7. Concerning current entity
Remark: previous to calling there must be a current entity
A(n) Returns the n-th attribute of current entity
IDE() Returns id of current entity
SETA(n,v) Sets attribute n of current entity to v
SETIDE(i) Sets identity of current entity to i
8. Concerning scheduled entities
AIC(r,n) Returns the n-th attribute of the r-th entity in calendar
IDIC(r) Returns the id of r-th entity in calendar
NC() Returns the number of scheduled items in calendar
NEIC(r) Returns the event code of r-th entity in calendar
TIC(r) Returns scheduled time of r-th enitity's event in calendar
9. Concerning entities in queues
AIQ(m,r,n) Returns the n-th attribute of the r-th entity in queue m
IDIQ(m,r) Returns the id of r-th entity in queue m
NQ(m) Returns number of entities in queue m
PRIQ(m,r) Returns the priority of r-th entity in queue m
10. Statistical routines
CLEARQ(m) Clears queue statistic of queue m, if m=0 clears all m
CLEARS(j) Clears statistic # j, if j=0 clears all j
QAVG(m) Returns average of queue # m
QMAX(m) Returns maximum of queue # m
QMIN(m) Returns minimum of queue # m
QNUM(m) Returns time duration for collecting queue statistics
QSTD(m) Returns standard deviation of queue # m
SAVG(j) Returns average of variable # j
SMAX(j) Returns maximum of variable # j
SMIN(j) Returns minimum of variable # j
SNUM(j) Returns sample size of variable # j
SSTD(j) Returns standard deviation of variable # j
SUMRY(u) Prints out statistics to file named u
TALLY(j,v) Collects statistic j for value v
11. Debugging aids
SETDEB(o) Sets debug option o (3 is default). o has the following effect:
╔══════════════════════════════════════════════════════════════╗
║o = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15║
║stop on error? N Y N Y N Y N Y N Y N Y N Y N Y║
║print error? N N Y Y N N Y Y N N Y Y N N Y Y║
║print calendar? N N N N Y Y Y Y N N N N Y Y Y Y║
║print queues? N N N N N N N N Y Y Y Y Y Y Y Y║
╚══════════════════════════════════════════════════════════════╝
SIMERR() Returns and clears error code, effective for even o above
SHOWQ(m) Prints out contents of queue m>0 or calendar if m=0
12. Manipulation of random number stream
SETANT(y) Sets (y > 0)/clears (y = 0) antitethic variables
SETSEE(x) Sets the random seed to value x (x is odd positive integer)