Home
QNAP2 version 9.3 User's Guide
Contents
1. 182 5 2 9 4 Application stipulations summary 182 5 2 9 5 Tracing facilities 183 The Preemptive Priority solver 184 5 2 10 1 Overview 184 5 2 10 2 Bibliography 184 5 2 10 3 Application 8 184 5 2 10 4 Application stipulations summary 184 5 2 10 5 Control of numerical 185 5 2 10 6 Tracing facilities 185 The Iterative solver 186 5 2 11 1 Overview 186 5 2 11 2 Bibliography 186 5 2 11 3 Application 8 186 5 2 11 4 Application stipulations summary 186 5 2 11 5 Control of numerical 188 Simulog v 5 3 5 4 5 5 5 2 11 6 Tracing facilities 188 5 2 12 The Difusion approximation solver DIFFU 189 5 2 12 1 Overview 2 2 2 ee 189 5 2 12 2 Bibliography 189 5 2 12 3 Application 8 189 5 2 12 4 Application stipulations summary 189 5 2 12 5 Tracing facilities 190
2. 67 34 TERMINAL Command 69 3 5 RESTART Command 70 3 6 REBOOT Command 71 37 STATION Command 72 3 7 1 Overview 72 3 7 2 NAME parameter 73 37 3 TYPE 74 3 7 4 SCHED 75 3 7 5 PRIOR parameter 77 3 7 6 QUANTUM parameter 78 377 INIT 79 3 4 8 SERVICE 80 Qnap2 V 9 2 3 7 9 TRANSIT parameter 81 3 7 10 SPLIT 84 3 7 11 MATCH parameter 85 3 7 12 FISSION parameter 86 3 7 13 FUSION parameter 86 3 7 14 RATE 87 3 7 15 CAPACITY parameter 88 3 7 16 REJECT parameter 89 3 7 17 COPY 90 3 8 CONTROL 92 3 8 1 Overview 92 3 8 2 OPTION parameter
3. eee 24 Zi S an ee ag th SE B RUE E hub 24 2 3 2 Variable and array declarations 24 2 3 3 Object type and attribute 26 2 3 3 4 Normal attribute declaration 26 2 3 3 2 Object parameters 27 2 3 3 8 Forward 28 2 3 3 4 Aditional attribute declaration 28 2 3 4 Object declarations 222 29 2 3 5 Reference declarations 2 222 2e 30 2 3 5 1 References to objects 30 2 3 5 2 Reference to any object 31 2 3 6 Static initializations 2 32 2 3 7 Label declarations 33 il 2 3 8 Procedure declarations 2 2 CC moon 33 2 3 8 1 1 34 2 3 8 2 Forward procedures 35 2 3 8 3 Generic procedures 36 2 3 8 4 Notes 37 2 3 9 Function declarations 37 2 3 10 38 2 4 Expressions 40 2 4 4 Overview 40 2 4 2 41 2 4 3 Variables 42 2 4 4
4. amp filename must be legal file name amp nb_bars gt 1 amp nb_subparts gt 1 amp Local variables amp INTEGER ibar isubpart REAL sum STRING pref_datafile ext_datafile name_datafile BEGIN pref_datafile _ amp data file name prefix ext_datafile dat amp data file name extension FILASSIGN ph_gnuplotfile filename OPEN ph_gnuplotfile 3 WRITELN ph_gnuplotfile set title title WRITELN ph_gnuplotfile set boxwidth 0 5 WRITELN ph_gnuplotfile set autoscale WRITELN ph_gnuplotfile set xrange 0 5 nb bars 0 5 WRITELN ph gnuplotfile plot Procedure GPLOBAR Qnap2 V 9 2 FOR ibar 1 STEP 1 UNTIL nb_bars DO BEGIN name_datafile pref_datafile CONVERT ibar STRING ext datafile FILASSIGN ph datafile name datafile OPEN ph datafile 3 sum 0 WRITELN ph datafile ibar 0 0 FOR isubpart 1 STEP 1 UNTIL nb subparts DO BEGIN sum sum x ibar isubpart WRITELN ph_datafile ibar sum END for CLOSE ph datafile WRITE ph gnuplotfile name datafile WRITE ph gnuplotfile title 7 legend ibar WRITE ph gnuplotfile with boxes IF ibar lt nb bars THEN WRITE ph gnuplotfile WRITELN ph_gnuplotfile END amp for WRITELN ph_gnuplotfile pause 1 Press return to continue CLOSE
5. ok Fk 2k ok ok ok oft af ok ok ok F K K K Fk FK K 2K K K K NAME LOAD LENGTH L RESPONSE L LENGTH A RESPONSE A sk ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok of SK 2k ok ok ok o ok ok ok ok FORK 0 500 0 628 1 130 1 000 1 800 PROC2 0 006 0 006 0 010 0 006 0 010 PROCi 0 778 1 903 3 425 3 500 6 300 JOINUP 0 556 0 759 1 365 1 250 2 250 FINISH 0 667 1 144 2 059 2 000 3 600 ok ok ok ok ok ok ok ok ok ok LOWER BOUND OF THE RESPONSE TIME DISTRIBUTION FUNCTION RINF x 1 0000 x 0 e t 0 0000 x 9 9131 x 0 e 0 4857 x User s Guide Solvers 193 FIRST MOMENT SECOND MOMENT VARIANCE 7 5549 0 ef 6 2224 0 ef 2 8642 0 ef 7 9785 82 7641 19 1075 0 7324 x 0 2920 x 0 8853 x HEURISTIC RESULTS ON THE RESPONSE TIME DISTRIBUTION FUNCTION RHEUR FIRST MOMENT SECOND MOMENT VARIANCE BOUNDS FOR SPLIT MATCH SYSTEMS 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 MEMORY USED 7
6. 205 5 4 4 4 Explicit stop 205 5 4 4 2 Accuracy 205 5 4 5 5 207 5 4 6 Estimation of confidence intervals 208 5 4 6 1 replication method 209 5 4 6 2 regeneration method 210 5 4 6 3 spectral 216 5 4 7 Parallel Replications 218 5 4 7 1 218 5 47 2 Installation 219 5 4 7 3 Use Warnings 220 5 4 7 3 1 Example 220 5 4 7 3 2 Precautions for use 222 5 4 7 4 List of communication interface commands 224 Simulation results 226 5 5 1 Overview 226 5 5 1 1 Queue statistics 226 5 5 1 2 User statistics 228 Qnap2 V 9 2 7 5 5 1 3 Statistics control 22 2 oo oo on 5 5 1 4 Partial results 5 5 2 Statistics specification 5 5 2 1 CONTROL parameters 5 5 2 2 SETSTAT procedures 5 5 3 Statistical outputs 5 5 3 1
7. 5 X TO A X 0 50000 A Y 0 50000 S Y X 0 50000 A Y 0 50000 A X B X 0 16667 C Y 0 33333 OUT 0 50000 A Y B X 0 16667 C Y 0 33333 OUT 0 50000 168 Analytical Solvers Qnap2 V 9 2 X TO X 1 00000 Y TO A Y 1 00000 SUBCHAIN ANALYSIS aK ak 22225 NETWORK IS OPEN CLASS X BELONGS TO THE OPEN SUBCHAIN 1 THE SOURCE OF WHICH 15 5 CLASS Y BELONGS TO THE OPEN SUBCHAIN 1 THE SOURCE OF WHICH 15 5 ARRIVAL RATES AFTER 0 ITERATIONS ERROR 0 100E 01 STATION 5 C X 1 000 1 000 1 000 0 0000 00 1 000 1 000 0 0000E 00 1 000 ARRIVAL RATES AFTER 19 ITERATIONS ERROR 0 781E 05 STATION 5 C X 0 0000E 00 8333 3333 0 0000 00 Y 0 0000E 00 1 167 0 0000E 00 6667 CV2 aK K aK A K K K K STATION 5 C X 1 000 1 000 1 000 1 000 Y 1 000 1 000 1 000 1 000 MEAN SERVICE TIMES aK ak ak a a 22 225 STATION 5 C X 10 00 1 000 3 000 3 000 Y 10 00 1 000 3 000 3 000 the intermediate results specific to the solver selected by the dispatcher and the standard report are not given here 5 2 5 List of the analytical solvers The following solvers are implemented in QNAP2 CONVOL convolution algorithms CONVOL is a fast exact but numerically unsafe solver It implements the product form theorems of Baskett Chandy Muntz and Palacios with convolution algorithms MVA mean value analysis MVA is a fa
8. FOR N 1 STEP 1 UNTIL 100 DO X L ID p lt M FOR N 100 STEP 1 UNTIL 1 X X L ID FOR Q B C DO BEGIN PRINT QUEUE Q L MCUSTNB Q0 PRINT THRUPUT MTHRUPUT Q END F R I 0 10 100 STEP 100 UNTIL 1000 00 PRINT I FOR Q ALL QUEUE WITH MTHRUPUT QUEUE gt 0 DO PRINT Q MTHRUPUT Q END 2 5 8 WITH statement Syntax with_statement WITH object id DO statement Semantics WITH provides an implicit reference to the object being manipulated Its use is allowed in any algorithmic block Example DECLARE OBJECT MESSAGE INTEGER LENGTH STRING 55 END MESSAGE MESS1 EXEC WITH MESS1 DO BEGIN LENGTH GET INTEGER amp equivalent to MESS1 LENGTH GET INTEGER TYPMESS GET STRING User s Guide Algorithmic Language 53 amp equivalent to amp MESS1 TYPMESS GET STRING END 54 Statements Qnap2 V 9 2 2 6 Input output facilities The algorithmic language of QNAP2 provides a set of predefined procedures and functions for input output The I O facilities can be classified into three categories 1 Reading writing data from to text files or to the terminal 2 Saving restoring a complete model to from a library file 3 Plotting charts on a graphical terminal printer or plotter 2 6 1 Data files QNAP2 data files use the standard Fortran 77 formatted input output features The data files are standard human re
9. ok ok ok sk ok ok ok ok ok ok ok ok ok coke ok ok ok cock ok ok ok ck coke ok ok ok ok ok coke ok ok ok ok coke ok oe ok ok ok coke ok ok ok ck oe ok ok ok ok oko koe MARGINAL PROBABILITIES STATION B GLOBAL CUSTNB 0 1 2 3 PROB 0 900 0 090 0 009 0 001 VARIANCE OF CUSTOMER NUMBER 0 123 MEMORY USED 2757 WORDS OF 4 BYTES 5 51 OF TOTAL MEMORY User s Guide Solvers 161 162 5 2 Analytical Solvers 5 2 1 Overview QNAP2 includes a set of specialized analytical solvers which yield exact or approximate steady state solutions These solvers are activited by the SOLVE procedure They apply only to models verifying some fundamental assumptions transitions the transitions performed at the completion of a service may be class dependent the class of a customer may be modified during a transition and the transition probabil ities may not depend on the state of the network services a service is restricted to a single work demand procedure and may not include any other operation The work demand may not depend on the state of the network No synchronization procedure may be used The available distributions for specifying work demands are e EXP m exponential m mean e HEXP m c2 hyper exponential m mean c2 squared coefficient of variation e ERLANG m k Erlang m mean and k steps c2 1 k e CST m constant m COX t Coxian law
10. 93 3 8 3 UNIT 94 3 84 CLASS parameter 95 3 85 MARGINAL parameter 96 3 86 CONVERGENCE parameter 02 000 00048 98 387 TSTART parameter 99 3 8 8 TMAX parameter 99 3 89 RANDOM parameter 99 3 8 10 ACCURACY 100 3 8 11 ESTIMATION parameter 101 3 8 12 STATISTICS parameter aaa aaa 101 3 8 13 CORRELATION 102 3 8 14 PERIOD parameter 103 3 8 15 TEST 103 3 8 16 TRACE parameter 104 3 8 17 NMAX parameter 105 3 8 18 ENTRY 106 3 8 19 EXIT parameter 107 3 8 20 ALIAS parameter 107 4 Modeling Mechanisms 109 41 111 4 2 Queue Organization 112 4 2 1 Queue structure 112 4 2 2 Queue discipline 112 4 2 3 Queue 114 4 2 4 Queue initialization 115 4 3
11. Figure 10 1 GNUPLOT curves plotting 284 Example Qnap2 V 9 2 Random bar charts Figure 10 2 GNUPLOT bar charts plotting User s Guide Graphics and QNAP2 285 286 Example Qnap2 V 9 2 Errors Warnings 288 Qnap2 V 9 2 A 1 Error management A 1 1 Message format The message printed when an error or a warning occurs is OBOEO5 gt ERROR INTER END OF FILE The first information displayed is an internal error code which helps locating the QnAP2 module issuing the message These internal codes are used by QnAP2 developers to correct bugs The word ERROR or WARNING indicates the severity level of the reported problem Errors cause the execution of the current EXEC block to be abandonned Warnings are just informational execution continues after the message is printed The word between parentheses indicates which QNAP2 main module detected the error For example compilation errors are detected by the COMPIL module the compiler execution errors are most often detected by INTER the algorithmic language interpreter This is intended mostly for QNAP2 debugging but can be useful to the user The rest of the message is the explicit error message The message text is generally completed with additional information such as the source line number and the values of the concerned variables Customers referenced in error messages are numbered according to their creation order The numbe
12. 100 capacity for small items cannot be reached in practice as the global limit is 10 Note The capacity limit includes customers being served as well as waiting customers 3 7 16 REJECT parameter Syntax reject parameter REJECT class_list statement Semantics The REJECT parameter specifies the processing of customers that are rejected due to the limited capacity of their destination station The reject processing may be different for each customer class If no class list is given the reject processing applies to all classes for which no specific reject was specified If a class list is specified its expression is evaluated at compile time The statement is evaluated at initiation time for analytical algorithms or at solution time for simulation No default processing is defined so this parameter is mandatory for finite capacity stations Example STATION NAME STORAGE1 CAPACITY 20 REJECT largei large2 BEGIN PRINT TIME STORAGE capacity exceeded TRANSIT STORAGE2 END REJECT small SKIP TRANSIT PACK User s Guide Control Language 89 Assume 5 1 is full and a customer arrives If its class is largel or large2 a warning message is printed and the excess customer is transferred to station STORAGE2 It its class is small it just skips the station and directly goes to PACK Note 1 With analytical solvers the only allowed processing is a
13. 150 4 15 152 4 15 1 Timer creation 152 4 15 2 Timer manipulation 153 4 15 3 Timer priority 153 4 15 4 154 Solvers 157 5 1 159 5 11 Overview 159 5 1 2 Bringing resolution into play 159 5 1 3 Results 160 5 2 Analytical Solvers 162 5 2 1 Overview 162 5 2 2 Functional limitations 162 5 2 2 1 Definitions 162 5 2 2 3 Network topology 163 Qnap2 V 9 2 5 2 8 5 2 4 5 2 5 5 2 6 5 2 8 5 2 9 5 2 10 5 2 11 User s Guide 5 2 2 2 1 open sub chain 163 5 2 2 2 2 open network 164 5 2 2 2 3 mixed 165 5 2 2 2 4 source station 165 5 2 2 2 5 customer class 166 5 2 2 3 Ergodicity conditions 166 Dispatching principles 167 5 2 3 1 Automatic dispatching 167 5 2 3 2 Controlled dispatching
14. 5 3 5 Control of numerical convergence The convergence of the numerical algorithms used to compute the steady state probabilities may be controlled by the four parameters of the CONVERGENCE parameter of the CONTROL command parameter 1 maximum number of iterations default value 100 parameter 2 precision of the termination test default value 1E 6 parameter 3 number of test vectors used default value 10 parameter 4 ratio between the number of non null entries in the state transition matrix and the number of states default value 5 5 3 6 Tracing facilities The TRACE option OPTION parameter of the CONTROL command produces the following intermediate results setting of the parameters used for the control of the numerical convergence e list of the states of the model and of the transition rates from one state to another e total number of states and number of non zero elements in the transition matrix conver gence results at each iteration e stationary probabilities of the states Example DECLARE QUEUE A B INTEGER N CLASS X Y STATION NAME SCHED PRIOR PREEMPT INIT User s Guide Solvers 201 PRIOR X PRIOR TRANSIT SERVICE AON bd we we we I fin STATION NAME B SERVICE TRANSIT gt m ve b Ww CONTROL OPTION TRACE EXEC BEGIN N 1 MARKOV END intermediate results ITMAX 100 EPS 0 100E 05 M 10 ALP
15. Each queue of the model will have an additional attribute N each customer will have two additional attributes SIZE and TYPE A new object type has been defined Each CCW object will consist of two integer numbers ADDR DEVICE and an array of three real numbers SEARCH Note Several rules must be followed when adding attributes to a type 1 objects of the type must not exist 2 a subtype must not exist 18 Types Qnap2 V 9 2 Example DECLARE FILE INTEGER IFILE amp No predeclared files exist QUEUE OBJECT MACHINE STRING NAME END QUEUE REAL TR amp No a sub type has been created 2 2 2 2 Definition of a new object type The user may define other object types An object type is defined by an object type identifier object type id by an enumeration of the attributes that are associated with this type and optionally by a list of formal parameters Example DECLARE amp declaring an object type amp identifier with formal parameters OBJECT NODE N T INTEGER N QUEUE CPU amp attributes of the object type QUEUE DISK N REAL T END Each NODE object is made of one queue CPU N queues DISK and one real T An object type may also be declared with reference to a known type predeclared or already declared type The new object type inherits all the attributes of the referenced type Example DECLARE CUSTOMER OBJECT MESSAGE INTEGER LENGTH REAL STAT_T REF QUEUE DESTINATION ORIGIN
16. 1 DECLARE FILE f1 2 INTEGER I 3 I GET f1 INTEGER 0B0CO4 gt ERROR INTER FILE 1 IS NOT WELL BUILT 010500 LINE NUMBER 3 4 END STOP QNAP2 END OF EXECUTION e 0B0905 gt ERROR INTER CANNOT ASSIGN OPEN FILE The procedure FILASSIGN assigns a physical file the name of which is given as second argument to the file object given as first argument 300 Error and Warning Messages Qnap2 V 9 2 0B0A02 e OBOAOS e 0 07 e OBOCOL e 0 0 04 User s Guide The preceding error message is printed if the QNAP2 file is already opened The user has to check that the specified file is closed before assigning it gt WARNING INTER SYSTEM FILE WILL NOT BE CLOSED The QNAP2 procedure CLOSE is used to close a file Be careful that the predeclared file FSYSINPU and the implicit files cannot be closed To suppress this warning message the user has to check that he she is not trying to close an implicit file gt ERROR INTER BAD FILE DEFINITION IN CLOSE PROCEDURE This message is printed if a QNAP2 file is closed without having been assigned before The user has to assign the file or to ensure that the file has been opened Example 1 DECLARE FILE f1 2 EXEC CLOSE f1 0BOAO5 gt ERROR INTER BAD FILE DEFINITION IN CLOSE PROCEDURE 010500 LINE NUMBER 2 3 END STOP QNAP2 END OF EXECUTION gt ERROR INTER UNABLE TO CLOSE FILE This
17. 13 1489 5 19920 11 5783 4000 4 77794 11 8754 5 16599 10 2174 4500 4 90095 11 3336 5 26626 9 53640 5000 4 90864 10 1259 5 30314 8 60059 5500 4 85675 9 49091 5 25512 8 07207 6000 4 97648 9 68147 5 35181 7 99374 6500 4 90010 9 54655 5 28072 7 93696 34 END This example illustrates some of the features of the precision control facility 206 Simulation Qnap2 V 9 2 e The accuracy of a result is considered satisfactory when 1 The confidence interval is lower than the requested threshold for the last two samples 2 The confidence interval is decreasing e The simulation is stopped when all results are satisfactory 5 4 5 TEST sequence A test sequence executed periodically during a simulation run may be specified with the TEST parameter This sequence may include statements testing the model state and performing various actions In the test sequence one may e access model variables and perform various printing and tests e print the accumulated statistics about the model behaviour OUTPUT procedure e stop a simulation run STOP procedure e define a regeneration point call to the SAMPLE or SETSTAT SAMPLE procedures when the regeneration method is used However a test sequence may not include operations on customers e g creation or transi tion nor synchronizations If the TEST parameter is not specified no action is performed i e def
18. 189 STATION NAME SOURCE TRANSIT B X 1 B Y 1 SERVICE X CST TX SERVICE Y CST TY SOLVE DIFFU 5 2 12 5 Tracing facilities When the TRACE option is set the standard intermediate results of SOLVE are produced completed by the two first moments of the inter arrival time and service time for each station of the network 190 Analytical Solvers Qnap2 V 9 2 5 2 13 The Split Match approximation solver SPLITMAT 5 2 13 1 Overview SPLITMAT was developed to solve series parallel networks of exponential servers with FIFO scheduling exponential arrivals and SPLIT MATCH synchronizations SPLITMAT is an ap proximate solver that computes heuristic estimates based on performance bounds The lower bounds are based on the statistics of the stationary response times in D M 1 queues The upper bounds are based on independent response times in M M 1 queues The heuristic estimates are obtained as linear combinations of the upper and lower bounds The estimated results are the utilization of the servers the length of the queues and the response time of the stations In addition the solver computes the distribution of the response time of the network i e the total network traversal time Note Due to the specific nature of the results computed by SPLITMAT the results table produced by this solver is different from the standard results table For the same reason the results are not accessible b
19. 26 OPEN F1 2 27 AUDIT FSYSOUTP F1 Debugger 28 AUDIT FSYSTERM F1 User request 29 END 30 31 EXEC BEGIN 32 3 33 HALT amp at least one break point 34 SIMUL 35 END 36 END 258 Example Qnap2 V 9 2 8 3 2 First interactive break point The first break point is placed on line 33 The debugger is called as soon as QNAP2 executes this statement The first break point cannot be removed so it should be placed appropriately The process is started the model has been compiled During interpretation of the algorith mic code contained in the EXEC block the HALT statement is reached and the first break point is generated Debugger HALT ON BREAK POINT BEFORE LINE 33 User request BREAK 9 amp request for stop on line 9 User request GU The difference between BREAK and HALT is that break points placed with BREAK can be removed which is not the case with HALT 8 3 3 Beginning of simulation Debugger SIMULATION Debugger HALT ON BREAK POINT BEFORE LINE 9 User request SHBREAK Requests list of break points Debugger EXISTING BREAK POINT BEFORE LINE 9 User request PRINT I amp requests value of I Debugger 3 8 3 4 Using the environment SAVE and RESTORE functions Here we deal only with the environment SAVE function RESTORE will be handled later This function is used to detect a problem which arises at a late stage of the simulation It avoids a costly and
20. CYCLIC schedules the timer for TIME delay After activation the timer is automatically rescheduled for the same duration TRACKTIME schedules the timer to track time changes The timer is activated once just before time changes i e after all simultaneous events The timer is rescheduled immedi ately CANCEL cancels any previous activation operation and makes the timer idle Note 1 ABSOLUTE RELATIVE CYCLIC and TRACKTIME override any previous setting If the timer was already scheduled the previous setting is cancelled 2 Most of these operations are forbidden on predeclared timers Refer to the Reference Manual 4 15 3 Timer priority Syntax PRIOR timer integer Semantics When several timers expire at the same simulation time their handlers are activated one after the other The timer priorities can be used to control the activation orders the timer with the highest priority level is activated first The PRIOR procedure is used to set the integer priority level of a timer to a specific level User s Guide Modeling Mechanisms 153 4 15 4 SIMUL C 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 Maximu 4i Example OG QNAP2 01 04 95 V 9 2 COPYRIGHT BY CII HONEYWELL BULL AND INRIA 1986 DECLARE QUEUE PRODUCE PACKAGE TIMER FAILURE STATION NAME PRODUCE amp Produ
21. Permitted service specifications are generally limited by the solver used the limits for each solver of QNAP2 are given in Chapter 5 Example STATION Command Qnap2 9 2 DECLARE QUEUE CLASS 2 REAL 5 STATION NAME SERVICE X CST 4 SERVICE HEXP SA 16 SERVICE EXP 5 67 The service time of class X customers is defined by a constant work demand of 4 service units the work demand of class Y customers is a hyper exponential distribution having a mean equal to SA and a squared coefficient of variation equal to 16 class Z customers work demand is distributed according to an exponential distribution having a mean equal to 5 67 default service for this station Example DECLARE QUEUE A SEM STATION NAME SERVICE BEGIN EXP 12 P SEM PRINT TIME CST 5 V SEM END 3 7 9 TRANSIT parameter Syntax transition parameter TRANSIT class_list transition list transition_list queue sublist class_sublist real_sublist queue sublist class_sublist real sublist Semantics The TRANSIT parameter describes the routing rules of customers at service completion time The routing mechanism is defined as a probabilistic switch The transition probabilities may be given for each destination station and for each class by giving a list of 3 uples Each 3 uple consists of e one or several destination stations one or several destinati
22. e Statements following a TRANSIT of the current customer will never be executed 4 9 2 MOVE procedure Syntax MOVE queue queue2 class priority_level Semantics The MOVE procedure forces the transition of the first customer of station queue into the station queue under the similar conditions as the TRANSIT procedure If queuefis empty the procedure call is ignored Example User s Guide Modeling Mechanisms 133 134 DECLARE QUEUE CLASS X Y STATION NAME SERVICE BEGIN CST 1 TRANSIT NEW CUSTOMER X 3 MOVE C A END During its service in A a customer creates a son and sends it to queue B with class X and a priority level of 3 Then it forces the first customer in the C queue to transit to A 4 9 3 BEFCUST and AFTCUST procedures Syntax BEFCUST customer1 customer class priority level AFTCUST customer1 customer class priority level Semantics The BEFCUST procedure forces the transit of customer to the queue containing customer customer is placed before customer2 with the specified class and priority_level The AFTCUST procedure has the same properties except that customer is placed after customer2 If customer2 is not in a queue the execution of the procedures BEFCUST or AFTCUST causes a simulation error If the queue of customer2 has a priority queueing discipline SCHED PRIOR a consis tency check is performed in order to ver
23. slaves are not necessarily started from the same directory as the master These files must also be visible by NFS installation by all the stations used You should also make sure that operations on a file assign read write are done by the same process a slave can only write on a file if it is the slave and not the master which previously assigned and opened it For each PVM session the standard output PRINT of the slave processes is redirected to a file called tmp pvml e You are strongly advised not to debug CONTROL OPTION DEBUG a model which is using parallel replications The CPU time taken functions GETCPUT GETPROFILE only work on one process at time Parallel replications and serial replications do not necessarily behave in the same way Parallel replications are started from the same simulation context which is not necessarily the case for serial replications For example a replication may change a global variable of the model In serial replications the next replication will look at the changed value of that variable while each parallel replication will use the initial value Each user must be careful over this point if ever he wants to operate in parallel models designed for serial replications e You are strongly advised to run only one slave at one time on each station so as to avoid collisions when information is transferred from the master to the slave and vice versa e The slaves do
24. 167 5 2 8 3 Dispatching 167 Tracing facilities 168 List of the analytical solvers oaa 169 The convolution solver 171 5 2 6 1 Overview 171 5 2 6 2 Bibliography 171 5 2 6 3 Application stipulations 171 5 2 6 4 Application stipulations summary 174 5 2 6 5 Tracing facilities 176 5 2 6 6 Marginal probabilities 176 The Mean Value Analysis solver MVA 177 5 2 4 1 Overview 177 5 2 7 2 Bibliography 177 5 2 7 3 Application stipulations 177 5 2 7 4 Application stipulations summary 177 5 2 7 5 Tracing facilities 178 The Mean Value Analysis Normalized Convolution Algorithm MVANCA 179 5 2 8 1 Overview 179 5 2 8 2 Bibliography 179 5 2 8 3 Application 8 179 5 2 8 4 Application stipulations summary 179 5 2 8 5 Tracing facilities 181 The Heuristic solver HEURSNC 182 5 2 9 1 Overview 0 182 5 2 9 2 Bibliography 182 5 2 9 3 Application 8
25. 4 15 Timers Timers QNAP2 objects used to model processes independently of the queueing network QNAP2 uses predeclared timers to perform some simulation functions e g PERIOD TSTART TMAX The user can define his own timers Timers can be used only in simulation Each timer is assigned a procedure called the handler The handler is called automatically by QNAP2 when the timer expires The handler can perform any algorithmic language operation except work demands or blocking synchronizations a handler is not allowed to spend time or become suspended but it can operate on customers queues flags exceptions and timers Note Timers should not be confused with the operating system timers that can be connected toi a QNAP2 exception see previous section QNAP2 timers operate on simulation time not on real time 4 15 1 Timer creation A timer can be created statically in a DECLARE command or dynamically with the NEW function Timer objects have the following attributes HANDLER is a reference to the handler procedure TIMPRIOR is the integer priority level STATE takes the following values when the timer is idle when it was activated by SETTIMER ABSOLUTE when it was activated by SETTIMER RELATIVE when it was activated by SETTIMER CYCLIC and 4 when it was activated by TRACKTIME wo ACTIARG is the value of the argument passed to the last activation procedure used Note 1 ACTIARG should not be use
26. 5 TA Program example mk oce RUNE E PEE eqs 6 1 5 Fields of application 8 136 Running de xo tec dx RTL Red ere hob ep D dt 9 2 Algorithmic Language 11 221 Chokens u dme Dee dei ete ia dni gia 13 2 1 1 Syntax 13 2272 Character S605 e x tede Suo eso QUE e tue uode Ados e Ob Rm e eid Al 13 2522 Reserved words mex ce er SC ay hee 14 2 14 lIdeutiflers xod y eisen i PIT DV woes 14 24150 N mbers dem 2 en Bee deg DAC Ber 15 21 62 Character strings shoe ts iva Rer e P RU 15 AR Comments 5 2 ee SR 15 2158 3SeDaLdlOIS aye Aish uM c gefeiert eR qol 16 222 den eee eU RUNI aar ern 17 2252 Reha Ge d eR EG dan 17 222527 SODJECHS o ipt de teed Uri exp e re ees 18 2 2 2 1 Extension of a predefined object type 18 2 2 2 2 Definition of a new 1 19 222525 ap RE SU oe de Ee on S R E 20 2 24 Data items management 20 2055 References ne ou dee e Ue le cd Goa We 22 2 3 Declaration Statements
27. DECLARE INTEGER N amp new declarations REAL STATION NAME amp alteration INIT N of station A CONTROL TMAX T 66 DECLARE Command Qnap2 V 9 2 3 3 Command Syntax erec command EXEC statement Semantics The purpose of the EXEC command is to introduce and execute a statement of the algorithmic language simple statement or compound statement This statement is intended to bring the real analysis into play and perform the following functions e initialization of variables e call to resolution procedures e display of results The statement associated with an EXEC command is executed at execution time i e be fore the compilation of the next command in the program and immediately after the compilation of this EXEC command Example DECLARE INTEGER N QUEUE A B STATION NAME TRANSIT B SERVICE EXP 1 STATION NAME B TRANSIT A SERVICE CST 2 CONTROL TMAX ACCURACY 1000 ALL QUEUE EXEC BEGIN N 1 SIMUL PRINT RESPONSE MRESPONSE A MRESPONSE B END amp execution of the preceding block amp one simulation run STATION NAME B TRANSIT A SERVICE CST 3 FOR N 1 STEP 1 UNTIL 5 DO SIMUL User s Guide Control Language 67 amp execution of the previous intruction amp 5 simulation runs 68 EXEC Command Qnap2 V 9 2 3 4 TERMINAL Command Sy
28. PRINT WRITELN skip to the next line after printing whereas WRITE stays on the same line e PRINT always inserts a blank character at the beginning of the output line Fortran 77 standard With WRITE and WRITELN this is left under the user s responsibility The file argument specifies the destination of the output The default destination is FSYSPRINT By default it is identical to the QNAP2 standard output FSYSOUTPUT The optional format argument specifies the output format with the following syntax 4 width or e width decimal places real numbers only width specifies the total number of characters to print the data item decimal places specifies the number of digits to print after the decimal point Example WRITELN Result 10 N 10 X 10 4 The default format used by PRINT is the following INTEGER 10 sign 8 digits 1 space REAL 12 12 characters 4 significant digits BOOLEAN 4 5 TRUE or FALSE explicitely printed STRING actual string length Object 10 8 characters 2 spaces The actual format for reals depends on the magnitude of the number Very small and very large numbers are printed with the scientific mantissa exponent notation e g 1 057E 9 The default format for WRITE and WRITELN is to print only the minimum number of characters no surrounding spaces Reals are printed with four significant digits Strings are right justified Note 1 WRITELN and PRINT both print a blank
29. RESPONSE SERV NB Sk ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok oft af 27 2k ok ok ok SOURCE 1 004 1 000 1 000 1 004 148 1 SYST 0 6894 0 6651 4 344 4 149 143 0 0 5583E 01 0 5567E 01 1 158 0 9705 sk ko k ae af koe ae af 3 slaves used for 20 replications sek ke jeje koe koe jefe koe koe FE Fe oe a joe 11 replication s 55 0000 william 7 replication s 35 0000 jack 2 replication s 10 0000 kk kk ke kk ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke a a a a a a END OF SIMULATION MEMORY USED 5922 WORDS OF 4 BYTES 0 59 OF TOTAL MEMORY 18 19 END 5 4 7 3 2 Precautions for use Because of the way it works parallelization of replications requires the user to take a certain number of precautions e It is unnecessary and ineffective to have a checking instruction CONTROL RANDOM Indeed each slave reads its random germ in the shared file ranpar dat e Watch out for the write read instructions in files WRITELN WRITE GET PRINT SETTRACE etcetera during replication The slaves do not write to the standard output of the master If you use a file you are advised to give its absolute path as the 222 Simulation Qnap2 V 9 2
30. SOLVE amp the global marginal probabilities amp are computed only for station A up to amp the twentieth order and for station B amp up to the fifth CONTROL MARGINAL ALL QUEUE 10 EXEC SOLVE amp the global marginal probabilities are amp computed up to the tenth order and for amp all the stations of the network 3 8 6 CONVERGENCE parameter Syntax convergence_parameter CONVERGENCE real list Semantics The CONVERGENCE parameter is used to modify the default values of some parameters of the mathematical solvers MARKOV SOLVE The precise meaning of these values is described in Chapter 5 parameter 1 maximum number of iterations default value 100 parameter 2 precision of the termination test default value 1E 6 parameter 3 number of test vectors used default value 10 in the Markovian solver parameter 4 ratio between the number of non null entries in the state transition matrix and the number of states default value 5 in the Markovian solver The default value is CONVERGENCE 100 1E 6 10 5 The real list expression is evaluated at initiation time Example CONTROL CONVERGENCE 500 1E 6 5 5 MARKOV amp Resolution with 500 iterations 5 test amp vectors and a precision of 1 E 6 CONTROL CONVERGENCE 1000 EXEC MARKOV amp up to 1000 iterations may be used amp others parameters keep their default values 98 CONTROL Command Qnap2 V 9
31. TRANSIT X TRANSIT Y SERVICE NAME SERVICE RATE TRANSIT SOLVE C MVANCA NAME TYPE SOLVE C MVANCA NAME TYPE SCHED SERVICE X SERVICE Y SOLVE C MVANCA NAME SCHED SOLVE C MVANCA Y A X CST 1 MULTIPLE 3 SINGLE LIFO PREEEMPT CST TX CST TY 5 NAME MULTIPLE 3 SCHED PS SOLVE MVANCA NAME INFINITE SOLVE MVANCA NAME B TYPE SINGLE SCHED FIFO CAPACITY 5 REJECT SKIP SERVICE EXP 1 SOLVE MVANCA Qnap2 V 9 2 STATION NAME B TYPE MULTIPLE 3 SERVICE EXP 1 SCHED EXCLUDE X Y CAPACITY 8B BR SOLVE MVANCA END 5 2 8 5 Tracing facilities When the TRACE option is set only the standard intermediate results of SOLVE are produced no specific intermediate results User s Guide Solvers 181 5 2 9 Heuristic solver HEURSNC 5 2 9 1 Overview The solver HEURSNC was developed in order to solve networks with a large number of sub chains The method yields approximate results 5 2 9 2 Bibliography NEUSE D and CHANDY SCAT A heuristic algorithm for queuing networks of computing systems ACM Sigmetrics 10 1 Fall 1981 pp 59 79 5 2 9 3 Application stipulations The application stipulations of HEURSNC are similar to those of the solver
32. The WAITOR procedure defines a disjunct waiting condition It causes the customer de faulting to the current customer to wait until one of the flags in flag list is in the set state The waiting customer is freed when one of the flags is in the set state or if a call to the FREE procedure occurs 148 Flags Qnap2 V 9 2 4 14 Exceptions Exceptions QNAP2 objects used to catch special events such as external signals sent by the operating system e g user interrupt error condition QNAP2 uses predeclared exception objects to handle internal events such as start end of the simulation Each exception object is assigned a procedure called the handler The handler is called automatically by QNAP2 when the exception is raised The handler can perform any algorithmic language operation except work demands or blocking synchronizations handler is not allowed to spend simulation time or become suspended but it can operate on customers queues flags exceptions and timers 4 14 1 Exception creation An exception object may be created statically with the DECLARE command or dynamically with the NEW function Exception objects are parameterized The optional parameter is the name of the handler procedure This allows to assign the handler procedure upon creation of the exception object Example DECLARE PROCEDURE MESSAGE BEGIN PRINT Exception raised END EXCEPTION MESSAGE INTR When used with ex
33. current solver lt first solver repeat repeat Select current solver check if current solver applies to the model if match exit else when current solver last solver raise error current solver lt next solver run selected solver if successful exit else when current solver last solver raise error current solver lt next solver User s Guide Solvers 167 5 2 4 Tracing facilities When the TRACE option is set OPTION parameter of the CONTROL command a set of standard intermediate results is produced by the solver Besides specific additionnal results are produced by each solver These specific outputs are described in the sections devoted to each solver The standard intermediate results consist of the following data e list of the non zero transition probabilities e results of sub chain analysis number and type of subchains arrival rates in each station number of iterations for the computation of the arrival rates e number of customers in each class and in each subchain e mean and squared coefficient of service times for each station and each class Example DECLARE QUEUE 5 A INTEGER N CLASS X Y STATION NAME 5 TYPE SOURCE TRANSIT A X 1 A Y 1 SERVICE EXP 10 STATION NAME TRANSIT B X 1 C Y 2 0UT 3 SERVICE EXP 1 STATION NAME B C TRANSIT A SERVICE EXP 3 CONTROL OPTION TRACE EXEC SOLVE Standard intermediate results TRANSITIONS
34. ke ke ke ke ke ke a a a a a a NAME SERVICE BUSY CUST NB RESPONSE SERV NB kk kk ke ke ke ke ke ke ke ke ke ke SOURCE 1 007 1 000 1 000 1 007 14895 SYST 7131 7082 5 676 5 716 14894 0 2458 01 0 2680 01 1 323 1 302 kk kk ke ke ke kk ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke a a a a a a END OF SIMULATION MEMORY USED 4647 WORDS OF 4 BYTES 1 78 OF TOTAL MEMORY User s Guide Solvers 211 Another way to test a regeneration state is to program this test in a service provided that the condition is met only when this service is active This is in general a more efficient approach because the condition is tested less frequently than in the previous case Example DECLARE QUEUE SOURCE SYST MONITOR STATION NAME SOURCE TYPE SOURCE TRANSIT SYST SERVICE EXP 1 STATION NAME SYST TRANSIT MONITOR SERVICE HEXP 0 7 5 STATION NAME MONITOR TRANSIT OUT SERVICE IF SYST NB 0 THEN SAMPLE CONTROL TMAX 15000 ACCURACY SYST ESTIM REGENERATION EXEC SIMUL X SIMULATION WITH REGENERATIVE METHOD TIME 15000 00 NB SAMPLES 4364 CONF LEVEL 0 95 kk kk ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke a a a a a a a a a NAME SERVICE BUSY P
35. 0 005 0 005 0 009 0 000 2 0 006 0 009 0 009 0 001 0 001 0 009 0 000 0 001 0 005 0 005 0 003 0 003 0 006 0 000 4 0 008 0 003 0 003 0 003 0 003 0 010 0 000 5 0 016 0 015 0 015 0 006 0 006 0 012 0 000 kk ke ke ke ke ke ke ke ke ke END OF AUTOCORRELATION COMPUTATIONS END OF SIMULATION MEMORY USED 5201 WORDS OF 4 BYTES 1 99 OF TOTAL MEMORY The values of the autocorrelation coefficients confirm the validity of the state system empty as regeneration point However it can be observed that the confidence interval obtained is significantly larger than with the previous model because of the hyper exponential inter arrival process the variance of the response time is greater Without theoretical results determining the regeneration states of the model one will choose artificial regeneration points For example spliting the simulation run into fixed length sub runs produces intervals which satisfy the independence hypothesis if the length of the intervals is large enough The end of each interval can then be considered as an approximate regeneration point The length of the intervals should be large enough so that within an interval the behaviour of the model be as independent as possible of its behaviour in the previous interval On the other hand the
36. 132 4 9 Customer Forced 1 133 4 9 1 TRANSIT 133 4 9 2 MOVE 133 4 9 3 BEFCUST and AFTCUST 134 4 10 Customer split and match 135 4 11 Semaphores 137 4 11 1 Semaphore creation 137 4 11 2 P 137 4 11 3 137 4 11 4 PMULT and VMULT 139 4 12 Resources 144 4 12 1 Resource 144 4 12 2 P 144 4 12 3 144 4 12 4 Server resource equivalence 145 4 12 5 PMULT and VMULT 146 4 13 147 4 13 1 Flag creation 147 4 13 2 SET RESET and UNSET procedures 147 4 13 3 WAIT WAITAND and WAITOR procedures 147 4 14 Exceptions 149 4 14 1 Exception creation 149 4 14 2 Exception manipulation
37. 3 to open a file for writing The file may already exist Note 1 Most predeclared files are assigned through the QNAP2 startup procedure It is not required to them before using them some of them are already opened or an automatic OPEN is performed in the right mode 2 Attempting to open a file that is already opened or to close a file that is already closed yields an execution error 3 FILASSIGN sets the FILE attribute FILASSGN 4 OPEN and CLOSE set the FILE attribute OPENMODE 5 When an error occurs during any I O operation QNAP2 sets the FILE attributes ERRSTATUS and HARDIOST 2 6 2 Library files Library files can be used to save a complete model for later processing A library file contains an image of QNAP2 s working memory It contains all the declared object types variables procedures and objects declared or created at the time the model was saved Library files can be used to save compilation time when a model is run frequently They can be used to save a model for later debugging or to freeze the model state during simulation and restart from the frozen state Syntax SAVE SAVERUN file label RESTORE file label 58 Input output facilities Qnap2 V 9 2 Semantics The SAVE and SAVERUN procedures are used to save the model in a library file The default file is FSYSLIB It is normally assigned to a physical file through QNAP2 startup procedure If another file is used it should be assigne
38. 5 2 13 The Split Match approximation solver SPLITMAT 191 5 2 13 1 Overview 191 5 2 13 2 Bibliography 191 5 2 13 3 Application 8 191 5 2 13 4 Application stipulations summary 192 5 2 13 5 Tracing facilities 196 The Markovian Solver 197 5 3 1 Overview 197 5 3 2 Bibliography 197 5 3 3 Application conditions 197 5 3 3 1 Network topology 197 5 3 3 2 5 1 197 5 3 3 3 Scheduling 198 5 3 3 4 198 5 3 3 5 Transitions 199 5 3 8 6 199 5 3 8 7 Instantaneous transitions 200 5 3 4 Results 201 5 3 5 Control of numerical 201 5 3 6 Tracing facilities 201 Simulation 204 5 4 1 Overview 204 5 4 2 Bibliography 204 5 4 3 Application stipulations 204 5 4 4 Control of simulation
39. C C NEXT END PRINT MAXIMUM XMAX END 4 2 2 Queue discipline The general rule is that a customer arriving at a station is assigned a position inside the queue according to the SCHED parameter of the station This rule does not apply when the placement of the customer is forced by the procedures BEFCUST or AFTCUST see section 4 9 Customer Forced Transition FIFO The incoming customer is placed at the end of the queue thus becoming the LAST customer in the queue 112 Queue Organization Qnap2 V 9 2 LAST FIRST LIFO The incoming customer is placed at the head of the queue thus the FIRST attribute of the queue always references the last arrived customer LAST FIRST FIFO PRIOR Each customer has a priority level CPRIOR attribute of the customer This attribute may be modified during a transition by means of the TRANSIT procedure the BEFCUST procedure or the AFTCUST procedure directly by the PRIOR procedure or by the PRIOR parameter of the station The customers are ranked by priority level those with the highest priority level being at the head of the queue Customers with equal priority levels are ordered according to a FIFO discipline LAST FIRST The numbers in the boxes are the priority levels The parenthesized numbers show the order of arrival in the queue LIFO PRIOR The customers are ordered according to their priority levels the customers with the highest priority levels bei
40. END DECLARE QUEUE NODE REF MESSAGE STATION NAME SERVICE NODE BEGIN M NEW MESSAGE TRANSIT M M DESTINATION END User s Guide Algorithmic Language 19 20 Each object of type MESSAGE has all the attributes the features of the type CUS TOMER with the additional attributes LENGTH STAT_T DESTINATION and ORIGIN As a consequence an object of type MESSAGE may be used in the same fashion as an object of type CUSTOMER A complex hierarchy of types and sub types may be defined Three operators are provided to check types at run time e The double colon operator is used to indicate that an object is in fact of a sub type IS operator can be used to ensure that an object belongs to a specific type The IN operator can be used to ensure that an object belongs to a specific type or of its sub types More details about these features are provided in section 2 4 expressions The fictitious type ANY can be used to declare references to objects of any type 2 2 3 Lists A list facility is provided to ease manipulation of objects and variables of the same type Example DECLARE QUEUE DISK 20 CPU REF QUEUE Q 30 INTEGER N 10 L N EXEC BEGIN amp list of the L 1 STEP 1 UNTIL N amp N first integers amp L 1 REPEAT N amp list of N 1s amp Q ALL QUEUE amp list of all amp declared queues END 2 2 4 Data items management Any data is c
41. MATCH Joining up of split customers FISSION fission and transition of customers FUSION fusion of customers RATE service rate CAPACITY maximum queue capacity REJECT rejection statement for customers in excess PRIOR priority level of customers QUANTUM service quantum allocated to customers COPY parameters copied from another station The syntax rules of these parameters are given below 72 STATION Command Qnap2 V 9 2 3 7 2 NAME parameter Syntax name parameter queue list x object_type id object_type_ididentifier Semantics The NAME parameter must be the first parameter of the STATION command The command defines as many stations as there are queues in the queue list each station being identified by the name of its associated queue there is only one queue per station two stations may not share a queue The notation is used to describe a template queue This facility may be used in the two following cases 1 description of objects defined as sub types of QUEUE x followed by the object type identifier 2 description of queues defined as attributes of an object followed by the object type identifier a dot and the attribute identifier The queue list expression is evaluated at compile time Example DECLARE QUEUE CPU DK 10 amp definition of the stations associated amp with the five first queues of DK 10 STATION NAME CPU TRAN
42. Pujolle It applies to open multi class networks with non exponential FIFO servers SPLITMAT Baccelli et al algorithm for parallel split match networks SPLITMAT is a fast approximate and numerically safe solver It implements a bounding algorithm developped by F et al It applies to open series parallel networks with exponential FIFO single server stations Analytical Solvers Qnap2 V 9 2 5 2 6 convolution solver CONVOL 5 2 6 1 Overview CONVOL is the direct application of the product form theorems due to Baskett Chandy Muntz and Palacios These theorems extend to open closed and mixed multiclass queueing networks previous results obtained by R R Jackson The product form theorems have been also extended to networks with finite capacity queues and or multiple server stations with concurrency classes of customers This solver uses efficient computing algorithms that can handle large networks with small computation times especially as compared to simulation times and that produce the exact steady state solution The main restriction of this method is to require exponentially distributed service times or scheduling disciplines leading to similar properties 5 2 6 2 Bibliography BASKETT F CHANDY K M MUNTZ R R and PALACIOS Open Closed and Mixed Networks of Queues with Different Classes of Customers J ACM 22 2 April 1975 pp 248 260 REISER M and KOBAYASHI H Recursive algorithms for ge
43. REF QUEUE Q STATION NAME A SERVICE BEGIN EXP 2 IF CUSTNB B 0 THEN Q B ELSE Q C TRANSIT Q END At service completion time the customers of A are forwarded to B if this station is empty otherwise to Example DECLARE QUEUE A C CLASS X Y STATION NAME TRANSIT X 1 C 1 SERVICE X BEGIN CST 1 5 IF CUSTNB B X CUSTNB C X 3 THEN TRANSIT A END If both B and C stations contain 3 customers the customer completing its service in A is sent again to A otherwise it is forwarded to B or C with equal probabilities 5 3 3 6 Service rate The service rate of every server of a station may depend on the instantaneous number of customers present in this station It is expressed with the general form of the RATE parameter Example DECLARE QUEUE A STATION NAME RATE 1 1 8 2 4 SERVICE EXP 5 User s Guide Solvers 199 amp is equivalent to STATION NAME SERVICE A IF CUSTNB A 1 THEN EXP 5 ELSE IF CUSTNB A 2 THEN EXP 5 1 8 ELSE EXP 5 2 4 5 3 3 7 Instantaneous transitions After a transition performed at service completion time it is possible to initiate other instan taneous transitions under conditions dependent on the current number of customers in each station CUSTNB function These transitions should be described in a test sequence associated with the TEST param eter Each possible transition may be described on
44. RESEQUENCE resequencing the customers are served in the very order that they de parted from the specified reference queue and possibly with the specified class The specified SCHED parameter is assigned to all the stations identified by the NAME parameter The expressions appearing in a SCHED parameter are evaluated at initiation time Example DECLARE QUEUE CPU DK PROC 5 CLASS X Y STATION NAME SCHED CPU LIFO PREEMPT STATION Command Qnap2 V 9 2 STATION NAME DK STATION NAME SCHED PROC 1 PROC 2 QUANTUM 0 2 The CPU server has a LIFO preemptive service discipline i e any arriving customer pre empts the server Station DK has a simple FIFO queue discipline default value Station PROC 1 and station PROC 2 are scheduled with a quantum algorithm each quantum being 0 2 time units long Concurrency sets with classes The concurrency sets are defined by means of customer classes and or probabilities Each concurrency set definition is enclosed between parentheses The concurrency sets are defined with the following generic form ci 2 P1 25 Cn Pin c1 2 P2 2 Cn 2 Pm n which means that a customer of class c entering the station belongs to concurrency set with the probability p The default value of p is 1 The sum of probabilities assigned to class cj among concurrency sets must be less than or equal to
45. SERVICE COPY STATION NAME TRANSIT SERVICE 52 51 SOURCE A EXP 10 A OUT EXP 1 The two sources 51 and 52 send customers of the same class in A Two customer classes should be used in this case 5 2 2 2 2 open network In an open network one should have e either only one source for all the sub chains e either a different source for each sub chain Example Incorrect network DECLARE QUEUE S1 2 A B C CLASS X Y 7 STATION NAME TYPE TRANSIT SERVICE STATION NAME TYPE TRANSIT SERVICE STATION NAME TRANSIT SERVICE STATION NAME COPY STATION NAME COPY 1 SOURCE A X 1 B Y 1 EXP 10 2 SOURCE 2 20 A OUT EXP 1 The source 51 sends customers in two sub chains and 164 Analytical Solvers 51 A X OUT S1 B Y 0UT Qnap2 V 9 2 The source 52 sends customers in the sub chain S2 C Z QUT One should have either three distinct sources or a single source 5 2 2 2 3 mixed network In a mixed network one should have a different source for each open sub chain Example Incorrect network DECLARE QUEUE S A CLASS 2 STATION NAME TYPE TRANSIT SERVICE STATION NAME SCHED INIT Z TRANSIT TRANSIT TRANSIT SERVICE SERVICE SERVICE There are two open sub chains 5 SOURCE A X 1 Y 1 EXP 10 A PS X
46. and you want to run this model on the stations joe william and jack Let us say also that you are working on joe Comments on the user operations are between the signs lt and gt john joe lt start the interface on the machine joe which means that it is automatically in the list of usable machines gt pvm gt add william lt adds william to the list of stations gt 1 successful HOST DTID william 0000 pvm gt add jack 1 successful HOST DTID jack c0000 pvm gt add joe lt error you are trying to add to the list of usable stations one which is already there in this case the one on which you are working 0 successful HOST DTID Simulation Qnap2 V 9 2 joe Duplicate host pvm gt add averell lt error you are using a station you did not intend to use gt 1 successful HOST DTID averell c0000 pvm gt delete averell lt so remove this station from the list gt 1 successful HOST STATUS averell deleted pvm gt conf 3 hosts 1 data format HOST DTID ARCH SPEED joe 40000 SUN4 1000 william 0000 SUN4 1000 jack 100000 SUN4 1000 gt quit pvmd still running john joe Then you start the QNAP2 executable on the model in question model qnp If while the replications are running you return to the communication interface you can see the list of the slave executables of QNAP2 which are running john joe pvm gt ps 05 A OUT TID PTID FLAG joe 40003 0 04
47. mean c2 squared coefficient of variation ERLANG m k Erlang m mean and k steps c2 1 k CST m constant m approximated by an ERLANG m 5 COX t Coxian law with coefficients in table t The characteristics mean variance of the work demand may depend on the instan taneous number of customers in each station globally or for each class In this case the characteristics of the work demand should be computed in the service description just before the call to the work demand procedure the instantaneous number of customers may be accessed by the CUSTNB function Example DECLARE QUEUE A STATION NAME SERVICE M IF CUSTNB A lt 3 THEN EXP 2 ELSE ERLANG 2 3 If the number of customers in A is less than 3 the service is distributed according to an exponential distribution otherwise it is distributed according to an Erlang distribution Example DECLARE QUEUE A B CLASS X Y REAL 5 STATION NAME SERVICE BEGIN S 0 43 3 45 CUSTNB B X EXP S END The service demand of class A customers linearly depends on the number of class X customers in B 198 The Markovian Solver Qnap2 V 9 2 5 3 3 5 Transitions The general probabilistic transition mechanism applies in the normal way For dynamic routing the procedures TRANSIT or MOVE may be used They must appear after the work demand procedure in the description of the service Example DECLARE QUEUE A B C
48. ph_gnuplotfile END amp proc User s Guide Graphics and QNAP2 281 10 3 Example Here is an example using the two preceding procedures with the corresponding GNUPLOT displays Example code DECLARE INTEGER nb_curve 4 nb_point 10 REAL x nb_curve nb_point y nb_curve nb_point STRING legend nb_curve INTEGER icurve ipoint EXEC BEGIN FOR icurve 1 STEP 1 UNTIL nb_curve DO BEGIN FOR ipoint 1 STEP 1 UNTIL nb_point DO BEGIN x icurve ipoint ipoint RANDU icurve ipoint icurve RANDU END legend icurve Stream CONVERT icurve STRING END GPLOCUR curve gnuplot nb_curve nb_point x y Random curves legend PRINT Please run gnuplot on curve gnuplot to display curves END amp exec DECLARE INTEGER nb_bar 6 nb_subpart 5 REAL 2 nb_bar nb subpart STRING legend2 nb bar INTEGER ibar isubpart REAL barmax EXEC BEGIN 282 Example Qnap2 V 9 2 barmax nb_subpart 1 RANDU FOR ibar 1 STEP 1 UNTIL nb_bar DO BEGIN FOR isubpart 1 STEP 1 UNTIL nb_subpart DO BEGIN z ibar isubpart barmax isubpart RANDU END legend2 ibar Bar chart CONVERT ibar STRING END GPLOBAR bar gnuplot nb_bar nb subpart 2 Random bar charts legend2 PRINT Please run gnuplot on bar gnuplot to display bar charts END exec END User s Guide Graphics and QNAP2 283 Random curves
49. printing results R EXP 34 amp generation of a random number X 1 5 LR 1 2 3 4 amp value of a discrete function R CURVE LR X END 2 4 5 Lists Syntax list sublist sublist simple sublist conditional sublist with clause repeat clause conditional sublist expression THEN sublist ELSE sublist simple_sublist simple expression list dimensioned variable subscript sublist ALL object_type id simple_sublist single_variable_id simple_expression STEP expression UNTIL expression subscript_sublist sublist with clause WITH expression repeat clause REPEAT expression Semantics Lists are provided as a shorthand facility to designate and manipulate objects and variables of the same type ALL object_type_id comprises a list of all objects of this type which have been created Note construct ALL CUSTOMER is not allowed The WITH clause selects items in the specified list according to the control boolean expres sion the evaluation of the boolean expression is performed for each element in the list Control variables may be object type identifiers to allow dynamic matching of list items or list item attributes The REPEAT clause repeats the previous list times where n is the value of the integer expression warning the list is not reevaluated before repetition The STEP UNTIL clause allows a list to be built through the enumeration of the
50. the activation and sequencing of the resolution methods and the editing of the results The QNAP2 language involves two levels 1 a control language 2 an algorithmic language derived from SIMULA and PASCAL that details and completes control statements Syntactically there are three kinds of control statements Stand alone commands TERMINAL command RESTART command or END com mand Parameterized commands DECLARE command STATION command or CON TROL command In a QNAP2 program these commands will be followed by instructions assigning values to the parameters default values being also generally provided These instructions may be algorithmic blocks The EXEC command This command is always described by an algorithmic block The command language fulfills different functions e initialization completion e model description e analysis control e solution Consequently a QNAP2 program is an ordered sequence of commands The definitions and the rules of use of these commands are to be found in the Control Language part of this manual Control Language Chapter 3 the Algorithmic Language is defined in the first part of the manual Algorithmic Language Chapter 2 Language Qnap2 V 9 2 1 3 Solvers The solvers implemented QNAP2 be classified into four categories 1 discrete event simulation applicable to all models high quality random number generator e accuracy estimation b
51. there are three servers and the customers are processed according to the mechanisms of queueing network models In the second version the CUSTOM station allocates a server to each customer The processing of one customer is explicitly described posession of resources A B and C synchronizes these activities The customer transitions correspond to P and V operations 4 12 5 PMULT and VMULT procedures These procedures are described in the preceding chapter about the semaphores 146 Resources Qnap2 V 9 2 4 13 Flags The flags may be used to synchronize customers with simpler tools than semaphores resources This mechanism is especially useful to describe parallel activities A flag has two possible states set and unset The STATE attribute of a flag represents its current state the TRUE value being the set state and the FALSE value being the unset state Customers manipulate flags by means of procedures and functions 4 13 1 Flag creation Syntax flag Semantics The NEW function dynamically creates a flag the initial state of this flag is unset This NEW function returns a reference to the created flag Flags may also be statically created within the DECLARE command by declaring variables of type FLAG 4 13 2 SET RESET and UNSET procedures Syntax SET flag UNSET flag RESET flag Semantics The SET procedure puts the specified flag in the set state The UNSET
52. 1 If class cj is missing from a set description the corresponding probability is zero Example DECLARE CLASS C1 C2 C3 C4 C5 C6 STATION NAME A SCHED EXCLUDE C1 0 4 C2 0 5 C3 0 2 C4 C5 A class C1 customer entering station A belongs to the first concurrency set with probability 0 4 A class C4 customer entering station A always belongs to the second concurrency set Class C6 customers do not belong to any concurrency set Concurrency sets without classes When there is only one customer class the concurrency sets are defined with probabilities A customer belongs to concurrency set j with probability p The sum of probabilities must be less than or equal to 1 Example SCHED 0 2 0 4 0 3 A customer entering the station belongs to the first concurrency set with probability 0 2 It belongs to no concurrency set at all with probability 1 0 2 0 4 0 3 3 7 5 PRIOR parameter Syntax prior_parameter PRIOR class_list integer User s Guide Control Language 77 78 Semantics The PRIOR parameter determines the priority level of the customers entering the stations identified by the NAME parameter This priority level may be different for each class of cus tomers If a class list is specified its expression is evaluated at compile time All classes of the list will have the same priority The PRIOR parameter without class specification applies to all the
53. 1 In the first part of the declaration all formal parameters must be specified after the name of the procedure After that they must be declared between the definition of the name and the FORWARD keyword Local variables may be placed also before the FORWARD keyword It is highly recommended to put local variables in the second part for clarity 2 The second part must appear in the same DECLARE block The formal parameters must not be defined at this point Local variables may be declared if this has not already been done A compound statement declares the body of the procedure Example DECLARE PROCEDURE PA IA RB SC INTEGER IA REAL RB STRING SC FORWARD PROCEDURE PB BD BOOLEAN BD BEGIN 1 1 0 1 END PROCEDURE PA BEGIN PB TRUE END 2 3 8 3 Generic procedures Syntax generic procedure declaration PROCEDURE identifier formal parameter local declaration GENERIC The declaration of a generic procedure contains the specification of an identifier and an optional list of parameters with the corresponding local declarations No definition of the procedure body is authorized at this level 36 Declaration Statements Qnap2 V 9 2 pointer a generic procedure is defined in the same manner a pointer an object the keyword REF is reserved for this use The assignment of a normal procedure to a procedure reference is performed simply with The
54. 1111 0 ef 4 6296 x 0 e t 5 0815 0 ef 1 6000 x 0 e t 13 9500 255 5552 60 9523 1 0000 x 0 0 0000 x 2778 4444 1587 5556 0 67 OF TOTAL MEMORY amp 2 Dual stage split match network DECLARE QUEUE PROC3 PROC4 MID_JOIN STATION STATION STATION STATION NAME PROC1 K ie k k ok ok k K 6734 WORDS OF 4 BYTES SPLIT PROC3 C3 1 PROC4 C4 1 NAME PROC3 SERVICE EXP 0 5 TRANSIT MID_JOIN NAME PROC4 SERVICE EXP 0 9 TRANSIT MID_JOIN NAME MID_JOIN MATCH PROC1 C3 1 C4 1 SERVICE EXP 1 0 TRANSIT JOINUP EXEC SOLVE SPLITMAT 194 Analytical Solvers Qnap2 V 9 2 RESULTS ON INDIVIDUAL QUEUES SOURCE STATION SRC ARRIVAL RATE 0 556 L LOWER BOUND A APPROXIMATION X X ok ok ok ok ok ok ok ok ck coke ok ok ok ck coke ok ok ok ck coke ok ok ok ck coke ok ok ok coke ok ok ok ok ok coke ok ok ok ok coke ok oe ok ok ok ok ok ok ok K K koe LOAD LENGTH L RESPONSE L LENGTH A RESPONSE A ER FC A Ek of a OK FORK 0 500 0 628 1 130 1 000 1 800 PROC2 0 006 0 006 0 01
55. 486 gt 20 simplei 0 1 V semi VALUE 1 gt 20 simplei 0 0 gt OUT TIME 100 000 gt TIMER TSYSTMAX IS JUST ACTIVATED TIME 100 00 ok ok ok ok ok ok ok 2k ok ok ok ok aft af 2fe ok ok NAME SERVICE BUSY PCT CUST NB RESPONSE SERV NB ok ok ok ok ok ok ok 2k ok ok ok ok aft af 2fe ok ok double 2 962 0 2962 1 516 15 16 10 3 049 0 3049 1 588 15 88 10 simple2 2 979 0 2979 1 580 15 80 10 semi 0 0 0 2962 1 559 19 sem2 0 0 0 2962 1 559 19 kk kk ke ke ke ke ke ke ke ke OF SIMULATION MEMORY USED 6797 WORDS OF 4 BYTES 0 68 OF TOTAL MEMORY 46 47 END User s Guide Modeling Mechanisms 143 4 12 Resources A resource is a station consisting of a queue and or more resource units or passive servers During a service a customer may require a resource unit If the request is not satisfied the customer is blocked until a resource unit is available 4 12 1 Resource creation A resource is statically created by means of the STATION control statem
56. 5 117 4 3 1 Single server station 117 4 3 2 Multiple server station 222 2 oo oo re 117 4 3 3 Infinite server station 118 4 3 4 Source station 118 4 4 119 4 4 1 Work demands 119 4 4 2 Object manipulation 119 4 4 3 Service Completion Common 120 4 4 4 Service Suspension 120 4 5 Server Allocation 122 4 5 1 Station without quantum or preemption 122 User s Guide Simulog iv 4 5 2 Station with 123 4 5 3 Station with quantum allocation 123 4 5 4 Multiple server station with concurrency sets 125 4 5 5 Resequencing 126 4 6 Customer Priority Level 128 4 6 1 PRIOR parameter 128 4 6 2 PRIOR procedure 128 4 6 3 TRANSIT 129 4 6 4 BEFCUST and AFTCUST 129 4 7 Customer Creation 131 4 8 JOIN and JOINC procedures
57. 5 4 7 3 Use Warnings To start the replications on a model containing OPTION SIMPAR you must first start the communication interface with PVM To do this you start the pvm command in the QNAP2 installation directory in the sub directory lib PVM_ROOT 1ib pvm A prompt then appears pvm gt You can then enter the PVM configuration commands A full list is given at the end of the chapter The useful commands are e add station name allows you to work to start a process on the station in question conf gives the list of stations that can be used on which processes can be started e delete station name removes the station from the list of usable machines e halt stops PVM and quits the interface kill number kills the process with the number specified kill c number kills the child process of the process whose number has been specified e ps gives the list of all the processes with their associated numbers TID column and the number of their parent process PTID column The numbers are hexadecimal e quit leaves the interface without killing the process e reset kills all the processes without leaving the interface Useful if following an entry error QNAP2 slaves continue to function help online help 5 4 7 3 1 Example Let us say you have a model model qnp containing the replication parallelization commands i e CONTROL ESTIMATION REPLICATION number OPTION SIMPAR
58. A 1 2 1 Error during compilation 289 A 1 2 2 Error during simulation 289 A 2 Error and Warning Messages 290 Introduction 1 6 eg qu sr mS suave 291 42 2 List of messages suo e meom Roy Ru eR vecteur 292 A 3 Problem reporting 311 B New features 313 1 New modelling mechanisms 316 B 1 1 Finite capacity queues 316 12 Concurrency in eat ee 316 B 1 3 Customer resequencing 2 Cm lA 316 B 1 4 Customer split and 316 B 1 5 Dumers bet Od wie CAE duae 317 Bi simitlation control 4d saad BAR ie ESS Gow Go ee Seat 318 B 2 1 Generalized trace s nu Sha ee ne hea Aa 318 B 2 2 Generalized 2 318 B 2 3 Accuracy control 22 EE Pe RES 319 Bedi HX CEPLIONS a vou Brie Lata eae ee 319 B3 Analy tical solvers 4 som de IRR ORUM etel dw ods wa ae le ale 321 B 4 Algorithmic 322 Beas User functions u te eret sh ae et 322 B 4 2 Hierarchical predeclared procedures and functions 322 B 5 Compatibility with 80 323 C New features V9 1 V9 2 a
59. A fission specification without class_list applies to all classes for which no fission is defined If a class_list is present it is evaluated at compile time The other expressions are evaluated at initiation time The fission mechanism is defined as a probabilistic switch between several fission possibilities prob is a real expression giving the weight of each fission possibility If the sum of prob values is not 1 then all prob values are normalized The triples queue class count indicate the destination queue the class of pieces and the number of pieces resulting from each fission A single customer may be fissioned into any number of pieces Example DECLARE QUEUE UNPACK CLASS SCREWBOX SCREW STATION NAME UNPACK FISSION SCREWBOX SCREW 100 A single customer of class SCREWBOX is fissioned into 100 customers of class SCREW Note SPLIT MATCH and FISSION FUSION should not be confused SPLIT is intended to work in conjunction with MATCH FISSION and FUSION can be used independently See section 4 10 for more explanations 3 7 13 FUSION parameter Syntax fusion_parameter FUSION join PRIOR integer FUSION join WEIGHT real join class count result_class 86 STATION Command Qnap2 V 9 2 Semantics The FUSION parameter is used to specify a fusion of customers into a single customer All the expressions are evaluated at initi
60. CONVOL with the following additions e closed network no concurrency sets no limited capacity stations no dependent service rates per class e if R i is the i th service rate coefficient then R i must be a concave monotonically non decreasing function of i marginal probabilities may not be requested 5 2 9 4 Application stipulations summary station scheduling service distinct global dependent type time serv time dependent serv rate distribution per class serv rate per class PS MULTIPLE FIFO exponential PS general INFINITE SINGLE FIFO exponential no yes no LIFO PREEMPT general yes yes no general yes yes no no yes no x mo imo no Example In this example a queueing network consisting of two stations A and B is described and analysed by the solver HEURSNC with various specifications of stations A and B DECLARE QUEUE A B CLASS X Y REAL 2 TX 1 5 TY 0 5 REAL R 2 2 3 RX 2 3 4 RY 2 4 3 INTEGER W 3 STATION NAME B TYPE INFINITE INIT TRANSIT A SERVICE CST 1 182 Analytical Solvers Qnap2 V 9 2 STATION EXEC STATION EXEC STATION EXEC STATION EXEC STATION EXEC STATION EXEC NAME RATE R TRANSIT B SERVICE EXP T SOLVE HEURSNC NAME MULTIPLE 3 SOLVE HEURSNC NAME SINGLE SCHED LIFO PREEEM
61. MACHINE 38 Declaration Statements Qnap2 V 9 2 INTEGER NUMBER amp attribute REAL TOPER END OBJECT CONVEYOR INTEGER NUMBER amp attribute REAL TTRANSP END PROCEDURE WORK INTEGER NUMBER amp local variable BEGIN END PROCEDURE DOIT INTEGER NUMBER amp local variable BEGIN END REAL FUNCTION ISOK NUMBER INTEGER NUMBER amp local formal argument BEGIN END Note In old versions of QNAP2 it was possible to have an implicit reference to an attribute in a procedure called inside a SERVICE Implicit references to attributes of predefined object types such as QUEUE or CUSTOMER or user defined object types are no longer allowed User s Guide Algorithmic Language 39 2 4 Expressions 2 4 1 Overview Syntax expression simple expression conditional_expression type expression simple_erpression comp term relation operator comp term conditionalespression IF expression THEN expression ELSE expression type_expression object id object_type id object id IS object_type id object id IN object_type id relation_operator lt gt lt gt lt gt comp term sign term add_operator term sign gt add_operator 08 term factor mult operator factor mult operator x AND factor primary primary primary constant variable expression function call NOT primary Semantics As shown in the rules fo
62. OUT Y OUT Z A X EXP 1 Y EXP 2 Z EXP 3 5 S A X 0UT 5 S A Y 0UT and one closed sub chain 2 The two open sub chains include the same source station 5 2 2 2 4 source station A source station may not send customers directly to the OUT queue Example Incorrect network DECLARE QUEUE S STATION NAME TYPE TRANSIT User s Guide A 5 SOURCE A 0 96 OUT Solvers 165 5 2 2 2 5 customer class given customer class must belong to only one sub chain Example Incorrect network DECLARE QUEUE A B C CLASS X Y STATION NAME TRANSIT X TRANSIT CY now ou QUE STATION NAME TRANSIT nou m w STATION NAME TRANSIT X TRANSIT Y nou aw P4 There two sub chains A X B X 4 Y C Y CD B Y The two sub chains are distinct but class X belongs to both of them 5 2 2 3 Ergodicity conditions The analysis can be performed only if all the sub chains are ergodic A sub chain is said to be ergodic if for any pair station A class X a customer of the sub chain leaving station A with class X will return to station A with class X after a finite period The ergodicity conditions are verified in QNAP2 taking into account the initial state of the network The transient states ie the pairs station class which contain customers in the initial state of the network but which do not cont
63. QUEUE This message means that the customers leaving a queue are sent to an undefined station This message is printed only if the transition is defined with a reference to a station equal to NIL Example 1 DECLARE QUEUE OBJECT foo 2 INTEGER N 3 END 4 REF foo D 5 QUEUE A B C 6 REAL ri 1 7 8 STATION NAME A 9 INIT 1 10 SERVICE EXP 1 11 TRANSIT B 0 5 C r1 D 23 EXEC BEGIN 24 0 1 25 SOLVE 26 END 040108 gt ERROR EVAL TRANSITION TO AN UNDEFINED QUEUE STATION A 27 28 END STOP QNAP2 END OF EXECUTION e 060109 gt ERROR EVAL TRANSITION TO A QUEUE NOT IN THE NETWORK The NETWORK procedure is used to specify a sub network in this case the reso lution will apply only to the stations in the sub network This message means that some customers are sent to a station which does not belong to this sub network The user can remove the NETWORK procedure from the model extend the list of queues in the sub network or modify the customer transitions so that they stay in the sub network e 0G010B gt ERROR EVAL TRANSITION TO AN UNDEFINED CLASS 304 Error and Warning Messages Qnap2 V 9 2 e 06010 e 010507 01050 User s Guide This message means that the class of customers leaving a queue is changed to an undefined class This message is printed only if the class is defined with a reference equal to NIL Example 1 DECLARE 2 REF CLASS _C 3 CLASS C1 C
64. The following CONTROL parameters can be used to request additional statistical results Refer to chapter 3 on page 92 for details about these parameters Note These parameters are provided only for compatibility with previous QNAP2 releases SET STAT keywords procedure calls always override CONTROL parameters It is not recom mended to mix CONTROL specifications and SETSTAT keyword specifications as the CON TROL parameters will probably be ignored Use of the SETSTAT keyword procedures is en couraged as the algorithmic language is more powerful more selective and more flexible than the command language CLASS is used to specify the queues on which class specific results must be computed MARGINAL is used to specify the queues on which marginal probabilities on the number of customers must be computed ACCURACY is used to specify the queues and classes on which confidence intervals must be computed 230 Simulation results Qnap2 V 9 2 CORRELATION is used to specify the queues and classes on which correlation coefficients must be computed 5 5 2 2 SETSTAT procedures The following SETSTAT keyword procedures are used to specify which statistics must be com puted on queues or watched variables Basic queue statistics Syntax SETSTAT QUEUE queue list SETSTAT CLASS queue_list class_list Semantics QUEUE is used to request basic statistics on all standard results on the specified queues CLASS is used
65. This customer preempts the server X service is suspended and resumes at Y service completion time 13 X suspension______ sk a ok oj ok ok oj ok ok ok ok ok oe Y _____ EEEEEEEEEEEEE EEEE aac gt preemption resume 0 3 5 10 13 v 15 20 User s Guide Modeling Mechanisms 121 4 5 Server Allocation The presence of a customer in a queue corresponds to the allocation of a server whatever its state may be When a server is allocated to a customer this customer is said to be served even if its service is blocked for some reason If no server is allocated to a customer or as soon as the server has been preempted the customer is said to be waiting The server allocation mechanism is defined by the SCHED parameter of the station 4 5 1 Station without quantum or preemption A server is allocated only after the departure of the current customer When a customer enters a station and if an idle server exists the server is immediately allocated to this customer all the servers are equivalent in a station If all the servers are busy at customer arrival time then the customer is set to wait When a customer leaves the station at service completion time or when forced by another customer the freed server is immediatly allocated to the first waiting customer scanning from the head of the queue The servers are allocated independently of the other requests posted by the customer thus a customer waiting for
66. a join condition Note blocked customer is in service so it uses a server in its current queue e The BLOCK and UNBLOCK procedures do not block the customers but the servers The blocked time of the servers is not accounted to the customers utilization rate the mean utilization rate is the fraction of servers or of resource units which have been used i e occupied by customers during the measurement session global S g Tm M e class S q k Tm M where M is the number of servers or resource units in the station In the case of a single server it is equal to the mean server busy fraction and also to the fraction of time the station was occupied by at least one customer In the case of a simple queue SERVER MULTIPLE 0 or SEMAPHORE this value is always null In the case of an infinite server INFINITE the result is always zero Note For a multiple server the utilization rate multiplied by the number of servers in the station yields the mean number of occupied servers User s Guide Solvers 227 5 5 1 2 User statistics User statistics are automatically computed on variables declared with the WATCHED keyword Watched variables also called statistical variables must be specified as discrete or contin uous variables e A variable is said to be continuous when the computed statistics take time into account Continuous variables are sometimes called integrators number of customers
67. a macro definition may consist of any sequence of instructions Its analysis is performed only when the macro is called A macro may not contain calls or definitions of other macros e a macro definition may occur anywhere in a model between two statements parameters algorithmic language statements The number of dummy arguments is limited to 20 Note The semicolon is not a separator in the case of macros it is not to be used to terminate the MACRO statement the END statement nor with the macro call User s Guide Macro Processing 241 242 6 2 Macro statement call Syntax macro call macro id actual_param actualparam identifier 4 4 integer_cst real_est string cst boolean_cst Semantics DI call to a macro statement is equivalent to the copy of the whole macro definition body in which the dummy arguments are replaced by the actual parameters into the QNAP2 source file in place of the call The actual parameters must be simple syntactic tokens expressions are not allowed Pro cedure function or type identifiers may be used as actual parameters of a macro A macro statement may be called anywhere in a model definition except within a macro definition Example DECLARE QUEUE CPU DA DB MACRO DISK N TETA STATION END amp Macro calls DISK DA DISK DB Generated text STATION STATION Macro st
68. a resource or a semaphore remains candidate for a server Example DECLARE QUEUE A STATION NAME A TYPE MULTIPLE 3 SCHED FIFO PRIOR 6 0 90 9 600 B arrival order customer holds a server If customer 6 completes its service first the queue becomes 6 4 9 6 Q A new customer 7 enters the station 122 Server Allocation Qnap2 V 9 2 Before being served the customer 7 must wait for a service completion since SCHED has not been specified with PREEMPT 4 5 2 Station with preemption In a single server station with preemption SCHED PRIOR PREEMPT or SCHED LIFO PREEMPT the server is always detained by the first customer in the queue As soon as a waiting customer reaches the head of the queue the server is preempted from the customer being served and immediately allocated to the new customer This preemption may occur under the following circumstances e SCHED LIFO PREEMPT a new customer arrives any customer e SCHED PRIOR PREEMPT a new customer arrives having a higher priority level than the customer being served or in the case of a modification of the priority of the waiting customers PRIOR procedure In the case of a multiple server station the n servers are always allocated to the first n customers in the queue If a customer arriving at the station or moved after a priority modification enters the set of the first n customers it then preempts t
69. algorithmic instructions block execution TERMINAL QNAP2 program interactive execution REBOOT algorithmic reboot block after a deferred RESTORE RESTART introduction of a new model END end of QNAP2 source file Example Definition of a station and of a control parameter DECLARE QUEUE STATION NAME A INIT 21 amp number of customers CONTROL TMAX 1000 amp simulation duration EXEC SIMUL amp simulation with amp one customer only User s Guide Control Language 63 64 STATION NAME INIT 3 EXEC SIMUL amp simulation with amp 3 customers CONTROL TMAX 5000 EXEC SIMUL amp simulation with amp 3 customers amp duration limited to 5000 The preceding example can also be written as shown below by associating a variable N to the number of customers in A and a variable T to the simulation duration Example DECLARE QUEUE A B REAL INTEGER N STATION NAME A INIT N CONTROL TMAX T EXEC BEGIN N 1 T 1000 SIMUL N 3 SIMUL 5000 SIMUL END 3 1 2 Command parameters evaluation During a session the QNAP2 system enters different processing phases according to the different commands encountered in a QNAP2 program A definition of these phases is necessary for a clear understanding of the processing done by QNAP2 during each of them and the way the expressions and the commands appearing in a QNAP2 program are
70. an inserted block 8 3 6 8 3 7 Cancelling a specified break point 8 3 8 Restoring the context saved during debugging Trace Facilities 9 1 Trace control 9 2 Standard 9 3 Generalized Trace 9 3 1 Overview 9 3 2 Basic concepts 9 3 3 9 3 3 1 Symbolic event names 9 3 8 2 Default tracing actions User s Guide 239 241 242 243 246 247 248 250 250 250 251 253 255 256 256 256 256 256 258 258 259 259 259 259 259 260 260 261 264 265 267 267 267 268 269 270 Simulog vii 9 3 4 GETTRACE 270 95335 SE Xam ple PUE OR Ren eae Es ata es 272 10 Graphics and QNAP2 275 10 1 Procedure 278 10 2 Procedure 280 Example ote a aa SM Dude doces 282 Errors and Warnings 287 A L Enorumanagement teim len re Sree REY 289 Adel Message format i10 an ae ee ee as RE ES 289 A 1 2 Qnap2 b haylout 289
71. at the beginning of solution time The INIT parameter without the class option is applied for all the classes for which no specific initial value exists If a class list is specified its expression is evaluated at compile time The initial number of customers may be a constant or an expression The expression defining the initial number of customers in an INIT parameter is evaluated at initiation time The means by which customers are initially generated and placed in queues are described in Chapter 4 Note that a resource or semaphore station may not contain customers at initialization time Example DECLARE QUEUE A B User s Guide Control Language 79 80 CLASS X Y INTEGER N STATION NAME 2 1 STATION NAME B INIT Station A is initialized with two customers of class X and one customer of class Y Station B is initialized with N customers in both class X and class Y N must have a value before calling a solver Note INIT N is a common trap for QNAP2 beginners This parameter does not initialize the station with N customers but with N customers for each class existing at initiation time 3 7 8 SERVICE parameter Syntax service parameter SERVICE class_list statement Semantics The SERVICE parameter specifies the service required by the customers being in the stations identified by the NAME parameter The service may be different for each custom
72. classes for which no specific priority level is defined Priority levels are positive integers the greater the integer the higher the priority The priority level may be a constant or an expression The expression defining the priority level in a PRIOR parameter is evaluated at initiation time no dynamic evaluation during solution time If the PRIOR parameter is undefined for a given class the customers belonging to this class keep their previous priority levels zero is the default priority level for each newly created customer Note that affecting a priority level to a customer is not related to the fact that the station scheduling policy is PRIOR Example DECLARE QUEUE UC UK INTEGER PX CLASS 2 STATION NAME UC PRIOR X Y PX PRIOR 2 STATION NAME UK SCHED PRIOR PREEMPT PRIOR Y 1 PRIOR Z 3 The customers entering the station UC get new priority levels class X and class Y customers get a priority determined by variable PX evaluated at solution time Customers of the other classes get a priority level equal to 2 The customers treated in station UK are served in priority order with possible preemption Class Y customers and class Z customers get priority levels equal to 1 and 3 respectively Class X customers keep their priority level i e the one they had before entering the station UK 3 7 6 QUANTUM parameter Syntax quantum parameter QUANTUM class_list real Sem
73. concurrency sets can be solved with the CONVOL method CONVOL is able to solve queueing networks including both finite capacity queues and multiple server with concurrency sets provided that these two features are not used on the same stations The analytical solvers are described in chapter 5 Solvers User s Guide New features 321 B 4 Algorithmic language Two enhancements have been performed on the algorithmic language user declared functions and structured identifiers for predeclared procedures and functions B 4 1 User functions With V9 0 the user is now allowed to declare functions User declared functions have exactly the same flexibility as user declared procedures local variables arguments passed by value or by reference forward declarations generic declarations and references to user functions The declaration syntax is exactly the same as for procedures except that e the keyword FUNCTION replaces the keyword PROCEDURE and e the function type must precede the declaration Example DECLARE BOOLEAN FUNCTION ISOK Q User functions are presented in section 2 3 9 Function declarations B 4 2 Hierarchical predeclared procedures and functions In V9 0 a new syntax has been introduced for predeclared procedure and function identifiers The identifiers are now structured in the following way functtonality keyword The first word refers to a general purpose functionality e g SETSTAT for sta
74. configuration Syntax conf Output fields HOST host name DTID tid base of pvmd ARCH xhost architecture MTU UDP max packet size SPEED host relative speed delete Delete hosts from virtual machine Syntax delete hostname echo Echo arguments Syntax echo arg halt Stop pvmds Syntax halt help Print helpful information about a command Syntax help command id Print console task id Syntax id jobs Display list of running jobs Syntax jobs options Options 1 give long listing kill Terminate tasks Syntax kill options tid Options c kill children of tid Show status of hosts Syntax mstat name ps List tasks Syntax ps axh Options all hosts default is local hhost specific host tid 224 Simulation Qnap2 V 9 2 nhost specific host name show console task default is not Output fields HOST host name A OUT executable name TID task id PTID parent task id FLAG status FLAG values task connected to pvmd task waiting authorization o task connection being closed pstat Show status of tasks Syntax pstat tid quit Exit console Syntax quit reset Kill all tasks Syntax reset setenv Display or set environment variables Syntax setenv name value sig Send signal to task Syntax sig signum task spawn Spawn task Syntax spawn options file arg Options count number of tasks default is 1 host
75. customer populations moving from one station to another or changing from one class to another but which do not mix themselves A sub chain is said to be closed if its population is constant fixed at initialization time Such a sub chain may not involve a source or exit station OUT queue A sub chain is said to be open if it contains at least one source and one exit station closed network a network is said to be closed if all its sub chains are closed open network a network is said to be open if all its sub chains are open mixed network a mixed network is made up of at least one closed sub chain and at least one open sub chain Example amp the services are not described DECLARE QUEUE A B C CLASS 2 STATION NAME TRANSIT X TRANSIT Y B 0 2 0UT M wo N STATION NAME TRANSIT A TRANSIT Z A X STATION NAME TYPE SOURCE TRANSIT B Y 0 1 A Y There are two sub chains in this network A X B Z closed sub chain C B Y OUT open sub chain therefore the network is a mixed network 5 2 2 2 Network topology The implemented analytical solvers overimpose the following conditions concerning the network topology 5 2 2 2 1 open sub chain An open sub chain should contain only one source station Example Incorrect network DECLARE QUEUE 51 52 STATION NAME 1 User s Guide Solvers 163 STATION NAME TYPE TRANSIT
76. customers PMXCUSTNB queue class maximum number of customers during the last sampling interval 5 5 4 Simulation process The SIMUL procedure places on the time scale of the model under study the various events occuring in the model enqueuing preemption it interprets the actions performed by these events and makes the appropriate modifications on the objects and variables of the model The simulation always follows the event order on the time scale of the model no event can be processed if all the earlier events have not yet been handled If several events occur at 236 Simulation results Qnap2 V 9 2 the same time the simulator obviously handles sequentially actions that supposed to be simultaneous The actual order may be important for the behaviour of the model for instance if two stations read and write simultaneously a shared variable The order chosen by the model to handle simultaneous events should be taken into account At any instant of time the model executes operations for a given process a customer a timer or an exception This process is named the current process Timers and exceptions become the current process only when their handler procedure is activated A customer may become the current process we shall say the current customer if it verifies the following conditions e a server is allocated to this customer it is not waiting on a semaphore resource flag or join condition e it ha
77. due to preemption Note Those attributes are available within the reject statement only and before any delay or synchronization operation is performed by the rejected customer 4 2 4 Queue initialization If the initial state of a queue involves several customer classes the initial customers are ordered according to the following rules e the number of customers of each class is determined by the INIT parameter of the station e the customers are generated and sent to the station according to the declaration order of the classes customers of the first declared class are created first and so on e ihe customers are ordered according to the SCHED parameter of the station but the server allocation is not yet started if the station has a priority discipline the customers of the highest priority level will be at the head of the queue e when all the customers defined by the INIT parameter are in the queue the server alloca tion is started Therefore in a station with a priority discipline the customers with the highest priority levels are served first Example DECLARE QUEUE A B C CLASS X Y Z STATION NAME A INIT 1 SCHED FIFO ance LAST FIRST customer being served STATION NAME INIT X 2 INIT Z 1 SCHED LIFO PREEMPT X X 2 LAST FIRST STATION NAME C INIT Y 2 INIT 1 User s Guide TYPE MULTIPLE 3 PRIOR Y 1 SCHED PRIOR Model
78. e The FUNCTION keyword is preceeded with the type of the result e Inside the body of the function the returned result must be assigned to the predefined variable RESULT User s Guide Algorithmic Language 37 Example DECLARE BOOLEAN FUNCTION ISREADY RQ REF QUEUE RQ REF CUSTOMER RC BEGIN RC RQ FIRST IF RC NIL THEN RESULT TRUE ELSE RESULT NOT RC BLOCKED END Three types of functions may be defined exactly like the three types of procedures e Normal functions e Forward functions e Generic functions Refer to the previous section for details about procedure declarations Note A generic function is declared like a generic procedure When a normal function is assigned to a reference to a generic function the asignment statement must be followed by the ADDRESS keyword in order to distinguish it from a call to the function Example DECLARE BOOLEAN FUNCTION ISOK RQ REF QUEUE RQ GENERIC REF 150 RI BOOLEAN FUNCTION ISUP RQ REF QUEUE RQ BEGIN RESULT END EXEC RI ISUP ADDRESS amp RI ISUP would be incorrect amp as ISUP returns a boolean 2 3 10 Locality The property of locality exists for objects procedures and functions The same identifier may appear as a global variable a local variable in one or several procedures and functions and as an attribute of one or several object types Example DECLARE INTEGER NUMBER amp global variable OBJECT
79. feature depends on the available compiler and linker The main point is that the calling conventions be compatible with the calling conventions of the Fortran compiler It is also possible to tailor the Fortran UTILIT routine to handle the calling conventions and eventual convertion operations between Fortran and the other language User s Guide Interface with Fortran 245 7 1 UTILITY procedure Syntax UTILITY integer arrayl array2 Semantics The UTILITY procedure is used to trigger from QNAP2 program the controlled execution of an external user defined FORTRAN subroutine named UTILIT The integer is generally used as a code specifying what the UTILIT subroutine should do The two arrays are used for data communication between the model and the UTILIT subroutine The arrays must be INTEGER REAL BOOLEAN or STRING arrays 246 UTILITY procedure Qnap2 V 9 2 7 2 UTILIT subroutine Syntax SUBROUTINE UTILIT ICODE IRTAB1 IRTAB2 INTEGER ICODE IRTAB1 IRTAB2 user code RETURN END Semantics The UTILIT subroutine is a Fortran routine It must be declared with three dummy integer arguments The body of the subroutine should not directly alter the values of the arguments Communication with the model must be performed via special purpose subroutines see next section The user code may include named COMMON declarations The blank common is reserved for QNAP2 internal use The common names should begin with t
80. generic procedure and the actual procedure must have compatible formal parameter lists Example DECLARE PROCEDURE COMBINE X Y 7 REAL X Y VAR REAL Z GENERIC amp generic procedure combining two reals REF COMBINE RP PROCEDURE SUMSQRT AB AC BC amp Pythagorus formula REAL AB AC VAR REAL BC BEGIN BC SQRT AB AB AC AC END RP SUMSQRT 2 3 8 4 Notes e QNAP2 accepts only one procedure declaration level Procedures may not be declared inside other procedures e g as in Pascal e case the procedure is called in the service of a virtual station no implicit reference on the object containing the queue is available in the procedure this is not the case in the body of the station service procedure containing customer manipulation operations should be called only within the context of simulation procedure may change the value of a variable declared as a formal parameter passed by value without VAR This cannot however affect the value of the actual parameter A local variable may be of any scalar type including references e Local variables of a procedure may not be instances of types of predefined objects or of user types no static creation of an object in a procedure 2 3 9 Function declarations Function declarations are very similar to procedure declarations The main differences are the following e The FUNCTION keyword replaces the PROCEDURE keyword
81. is not activated e PERIOD cancels any previous definition of PERIOD 3 8 15 TEST parameter Syntax test_parameter TEST statement Semantics The TEST parameter is used to specify a statement to be executed during a simulation at the end of each interval determined by the PERIOD parameter In a test sequence the user may for instance e define regeneration points using the SAMPLE procedure in order to split the simulation duration into independent fixed or variable length intervals as required by the regeneration method e print the results obtained for each station during the current period by using for example the OUTPUT procedure and therefore keep track of the station behaviour during the simulation User s Guide Control Language 103 stop the simulation run before the completion of the simulation duration TMAX by using the STOP procedure All these actions may be conditionned by tests on the current state of the model current queue lengths number of services completed The default value is TEST The statement associated with a TEST parameter is executed during solution time Example DECLARE QUEUE A B C amp the OUTPUT procedure is called 10 amp times every 200 time units CONTROL PERIOD 200 TMAX 2000 TEST OUTPUT EXEC SIMUL amp the simulation run will stop after amp 2000 time units or if more than 500 amp services have been completed
82. is the curent customer referenced by the variable CUSTOMER If the queue associated with the resource contains waiting requests the resource is allocated to another customer depending on the ressource discipline FIFO PRIOR Note customer may not perform a V operation on a resource on which it did not perform a P operation as opposed to semaphores 144 Resources Qnap2 V 9 2 4 12 4 Server resource equivalence Servers and resources correspond to symmetrical views of synchronization A model consisting of a set of servers processing customers may be represented by a symmetrical model made up of customers requesting resources The following example shows two versions of the same model to illustrate this duality Example Version 1 DECLARE QUEUE A B C STATION NAME 20 TRANSIT B 0 4 C SERVICE EXP 5 STATION NAME B TRANSIT A SERVICE EXP 3 STATION NAME TRANSIT A SERVICE EXP 2 Example Version 2 DECLARE QUEUE A B C CUSTOM STATION NAME TYPE INIT SERVICE User s Guide CUSTOM INFINITE 20 WHILE TRUE DO BEGIN P A EXP 5 VO IF DRAW 0 4 THEN BEGIN Modeling Mechanisms 145 EXP 3 VOD ELSE BEGIN P C EXP 2 STATION NAME A TYPE RESOURCE STATION NAME B TYPE RESOURCE STATION NAME C TYPE RESOURCE In the first version
83. line 2 PRINT prints a 1 in the first column This corresponds to a form feed in the Fortran 77 standard 3 Beware of short formats if the data item does not fit into the specified width QNAP2 raises an error condition 2 6 1 3 Control procedures The following procedures are available to control data files FILASSIGN is used to assign a file name to QNAP2 FILE object OPEN and CLOSE are used to open and close files User s Guide Algorithmic Language 57 SETSYN is used to define a synonym I O redirection FILSETERR is used to set the error recovery level for I O operations SETRETRY is used to set the number of read attempts allowed before raising an error con dition SETBUF is used to set the I O buffer size of the FILE object which should match the file s record length Only FILASSIGN OPEN and CLOSE are described here For the other procedures please refer to the Reference Manual Syntax FILASSIGN file name OPEN file mode CLOSE file mode QNAP2 FILE objects must connected to a physical file This is performed with FILASSIGN Once the file name assigned to the FILE object all subsequent operations are performed via the FILE object This ensure model portability as the file names are operating system dependent The optional mode argument of OPEN can take the following values 1 to open a file for reading The file must already exist 2 to create a new file The file must not exist
84. may be used several times in a parenthesis Function calls are possible as for other operators If the dimension of the result of the concatenation exceeds the size of the destination variable it is truncated Example DECLARE STRING 10 51 52 53 BEGIN PRINT Execution of the program produces 51 ABCDEFG HIJKL PRINT R1 51 51 ABC 82 DEF PRINT R2 81 82 END Execution of the program produces Ri ABCDEFGHIJ R2 ABC DEF Note the truncation in the first result Note Be careful not to place the operator as the first element on an input line This will result in a syntax error as the character introduces QNAP2 commands when used as the first non blank character User s Guide Algorithmic Language 4T 2 5 Statements 2 5 1 Simple statement and compound statement Syntax statement simple statement compound statement compound statement BEGIN label id statement END simple_statement assignment_statement goto_statement procedure call if_statement for_statement while_statement Semantics Any instruction may be labelled provided that it is enclosed in a BEGIN END block The identifier used must have been declared as a LABEL Note A statement may be empty is accepted inside a compound statement only 2 5 2 Assignment statement Syntax assignment_statement single_variable ex
85. models with two different time scales because of the validity of the user computed results and to avoid too long simulations e 080408 gt ERROR SIMUL NEGATIVE VALUE ASSIGNED TO A DELAY A CUSTOMER or a TIMER is asked to wait a negative time delay which is forbidden The user has to ensure that this delay be always positive e 080409 gt ERROR SIMUL UNDEFINED TRANSITION No transition has been defined for the CUSTOMER in the specified QUEUE The user has to check the TRANSIT parameter of the queue e OROAOL gt WARNING SIMUL NO TMAX SPECIFIED TMAX 0 ASSUMED User s Guide Errors and Warnings 309 310 e OROMO3 1301 02 1301 03 e 130M0C e 130M0J The TMAX parameter has not been specified by the user at the beginning of the simulation QNAP2 will assume that TMAX is null The user has either to change the TMAX value at the simulation beginning with the SETTMAX procedure or to add a CONTROL instruction before the simulation launching gt ERROR SIMUL MEMORY OVERFLOW This message means that the input file cannot be read because QNAP2 memory space is full The user can either try to reduce the size of its model too many queues or too many customers or use a QNAP2 executable with a larger memory space To get such a QNAP2 executable the user can generate it himself or ask SIMULOG for it In both cases it is advisable to contact SIMULOG to get more information gt E
86. modification gt ERROR COMPILE THIS IDENTIFIER CANNOT BE INDEXED An indexed notation has got the form object attribute The printed identifier corresponds to object This message means that the object identifier has been defined as a simple variable and not as an object instance The user has to modify the faulty statement or the object declaration gt ERROR COMPILE ALL CANNOT BE USED FOR CUSTOMERS The ALL key word is used to build a list of entities of the same type But CUSTOMER entities cannot be listed by this means to prevent from building too large lists To build such a list the user has to build a list of queues and for each queue access to its customers by queue FIRST customer NEXT gt ERROR COMPILE THIS TYPE CANNOT QUALIFY THIS REFERENCE The operator checks that a specific entity belongs to the specified type This message means that the variable preceding the does not belong to the type specified after the The user has to check the model coherence Example DECLARE REF CUSTOMER _c BEGIN WITH _c QUEUE DO PRINT END END Errors and Warnings 293 294 050200 e 050301 050302 050303 e 050304 gt ERROR COMPILE CALL TO GENERIC PROCEDURE FORBIDDEN A generic procedure is different from the other ones because it has no algorith mic code it only defines a procedure signature the list of arguments and their types Such
87. not explicitely stop it the simulation goes on In this case the SIMACCUR exception can be raised again later 4 14 2 Exception manipulation Exception objects are handled by the SETEXCEPT keyword procedures Syntax SETEXCEPT CONNECT exception signal name procedure SETEXCEPT DISCONNECT exception SETEXCEPT HANDLER exception procedure SETEXCEPT MASK exception SETEXCEPT UNMASK exception SETEXCEPT LAUNCHTIMER exception delay SETEXCEPT CANCELTIMER exception where exception is an exception or a reference to an exception CONNECT is used to connect an exception to an external signal signal_name is the sym bolic name of the external signal as a character string enclosed in double quotes Leading and trailing blanks are ignored The available signals depend on the operating system refer to the installation guide The optional procedure specifies the procedure handler to call when the exception is raised DISCONNECT is used to cancel a previous SETEXCEPT CONNECT call Handling of the signal is left to the operating system HANDLER is used to specify the procedure to call when the exception is raised procedure must be the identifier of or a reference to a procedure with no argument Note CONNECT and DISCONNECT may not be used with the predeclared exceptions HAN DLER must be used to assign a procedure handler to these exceptions MASK and UNMASK MASK is used to temporarily mask occurrences of an ex
88. not need a licence for use So parallel replications can be run on several stations with only one licence e If an error occurs during replication QNAP2 stops with a corresponding error message and the slave processes are also stopped Example SIMULATION WITH REPLICATION METHOD 262147 gt ERROR INTER A REFERENCE WITH VALUE NIL IS USED 262147 LINE NUMBER 14 262147 ACTIVE STATION 42 FOR CUSTOMER 3 262147 TIME 1 842 262147 LINE NUMBER 14 Terminated with errors slaves being killed Please check that no zombie remains before launching a new parallel Qnap2 25 26 END STOP QNAP2 END OF EXECUTION Here 262147 is the process number of the QNAP2 master given in decimal e If ever you cannot add a station to the list of stations that PVM can use pvm gt add averell 0 successful HOST DTID averell Can t start pvmd You should check that all the operating conditions are met directories and files seen by the station in question environment variables properly placed and also that there are no network access problems to this station User s Guide Solvers 223 5 4 7 4 List of communication interface commands This paragraph summarizes the online help given help command by the pvm communication interface add Add hosts to virtual machine Syntax add hostname alias Define list command aliases Syntax alias name command args conf List virtual machine
89. number of intervals should be large enough to ensure an accurate estimation of the confidence intervals A useful rule of thumb is to have 100 fixed intervals This method can be simply implemented by causing the periodic activation of the procedure SAMPLE as shown in the following example Example DECLARE QUEUE SOURCE SYST Simulation Qnap2 V 9 2 STATION NAME SOURCE TYPE SOURCE SERVICE EXP 1 TRANSIT SYST STATION NAME SYST SERVICE HEXP 0 7 5 TRANSIT OUT CONTROL TMAX 15000 ACCURACY SYST ESTIM REGENERATION PERIOD 150 TEST SAMPLE CORRELATION SYST EXEC SIMUL X SIMULATION WITH REGENERATIVE METHOD TIME 15000 00 NB SAMPLES 100 CONF LEVEL 0 95 kk ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke a a a a a a NAME SERVICE BUSY PCT CUST NB RESPONSE SERV NB kk ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke a a a a a a SOURCE 1 007 1 000 1 000 1 007 14896 SYST 7131 7081 5 676 5 715 14896 0 2493E 01 0 2421E 01 1 079 1 046 ok ok ok sk ok ok ok ok ok ok ok ok ok coke ok ok ok cock ok ok ok ck coke ok ok ok ok ok coke ok ok ok ok coke ok oe ok ok ok coke ok ok ok ck oe ok ok ok ok oko koe AUTOCORRELATION FUNCTIONS ON QUEUE MEASURES Sk ok ok ok ok ok 27 ok ok
90. of the confidence interval method and of the parameters specific to each method is made within the CONTROL command with the following parameters ESTIMATION defines the confidence interval method used REPLICATION REGENER ATION SPECTRAL ACCURACY specifies the list of queues for which confidence intervals are to be produced TEST introduces a test sequence i e a process which is activated periodically during the simulation PERIOD defines the period of activation of the test sequence CORRELATION defines a list of queues for which autocorrelation functions are to be com puted applicable only to the regeneration method Alternately the following procedures are available in the algorithmic language SETSTAT ACCURACY specifies the statistical variables for which confidence must be com puted SETSTAT CORRELATION specifies the statistical variables for which autocorrelation fuc ntions must be computed The confidence intervals produced can be retrieved by specific result access functions during a simulation run or after completion of the simulation run For example CCUSTNB and GETSTAT CUSTNB ACCURACY both return the confidence interval on the mean number of customers in a queue A complete list of these functions is available in the QNAP2 Reference Manual Simulation Qnap2 V 9 2 5 4 6 1 replication method Independent replications is the most straightforward method for obtaining confidence intervals It cons
91. ok A positive value means something went wrong e g bad array indices QLOADR and QLOADB are similar to QLOADI for real and boolean data RTAB is a user defined Fortran REAL array LTAB is a user defined Fortran LOGICAL array QLOADS is similar to QLOADI for string data CTAB is a user defined Fortran CHARAC TER array ITAB is a user defined Fortran INTEGER array used to store the length of each character string IERR takes the value O if everything is fine 1 if a string is truncated 2 if the operation failed QSTORI is used to store integer Fortran data into a QNAP2 array The arguments are the following ITAB is a user defined Fortran INTEGER array IF1 resp IF2 is used to indicate the index of the first resp last element to read from the Fortran array 1 or 2 is used to specify which UTILITY array argument should be used IQ1 resp 102 is used to indicate the index of the first resp last element to store the data in the QNAP2 array IERR is a status code returned by QSTORI Communication routines Qnap2 V 9 2 QSTORR QSTORB and QSTORS similar to for real boolean and string data In all cases the QNAP2 array used should be of the appropriate type User s Guide Interface with Fortran 249 250 7 4 Example We assume that a user needs in his QNAP2 model to sort values stored in an array and that he owns a good Fortran sorting routine The principle is to use the UTI
92. parameters are then dynamically executed during the resolution process Intermediate results produced by a resolution procedure may be obtained by setting the TRACE option of the OPTION parameter of the CONTROL command The data produced by the TRACE option is specific to each solver 5 1 3 Results After the normal completion of a resolution procedure the performance criteria characterizing the steady state of the model are printed in a standard report This report is not printed if the NRESULT option has been specified see the OPTION parameter of the CONTROL command Additional results may be requested using CONTROL command parameters or SET STAT keyword procedures The computable results depend on the solver used e Class specific results can be computed by all solvers except some analytical solvers Marginal probabilities on the number of customers in the stations can be computed by all solvers except some analytical solvers e Confidence intervals may be computed by the discrete event simulator in order to validate the steady state assumption The computed values may also be accessed in the model itself by means of the built in result access functions see section 5 5 3 2 on page 234 The performance criteria printed in the standard report are mean utilization factor the utilization factor of a station is the percentage of busy servers or busy resource units in the station It is equal to zero in the case of an infinite st
93. pline has been defined 176 Analytical Solvers Qnap2 V 9 2 5 2 7 Mean Value Analysis solver MVA 5 2 7 1 Overview MVA was developed in order to avoid the computation of the normalizing constants which may lead to numerical unstabilities MVA yields exact results 5 2 7 2 Bibliography SEVCIK and MITRANI I The distribution of queueing network states at input and output instant Rapport de recherche INRIA 307 mai 1978 REISER M LAVENBERG S Mean Value Analysis of Closed Multichain Queuing Net works J ACM 27 2 April 1980 pp 313 322 DRIX P Etude d algorithmes de r solution de r seaux de files d attente ferm s BCMP et heuris tiques associ es These de docteur ing nieur Universit de Paris VI nov 1982 5 2 7 3 Application stipulations Application stipulations of the solver MVA are similar to those of the solver CONVOL with the following additions e closed networks no dependent service rates no concurrency sets e no limited capacity stations marginal probabilities may not be requested single server or infinite server 5 2 7 4 Application stipulations summary station scheduling service distinct global dependent type time serv time dependent serv rate distribution per class serv tate per class PS INFINITE SOURCE SINGLE FIFO exponential no no no LIFO PREEMPT general yes no no general yes no no m me fe 1 Example In this exa
94. released requested released requested released requested requested released requested released requested released requested released requested TOOL TOOL TOOL TOOL TOOL TOOL TOOL TOOL TOOL TOOL TOOL TOOL TOOL TOOL TOOL TOOL TOOL TOOL TOOL TOOL TOOL TOOL TOOL TOOL TOOL TOOL TOOL TOOL TOOL TOOL amp Turn off std trace passed passed passed passed passed passed blocked passed passed passed passed blocked blocked blocked blocked blocked Trace Facilities 273 18 67 13 ROBOT2 released TOOL 18 67 17 ROBOT2 requested TOOL blocked 56 END 214 Generalized Trace Qnap2 V 9 2 Graphics and Qnap2 276 Qnap2 V 9 2 Until the V9 2 release QNAP2 had included a few graphic commands that allowed to draw curves bar charts and pie charts Since QNAP2 V9 3 these commands that are listed below are no more available The graphic commands that have been suppressed are e CLEARSCR clear of graphical window MBEGIN initialization of graphical parameters MENDGR end of graphical operations MODIFY modification of graphical set up PLOATT graphical set up of curves bar charts and pie charts e PLOCUR curve plotting e PLOHIS bar chart plotting e PLOSEC pie chart plotting They were suppressed because QNAP2 main purpose is not to perform graphical operations and above all because these graphic mechanis
95. requested the table contains one more line for each class The name of the class is printed in the first column The rest of the line shows the mean results for the class When confidence intervals are requested the table contains one more line The first column contains a string The rest of the line contains the confidence intervals NAME is the name of the queue or class or the string SERVICE is the service time BUSY PCT is the occupation rate CUST NB is the number of customers in the station RESPONSE is the response time SERV NB is the number of served customers customers that actually have left the station At the end of a simulation run it is also possible to obtain detailed information on the current state of the network a complete list of the queue and customer attributes is given in the QNAP2 Reference Manual Note User s Guide Solvers 233 1 The final report does not include the stations from which no customer has left 2 The Little formulae MCUSTNB queue MRESPONSE queue MTHRUPUT queue and MCUSTNB queue class MRESPONSE queue class MTHRUPUT queue class are not exactly verified at the end of a simulation run This is a consequence of the definitions given above in fact the mean number of customers in the station includes the customers remaining in the station while the mean response time does not However if the working state of the model is stable and if th
96. single call to the SKIP procedure which causes the rejected customer to skip the station and proceed as if it had been served In this case the TRANSIT parameter must be used to specify the destination of the customer 2 With the discrete event simulator the reject statement can include any algorithmic lan guage operation 3 The reject statement is executed by the rejected customer Specific customer attributes and functions are available to obtain information about the reject conditions 4 The reject statement must ensure a proper fate to the rejected customer It should include at least one of the following e a work demand procedure in order to wait for a free place in the station a blocking synchronization operation e g WAIT a successful TRANSIT to another station or to the same station after making room 5 If one of the above operations is performed successfully then the reject condition is for gotten The corresponding data are lost A second reject becomes possible 6 Ifthe reject statement ends with a new reject condition and there was no delay or blocking synchronization then the simulation is stopped with an error message 7 Special case for RESOURCE and SEMAPHORE stations with limited capacity if a customer attempts a P operation and the station is full the P is not performed and the customer executes the reject statement of the resource or semaphore 8 In case of preemptive scheduling a customer en
97. spawn on host default is any ARCH spawn on hosts of ARCH enable debugging gt redirect output of job to console gt file redirect output of job to file gt gt file append output of job to file unalias Undefine command alias Syntax unalias name version Show libpvm version Syntax version User s Guide Solvers 225 5 5 Simulation results 5 5 1 Overview Queue statistics are automatically computed on queue related parameters number of cus tomers service time response time blocked time utilization rate throughput Default queue statistics are computed for all queues in the network The user can request that queue statistics be computed separately for specific customer classes The user can also request that queue statistics be restricted to specific queues and or specific parameters User statistics are computed on user variables declared as watched variables A watched variable is an ordinary integer or real variable except that its declaration is prefixed with the WATCHED keyword It can be used as any other variable in the algorithmic language Changes in the value of a WATCHED variable are automatically tracked by the simulator in order to produce standard statistics The basic statistics are the mean minimum maximum and variance Additional statis tics are available upon request confidence intervals marginal probabilities histograms and correlation coefficients All statistics can be comput
98. the customers e R g k total sum of the time periods spent in station 4 by class k customers mean service time the mean service time is computed with the total number of customers having left the station It is the mean time during which these customers have occupied a server of the station The uncompleted services are not taken into account in the computation of this mean value 226 Simulation results Qnap2 V 9 2 global S q N q e class k S q k N q mean response time the mean response time is computed with the total number of cus tomers having left the station It is the mean time they spent in the station waiting or being served The customers still in the station are not taken into account in the computation of this mean value e global R q N q e class k R g k N q k mean number of customers The mean number of customers in the station includes the customers having left the station and the customers remaining in the station at the end of the measurement session e global DZ iT q e class k X21 iT q k i Tm Note There is no distinction between customers waiting or being served mean blocked time This the mean time during which a customer is blocked waiting for a resource a semaphore or a flag As for the mean service time calculation the customers which have not left the station are ignored A customer is blocked when it is waiting for a resource a semaphore a flag or on
99. to request basic statistics on all standard results on the specified queues with class specific results for the specified classes Basic watched variable statistics Syntax SETSTAT CONTINUE DISCRETE watched_var_list Semantics CONTINUE and DISCRETE apply to watched variables only They are used to specify whether the watched variables are discrete e g mean size of requests or continuous e g average memory usage See section 5 5 1 2 Users statistics above Using one of these keywords is an implicit request to compute basic statistics on the specified variables Additional statistics Syntax SETSTAT ACCURACY stat_var_list SETSTAT PRECISION stat_var_list rel_error SETSTAT CORRELATION stat_var_list order SETSTAT MARGINAL stat_var_list intervals start width Semantics These keywords apply to all objects on which statistical results may be computed e queues e queue class couples User s Guide Solvers 231 watched variables Note In order to request additional statistics basic statistics must have been requested before e with the QUEUE and or CLASS keywords for queues and classes e with the CONTINUE or DISCRETE keyword for watched variables ACCURACY is used to request the computation of confidence intervals PRECISION is used to specify the required accuracy rel_error is the relative error The re sult is considered as satisfactory when the ratio of the confidence i
100. use the version provided with QNAP2 when using it This paragraph only gives the minimum necessary information for the use of parallel replications It is not a reference manual You can get more information about PVM by e email netlib ornl gov e reading the Newsgroup comp parallel pvm e ftp netlib2 cs utk edu directory e http http www epm ornl gov pvm pvm_home html Simulation Qnap2 V 9 2 5 4 7 2 Installation Startup Using the parallelization of replications requires the environment variable PYM_ROOT to be placed in the initialisation file of your login shell For example if your login shell is csh your cshre must contain the following line if MODLINE is installed setenv PVM_ROOT MODLINEHOME bin ARCH qnap2_tape the next two lines if MODLINE is not installed and if QNAP2 is installed alone in the usr local qnap2 directory for example setenv PVM_QNAP2 usr local qnap2 setenv PVM ROOT PVM QNAP2 The parallelization of replications is set off by the following command in the model QNAP2 CONTROL OPTION SIMPAR and cancelled by the command default option CONTROL OPTION NSIMPAR To actually get replications which start in parallel the confidence intervals must obviously be computed by the replications method see previous paragraph on the estimation of the confidence intervals CONTROL ESTIMATION REPLICATION number User s Guide Solvers 219 220
101. values to be generated The control expression may be either integer or real Example DECLARE BOOLEAN B QUEUE INTEGER 01 Expressions Qnap2 V 9 2 Example User s Guide QUEUE CPU TAPE DISK 5 REF QUEUE LQ 5 2 INTEGER XI 10 REF QUEUE 0 10 BEGIN amp sublists 1 amp 1 1 1 2 amp XI 1 1 and amp XI 2 2 XI IF B amp XI 1 1 and THEN 1 2 amp XI 2 2 ELSE 3 4 5 amp or XI 1 3 XI 2 4 amp 3 5 XI 1 STEP 1 UNTIL 5 amp yields 1 2 3 4 5 XI 1 REPEAT 5 amp yields 1 1 1 1 1 XQ ALL QUEUE amp list of the objects WITH NB gt O amp of type QUEUE having amp attribute NB gt 0 XQ LQ 1 STEP 1 amp yields LQ 1 2 UNTIL 5 2 amp L0 5 2 XQ ALL QUEUE WITH MTHRUPUT QUEUE gt 0 5 amp all declared queues amp having a mean amp throughput amp greater than 0 5 amp lists 1 2 amp 1 1 and amp XI 2 2 0 CPU DISK amp XQ 1 CPU and amp XQ 2 DISK XI 1 REPEAT 9 0 PRINT ALL QUEUE QI amp prints the value of amp attribute QI for all amp declared queues Algorithmic Language DECLARE REF QUEUE 19010 EXEC BEGIN E LQ NEW QUEUE REPEAT 10 amp us In this example only one queue is created and reference to this queue is saved in each element of LQ 2 4 6 Type operators Syntax iype expression o
102. without arguments BEGIN PRINT 110 world HELLO Example DECLARE QUEUE Q REAL SUM 3 0 0 0 PROCEDURE DELAY DELTA D amp procedure with arguments VAR REAL DELTA REAL D BEGIN D 2 CST D DELTA DELTA D 34 Declaration Statements Qnap2 V 9 2 END STATION NAME SERVICE 9 DELAY SUM In this example DELTA is passed by reference and D by value The statement D 2 D does not change the value of T Conversely after each service of the Q station SUM is increased by 3 0 Note that calling DELAY as DELAY 5 0 T is a nonsense since 5 0 is a constant This would yield a compilation error Example DECLARE QUEUE A RES PROCEDURE REQUEST R Q REAL R REF QUEUE Q BEGIN PQ CST R VQ END STATION NAME SERVICE A REQUEST 10 RES amp This service is equivalent amp to the following one STATION NAME SERVICE BEGIN P RES CST 10 0 V RES END 2 3 8 2 Forward procedures A forward procedure must be declared twice The first declaration defines the name and argu ments of the procedure The second declaration defines the local variables and the procedure body Syntax PROCEDURE proc_name argument_list amp declaration of the arguments FORWARD PROCEDURE proc_name User s Guide Algorithmic Language 35 amp declaration of local variables BEGIN END Semantics
103. 0 0 006 0 010 PROC1 0 778 1 903 3 425 3 500 6 300 PROC4 0 500 0 628 1 130 1 000 1 800 PROC3 0 278 0 287 0 516 0 385 0 692 MID_JOIN 0 556 0 759 1 365 1 250 2 250 JOINUP 0 556 0 759 1 365 1 250 2 250 FINISH 0 667 1 144 2 059 2 000 3 600 ok ok ok ok ok ck coke ok ok ok ok ok coke ok ok ok ok ok coke ok ok ok ok coke ok ok ok ok ok ok K K koe LOWER BOUND OF THE RESPONSE TIME DISTRIBUTION FUNCTION RINF x 1 0000 x 0 e t 0 0000 x 68 9044 x 0 4 0 4857 x 174 8680 0 4 0 7324 x 33 4597 1 e 0 7324 x 0 0183 4 0 e 1 9390 x 228 7079 x 0 e 0 8853 x 0 0013 x 0 4 2 8244 x 16 0815 x 0 e 0 2920 x 12 1464 1 e 0 8853 x FIRST MOMENT 10 6349 SECOND MOMENT 135 2399 VARIANCE 22 1377 HEURISTIC RESULTS ON THE RESPONSE TIME DISTRIBUTION FUNCTION RHEUR 1 0000 x 0 e t 0 0000 x 39 3828 0 e 0 2778 64 6735 0 e 0 4444 x 10 6147 1 e 0 4444 x 0 0036 x 0 4 1 4444 x 93 6983 0 e 0 5556 x 0 0004 x 0 4 2 0000 x 11 3608 x 0 e 0 1587 x User s Guide Solvers 195 196 3 5556 1 7 _ 0 5556 x FIRST MOMENT 1
104. 02 e 070 08 e 070 09 gt ERROR SUPER MEMORY OVERFLOW This message means that the input file cannot be read because QNAP2 memory space is full The user can either try to reduce the size of its model too many queues or too many customers or use a QNAP2 executable with a larger memory space To get such a QNAP2 executable the user can generate it himself or ask SIMULOG for it In both cases it is advisable to contact SIMULOG to get more information gt ERROR FREELM DOUBLE FREE ON THE SAME AREA BUG IN QNAP2 The same QNAP2 memory area has been freed twice It is a QNAP2 internal error The user has to contact SIMULOG e mail support simulog fr tel 33 1 30 12 27 77 gt ERROR SUPER MEMORY OVERFLOW GETLIM ALREADY ALLOCATED WORDS STILL AVAILABLE WORDS REQUESTED WORDS This message means that the input file cannot be read because QNAP2 memory space is full The user can either try to reduce the size of its model too many queues or too many customers or use a QNAP2 executable with a larger memory space To get such a QNAP2 executable the user can generate it himself or ask SIMULOG for it In both cases it is advisable to contact SIMULOG to get more information gt ERROR SUPER INCORRECT SYNTAX The QNAP2 algorithmic language syntax is not respected For example IF with out THEN or without 95 The user has to correct the line where the error occurred according
105. 10 semi 0 0 0 2644 sem2 0 0 0 8408 01 14 80 15 83 8 410 1 392 1 051 SERV NB 10 10 10 19 8 ok ok coke ok ok ok ok ok ok OF SIMULATION MEMORY USED 6405 WORDS OF 4 BYTES 0 64 OF TOTAL MEMORY User s Guide Modeling Mechanisms 141 55 56 RESTART amp start another model SIMULOG QNAP2 01 04 95 1 2 CONTROL OPTION SOURCE RESULT TRACE 3 4 DECLARE QUEUE double simplei simple2 5 QUEUE semi sem2 6 7 STATION NAME double 8 INIT 10 9 TYPE SINGLE 10 TRANS IT OUT 11 SERV ICE BEGIN 12 PHULT semi sem2 1 1 13 EXP 2 14 VMULT sem1 sem2 1 1 15 END 16 17 STATION NAME simplel 45 EXEC SIMUL SIMULATION V9 2 COPYRIGHT BY CII HONEYWELL BULL AND INRIA 1986 amp both requests are performe CUSTOMER QUEUE CLASS PRIOR NB OPERATION TIME 0 000 gt 1 double 0 10 PMULT ON QUEUES SEMAPHORE semi 1 REQUESTS SEMAPHORE sem2 1 REQUESTS gt CUSTOMER UNBLOCKED gt 1 double 0 10 DELAY 1 801 UNTIL 1 801 gt 11 simplei 0 10 P semi VALUE 0 142 Semaphores Qnap2 V 9 2 gt 21 2 0 10 2 VALUE 0 TIME 30
106. 105 VMULT procedure 152 WAIT procedure 161 WAITAND procedure 161 WAITOR procedure 161 WHILE statement 54 WITH clause 46 55 WITH statement 56 work demand 86 130 Qnap2 V 9 2
107. 2 3 8 7 TSTART parameter Syntax tstart_parameter TSTART real Semantics The TSTART parameter defines the time when the measurements on the simulated model are started in order to produce statistical estimations of the steady state performance criteria It can be used to reduce the bias due to the transient behaviour of the simulated model The value of TSTART may be a constant or a real expression The default value is TSTART 0 The real expression is evaluated at initiation time 3 88 TMAX parameter Syntax imar parameter TMAX real Semantics The TMAX parameter defines the maximum duration of a simulation run expressed in units of time of the model itself The duration may be defined by a constant or an expression The default value is TMAX 0 The real expression is evaluated at initiation time Example DECLARE REAL CONTROL TMAX TIMEMAX FOR 1000 5000 10000 DO SIMUL Note The maximum simulation time may also be set with the SETTMAX procedure SETTMAX may also be used during the simulation See the Reference Manual for details 3 8 9 RANDOM parameter Syntax random_parameter RANDOM integer Semantics The random numbers generated by the random number generation functions see the 2 Reference Manual for the list of these functions are produced by a single uniform pseudo random number generator User s Guide Control Lan
108. 2 4 QUEUE A B C 5 REAL 1 1 6 7 STATION NAME A 8 INIT 1 9 SERVICE EXP 1 10 TRANSIT B 0 5 C 0 C r1 22 EXEC BEGIN 23 0 1 24 SOLVE 25 END 040108 gt ERROR EVAL TRANSITION TO AN UNDEFINED CLASS STATION A CLASS 26 27 END gt ERROR EVAL A SOURCE A RESOURCE OR A SEMAPHORE CANNOT BE INITIALIZED WITH CUSTOMERS The INIT parameter in a STATION block specifies the number of customers in a queue before the beginning of the resolution Source resource or semaphore stations take specific roles and cannot contain customers before the resolution begins Such stations are defined by the following commands e TYPE SOURCE e TYPE RESOURCE e TYPE SEMAPHORE The user has to suppress the INIT command or modify the station type gt ERROR INTER INDEX OUT OF BOUNDS VALUE This message means that the index computed by QNAP2 is out of the array bounds The user has to compare the index value with the bounds declared for the array gt WARNING INTER ATTEMPT TO DIVIDE BY ZERO Errors and Warnings 305 306 01050 e 010510 MAXIMUM VALUE ASSUMED A division by zero has been detected by QNAP2 in the model algorithmic code The result of the operation is then equal to the maximum real or integer value the machine can manage It is highly advisable not to allow such operations gt ERROR INTER INCORRECT CONTROL VALUES IN A STEP UNTIL CLAUSE THE SECOND BO
109. 2 OPTION parameter Syntax option parameter option Semantics The options have the following meanings the default options are underlined OPTION option SOURCE NSOURCE RESULT NRESULT TRACE NTRACE DEBUG NDEBUG VERIF NVERIF WARN NWARN SIMPAR NSIMPAR SOURCE NSOURCE printing or not of the QnAP2 program lines following this control state ment RESULT NRESULT printing or not of the final results of the analysis in all cases these re sults are available by means of the result access functions and may be printed using the OUTPUT procedure TRACE NTRACE in the case of mathematical methods printing of the intermediate results in the case of the simulation printing of the complete event trace DEBUG NDEBUG when the model is solved with the discrete event simulator DEBUG enables use of the interactive source level debugger This option should not be used with the analytical solvers User s Guide Control Language 93 VERIF NVERIF enables some tests during execution e g array subscripts testing references coherence NVERIF may be used with tested models to reduce execution times WARN NWARN printing or not of the QNAP2 warning messages SIMPAR NSIMPAR activation or not of the parallelization of replications if it is allowed Example In the following example several analyses are performed without any immediate result print ing CONTROL OPT
110. 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 000 514 514 833 833 873 000 833 000 532 532 000 702 702 917 917 237 237 44 00 00 59 59 48 48 21 21 44 44 dq 1000 HG HL Hn User s Guide END GETTRACE CPROVOKE in IF REQUEST THEN ELSE requested released GETTRACE QSUBJECT IF EXEC BEGIN SETTRACE DEFSET NIL SETTRACE SET TOOL RESUSE CONTROL TMAX 20 OP REQUEST THEN ELSE TION EXEC SIMUL 1 CO SO FP SP 9 PRP RPP PRP RP OS ROBOT1 ROBOT1 ROBOT1 ROBOT1 ROBOT1 ROBOT1 ROBOT2 ROBOT2 ROBOT2 ROBOT2 ROBOT2 ROBOT1 ROBOT2 ROBOT1 ROBOT1 ROBOT1 ROBOT1 ROBOT1 ROBOT1 ROBOT1 ROBOT2 ROBOT1 ROBOT2 ROBOT2 ROBOT1 ROBOT1 ROBOT2 ROBOT2 ROBOT1 ROBOT1 GETTRACE QPROVOKE STATMESS GETTRACE EVSTATUS TRACE NRESULT requested released requested released requested released requested released requested released requested requested released released requested
111. 5 SERVICE Y CST 4 Three customers are in station A 2 class X customers and 1 class Y customer The first services of station A are service X ______ ______ AD O O transition X _______ ______ ______ gt ___ transition Y ______ gt _______ transition TIME 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Example DECLARE QUEUE B CLASS X Y STATION NAME INIT X 2 1 SCHED QUANTUM QUANTUM X 2 QUANTUM Y 4 SERVICE X CST 5 SERVICE Y CST 4 0 The service quanta are different for class X and class Y customers 124 Server Allocation Qnap2 V 9 2 X kkk RN RN gt ____ transition X _______ so ______ l 22 gt transition CY _______ ______ l2 I_ ____ transition TIME 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 5 4 Multiple server station with concurrency sets Concurrency sets are defined with the EXCLUDE option of the SCHED parameter A customer entering a station is assigned a concurrency set according to its class and or a probability A customer belongs to one concurrency set at most It can belong to no concurrency set at all Two customers belonging to the same concurrency set may not be
112. 5 END STOP QNAP2 END OF EXECUTION e 060307 gt ERROR DECLARE ATTRIBUTES CANNOT BE DECLARED IF OBJECTS OF THE CORRESPONDING TYPE HAVE BEEN CREATED Attributes cannot be added to an object type if objects of this type already exist The user has to modify the model structure or to create two different types e 060309 gt WARNING DECLARE HAS BEEN ADDED BEFORE THIS ELEMENT QNAP2 adds at the end of the preceding algorithmic statement To avoid this warning message the user has to add in the source file 060301 gt ERROR DECLARE IS NOT A LEGAL IDENTIFIER The ANY keyword can be used only after the REF keyword to define a reference to any object type This message is printed if ANY is used without the REF keyword The user has to modify the declaration Example 1 DECLARE QUEUE ANY _ptr 06030J gt ERROR DECLARE ANY IS NOT A LEGAL IDENTIFIER 2 3 END e 060301 gt ERROR DECLARE THIS IDENTIFIER HAS ALREADY BEEN DECLARED An identifier is the name of a user defined variable integer real object type user procedure or a QNAP2 key word 298 Error and Warning Messages Qnap2 V 9 2 060601 e 060606 e 040101 e 040102 e 040105 e 040201 User s Guide This message is printed when the user tries to declare an identifier that has already been defined The user has to check the previous declarations and the identifier spelling gt ERR
113. 8 1924 SECOND MOMENT 399 9451 VARIANCE 68 9823 MEMORY USED 7712 WORDS OF 4 BYTES 0 77 OF TOTAL MEMORY 57 58 END 5 2 13 5 Tracing facilities No specific tracing facilities are provided with this solver The TRACE option is ignored Analytical Solvers Qnap2 V 9 2 5 3 The Markovian Solver 5 3 1 Overview The Markovian solver of QNAP2 may be used theorically for any model that may be mapped onto a first order markovian process with a finite number of states The solver accepts the model description as input and performs the following operations e verifies that the solution method requirements are met and chooses a representation for the state of the model e computes all the possible states of the model and their transition probabilities e computes the stationary probability of each of them e computes the performance criteria of the different model components response time ocupation rate marginal probabilities The solver computes exact values of the performance criteria characterizing the steady state of the model Theoretically it may be used with a wide range of models general service distri butions various scheduling disciplines synchronization In practice its usage is limited by the number of states generated during the analysis of a model and therefore by its requirements in memory space and computation power The Markovian solver is activated by the procedure MARKOV 5 3 2 Bibliograph
114. AME INIT TRANSIT SERVICE NAME TRANSIT SERVICE NAME TRANSIT SERVICE NAME TYPE 5 SEMAPHORE 3 20 BEGIN EXP 5 P S 8 P S END A 1 B 1 BEGIN CST 10 VCS END The station C has a queue capacity limited to three customers including the one being served When the queue is full the customers may not enter the station and have to stay in their previous station or B 138 Semaphores Qnap2 V 9 2 Note This example is shown as an illustration only Finite capacity queues are directly imple mented in QNAP2 with the CAPACITY parameter of the STATION command 4 11 4 PMULT and VMULT procedures Syntax PMULT customer list_of_prioritylevels list_of_queues list_of_classes list_of_integers VMULT customer list_of_queues list_of_integers Semantics The PMULT and VMULT procedures apply to queues whose type is semaphore and or resource The PMULT procedure does simultaneously and in an indivisible way a whole set of P requests to the semaphores and or resources in the list_of quewes argument The execution of this procedure is strictly equivalent to an indivisible succession of P operations that will never be interrupted and that will be totally fulfilled even if some of these operations are blocking The VMULT procedure does simultaneously and in an indivisible way a whole set of V operations to the s
115. CT CUST NB RESPONSE SERV NB kk kk ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke a a a a a a a a a SOURCE 1 007 1 000 1 000 1 007 14896 SYST 7131 7081 5 676 5 715 14896 0 2458 01 0 2680 01 1 323 1 302 MONITOR 0 0000E 00 0 0000E 00 0 0000E 00 0 0000E 00 14896 kk kk ke ke ke ke ke ke ke ke a a a a a a OF SIMULATION MEMORY USED 4728 WORDS OF 4 BYTES 1 81 OF TOTAL MEMORY The results obtained point estimates and confidence intervals are identical to the previous ones Indeed the two simulation runs use the same random number stream have the same 212 Simulation Qnap2 V 9 2 length and the same regeneration points used The difference between the two simulations lies in the way the regeneration points are detected and of course in the computation cost In many situations approximate regeneration points for a given model can be derived from the existence of exact regeneration states for a simpler version of the model studied For ex ample in the previous model the existence of a regeneration state is related to the Poisson assumption on the arrival process If the arrival process is not Poisson the state system empty is no longer a regene
116. E EXP 5 TRANSIT 0 2 STATION NAME B SERVICE CST 3 TRANSIT A STATION NAME C SERVICE EXP TC TRANSIT A amp execution phase model initialization amp and call to the analytical solvers EXEC BEGIN TC 0 65 FOR N 2 4 8 DO BEGIN SOLVE PRINT N N RESULT MTHRUPUT A END END amp Model alteration STATION NAME B SERVICE CST 3 amp Control parameters of the resolution method CONTROL TMAX 5000 ACCURACY MARGI ALL QUEUE amp launches a new run Qnap2 V 9 2 FOR N 2 4 8 DO SIMUL END amp amp end of the QNAP2 program User s Guide Introduction 7 8 1 5 Fields of application QNAP2 was initially designed as a modeling tool to carry out quantitative analyses of complex computer architectures Although many features of QNAP2 reflect this basic motivation QNAP2 can also be considered as a general purpose tool packaging large segments of queueing network theory In this respect QNAP2 may be used to perform modeling studies of any system which from a structural standpoint may be represented as a network of service stations Examples of such systems are e communication systems e transportation sytems e manufacturing facilities logistics facilities Also QNAP2 provides powerful support for theoretical work and tutorial activities in the field of queueing network theory Fields of applicati
117. ELETED DISCRETE DISPOSE DRAW DUMP ERLANG EXCEPTION EXP EXPO FATHER FAUDITED FAUDITOR FILASSIGN FILE FILSETERR FIRST INTREAL INTROUND ISAUDTED ISBLOCK JOIN JOINC LAST LINK LIST LOG LOG10 LTRIM MAP MARKOV MAX MAXCUSTNB MBEGIN MBLOCKED MBUSYPCT MCUSTNB MENDGR REAL REALINT REFSON REMOVE RESET RESTORE RESULT REVERSE RINT RTRIM SAMPLE SAVE SAVERUN SERVNB SET SETBUF SETEXCEP SETRETRY SETSTAT SETSYN SETTIMER TSYSWDOG TYPNAME UNAUDIT UNBLOCK UNIFORM UNSET UTILITY VCUSTNB VRESPONSE WAIT WAITAND WAITOR WATCHED WRCHCODE WRITE WRITELN WRSUBSTR Qnap2 V 9 2 Index 334 Qnap2 V 9 2 Index operator 42 48 END statement 265 MACRO statement 265 ACCURACY parameter 109 174 AFTCUST procedure 130 142 146 algorithmic language 4 11 ALIAS parameter 117 ALL clause 46 analytical solvers 177 AND operator 42 array 31 array declaration 23 array enumeration rule 16 arrays 15 assignment 50 assignment statement 50 attribute 43 attribute declaration 25 26 automatic dispatching 183 BEFCUST procedure 142 146 BOOLEAN type 31 42 CAPACITY parameter 96 Character Set 11 character set 11 character strings 13 CLASS object 28 CLASS parameter 103 174 CLASS type 29 classes 4 command evaluation 66 comments 14 compile time 67 69 86 96 97 concurrency set 81 137 conditional expressions 42 confidence interval 226 Const
118. END amp outside the NETWORK A B The user may also define an executable entry block ENTRY parameter and an executable exit block EXIT parameter to be executed just before and just after the resolution procedure is invoked The solvers of QNAP2 may then be activated by using one of the resolution procedures e SOLVE for analytical solvers e MARKOV for the Markovian solver e SIMUL for the discrete event simulation The system then enters initiation time during which the evaluation of the following parameters of each station of the network is done This evaluation is performed once only these parameters are not re evaluated during solution time User s Guide Solvers 159 160 e probabilistic transitions parameters TRANSIT SPLIT FISSION e customer merges parameters MATCH FUSION e initial number of customers parameter INIT e number of servers parameter TYPE e queue capacity parameter CAPACITY e priority levels parameter PRIOR e quantum values parameter QUANTUM e service rates parameter RATE When initiation time is completed the system enters solution time 1 if SOLVE was activated the SERVICE parameters are then evaluated in order to get the work demands distributions and the REJECT parameters are evaluated to get the rejection policy these evaluations are performed once only and the analysis proceeds 2 if MARKOV or SIMUL was activated the statements associated with the SERVICE and REJECT
119. ENDER station Assume that the SENDER station sent 6 customers numbered from 1 to 6 Assume that customers 1 4 6 are still in the NETW station whereas customers 2 3 5 arrived at the RECEIVER station The queue contains RECEIVER Customer 1 seizes the server When 1 has completed its service the succeeding customers can proceed User s Guide Modeling Mechanisms 127 128 4 6 Customer Priority Level Each customer has a priority level which may vary during its life in the model This priority level is the CPRIOR attribute of the customer object The customer priority level is used to e order the customers in queues if these queues have a PRIOR scheduling SCHED PRIOR determine the execution order of actions during a simulation run The priority level may only have positive or null values following mechanisms modify the priority level of customers 4 6 1 PRIOR parameter The PRIOR parameter of a station defines the priority level of the customers entering this station according to their classes customer classes for which no priority level is defined in a station keep their previous level Example DECLARE QUEUE A CLASS X Y Z STATION NAME PRIOR X 1 PRIOR Y 3 In station the class X customers have a priority level of 1 class Y customers have 3 and class Z customers keep the one they had before default value 0 Note The effect of a PRIOR parameter can be cance
120. FALSE FOR FORWARD GENERIC GOTO IF IN 15 NIL NOT OBJECT OR REF REPEAT STEP THEN TRUE UNTIL VAR WATCHED WHILE WITH Predefined identifiers may not be redefined by the user predefined object types predeclared objects standard procedures and functions 2 1 4 Identifiers Syntax Identifier Semantics letter letter digit The first character of an identifier must be a letter only the first eight characters are Tokens significant identifiers longer than 8 characters are flagged by a WARNING Identifiers longer than 8 characters are truncated All the identifiers used in a QNAP2 program must be declared There are several reserved identifiers in the language The complete list of these identifiers is given in Appendix D It includes keywords BEGIN DO AND predefined variable identifiers FIRST LAST TIME and procedures and function identifiers EXP ABS P These identifiers cannot be used for declarations of items or for aliasing names Note Command names and parameter names are not reserved identifiers STATION SCHED Qnap2 V 9 2 2 1 5 Numbers Syntax integer_cst digit realLcst integer cst integer cst E integer cst Semantics Numbers may be either reals or integers Checks are made against the maximum value allowed by the host machine software Example 0 amp integers 45 456789 45 amp reals 4E 6 3 4 46 is incorrect amp
121. For example e A node buffer in a telecommunications network can hold a limited number of packets e A conveyor in a manufacturing plant can hold a limited number of items In V9 0 it is now possible to specify the maximum number of customers that can reside simultaneously in a queue The default queue capacity is infinite The maximum capacity can be specified globally and or for each customer class When a customer attempts to enter a full queue it is said to be rejected The rejection mechanism is entirely user controlled It is defined by an algorithmic code sequence very similar to the service process of the station The finite capacity queues are descibed in section 4 2 3 Queue capacity B 1 2 Concurrency sets In a multiple server station several customers may be served simultaneously Sometimes it is necessary to prevent this for example e When the customers represent parallel processes with precedence constraint When two customers represent two processes sharing the same resource The general problem is that of mutual exclusion QNAP2 can model mutual exclusion with the concept of concurrency sets With regard to each station customers can be classified into several sets The sets can be defined with customer classes and or probabilities Two customers belonging to the same concurrency set cannot be served simultaneously even if there is an idle server This mechanism is implemented as a new scheduling option It is
122. Function call 43 2 4 5 1 8 44 2 4 6 operators 46 2 4 7 String operator ooa ee 47 2 5 Statements 48 2 5 1 Simple statement and compound statement 2 48 2 5 2 Assignment statement 48 2 5 8 Procedure call 49 2 5 4 GOTO statement 50 2 5 5 statement 51 2 5 6 WHILE statement 52 2 5 7 FOR statement 52 2 5 8 WITH statement 53 2 6 Input output facilities 55 2 6 14 Data files 55 2 6 1 1 Input 55 2 6 1 2 56 2 6 1 3 Control procedures 57 2 6 2 Library 58 Control Language 61 3 1 Control 63 3 1 1 Control language 63 3 1 2 Command parameters evaluation 64 3 1 3 Syntactic conventions 65 3 2 DECLARE 66 33 EXEC Command
123. HA 0 500E 01 NMAX 1200 NAMAX 6000 STATES OF THE SYSTEM STATE NUMBER 1 STATION A CUSTNB 2 STAGE 0 POSITION 1 CLASS Y STAGE 0 POSITION 2 CLASS X STAGE 0 STATION B CUSTNB 0 STAGE 0 STATE NUMBER 5 STATION A CUSTNB 0 STAGE 0 STATION B CUSTNB 2 STAGE 0 POSITION 1 CLASS X STAGE 0 POSITION 2 CLASS Y STAGE 0 RATE FROM 4 TO 5 0 1000E 01 RATE FROM 4 TO 1 0 3333E 00 RATE FROM 5 TO 2 0 3333E 00 TOTAL NUMBER OF STATES 5 NUMBER OF NON ZERO ELEMENTS IN MATRIX 12 Gk ATTER 1 k k k RQIO 5 7V P RES 0 100000084983449D 01 0 197122871716286D 11 ITER 1 RESIDU 0 36304150152540D 05 V P 0 100000084983449D 01 2 ITERATIONS 202 The Markovian Solver Qnap2 V 9 2 PROBABILITY OF THE STATES 1 TO 5 0 7692D 01 0 1319D 00 0 3956D 00 0 9890D 01 0 2967D 00 the standard report is omitted User s Guide Solvers 203 204 5 4 Simulation 5 4 1 Overview The SIMUL procedure of QNAP2 performs a discrete event simulation of the model under study The simulation reproduces on the time scale of the model the dynamic behaviour of the different model components stations customers variables This behaviour is considered only at the instants at which an event occurs in the model i e customer transition service beginning Random number generators are used to reproduce the stochastic behaviour of the model components service distr
124. IMULOG for it In both cases it is advisable to contact SIMULOG to get more information Errors and Warnings 299 gt ERROR EDIT INCORRECT SYNTAX The QNAP2 algorithmic language syntax is not respected For example IF with out THEN or without 95 The user has to correct the line where the error occurred according to the algo rithmic language syntax 0A0205 gt ERROR EDIT MEMORY OVERFLOW This message means that the input file cannot be read because QNAP2 memory space is full The user can either try to reduce the size of its model too many queues or too many customers or use a QNAP2 executable with a larger memory space To get such a QNAP2 executable the user can generate it himself or ask SIMULOG for it In both cases it is advisable to contact SIMULOG to get more information e 0 0501 gt ERROR COMPILE THIS IDENTIFIER HAS NOT BEEN DECLARED An identifier is the name of a user defined variable integer real object type user procedure or a QNAP2 key word QNAP2 does not recognize the printed identifier in the model source code The user has to declare the identifier if it has not been already done and or to check its spelling e 0B0902 gt ERROR INTER FILE IS NOT WELL BUILT This message is printed when an input output operation is performed on a file which has not been assigned user has to assign and open FILASSIGN and OPEN procedures the file Example
125. INTEGER BYTES STRING HEADER REF CLASS CIRCUIT END This example shows the declaration of two new object types MESSAGE and PACKET These object types are both declared with reference to the predefined type CUSTOMER Ob jects of these types inherit the predefined attributes and the properties of the CUSTOMER type All operations allowed for objects of type CUSTOMER can be applied to objects of these two types The additional attributes are specific to the new types They are not added to the CUS TOMER type 2 3 3 2 Object parameters Attributes cannot be initialized at declaration time within the object type declaration Never theless a facility is provided to allow attributes to be initialized at object creation time through a parameter mechanism For this purpose the formal parameter list may contain some of the attribute names which are specified in the variable declaration statements associated with the object type declaration The list of these declaration statements follows the object type identifier and is delimited by the END keyword At creation time object declaration or function call NEW object type_id the actual parameter list is matched against the formal parameter list in order to make the appropriate initializations This mechanism is provided only for scalar items references and arrays because objects cannot be globally assigned Example DECLARE amp declaration of a new amp object type CENTER OBJECT CENTE
126. ION NSOURCE NRESULT DECLARE QUEUE CPU INTEGER N STATION NAME INIT CPU N N 0 WHILE MBUSYPCT CPU lt 0 8 DO BEGIN N N 1 SOLVE END END EXEC OUTPUT As long as the CPU utilization rate remains lower than 80 the number of customers is incremented and no result is printed The results are printed only for the last solution performed OUTPUT procedure 3 8 3 UNIT parameter Syntax unit_parameter unit file unit OUTPUT PRINT INPUT GET LIBR TRACE Semantics The UNIT parameter controls QNAP2 input output files OUTPUT corresponds to the printing of the model source program if OPTION SOURCE and to the printing of the results if OPTION RESULT as well as error and warning messages 94 CONTROL Command Qnap2 9 2 PRINT corresponds to the output produced by the PRINT procedure as well as the default output of the WRITE and WRITELN procedures INPUT corresponds to the file containing the source program to be analyzed GET corresponds to the default input file for the GET and GETLN functions LIBR corresponds to the default library file for the SAVE and RESTORE procedures TRACE corresponds to the standard trace output file The default values of these parameters are the predeclared QNAP2 input output files FSYSOUTPUT FSYSINPUT FSYSPRINT FSYSGET FSYSLIB FSYSTRACE These files are normally assigned properly when QNAP2 is launch
127. LITY procedure in the QNAP2 program to transfer the array to the UTILIT subroutine where e the values are obtained from QNAP2 e the sorting routine is called named for instance SORTIN e the sorted values are sent back to QNAP2 7 4 1 Qnap2 program amp ITAB values to be sorted amp IRES sorted values DECLARE INTEGER ITAB 10 3 2 7 4 10 8 5 9 1 6 INTEGER IRES 10 EXEC BEGIN UTILITY 1 ITAB IRES PRINT IRES END END 7 4 2 Fortran subroutine C23456 SUBROUTINE UTILIT ICODE IRTAB1 IRTAB2 INTEGER ICODE IRTAB1 IRTAB2 CN array dimension INTEGER PARAMETER N 10 TABIN values to be sorted C TABOUT sorted values IERR error code INTEGER TABIN N TABOUT N IF ICODE NE 1 GOTO 2 C QNAP2 gt FORTRAN CALL QLOADI IRTAB1 1 N TABIN 1 N IERR IF IERR GT 0 GOTO 1 sorting user routine CALL SORTIN N TABIN TABOUT C FORTRAN gt QNAP2 CALL QSTORI TABOUT 1 N IRTAB2 1 N IERR IF IERR EQ 0 GOTO 2 C ERROR Example Qnap2 V 9 2 1 CONTINUE PRINT ERROR C END 2 CONTINUE RETURN END 7 4 3 Link edition In the link command the routine SORTIN and the other user routines called by SORTIN must be specified example for DEC VAX VMS LINK NOMAP EXE QNAP2 QNAP2 0BJ QNAP2 LIB BRIGITTE LIB UTILIT 0BJ SORTIN 0BJ The link command resides in the QNaAP2 installation command Refer to the installation instructions for
128. OL OPTION NDEBUG first break point must be placed in the QNAP2 program using the HALT procedure This first break point is fixed and is no longer removable When it is reached a message giving the line number appears on the screen and the user can then enter any request in QNAP2 algorithmic language 8 2 2 2 Debugger commands Syntax HALT GO BREAK line_num SHBREAK CANCELBR line_num INSERT file line_num REMOVE line_num SHINSERT STP 256 The functions of debugger Qnap2 V 9 2 HALT Generates break point at the current line If it is placed in an algorithmic sequence of the model it cannot be removed GO Enables restart of the normal QNAP2 program process until the next break point is reached BREAK Allows break points to be placed before the specified line numbers The line numbers are those given in the FSYSOUTP output file when the model is compiled SHBREAK Produces a listing of all lines in which breakpoints has been inserted CANCELBR Enables removal of break points placed by BREAK on the specified lines If no BREAK has been requested on such lines a message is printed INSERT Allows code to be inserted before processing the statements of the specified line The code is read from the file if it is specified otherwise it is read from the keyboard If no line number is given the code is processed at the level of the current line Statements cannot be ins
129. OL parameters will probably be ig nored a warning message will tell you e The SETTRACE procedure of V8 0 is now replaced by SETTRACE BOUNDS and SET TRACE WIDTH Using the old SETTRACE procedures yields a syntax error User s Guide New features 323 324 Compatibility with V8 0 Qnap2 V 9 2 New features V9 1 V9 2 amp V9 3 326 Qnap2 V 9 2 This chapter presents the new features of QNAP2 releases 9 1 9 2 amp 9 3 C 1 New features of QNAP2 V9 1 These features are presented in the QNAP2 User s Guide and in the QnaP2 Reference Manual 1 Multiple requests and or releases of pass grants to semaphores or resource units See PMULT and VMULT procedures 2 The CONVERT function is now able to convert QNAP2 internal names into STRING variables see the reference manual 3 The HOSTSYS GETENV function can get the value of environment variables Error codes are returned by the HOSTSYS GETERCOD function see the reference manual C 2 New features of QNAP2 V9 2 These features are presented in the QNAP2 User s Guide and in the QNAP2 Reference Manual 1 The simulation execution profile This feature is available only on UNIX platforms See the reference manual GETPROFILE and SETPROFILE Example EXEC BEGIN SETPROF ILE CLEAR amp Clear profiling structures SETPROFILE METERPROC procedure Ask for results on procedure SETPROF ILE STARTHMETER amp Start profiling the execution SIMUL SETPROFILE STOPME
130. OR STATION INCORRECT SYNTAX The QNAP2 language syntax is not respected in a STATION block The QNAP2 algorithmic language syntax is not respected For example IF with out THEN or without 95 The user has to correct the line where the error occurred according to the algo rithmic language syntax gt WARNING STATION HAS BEEN ADDED BEFORE THIS ELEMENT QNAP2 adds at the end of the preceding algorithmic statement To avoid this warning message the user has to add in the source file gt ERROR EDIT INCORRECT SYNTAX The QNAP2 algorithmic language syntax is not respected For example IF with out THEN or without 95 The user has to correct the line where the error occurred according to the algo rithmic language syntax gt WARNING EDIT END OF FILE DETECTED ON FILE This error is generated when the input file has been entirely read and no end of model has been specified It is usually due to the fact that the END key word has been forgotten at the end of the source file The user only has to add END at the end of the file gt ERROR EDIT MEMORY OVERFLOW This message means that the input file cannot be read because QNAP2 memory space is full The user can either try to reduce the size of its model too many queues or too many customers or use a QNAP2 executable with a larger memory space To get such a QNAP2 executable the user can generate it himself or ask S
131. PR VALUE 0 gt c Y 2 1 DELAY 8 197 UNTIL 9 097 gt 4 A Y 2 3 DELAY 0 879 UNTIL 1 780 TIME 1 780 gt 4 A Y 2 2 B Y 2 1 gt B Y 2 1 PR VALUE 0 gt 1 X 1 2 DELAY 0 027 UNTIL 1 807 TIME 1 807 gt 1 X 1 1 C X 1 gt 2 X 1 1 DELAY 0 416 UNTIL 2 223 TIME 2 000 gt TIMER TSYSTRAC IS JUST ACTIVATED 34 END 266 Standard Trace Qnap2 V 9 2 9 3 Generalized Trace The generalized tracing facilities allow the user to specify which events to trace and what tracing actions to perform The tracing actions are completely general as they are specified directly in the algorithmic language For example the standard trace can be completely emulated with the generalized trace The generalized tracing facilities are designed not only for model debugging but also for tailored applications user trace animation trace It can also be used to catch special events and process them as needed 9 3 1 Overview The generalized trace provides the following features e Restrict tracing to specific objects queues classes customers timers flags e Restrict tracing to specific events work demand procedures synchronization operations Generalized tracing actions the tracing actions are not restricted to printouts The user specifies a trace procedure to trigger for each traced object event User defined tracing procedures may not have parameters References on parameterless generic procedures are also allowed The actua
132. PT SERVICE X CST TX SERVICE Y CST TY SOLVE HEURSNC NAME SCHED A PS SOLVE HEURSNC NAME A TYPE MULTIPLE 3 SCHED PS SOLVE HEURSNC NAME A TYPE INFINITE SOLVE HEURSNC 5 2 9 5 Tracing facilities When the TRACE option is set only the standard intermediate results of SOLVE are produced no specific intermediate results User s Guide Solvers 183 184 5 2 10 Preemptive Priority solver PRIORPR 5 2 10 1 Overview PRIORPR was developed in order to solve closed multiclass queueing networks involving premp tive priority scheduling It is an approximate method 5 2 10 2 Bibliography VERAN M Exact analysis of a priority queue with finite source Modeling and Performance Evaluation Methodology F Bacelli and 6 Fayolle eds Lectures Notes in Control and Infor mation Sciences Springer Verlag 60 1984 pp 371 390 5 2 10 3 Application stipulations The application stipulations of the solver PRIORPR are those of the solver CONVOL with the following additions e closed network e no class transitions i e number of subchains number of classes one and only one single server station with PRIOR PREEMPT scheduling exponential service times and distinct priority level for each class e results per class requested for the preemptive prior station name of this station in the list of the CLASS parameter no concurrency sets e no limited ca
133. QNAP2 version 9 3 User s Guide July 1996 Trademarks Unix is a registered trademark of AT amp T X Window System is a trademark of the Massachusetts Institute of Technology SunView OpenWindows NFS are trademarks of Sun Microsystems Inc is a trademark of the American Mathematical Society PosTSCRIPT is a registered trademark of Adobe Systems Inc Copyright 1992 Simulog User s Guide Simulog i Abstract The QUEUEING NETWORK ANALYSIS PACKAGE version 2 QNAP2 is a modeling and simu lation software system developed to facilitate the analysis of large and complex discrete event flow systems such as data communication networks computer systems manufacturing facilities and logistics systems QNAP2 uses an object oriented representation of model components It is comprised of a user interface language with facilities for object oriented modeling and a collection of efficient resolution algorithms including a discrete event simulator with run length control features The QNAP2 documentation includes the User s Guide and the Reference Man ual The User s Guide presents the features of the QNAP2 language including the mechanisms it provides to build and analyze models The Reference Manual describes all the language commands Contents 1 Introduction 1 Tek Overview ner 3 1 25 an guages n ea be ER Ex Ok Bae ee 4 1 97 950 VOPS ador dT e teh tar aei edi du etx
134. QNAP2 HAD CHANGED BETWEEN SAVE AND RESTORE YOU MUST SAVE YOUR MODEL AGAIN WITH THE NEW VERSION The QNAP2 versions used for the model save and restore are different It is mandatory that the save and restore operation be performed by the same QNAP2 version e 07 gt ERROR SUPER ABORT THE NETWORK IS PROBABLY SATURATED This message occurs when the execution context cannot be saved because the QNAP2 memory space is full This message means that the input file cannot be read because QNAP2 memory space is full The user can either try to reduce the size of its model too many queues or too many customers or use a QNAP2 executable with a larger memory space To get such a QNAP2 executable the user can generate it himself or ask SIMULOG for it In both cases it is advisable to contact SIMULOG to get more information e OBOIO3 gt ERROR INTER FILE IS NOT WELL BUILT This message is printed when an input output operation is performed on a file which has not been assigned The user has to assign and open FILASSIGN and OPEN procedures the file e 060102 gt ERROR EVAL NO STATION IN THE NETWORK User s Guide Errors and Warnings 303 A network checking occurs when a resolution method MARKOV SIMUL SOLVE is invoked But a resolution has no meaning if no station is defined The user has to check that queues are created before the model resolution e 0G0108 gt ERROR EVAL TRANSITION TO AN UNDEFINED
135. Qnap2 V 9 2 amp prefixed variables amp refers to the attribute SIGMA amp of the queue CPU X CPU SIGMA refers to the attribute TIMEIN of the customer referenced by the third entry of LC LC 3 TIMEIN STATION NAME SERVICE CPU BEGIN EXP 5 SIGMA SIGMA TIME TIMEIN END In the preceding block the attribute SIGMA is implicitly prefixed by CPU the current queue and the attribute TIMEIN by a reference to the customer being served known as CUSTOMER 2 4 4 Function call Syntax Junction call function id sublist functionid identifier Semantics Built in functions are used to call QNAP2 services e g mathematical functions random number generators results printing Each function has a type which is the type of its result A list of the available functions is given in the QNAP2 Reference Manual Some functions have a variable number of parameters e g GETSTAT SERVICE MEAN others have no parameters e g RANDU The user may define his own functions When calling user functions the number type and order of the parameters must match the declaration of the formal arguments Example DECLARE REAL R X LR 4 REF CUSTOMER C QUEUE A CLASS CX STATION NAME A SERVICE BEGIN amp dynamic creation of a new customer C NEW CUSTOMER Eis END User s Guide Algorithmic Language 43 44 BEGIN PRINT GETSTAT SERVICE MEAN A CX amp
136. R L PROB NLINES amp declaration of its User s Guide Algorithmic Language 27 amp attributes INTEGER NLINES amp number of lines QUEUE LINE NLINES amp array of NLINES queues REAL PROB NLINES amp routing probabilities REAL TLINE amp average service time REF QUEUE L amp output queue END DECLARE object creation CENTER NIL 0 5 0 2 0 2 0 1 4 CT Each CENTER object is composed of NLINES stations LINE with appropriate routing array PROB and output queue L and service scalar TLINE characteristics The attributes appearing in the formal parameter list L PROB NLINES are specified when creating an object of type CENTER Note It is not mandatory that the actual parameter list length match the formal parameter list length Ifthe actual parameter list is shorter than the formal parameter list the missing param eters are initialized with the default values as indicated in section 2 3 6 Static initializations 2 3 3 3 Forward attributes It is possible to describe as an attribute of an object a reference on an object whose type is not already defined A forward reference to an object is allowed only if the referenced object type declaration is performed within the same DECLARE block as the object type which contains the forward reference Example DECLARE OBJECT CONTAINER REF CONTENT RCONTENT END amp only declarations may be placed here amp any Qnap2 command is f
137. RCE multiple SEMAPHORE multiple SOURCE multiple multiple SINGLE MULTIPLE integer INFINITE Semantics The parameters have the following meanings SERVER defines a server station the number of servers is specified by 74 STATION Command Qnap2 V 9 2 SINGLE the station is a single server MULTIPLE n the station is made of identical servers n gt 0 INFINITE the station is made of an infinity of servers hence it is a pure delay RESOURCE defines a resource station the number of resource units available is specified by SINGLE the resource may not be shared MULTIPLE n the resource may be shared by n customers INFINITE the resource is always available SEMAPHORE defines a semaphore station the initial value of the counter is specified by SINGLE the initial value of the semaphore counter is 1 MULTIPLE n the initial value of the semaphore counter is n n gt 0 SOURCE defines a source station MULTIPLE n used alone defines a station of type SERVER The integer associated with the option MULTIPLE may be a constant or an expression If the TYPE parameter is omitted the station is considered as a single server provided that the SERVICE parameter appears in the description of the station If the SERVICE parameter is also omitted then no server is associated with the station and it is only a queue in which customers must be explicitly manipulated see TRANSIT and MOVE procedures The specified
138. RE QUEUE A B C CLASS X Y EXEC SOLVE amp no class result is produced CONTROL CLASS B amp class results are produced amp for stations and B SOLVE CONTROL CLASS A amp class results are produced amp for station A only EXEC SOLVE CONTROL CLASS ALL QUEUE amp class results are produced amp for stations A B and C EXEC SOLVE CONTROL CLASS NIL amp class results are not needed anymore EXEC SOLVE EXEC BEGIN PRINT MRESPONSE A X MSERVICE A X PRINT MTHRUPUT B Y END 3 8 5 MARGINAL parameter Syntax marginal parameter MARGINAL queue sublist integer Note This parameter is provided for compatibility with previous QNAP2 releases and might be removed in the future When using the discrete event simulator the SETSTAT MARGINAL 96 CONTROL Command Qnap2 V 9 2 procedure should be used to specify the required marginal probabilities Refer to section 5 5 Simulation results for details Semantics The MARGINAL parameter specifies the stations for which the marginal probabilities are needed The marginal probabilities are the probabilities that these stations contain exactly 0 1 2 3 n customers respectively globally for all the customer classes or for each class separately The marginal probabilities per customer class are computed only if the results per class are also requested for the station see CLASS p
139. RROR STATIS NO STATISTIC STRUCTURE CONNECTED TO THE VARIABLE The user tries to obtain a result using a GETSTAT function on a variable to which no statistic structure is connected The user has to check that the GETSTAT function arguments are queues or watched variables for which the specified result has been requested gt ERROR STATIS UNAVAILABLE RESULT BECAUSE MISSING USER SPECIFICATION The user tries to obtain a result using a GETSTAT function the calculation of which has not been requested The user has to check that the GETSTAT function arguments are queues or watched variables for which the specified result has been requested gt ERROR STATIS NO STATISTIC ON THE STATION The user tries to obtain a queue result using a GETSTAT function the calculation of which has not been requested The user has to check that the SETSTAT request corresponding to this result has been performed gt ERROR STATIS OPERATION FORBIDDEN DURING SIMULATION Most of the SETSTAT procedures can not be called during the simulation The user has to perform the results requests before the simulation starts Error and Warning Messages Qnap2 V 9 2 A 3 Problem reporting Sometimes QNAP2 does not behave as expected Most often a careful analysis of the model is required to understand what happened in the model You may also run into a bug Generally you will find that a slight modification in your model makes the problem disap
140. SIT A 10 6 4 At the end of their service time customers go to station e A with the probability 0 5 e B with the probability 0 3 e C with the probability 0 2 Example DECLARE QUEUE A B C CLASS X 2 REAL PA PB STATION NAME SERVICE EXP 5 TRANSIT TRANSIT X TRANSIT Y A PA B Y PB C Z 1 7 1 2 The TRANSIT parameter without class option TRANSIT B applies default value for class Z for which no transition is defined Customers move according to the following transition rules 82 STATION Command Qnap2 V 9 2 X 7 1 A Z 1 3 Y ccv 2 3 Example DECLARE QUEUE 01 02 CLASS X Y STATION NAME 01 TRANSIT X Y Q1 X 0 1 Q2 Y Class X and Y customers go to Q1 in class X with probability 0 1 They go to Q2 with probability 0 9 Example amp open network DECLARE QUEUE A STATION NAME TRANSIT A 0 2 OUT Customers leave the network i e are destroyed with a probability equal to 0 8 at service completion time in Example amp description of a source DECLARE QUEUE B CLASS X Y STATION NAME SOURCE SERVICE CST 10 TRANSIT X 0 2 Y The source G generates customers at constant time intervals 10 time units These cus tomers are routed to station A with class X having a probability of 0 2 i e there is a custome
141. SIT DK 1 REPEAT 5 1 REPEAT 5 SERVICE EXP 1 STATION NAME DK 1 STEP 1 UNTIL 5 TRANSIT CPU SERVICE EXP 0 1 amp alteration of the previously amp defined CPU station STATION NAME INIT CPU 5 Example DECLARE INTEGER N 10 QUEUE REAL X PROB N QUEUE INTEGER I QUEUE QD STATION NAME 0 TRANSIT 0 PROB SERVICE EXP X User s Guide Control Language 73 This simple model description defines a general closed network of N stations The mean service time the initial number of customer and the transition probabilities of each station are attributes of the queue associated with this station Example DECLARE QUEUE OBJECT LINE INTEGER SPEED END OBJECT NODE REAL TNODE QUEUE CPU BUFFER END amp template station LINE STATION NAME LINE SERVICE EXP 1 QUEUE LINE SPEED amp template station BUFFER STATION NAME SERVICE TRANSIT NODE BUFFER EXP TNODE CPU Note that in the description of the BUFFER station an implicit reference on the including NODE object is automatically provided This is not the case for the LINE object The prede fined variable QUEUE references the current queue It must explicitely be specified as a LINE object with the operator in order to access the SPEED attribute 3 7 3 TYPE parameter Syntax type_parameter station_type station_type SERVER multiple RESOU
142. STEP THEN TRUE UNTIL VAR WATCHED WHILE WITH The following are predeclared identifiers in the QNAP2 system It is possible to use them as user identifiers in the following cases e as an object attribute e as a local variable in a procedure or function However this is not a recommended programming practice ABORT ABS 05 AFTCUST ASIN AUDIT BEFCUST BLOCK BLOCKED BOOLEAN BREAK CANCELBR CARD CBLOCKED CBUSYPCT CCLASS CCUSTNB CHARCODE CHREXCLUDE CHRFIND CLASS CLEARSCR CLOSE CONVERT cos COX CPRIOR CQUEUE CRESPONSE CSERVICE CST User s Guide FIX FLAG FLINKCUS FLISTCUS FREE FSYSERR FSYSGET FSYSINPU FSYSLIB FSYSOUTP FSYSPRIN FSYSTRAC FUNCTION GET GETCPUT GETDATE GETDTIME GETMEM GETSIMUL GETSTAT GETTRACE GO HALT HEXP HISTOGR ICLASS INCLUDIN INDEX INSERT INSERVICE INTEGER MIN MOD MODIFY MOVE MRESPONSE MSERVICE MTHRUPUT NB NBAUDTED NBAUDTOR NBIN NBOUT NETWORK NEW NORMAL OPEN OUT OUTPUT P PAUSE PCUSTNB PLOATT PLOCUR PLOHIS PLOSEC PMXCUSTNB PRINT PRINTF PRIOR PROCEDURE QUEUE RANDU SETTMAX SETTRACE SHBREAK SHINSERT SIMACCUR SIMSTART SIMSTOP SIMUL SIN SKIP SULVE SONNB SQRT STARTED STATE STOP STP STRING STRLENGTH STRMAXL STRREPEAT SUBSTR TAN TIME TIMER TRANSIT TRANSLATE TSYSPERI TSYSSPCT TSYSTMAX TSYSTRAC TSYSTSTR Reserved Identifiers 331 332 CTHRUPUT CURVE CUSTNB CUSTOMER CVNOERR D
143. Standard report 5 5 3 2 Result access functions 5 5 4 Simulation process 5 5 4 1 Tracing facilities 5 5 4 2 Model state 6 Macro Processing 6 1 Macro statement definition 6 2 Macro statement Interface with Fortran 7 1 UTILITY procedure 7 2 7 3 Communication 74 7 4 1 _ 2 1 4 2 Fortran subroutine 7 4 3 Link edition 2 2 oo A The Qnap2 debugger 8 1 8 2 The functions of debugger 8 2 1 Available functions A 8 2 2 Running the 1 0 8 2 2 1 When constructing a 8 2 2 3 Debugger commands oaa aaa 8 3 8 3 1 Model declaration 8 3 2 First interactive break 8 3 8 Beginning of simulation 8 3 4 Using the environment SAVE and RESTORE functions 8 3 5 Removal of
144. T T SOLVE ITERATIV NAME SCHED A PS SOLVE ITERATIV NAME A TYPE MULTIPLE 3 SCHED PS SOLVE ITERATIV NAME A Solvers 187 INFINITE SOLVE ITERATIV 5 2 11 5 Control of numerical convergence The convergence of the iterative process may be controlled by the two first parameters of the parameter CONVERGENCE of the CONTROL command e parameter 1 maximum number of iterations e parameter 2 threshold of the convergence test 5 2 11 6 Tracing facilities When the TRACE option is set the standard intermediate results of SOLVE are produced completed by specific intermediate results obtained at each iteration of the iterative method These intermediate results consists of e the relative arrival rates in each station as a function of the number of customers in this station e ihe standard report obtained at the end of each iteration it is to be noted that the results found in those reports are meaningless as long as the convergence of the iterative process has not been reached 188 Analytical Solvers Qnap2 V 9 2 5 2 12 Difusion approximation solver DIFFU 5 2 12 1 Overview DIFFU was developed to solve open queueing networks with stations having non exponential service times and FIFO scheduling DIFFU is an approximate solver The basic principle of this method is to compute the arrival rates for each station in the network and to estimate the
145. TATION NAME B TYPE INFINITE INIT TRANSIT A SERVICE CST 1 STATION NAME RATE R TRANSIT B SERVICE EXP T SOLVE CONVOL STATION NAME A TYPE MULTIPLE 3 SOLVE CONVOL STATION NAME SINGLE SCHED LIFO PREEEMPT RATE X RX RATE Y RY SERVICE X CST TX SERVICE Y CST TY SOLVE CONVOL 174 Analytical Solvers Qnap2 V 9 2 User s Guide STATION EXEC STATION EXEC STATION EXEC STATION STATION EXEC STATION EXEC STATION EXEC END NAME SCHED A PS SOLVE CONVOL NAME A TYPE MULTIPLE 3 SCHED PS SOLVE CONVOL NAME A TYPE INFINITE SOLVE CONVOL NAME B TRANSIT OUT NAME SOURCE SERVICE EXP T TRANSIT B X 1 B Y 1 SOLVE CONVOL NAME B TYPE SINGLE SCHED FIFO CAPACITY 5 REJECT SKIP SERVICE EXP 1 SOLVE CONVOL NAME B TYPE MULTIPLE 3 SCHED FEFS EXCLUDE X Y CAPACITY SOLVE CONVOL Solvers 175 5 2 6 5 Tracing facilities When the TRACE option is set the standard intermediate results of SOLVE and results about the normalization constants are produced 5 2 6 6 Marginal probabilities Marginal probabilities can be computed with CONVOL solver excepted if an EXCLUDE disci
146. TER amp Stop profiling IF GETPROFILE ISMETERED procedure PRINT Consumed time amp Print results GETPROFILE RESULTS TOTALCPU procedure SETPROFILE CLEAR END 2 The parallelization of replications See its description in chapter Solvers Estimation of confidence intervals 3 The SPLITMAT solver See its description in chapter Solvers The Split Match approximation solver SPLIT MAT C 3 New features of QNAP2 V9 3 These features are described in this addendum 1 Running QNAP2 using the command line 2 Suppression of QNAP2 graphic commands The QNAP2 graphic commands are not supported any longer See how to emulate them in section Graphics and QNAP2 3 Documentation on error messages User s Guide New features V9 1 V9 2 amp V9 3 327 4 New statistical functions See their descriptions in the Reference Manual GETSTAT SAMPSIZE GETSTAT SAMPTIME GETSTAT THRUPUT MEAN SETSTAT THRUPUT MEAN 5 New traced events See their descriptions in the Reference Manual PMULT and VMULT events 6 The HOSTSYS SHELL function can issue a shell command 328 New features of QNAP2 V9 3 Qnap2 V 9 2 Reserved Identifiers 330 Qnap2 V 9 2 The following are reserved words QNAP2 system Using them as an identifier yields a compilation error ALL AND ANY BEGIN DO ELSE END FALSE FOR FORWARD GENERIC GOTO IF IN 15 NIL NOT OBJECT OR REF REPEAT
147. TO statement 53 HEURSNC solver 185 198 HEXP procedure 177 216 ICLASS attribute 32 Identifiers 23 identifiers 12 IF statement 53 54 implicit assignment 31 IN operator 42 48 infinite server station 128 INIT parameter 20 85 initiation time 67 95 INTEGER type 31 41 IS operator 42 48 ITERATIV solver 185 204 JOIN procedure 144 JOINC procedure 144 label declaration 33 LABEL type 50 53 labels 53 LIFO scheduling FILO scheduling 81 Lists 46 lists 18 local variables 38 locality 39 macro call 266 macro definition 265 MARGINAL parameter 105 174 192 MARKOV procedure 173 markovian solver 215 MATCH parameter 92 147 MBUSYPCT function 174 MCUSTNB function 174 modeling mechanisms 121 MOVE procedure 145 218 MRESPONSE function 174 MSERVICE function 174 MTHRUPUT function 174 multiple server station 127 MVA solver 185 193 MVANCA solver 185 195 NAME parameter 78 network definitions 177 NETWORK procedure 173 NEW function 19 20 NIL constant 43 NMAX parameter 115 NOT operator 42 NRESULT parameter 174 numbers 13 numerical operators 41 object initialization 32 object manipulation 130 object type 42 objects 15 16 objects attribute inheritance 18 objects attributes 16 objects predefined types 29 objects type declaration 25 objects user defined 17 OPENMODE attribute 32 OPTION 101 OR operator 42 OUT queue 20 OUTPUT proc
148. TYPE parameter is assigned to all the stations identified by the NAME pa rameter The expressions appearing in a TYPE parameter are evaluated at initiation time Example DECLARE QUEUE UC DK CHANNEL INTEGER NPROC STATION NAME TYPE UC MULTIPLE NPROC STATION NAME DK STATION NAME TYPE CHANNEL RESOURCE The number of servers of the UC station is given by the integer NPROC DK station is a simple server default value CHANNEL station is a nonshareable resource 3 7 4 SCHED parameter Syntax sched parameter SCHED order FEFS EXCLUDE concurrency_sets order FIFO LIFO FILO PRIOR PREEMPT RESEQUENCE queue class QUANTUM real PS concurrency_sets class real real User s Guide Control Language 75 76 Semantics The SCHED parameter describes the scheduling of the customers in the station The pa rameters have the following meanings FIFO first in first out customers are ordered according to their order of arrival FIFO is the default value of SCHED LIFO or FILO last in first out customers are ordered according to the reverse order of their arrival PRIOR priority customers are ordered in the queue according to their relative priorities CPRIOR attribute of customers The highest priority customers come first Equal priority customers are ordered FIFO default or LIFO according to the specified o
149. U 0 0 3 4 amp U 0 75 2 37 amp I 2 2 999 amp kI 2 array index is a common trap for QNAP2 beginners REAL T 10 REAL U 2 0 T 2 5 3 Procedure call Syntax procedure call User s Guide Algorithmic Language procedure_id amp Yields T 1 2 0 amp but amp yields an error message sublist 49 50 Semantics Procedures are either QNAP2 system routines e g resolution algorithms synchronization mechanisms printing or user provided routines list of the QNAP2 procedures is given in the QNAP2 Reference Manual Some procedures accept a variable number of parameters e g PRINT NETWORK Oth ers have no parameter e g SIMUL User defined procedures must be declared and described inside a declaration statement When calling user procedures the number type and order of the parameters must match the declaration of the formal arguments Example DECLARE CLASS X QUEUE REAL QUEUE PROCEDURE DELAY T REAL T BEGIN CST D PRINT TIME END STATION NAME CPU SERVICE BEGIN EXP 23 P A DELAY TETA TRANSIT CUSTOMER A X 2 5 4 statement Syntax goto_statement GOTO label_id Semantics Execution of a GOTO statement causes an unconditional transfer to the statement labelled label id Labels have to be declared identifiers with the LABEL type The labelled statement and the GOTO state
150. UND CANNOT BE REACHED This message is printed if the higher bound of a STEP UNTIL command is lower than the lower bound It is mandatory to modify the values of the bounds gt ERROR INTER OBJECT REFERENCED HERE DOES NOT BELONG TO THE TYPE EXPECTED FOR THIS REFERENCE OR IS ALREADY DELETED This message means that a reference refers to an object which does not belong to the specified type or which has been deleted The user has to check the reference type using the IS or IN operators Example 1 DECLARE QUEUE A B 2 CUSTOMER OBJECT person 3 REAL d_entry 4 5 REF person person 6 REF ANY rc 7 17 STATION NAME A 18 TRANSIT OUT 19 SERV ICE BEGIN 20 CST 2 21 rc QUEUE 22 WITH rc person DO 23 PRINT d entry d entry 24 END SIMULATION 010508 gt ERROR INTER OBJECT REFERENCED HERE DOES NOT BELONG TO THE TYPE person EXPECTED FOR THIS REFERENCE OR IS ALREADY DELETED 010500 LINE NUMBER 22 ACTIVE STATION A FOR CUSTOMER 2 TIME 2 000 Error and Warning Messages Qnap2 V 9 2 e 010603 e 010701 e 010702 e 010 01 e OIOBO2 e 0J0501 User s Guide LINE NUMBER 22 30 31 END STOP QNAP2 END OF EXECUTION gt WARNING INTER RESULT NOT AVAILABLE ZERO ASSUMED This message is printed if a non computed statistical result is requested by the user The result is not computed because the sample is empty or because its
151. USION A 1 B 2 C 136 Customer split and match Qnap2 V 9 2 4 11 Semaphores During its service a customer may ask a pass grant to a semaphore If the request is refused the customer is blocked until the grant is given A customer may also force another customer waiting or being served to ask for a pass grant A semaphore station consists of a queue and a counter The counter is the number of pass grants available if positive and the number of customers waiting if negative 4 11 1 Semaphore creation A semaphore is statically created by means of the STATION control statement with the following parameters TYPE SEMAPHORE MULTIPLE integer The integer value is the initial value of the counter default value 1 Only the PRIOR parameter and SCHED parameters may be specified in the STATION command A semaphore may be dynamically created as an instance of an object of type QUEUE or one of its sub types 4 11 2 P procedure Syntax P customer queue class priority level Semantics The P procedure forces the customer to ask for a pass grant to the semaphore queue If customer is omitted the pass grant is asked for the current customer referenced by the predefined variable CUSTOMER If the counter of the semaphore is positive the P operation does not affect the customer the semaphore counter is decremented by 1 If the semaphore counter is null or negative the grant is refused A new customer repr
152. YPE SINGLE TRANS IT OUT SERV ICE BEGIN P sem2 EXP 2 V sem2 END NAME simple1 INIT 10 TYPE SINGLE TRANS IT OUT SERV ICE BEGIN P sem1 EXP 1 V sem1 NAME simple2 10 TYPE SINGLE TRANS IT OUT SERV ICE BEGIN P sem2 EXP 1 V sem2 NAME sem1 TYPE SEMAPHORE SINGLE NAME sem2 TYPE SEMAPHORE SINGLE TMAX 100 amp if the customer is blocked by amp its first request he does not amp perform the second Qnap2 V 9 2 54 SIMUL SIMULATION CUSTOMER QUEUE CLASS PRIOR NB TIME 0 000 gt 1 double 0 10 P semi gt 1 double 0 10 P sem2 gt double 0 10 DELAY gt 11 simplei 0 10 semi gt 21 2 0 10 sem2 TIME 26 618 gt 20 simplei 0 1 V semi gt 20 simplei 0 0 gt OUT TIME 100 000 gt TIMER TSYSTMAX TIME 100 00 OPERATION VALUE 0 VALUE 0 1 801 UNTIL 1 801 VALUE 0 VALUE 0 VALUE 1 IS JUST ACTIVATED ok ok coke ok ok ok ok ok ok ok ok ok ck coke ok ok ok ok oko koe NAME SERVICE BUSY PCT CUST NB RESPONSE kk kk ke ke ke kk ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke a a a a a a a a double 2 644 0 2644 1 480 simplel 2 662 0 2662 1 583 simple2 1 233 0 1233 0 84
153. a QNAP2 command refer to Chapter 3 16 Tokens Qnap2 V 9 2 2 2 When you declare a variable you must state its type variable s type circumscribes the set of values it can have and the operations that can be performed on it A type declaration specifies the identifier that denotes a type Data types are e scalar types e array types e object types e reference types Scalar types and reference types are unstructured types Arrays and objects are structured Scalar types are limited to the four following types INTEGER REAL BOOLEAN and STRING New scalar types cannot be declared by the user There are six predefined object types QUEUE for queues CUSTOMER for customers CLASS for customer classes EXCEPTION for exceptions signals FLAG for synchronization boolean flags TIMER for timers FILE for input output files The user may define other object types either independent types or sub types of existing types 2 2 1 Arrays Arrays or dimensioned variables consist of a collection of elements of the same type scalar objects or references Arrays of arrays are not permitted Arrays may have one or several dimensions The number of dimensions and their ranges must be defined at declaration time refer to section 2 3 2 Variable and array declarations Example DECLARE INTEGER LI 20 amp declaration of an array with amp 20 INTEGER entries REAL RA 1 3 10 amp declaration of a real
154. a procedure cannot be activated because there is no corresponding algo rithmic code It is necessary to use a reference on this procedure and to assign it to a regular procedure the signature of which is equal to the one defined by the generic procedure The user has to see how to use generic procedures see the key words PROCEDURE GENERIC REF gt ERROR COMPILE EXPRESSION IS NOT WELL DEFINED An expression in the algorithmic language is not correct For example an as signment operation may be wrong because there is only one operand The user has to check the syntax of the source lines 050302 gt ERROR COMPILE INCORRECT MIXED TYPES This message means that a value of a specific type integer real reference to an object is assigned to a variable of another type For example when a WITH operation uses a reference the type of which is different from the type of the listed entities The user has to ensure that the types of the concerned entities are the same possibly by using the operators IS IN or gt ERROR COMPILE INCORRECT TYPE FOR AN OPERAND OR AN ARGUMENT A data used in an operation or as a parameter of a procedure does not belong to the expected type The user has to check the syntax of the performed operation and the types of the concerned entities gt ERROR COMPILE INCORRECT NUMBER OF ARGUMENTS The arguments of a procedure are not valid The error may be due either to the types of th
155. adable files Input is performed with the GET and GETLN functions Output is performed with the PRINT WRITE and WRITELN procedures Additionally a number of procedures available are to open close and perform other control operations on data files 2 6 1 1 Input functions Input files may contain the following items e integer numbers e real numbers e boolean values strings object identifiers e comments Data files must follow syntax rules similar to those of QNAP2 source files free format no tab or other control characters Data items should be separated by blank characters or end of line Blank lines and comments are ignored except when explicitely skipped with GETLN BOOLEAN values must explicitely be written as TRUE or FALSE Object identifiers must have been declared before attempting to read them Example Bristol Factory First design amp Control parameters 100 0 10000 0 amp TSTART and TMAX TRUE amp detailed stats amp Production plan 5000 amp number of items of each product class 3500 2900 amp Failure analysis User s Guide Algorithmic Language 55 CONVEYOR amp failing device 5000 0 amp failure date In this example CONVEYOR is an object identifier e g a QUEUE which must have been declared before being read Syntax GET GETLN file type_id length Semantics The GET and GETLN functions work in a very similar way The only difference is that GETLN sk
156. ain customers in the steady state are flagged by a WARNING If a non ergodic sub chain is detected the associated transitions are suppressed from the network and the analysis process continues Example A B DECLARE QUEUE STATION NAME 1 TRANSIT B SERVICE EXP 1 166 Analytical Solvers Qnap2 V 9 2 STATION NAME B TRANSIT SERVICE EXP 1 STATION NAME TRANSIT B SERVICE EXP 1 Sub chain A B C is not ergodic since a customer leaving station A will never return to this station 5 2 3 Dispatching principles The dispatcher works on an ordered chain of solvers built from a subset of the available solvers This subset is defined according to the following rules 5 2 3 1 Automatic dispatching The subset of solvers used by the dispatcher is then the whole set of currently implemented solvers in QNAP2 These solvers are ordered according to the following rules exact solvers gt approximate solvers numerically safe solvers gt numerically unsafe solvers fast solvers gt slow solvers 5 2 3 2 Controlled dispatching The subset of solvers used by the dispatcher along with their order are specified by the user in the parameter list of the procedure SOLVE Example SOLVE solveri solver2 solver3 The set of solvers is restricted to solverl solver2 and solver3 ordered as specified in the parameter list of SOLVE 5 2 3 3 Dispatching algorithm
157. alculation 3 8 11 ESTIMATION parameter Syntax estim_parameter ESTIMATION method method REPLICATION integer REGENERATION SPECTRAL real Semantics The ESTIMATION parameter controls the method used to estimate the confidence intervals requested Three methods for confidence intervals estimations are included in QNAP2 These methods are presented in the section 5 4 Simulation of the Chapter 5 of this manual Only a brief overview is given here REPLICATION The confidence intervals are computed using the replication method The integer parameter is mandatory in order to specify the number of replications requested The maximum duration of each replication is defined by the parameter TMAX The execution of the STOP procedure in the current replication terminates this replication and starts the next one REGENERATION The confidence intervals are computed using the regeneration method Exact or approximate regeneration points must be defined by explicit calls to the SAMPLE procedure in a service description or a test sequence SPECTRAL The confidence intervals are computed using the spectral method The real parameter is optional it is used to defined the first measurement period of the method The default value of this parameter is TMAX 512 3 8 12 STATISTICS parameter Syntax statistics_parameter STATISTICS option option PARTIAL GLOBAL User s Guide Control Language 101 102 Not
158. allel queueing network with one SPLIT and one MATCH is analyzed with the SPLITMAT solver A second example with two pairs of SPLIT and MATCH parameters is also shown Note the result table which is rather different from the standard result table due to the specific nature of the computed results SIMULOG 2 01 06 94 V 9 1 C COPYRIGHT BY CII HONEYWELL BULL AND INRIA 1986 1 amp 1 Basic split match network 2 3 DECLARE QUEUE SRC FORK PROC1 PROC2 JOINUP FINISH 4 CLASS CO C1 C2 C4 5 6 STATION NAME SRC 7 TYPE SOURCE Analytical Solvers Qnap2 V 9 2 8 SERVICE EXP 1 8 9 TRANSIT FORK 10 11 STATION NAME FORK 12 SERVICE EXP 0 9 13 SPLIT PROC1 C1 1 PROC2 C2 1 14 15 STATION NAME PROC1 16 SERVICE EXP 1 4 17 TRANSIT JOINUP 18 19 STATION NAME PROC2 20 SERVICE EXP 0 01 21 TRANSIT JOINUP 22 23 STATION NAME JOINUP 24 SERVICE EXP 1 0 25 MATCH FORK C1 1 C2 1 CO 26 TRANSIT FINISH 27 28 STATION NAME FINISH 29 SERVICE EXP 1 2 30 TRANSIT OUT 31 32 EXEC SOLVE SPLITMAT BOUNDS FOR SPLIT MATCH SYSTEMS SPLITMAT RESULTS ON INDIVIDUAL QUEUES SOURCE STATION SRC ARRIVAL RATE 0 556 L LOWER BOUND A APPROXIMATION ok ok ok ok ok ok ok ok ok ok
159. amp TEST is activated every 10 time units CONTROL PERIOD 10 TEST IF A NBOUT gt 500 THEN STOP EXEC SIMUL after each event of the model one tests if stations A B and C are both empty and if this condition is true then the SAMPLE procedure is called in order to create a regeneration point SP f9 f9 f9 CONTROL PERIOD 0 ESTIMATION REGENERATION TEST IF A NB B NB C NB 0 THEN SAMPLE EXEC SIMUL 3 8 16 TRACE parameter Syntax trace_parameter TRACE real real string Note This parameter is provided for compatibility with previous QNAP2 releases and might be removed in the future When using the discrete event simulator the SETTRACE keyword 104 CONTROL Command Qnap2 V 9 2 procedures should be used to specify the required tracing options Refer to chapter 9 for details Semantics The TRACE parameters controls starting or ending time of the event trace during a simu lation run The first value is the starting time and the second one is the ending time default value TMAX These values may be specified by a constant or an expression which is evaluated at initiation time It should be noted that for a simulation run the option TRACE of the OPTION parameter corresponds to TRACE 0 TMAX ie trace during the whole simulation run The default value is TRACE 0 0 0 0 which means that no trace is produced The string argument permits to cpecify L80 default value for a trace o
160. and RESET procedures put the specified flag in the unset state 4 13 3 WAIT WAITAND and WAITOR procedures Syntax WAIT customer flag WAITAND customer flag_list WAITOR customer flag_list Semantics The WAIT procedure performs a simple waiting condition It forces customer to test the state of flag If customer is omitted the default is the current customer referenced by the variable CUSTOMER If the flag state is unset then the customer is forced to wait on the flag While waiting it remains in its queue and if it was being served it keeps its server The waiting customer is freed when the flag passes into the set state or if a call to the FREE procedure occurs If the flag is in the set state the WAIT procedure is ignored User s Guide Modeling Mechanisms 147 Note Customers waiting on a single flag are chained together according to a LIFO discipline it is possible to scan the customers waiting on a flag using the following items the LIST attribute of the flag references the last customer arrived the LINK attribute of a customer references the next customer waiting on the same flag The WAITAND procedure performs a conjunct waiting condition It causes customer de faulting to the current customer to wait until all the flags in flag_list are in the set state The waiting customer is freed when all the flags are in the state set or when a call to the FREE procedure occurs
161. antics The ACCURACY parameter specifies the stations and classes for which confidence intervals are computed during a simulation run The confidence intervals are used to assess the accuracy of the results produced by the simulation run as compared to the theoretical stationary solu tion The confidence intervals are produced for all the standard performance criteria service response and blocing time number of customers utilization rate of the elements queue class defined by the sublist expressions queue sublist class_sublist CONTROL Command Qnap2 V 9 2 The sublist expressions are evaluated at initiation time e ACCURACY ALL QUEUE ALL CLASS means that the confidence intervals are re quired for all the stations and all the classes of the network e ACCURACY NIL means that no confidence interval is required default value If a class_sublist is associated with a queue_sublist the queues listed in the queue_sublist must appear also in the parameter CLASS The confidence intervals produced can be accessed by the confidence intervals access func tions These functions are similar to the results access functions and are available for the same performance criteria The complete list of these functions is given in the QNAP2 Reference Manual The selection of the confidence intervals estimation method used is controlled by the ES TIMATION parameter This parameter has to be specified to obtain the confidence intervals c
162. antics The QUANTUM parameter specifies the service quantum allocation to each class in the stations identified by the NAME parameter These values are used only if the QUANTUM option is specified in the parameter SCHED There is no default value provided for a quantum STATION Command Qnap2 V 9 2 SCHED QUANTUM will produce an error at run time if no quantum value is specified Each quantum value may be a constant or an expression The expression defining the quantum value in a QUANTUM parameter is evaluated at initiation time no dynamic evaluation during solution time The QUANTUM parameter without class option is applied to all the classes for which no quantum value is specified This default value may also be associated with the QUANTUM option of the SCHED parameter If a class list is specified its expression is evaluated at compile time Example DECLARE QUEUE UC REAL QT CLASS 2 STATION NAME UC SCHED QUANTUM 0 3 QUANTUM X QT amp equivalent description STATION NAME UC SCHED QUANTUM QUANTUM X QT QUANTUM 0 3 Service in station UC is allocated by quanta being 0 3 time units long for Y and Z classes and given by the variable QT for X class customers 3 7 7 INIT parameter Syntax init_parameter INIT class_list integer Semantics The INIT parameter specifies the number of customers of each class being in the stations identified by the NAME parameter
163. ants 43 CONTINUE directive 305 CONTROL command 100 control language 65 controlled dispatching 183 335 CONVERGENCE 202 CONVERGENCE parameter 106 206 220 conversion rules 51 CONVOL solver 185 187 COPY parameter 98 CORRELATION parameter 112 232 COX procedure 177 216 CST procedure 177 216 CUSTNB function 218 CUSTOMER creation 20 customer creation 143 CUSTOMER deletion 20 CUSTOMER object 19 28 customer transition 145 CUSTOMER type 29 data types 15 debugger 279 declaration statements 23 DECLARE command 23 69 DEFERRED directive 305 DIFFU solver 185 207 dimensioned variable 43 dispatching algorithm 183 dispatching principles 183 DISPOSE procedure 20 ELSE clause 42 ENTRY parameter 116 ERLANG procedure 177 216 error management 305 ESTIMATION parameter 110 226 EXCEPTION object 28 EXCEPTION type 29 exceptions 163 EXCLUDE scheduling 81 137 EXEC command 70 execution time 67 70 EXIT parameter 117 EXP procedure 177 216 expression evaluation 53 expressions 41 expressions expression evaluation 41 336 FIFO scheduling 81 FIFO server 6 FILASSGN attribute 32 FILE object 28 FILE type 29 FISSION parameter 93 147 flag 161 flag creation 161 FLAG object 28 FLAG type 29 flags initialization 32 FOR statement 55 function calls 45 functional limitations 177 functions 45 FUSION parameter 94 147 GLOBAL option 111 252 GO
164. arameter The optional integer indicates the order up to which these probabilities have to be computed This integer corresponds only to the previous queue sublist The default option is to compute the marginal probabilities up to the fifth order These probabilities and the variance of the customer number are printed together with the general results printed for the stations if OPTION RESULT In addition they may be used in the QNAP2 program using the function PCUSTNB and VCUSTNB The queue sublist and integer expressions are evaluated at initiation time e MARGINAL ALL QUEUE means that the marginal probabilities have to be computed for all the stations of the model e MARGINAL NIL means that no marginal probability is to be computed default value Example DECLARE QUEUE B C CLASS X Y CONTROL MARGINAL ALL QUEUE EXEC SOLVE amp the marginal probabilities are computed for classes B amp and C up to the fifth order amp PCUSTNB 0 A PCUSTHB 1 A PCUSTHB 5 A amp PCUSTNB 0 B PCUSTHB 1 B PCUSTNB 5 B amp PCUSTNB 0 C PCUSTHB 1 C PCUSTNB 5 C CONTROL CLASS ALL QUEUE EXEC SOLVE the marginal probabilities are amp now computed for each class amp PCUSTNB 0 A X PCUSTNB 5 A X amp PCUSTNB 0 A Y PCUSTNB 5 A Y amp PCUSTNB 0 B X PCUSTNB 5 B X CONTROL MARGINAL B 20 CLASS NIL User s Guide Control Language 97
165. array amp having two dimensions QUEUE DISK 10 amp declaration of an array of ten elements amp each element references User s Guide Algorithmic Language 17 amp an object of type QUEUE INTEGER NC 3 amp declaration of an integer NC amp initialized to 3 CLASS X NC amp declaration of NC classes with amp NC 3 Note The implicit enumeration rule is that the leftmost index or subscript varies the least rapidly and the rightmost index varies the most rapidly 2 2 2 Objects Objects are structured variables made up of scalar elements INTEGER REAL BOOLEAN or STRING references arrays or objects These elements are called the object attributes As opposed to the elements of an array the attributes of an object may be of mixed types 2 2 2 1 Extension of a predefined object type All predefined object types QUEUE CLASS CUSTOMER FLAG FILE TIMER EXCEP TION have predefined attributes A complete list of predefined attributes is given in the Reference Manual The user may add attributes to the QUEUE CLASS CUSTOMER and FLAG objects by simply declaring them Example DECLARE QUEUE INTEGER N amp declaring an integer amp attribute of queues CUSTOMER REAL SIZE amp declaring two new real CUSTOMER REAL TYPE amp attributes of customers OBJECT CCW amp declaring a new object type CCW INTEGER ADR DEVICE amp declaring attributes REAL SEARCH 3 amp of objects of type CCW END
166. at a and b may both be repeated but at least one of them must appear ses means that a list of elements a separated with commas may be used e g a or a a or a a a a a b means that a list of couples a b separated by commas may be used e g a b a b a b Example x alb dlelf 1 According to the definition of x the following sentences are correct acdedeef cd But the following are incorrect ac abcd 2 1 2 Character set The character set of the language consists of Letter the English alphabet letters A through Z and a through z the underline character _ the numbersign the percent sign 96 the at and the exclam Digits the Arabic numerals 0 through 9 Blanks the space character and the end of line or return character User s Guide Algorithmic Language 13 pluas equal minus lt gt different multiply gt greater than exponentiation lt less than divide gt greater than or equal to Special symbols opening parenthesis lt less than or equal to closing parenthesis assignment symbol period macro statement symbol comma string separator colon amp comment separator semicolon Note 1 Letter case is significant abc is different from ABC 2 TAB characters and other control characters are not allowed in QNAP2 files 2 1 3 Reserved words The following words are reserved ALL AND ANY BEGIN DO ELSE END
167. at all They are not taken into account in the queue statistics When all required customers have arrived the join up is performed immediately The input customers are destroyed and the resulting customer enters the station Several MATCH operations can proceed simultaneously on the same station The pieces corresponding to different origin customers wait separately that all the required customers have arrived Note A MATCH is performed only when all the required pieces have arrived If a piece is lost blocked somewhere or destroyed the other pieces will wait forever before the matching station Example In a manufacturing plant iron sheets must be cut into 12 pieces 4 of size A and 8 of size B A and B parts are tooled separately At the end one A part and two B parts must be welded together to form a C part DECLARE QUEUE CUT TOOLA TOOLB WELD CLASS SHEET A STATION NAME CUT INIT SHEET 100 SERVICE SHEET CST 10 SPLIT SHEET TOOLA A 4 TOOLB B 8 STATION NAME TOOLA TOOLB SERVICE CST 1 TRANSIT WELD STATION NAME WELD MATCH CUT SHEET A 1 B 2 SERVICE CST 2 TRANSIT OUT Note that in this example A and parts welded together must come from the same sheet If this is not a requirement then the fission fusion mechanism can be used instead FUSION has a slightly different syntax as the origin information does not apply F
168. atement call NAME TRANSIT CPU SERVICE EXP TETA 25 34 NAME DA TRANSIT CPU SERVICE EXP 25 NAME DB TRANSIT CPU SERVICE EXP 34 Qnap2 V 9 2 Interface with Fortran 244 Qnap2 V 9 2 QNAP2 can be connected to Fortran subroutines through the UTILITY feature Note that a Fortran subroutine may call other subroutines written in any language This enables to connect a QNAP2 model to any other software depending on the compiler and loader features which are operating system dependent The interface is defined in Fortran for conveniency The interface must be considered from the two aspects QNAP2 side and Fortran side On the QNAP2 side resides the UTILITY procedure This is a predefined QNAP2 procedure that can be called in any algorithmic language sequence Calling this procedure makes QNAP2 call a Fortran subroutine called UTILIT The UTILIT subroutine is the entry point on the Fortran side A default empty UTILIT subroutine is provided with QNAP2 The user may write his own UTILIT routine replace the default one and link it with QNAP2 The UTILIT routine may in turn call other Fortran subroutines When the UTILIT subroutine returns the UTILITY procedure call is terminated Fortran subroutines are provided with QNAP2 in order to allow for communication between the model variables and the Fortran variables Note It is possible to call subroutines written in languages other than Fortran This
169. ation mean service time this is the service time as seen by the customers mean response time the response time is the sum of the waiting time and service time mean number of customers this is the number of customers being served or waiting mean throughput defined as the mean number of customer services completed per time unit For the exact definition of the values obtained by a simulation see section 5 5 Simulation results on page 226 Example Introduction Qnap2 V 9 2 DECLARE QUEUE 5 CLASS X Y STATION NAME 5 TYPE SOURCE TRANSIT 1 1 SERVICE EXP 10 STATION NAME TRANSIT B X 1 0UT 3 SERVICE EXP 1 STATION NAME B TRANSIT A SERVICE EXP 3 CONTROL CLASS MARGINAL gt B 3 SOLVE END Standard Report CONVOLUTION METHOD CONVOL kk kk joke joke koe kj ke jk joe af ae ff ff fe kf fe kf fo kok NAME SERVICE BUSY CUST NB RESPONSE THRUPUT kk ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke a a a a a a 5 10 00 1 000 1 000 10 00 1000 1 000 1333 1538 1 154 1333 1 000 0 8333E 01 0 9615E 01 1 154 0 8333E 01 1 000 0 5000E 01 0 5769E 01 1 154 0 5000 01 B 3 000 1000 1111 3 333 0 3333E 01
170. ation and attempted to transit to a limited capacity station e It was forced to transit to a limited capacity station by another customer e It was the lowest priority customer in a limited capacity station and a higher priority customer came in It requested a pass grant procedure from a semaphore or resource station with limited capacity e It was forced by another customer to request a pass grant from a semaphore or resource station with limited capacity e It was rejected waited some time and tried to transit to a limited capacity station e It was rejected waited some time and tried request a pass grant from a limited capacity resource or semaphore Rejected customers execute the statement specified with the REJECT parameter of the STATION command The following customer attributes are available in order to obtain information about the reject conditions QREJECT is a reference to the queue from which the customer is rejected CLREJECT is a reference to the class which caused the reject when it was due to a class specific capacity limit CRJCAUTH is a reference to the higher priority customer which caused the reject when it was due to preemption 1 Actually it is limited by the available memory which is installation dependent Queue Organization Qnap2 V 9 2 CQUEUE is reference to the queue that the customer is leaving Its value is NIL if the customer was just created with the NEW function or if it was rejected
171. ation the work demands may be expressed in mega instructions and the service rate in MIPS e ina CHANNEL station the work demands may be expressed in Kilo bytes and the service rate in Kilobytes s The default value of the service rate is 1 i e 1 work unit per time unit In this case work demands are expressed in time units All the random variables used the work demands are assumed to be independent The completion of the service time of a customer currently in progress can be forced by executing a FREE procedure on this customer The current service time is then interrupted and will not be resumed and the customer proceeds with the next operation specified in its service description 4 4 2 Object manipulation operations During a service a customer may perform various operations on objects customers flags resources or semaphores force the transition of a customer into a station TRANSIT MOVE BEFCUST and AFTCUST procedures e ask for a semaphore pass grant or give a semaphore pass grant P and V procedures e request or release a resource P and V procedures e test or set the state of flags WAIT WAITAND WAITOR SET UNSET procedures e free waiting customer FREE procedure e create new customers NEW function with parameter CUSTOMER e define a join operation between a customer and its siblings JOIN and JOINC procedure e start and stop timers SETTIMER keyword procedures e enable and disable exc
172. ation time join specifies the number of customers of each class required to form the resulting customer of class result_class Several join specifications can be provided The selection can be performed with integer priority levels deterministic switch or real weights probabilistic switch Example DECLARE QUEUE SCREWIT CLASS SCREW BOLT SCREWED STATION NAME SCREWIT FUSION SCREW 1 BOLT 1 SCREWED One SCREW customer and one BOLT customer are fusioned into one SCREWED customer Note SPLIT MATCH and FISSION FUSION should not be confused SPLIT is intended to work in conjunction with MATCH FISSION and FUSION can be used independently See section 4 10 for more explanations 3 7 14 RATE parameter Syntax rate_parameter RATE class_list real_list Semantics The RATE parameter specifies how fast the server of a station or each server in the multiple server station case can handle the service requests of the customers present in the station This speed is measured in number of work units performed during each time unit e g MIPS KOPS The service rate may be constant or variable If the service rate is constant the service time of a customer is equal to its work demand divided by the service rate If the service rate is variable then it is the instantaneous service rate its value varies according to the number of customers queueing see the general form below The service rate may be diffe
173. attente ferm s BCMP et heuris tiques associ es These de docteur ing nieur Universit de Paris VI nov 1982 MUSSI Ph and NAIN Ph Description and Specifications for New Product Form Queueing Network Stations ESPRIT Project 2143 IMSE report R 5 5 3 V1 March 1989 5 2 8 3 Application stipulations The application stipulations are similar to those of the solver CONVOL with the following additions e closed networks e mono chain networks e no dependent service rates per class e marginal probabilities may not be requested no concurrency sets 5 2 8 4 Application stipulations summary station scheduling service distinct global dependent type time serv time dependent serv rate distribution class serv rate class SINGLE exponential be PREEMPT general general MULTIPLE FTO exponential general INFINITE ot relevant general xs ss no Example In this example a queueing network consisting of two stations A and B is described and analysed by the solver MVANCA with various specifications of stations A and B DECLARE QUEUE A B CLASS X Y REAL T 2 TX 1 5 TY 0 5 REAL R 2 2 3 RX 2 3 4 RY 2 4 3 INTEGER N 3 STATION NAME B TYPE INFINITE User s Guide Solvers 179 180 Analytical Solvers STATION EXEC STATION EXEC STATION EXEC STATION EXEC STATION EXEC STATION EXEC STATION EXEC INIT
174. attributes Each queue of the model has four additional attributes 2 integers N and M a real number TIMIN and an array of real numbers STAT Each customer has two additional attributes a reference CIO on IO type objects and a real TIO IO type objects are user defined objects Each IO object consists of an array of integer numbers CCW a queue reference DEVICE and two real numbers SEEK and SEARCH 2 3 4 Object declarations The predefined object types object type id are the following 1 queues QUEUE 2 classes CLASS 3 flags FLAG 4 customers CUSTOMER 5 timers TIMER 6 exceptions EXCEPTION 7 files FILE Example User s Guide Algorithmic Language 29 DECLARE amp declaration of a new amp object type CENTER OBJECT CENTER L PROB NLINES amp declaration of its amp attributes INTEGER NLINES QUEUE LINE NLINES REAL PROB NLINES REAL TLINE REF QUEUE L END DECLARE QUEUE CPU DISK1 DISK2 CLASS BATCH TS QUEUE EXT FLAG SYNC FILE F SP 89 amp number of lines array of NLINES queues routing probabilities average service time output queue creation of 3 queues creation of 2 classes creation of queue EXT creating a flag creating a file CENTER EXT 0 1 0 2 0 70 3 CT The last declaration statement creates an object CT of type CENTER The attribute L references the queue EXT and the attribute PROB is an array of
175. ault value TEST The test sequence specified with the TEST parameter is executed periodically according to the interval value specified in the PERIOD parameter of the CONTROL command There is no default value for the parameter PERIOD If the parameter PERIOD is not defined the test sequence is not activated e If PERIOD 0 the test sequence is executed at each occurence of an event in the model This may be used to systematically test the model state Note that this facility is costly and should only be used when necessary e PERIOD cancels any previous definition of the parameter PERIOD e TEST cancels any previous definition of the TEST parameter Example 1 CONTROL TMAX 1 6 PERIOD 1 E5 TEST OUTPUT After each interval of 100 000 time units the OUTPUT procedure is called printing of the cumulated statistics Example 2 DECLARE QUEUE CPU DISK INTEGER NSAMPLE CONTROL TMAX 1 6 PERIOD 0 ESTIM REGENERATION TEST IF CPU NB DISK NB 0 THEN BEGIN SAMPLE NSAMPLE NSAMPLE 1 IF NSAMPLE 100 THEN STOP END User s Guide Solvers 207 208 The state of the CPU and DISK stations is continuously tested i e whenever something happens in the model If the stations are both empty a regeneration point is created and the simulation is stopped when 100 regeneration points have occured 5 4 6 Estimation of confidence intervals Simulating a stochastic model consists in gen
176. ay e Message number e Message wording Message explanation and action to be taken The messages are arranged following the lexical order of their numbers This is not an exhaustive list If the user ever meets an error message which is not clear enough he she is advised to contact SIMULOG e mail support simulog fr to get the information he she needs Several message numbers can correspond to the same wording It is due to the fact that an error message can be called at several places inside QNAP2 and that a message number correspond to one and only one of these calls User s Guide Errors and Warnings 291 292 A 2 2 145 of messages e 050101 e 050103 e 050201 e 050202 e 050203 e 050206 gt ERROR COMPILE INCORRECT SYNTAX The QNAP2 algorithmic language syntax is not respected For example IF with out THEN or without 95 The user has to correct the line where the error occurred according to the algo rithmic language syntax gt WARNING COMPILE HAS BEEN ADDED BEFORE THIS ELEMENT QNAP2 adds at the end of the preceding algorithmic statement To avoid this warning message the user has to add in the source file gt ERROR COMPILE EXPRESSION IS NOT WELL DEFINED An expression in the algorithmic language is not correct For example an as signment operation may be wrong because there is only one operand The user has to check the syntax of the source line
177. bject id object type id object id IS object type id object_id IN object_type id Semantics e The double colon operator is used to specify that a reference to an object actually references an object of a sub type This enables access to the attributes of the sub type QNAP2 performs an automatic run time check to ensure that the referenced object has an acceptable type i e is of object_type id or one of its sub types e IS is a type equality operator It is used to check that a reference points at an object of a specified type e IN is a type acceptability operator It is used to check that a reference points at an object of a specified type or one of tts sub types Example DECLARE CUSTOMER OBJECT MESSAGE INTEGER LENGTH END REF CUSTOMER RC STATION NAME SERVICE BEGIN RC MESSAGE LENGTH 10 amp 10 Kbytes END The operator enables to pass from the type CUSTOMER RC to the MESSAGE sub type in order to access the LENGTH attribute This is a kind of type casting SERVICE BEGIN IF RC IN MESSAGE THEN PRINT RC MESSAGE LENGTH END 46 Expressions Qnap2 V 9 2 The test yields TRUE if RC points at a MESSAGE object or any sub type of MESSAGE which necessarily has a LENGTH attribute 2 4 7 String operator concatenation string expression string expression string expression siring cst string function call string expression The concatenation operator
178. but 0 46 is correct 2 1 66 Character strings Syntax string cst character Semantics A character string is defined as a string of characters beginning and ending with the double quote character A character string may not contain the end of physical source line character i e the two delimiters must be on the same physical input line If the character is to be stored in a character string it should be written as Example MEAN RESPONSE TIME n empty string is character string reduced to the character 2 1 7 Comments A comment starts with the ampersand character amp and includes all the characters up to the end of the physical input line Example amp This is a comment User s Guide Algorithmic Language 15 2 1 8 Separators The language is free format Therefore two consecutive items have to be separated by at least one blank character or by a physical line end except if one of the items is a special character or a comment or a character string An identifier a number or a keyword may not include blank characters or physical end of line Example DECLARE REAL AB XYZ EXEC BEGIN 36 12 XYZ AB 34E4 amp A amp EXEC BE GIN amp is incorrect AB 36 12 amp i XYZ B 34E4 amp i D i Note The slash character when used as the first non blank character of a line introduces
179. by the user 3 Default priority of the tracing actions implemented by QNAP2 The first selection criterion is the object The animation features of MODLINE are built on top of the generalized trace User s Guide Trace Facilities 267 1 When two trace specifications are candidates QNAP2 selects the one with the highest priority level If the priority levels are equal QNAP2 selects the object that undergoes the event first then the one that causes it and finally the one that is a partner of the event 2 If these criteria are not sufficient QNAP2 selects a CUSTOMER or a TIMER first then a FLAG or a QUEUE CLASS couple then a QUEUE and finally a CLASS 3 A tracing action specified as the default action never prevails over a user specification After selecting which object s tracing action is performed QNAP2 considers whether a spe cific action depending on the event type has been defined If no tracing action is defined for the occuring event a default tracing action is performed This means that tracing specifications based on event types are local to objects For example a trace specification defined for flag F and WAIT events is valid only for flag F It must be repeated for all flags if the user wants to catch all WAIT events 9 3 3 Trace specifications SETTRACE keyword procedures are used to specify tracing actions to enable disable tracing and to produce the standard trace messages Syntax SETTRACE SET obj
180. ce items TYPE SOURCE SERVICE EXP 10 TRANSIT PACKAGE STATION PACKAGE amp Package items SERVICE EXP 5 TRANSIT OUT DECLARE PROCEDURE RESTART BEGIN UNBLOCK PACKAGE END DECLARE PROCEDURE FAIL BEGIN BLOCK PACKAGE SETTIMER SETPROC FAILURE RESTART SETTIMER RELATIVE FAILURE 100 END DECLARE PROCEDURE INITIMER amp Initialize timer BEGIN SETTIMER SETPROC FAILURE FAIL SETTIMER ABSOLUTE FAILURE 500 END CONTROL TMAX 1000 OPTION NRESULT EXEC BEGIN SETEXCEPT HANDLER SIMSTART INITIMER SIMUL PRINT Maximum number of items GETSTAT CUSTNB MAXIMUM PACKAGE END m number of items 7 000 END In this example the timer object FAILURE is used to model a deterministic failure of a packaging machine The failure date is scheduled with SETTIMER ABSOLUTE The failure is Timers Qnap2 V 9 2 modeled by blocking the queue PACKAGE The queue is restarted after a deterministic repair time programmed with SETTIMER RELATIVE The timer is initialized within the SIMSTART exception because SETTIMER keyword pro cedures are not allowed outside simulation User s Guide Modeling Mechanisms 155 156 Timers Qnap2 V 9 2 Solvers 158 Qnap2 V 9 2 5 1 Introduction 5 1 1 Overview QNAP2 solving model means of a solver consists in computing or estimating the per formance criteria which characterize the model The ma
181. ception The exception stays hidden until it is unmasked with UNMASK MASK increments a counter whereas UNMASK decrements it The exception is considered as unmasked when the counter is null initial value LAUNCHTIMER when the exception is connected to an external timer signal LAUNCHTIMER is used to schedule this timer for delay seconds If the timer was already running the previous setting is cancelled Note This feature should not be confused with timer objects described in the next section An exception can be connected to a real time clock or to a cpu time clock This time has nothing to do with the internal simulation time 150 Exceptions Qnap2 V 9 2 CANCELTIMER is used to cancel any previous LAUNCHTIMER setting Example DECLARE EXCEPTION CPULIMIT PROCEDURE CLEANUP BEGIN PRINT CPU time limit expired PRINT Cleaning up at TIME SAVERUN suspend STOP END EXEC BEGIN SETEXCEPT CONNECT CPULIMIT CPU TIME CLEANUP SETEXCEPT LAUNCHTIMER CPULIMIT 3600 END The exception object CPULIMIT is connected to the external signal CPU TIME controlling the CPU time limit Then the CPU timer is launched for 3600 seconds When the CPU time limit is reached the operating system sends the CPU TIME signal to QNAP2 The exception is raised and the CLEANUP procedure is executed in order to save the model and stop the simulation in a clean way User s Guide Modeling Mechanisms 151
182. chanisms 125 126 arrival order customer holds a server When the two class Z customers have completed their service only one X and one Y customer can seize a server 4 5 5 Resequencing station A resequencing station is defined with the RESEQUENCE option of the SCHED parameter The customers are served in the resequencing station in the exact order that they departed from the reference station The order in which they arrive at the resequencing queue has no importance A customer arriving out of sequence cannot be served until all its preceeding customers have arrived A customer arriving before its preceeding customers simply waits in the queue until all its preceeding customers arrived even if there is an idle server A customer arriving after its succeeding customers seizes the server Note If one of the customers never arrives because it was blocked somewhere or destroyed the other customers will not be served and the resequencing station will hang forever Example STATION NAME SENDER TYPE SOURCE SERVICE EXP 2 TRANSIT NETW STATION NAME TYPE SERVICE TRANSIT NETW INFINITE EXP 1 RECEIVER STATION NAME RECEIVER SCHED RESEQUENCE SENDER SERVICE EXP 1 8 TRANSIT OUT Server Allocation Qnap2 V 9 2 The NETW station mixes the order of the customers The customers arriving at the CEIVER station are ordered and served according to their sending order at the S
183. cified with the procedures MOVE TRANSIT BEFCUST and AFTCUST if the customer explicitly asks to leave the station during its service or if another customer forces it to leave refer to the procedures MOVE TRANSIT BEFCUST and AFTCUST In the latter case the service is interrupted and cannot be resumed regardless of the re maining actions or requests Note At service completion or at service suspension time a customer does not release the re sources that it may own Ifa customer was blocked waiting on a flag a resource or a semaphore a forced transition will not cancel the demands the customer posted 4 4 4 Service Suspension Execution of a service may be interrupted for various reasons the server is preempted by the arrival of a customer with a higher priority level or by a quantum expiration e the customer is blocked the customer goes waiting or is set to wait for a resource a semaphore or a flag P WAIT one of the resources of the customer is preempted As soon as the customer recovers the server or the resource it needs its service restarts from the point of interruption Example Server preemption DECLARE QUEUE A CLASS X Y STATION NAME SERVICE CST 10 SCHED PRIOR PREEMPT PRIOR X 1 PRIOR Y 2 Service Qnap2 V 9 2 Consider the following sequence at time 0 class X customer starts being served by station A At time 3 a class Y customer arrives
184. coefficient of variation of the inter arrival times Then for each station an approximate solution of the GI G 1 type is computed using diffusion approxima tions 5 2 12 2 Bibliography GELENBE E and PUJOLLE G A Diffusion Model for Multiple Class queuing Networks Rapport de Recherche IRIA 242 aout 1977 12 pages 5 2 12 3 Application stipulations The application stipulations of the solver DIFFU are identical to those of the solver CONVOL with the following additions e open network e inter arrival times with general distributions e FIFO single server station with general service time distribution e no dependent service rates no concurrency sets e no limited capacity stations e marginal probabilities may not be requested 5 2 12 4 Application stipulations summary station scheduling service distinct global dependent type time serv time dependent serv rate distribution per class serv rate per class SINGLE FIFO yes m no SOURCE not relevant general yes no Example In this example a queueing network consisting of two stations A and B is described and analysed by the solver DIFFU with various specifications of stations A and B DECLARE QUEUE A B CLASS X Y REAL T 2 1 5 TY 0 5 REAL R 2 2 3 RX 2 3 4 RY 2 4 3 INTEGER N 3 STATION NAME B TRANSIT OUT SERVICE X CST TX SERVICE Y CST TY User s Guide Solvers
185. compatible with the existing ones i e FIFO LIFO PRIOR etc The concurrency sets are described in section 4 5 4 Multiple server station with concur rency sets B 1 3 Customer resequencing It is often required to process customers in a specific order For example In a telecommunications network packets arriving at their destination node must be resequenced before reassembling the message In a distributed data processing system data consistency requires that sequences of erations be performed in the same order on all nodes Resequencing is a new scheduling option Customers arriving at the resequencing queue are served in the same order as they departed from a reference queue Customers arriving out of sequence must wait until all their preceding customers have arrived This feature is described in section 4 5 5 Resequencing station B 1 4 Customer split and match These new features are intended to model systems including parallel processing with rendez vous mechanisms for example Message packetization and reassembly in telecommunication networks New modelling mechanisms Qnap2 V 9 2 e Fork and join primitives in multi tasking systems e Inter process synchronizations e Assembly and disassembly of parts in a manufacturing process These mechanisms could be emulated with the algorithmic language with customer creations and synchronization procedures e g NEW and JOIN Four new mechani
186. computation has not been requested The user has to ask for the result computation using the appropriate SETSTAT procedure and not to request non computed results gt ERROR INTER INVALID VALUE SPECIFIED FOR TMAX This message is printed if the SETTMAX procedure is used with an invalid param eter lower than zero or lower than the current date The user has to check the value of the parameter of the SETTMAX procedure gt ERROR INTER MEMORY OVERFLOW This message means that the input file cannot be read because QNAP2 memory space is full The user can either try to reduce the size of its model too many queues or too many customers or use a QNAP2 executable with a larger memory space To get such a QNAP2 executable the user can generate it himself or ask SIMULOG for it In both cases it is advisable to contact SIMULOG to get more information gt ERROR INTER A REFERENCE WITH VALUE NIL IS USED This message is printed if we use a reference that refers to an object equal to NIL The user has to modify the reference value so that it refers to an existing object gt ERROR INTER A REFERENCE TO A DESTROYED OBJECT IS USED This message means that a reference to a deleted object is used The user has to modify the reference value so that it refers to an existing object He she can check the referenced object destruction using the DELETED function Errors and Warnings 307 308 e 070602 e 070901 e 0J0H
187. d to guess the next wake up time of the timer use the GETSIMUL WAKETIME function instead 2 All the timer attributes are read only They can be changed by SETTIMER keyword procedures The predeclared timers are the following TSYSTMAX stops the simulation when TMAX is reached TSYSTSTR manages the starting period TSTART parameter TSYSPERI is activated periodically PERIOD parameter to manage the TEST sequence TSYSTRACE manages the starting and ending times of the trace TSYSSPCT is used internally by the spectral method TSYSWDOG is used internally for QNAP2 debugging The user can read the attributes of the predefined timers and change some of them although this is not recommended as it interferes with their normal operation 152 Timers Qnap2 V 9 2 4 15 2 Timer manipulation Timer objects are handled by the SETTIMER keyword procedures These procedures can be used only during the simulation Syntax SETTIMER SETPROC timer procedure SETTIMER ABSOLUTE timer date SETTIMER RELATIVE timer delay SETTIMER CYCLIC timer delay SETTIMER TRACKTIME timer SETTIMER CANCEL timer where timer is a reference to a timer object SETPROC is used to assign a handler procedure to a timer procedure must be the name of or a reference to a procedure with no argument ABSOLUTE schedules the timer for the specified simulation date which must be greater than TIME RELATIVE schedules the timer for TIME delay
188. d with FILASSIGN before saving the model The label argument is a string that is stored in the header of the library file SAVE can be used only within an EXEC block SAVERUN can be used in any algorithmic code sequence including during simulation The RESTORE procedure is used to restore the model from the library file The default file is FSYSLIB The optional label argument is compared against the one stored in the library file If the labels do not match QNAP2 prints an error message and does not restore the model When the model has been saved with SAVE the statements following the RESTORE are skipped until the next control language command When the model has been saved with SAVERUN the REBOOT command can be used to manipulate the model state before resuming the execution see chapter 3 Control Language Example The first model declares a number of procedures functions and variables All the compiled code is saved in the default library file DECLARE PROCEDURE READDATA amp Read data file and initialize model BEGIN END CONTROL ENTRY READDATA amp Call READDATA just before simulation EXEC SAVE DECLARATIONS END The second model is just three lines long it restores all the declarations and launches the simulation EXEC RESTORE EXEC SIMUL END Note 1 As opposed to data files library files are binary files They are not human readable but the resulting format is much mor
189. debugging We restart a session by restoring the simulation from its previously saved state This is done with the command shown below see section 2 6 2 for explanations about saving and restoring models EXEC RESTORE After restoring the model the execution is resumed Note that the model run after retrieval is exactly the same as the previous run Debugger MODEL RESTORED MODEL Debugger HALT ON BREAK POINT BEFORE LINE 9 User request SHBREAK Debugger EXISTING BREAK POINT BEFORE LINE 9 User request SHINSERT Debugger INSERT ON LINE 11 The break and insertion points are the same User request REMOVE 11 User request STP Debugger STEP BEFORE LINE 18 User request STP Debugger STEP BEFORE LINE 19 User request STP Debugger STEP BEFORE LINE 10 User request STP Debugger STEP BEFORE LINE 11 User request STP Debugger STEP BEFORE LINE 17 Example Qnap2 V 9 2 Trace Facilities 262 Qnap2 V 9 2 This chapter presents the trace facilities available in simulation Tracing facilities available with the analytical and Markovian solvers are decribed in chapter 5 with each solver QNAP2 provides a full set of tracing facilities with the discrete event simulator The standard trace prints all the events occuring in the model in a general purpose format The generalized trace allows the user to specify which events must be traced and how to process them User s Gu
190. dered as samples of independent identically distributed random variables these variables are used to estimate the confidence intervals and the final results In practice the independence hypothesis may be satisfied if the model corresponds to a stochastic regenerative process In this case the model contains one or more special states called regeneration states Whenever the system returns to one of these states a regeneration point is obtained i e a point where the past behaviour of the system has no more influence on its future behaviour The regeneration points may be used to split the simulation duration into intervals which satisfy the statistical independence hypothesis The determination of exact regeneration intervals is not in general feasible on reasonably complex models The simplest case is the case of Markovian models in which every state is a regeneration state Similarly in an open network model having a Poisson arrival process the state all the stations empty is generally a regeneration state The user may define regeneration points by testing a condition defining the regeneration states and by explicitly requesting the computation of partial statistics on the last interval if the test is satisfied The more general way to test a condition is to program the test in a special process called a test sequence which is activated periodically with a period specified by the user with the parameter PERIOD If a zero period is explici
191. details User s Guide Interface with Fortran 251 252 Example Qnap2 V 9 2 The 2 debugger 254 Qnap2 V 9 2 81 Introduction Whatever program is being operated the first runs often fail to provide the expected results and then comes the difficult task of pin pointing the source of error Usual methods in language based programs consist of Placing print out statements for variables or diagnosis messages in the program code This method is advantageous when the observation becomes significant over several iterations as is the case for example with mathematical programs new executable has to be created to modify such orders that is a recompilation of the relevant modules and a relisting of the links e Using an interactive debugger which when available is supplied either with the system or with the program This chapter covers this type of tool The point at which program processing is broken off to enable the user to make demands of the debugger will be termed the break point debugger permits the program process to be traced step by step statement by state ment allows insertion of break points consulting and modification of certain variable values continuation of normal program process through to the next break point pre specified by the user In the case of QNAP2 the debugger operates solely from the algorithmic code written by the user it is supposed a priori that the declared entities are known It fo
192. dimension 3 formal parameter N with initial values 0 1 0 2 and 0 7 2 3 5 Reference declarations 2 3 5 1 References to objects A reference to an object is declared by associating the keyword REF and the identifier of the object type for instance REF QUEUE is a reference to a queue REF FLAG is a reference to a flag Example DECLARE REF QUEUE PQ LPQ 10 amp queue references REF CUSTOMER PC LPC 0 10 2 amp customer references QUEUE REF QUEUE PQQ REF FLAG SYNCHRO REF FILE F amp queue reference attribute amp flag reference amp file reference The NIL constant is the value of a reference pointing to nothing default initial value for references 30 Declaration Statements Qnap2 V 9 2 Example DECLARE QUEUE A B FLAG F1 F2 REF QUEUE Q A declaration of a queue reference initially referencing declaration of a flag reference referencing nothing REF FLAG F amp 1 amp reference references Fi PRINT F STATE amp printing the STATE END amp attribute of object Fi 2 3 5 2 Reference to any object Syntax REF identifier Semantics ANY is a fictitious type Such references can point to an object of any type QUEUE CLASS CUSTOMER user type Note 1 Only references of this type can be handled objects of this type cannot be created stat ically or dynamically 2 References to scalar va
193. ditionaLattribute declaration object_type id type id identifier Semantics An object type declaration creates a new object type whose identifier is object_type_id The optional object type ref causes the attributes of the referenced type to be inherited by the object type being declared The attributes are declared in following declaration statements or using the specific attribute declaration statement Attributes may be either e scalar items arrays e objects of other known types i e predefined or declared previously They may be classified into four types e normal attributes e parameter attributes e forward attributes e additional attributes 2 3 3 1 Normal attribute declaration Normal object attributes are simply declared before the END keyword Normal attributes may be scalars including references to other objects or objects attributes of object types defined as sub types are defined similarly Example DECLARE INTEGER NBNODE 10 OBJECT NODE REAL SWITCH REF NODE ROUTE NBNODE QUEUE INBUF OUTBUF END Declaration Statements Qnap2 V 9 2 Each NODE object contains one REAL atribute an array of 10 references to NODE objects and two queues The INBUF and OUTBUF queues are automatically created when a NODE object is created Example DECLARE CUSTOMER OBJECT MESSAGE REAL LENGTH INTEGER LEVEL REF QUEUE ORIGIN END CUSTOMER OBJECT PACKET
194. e This parameter is provided for compatibility with previous QNAP2 releases and might be removed in the future When using the discrete event simulator the SETSTAT PARTIAL procedure should be used to request partial statistics Refer to section 5 5 Simulation results for details Semantics When the regeneration method is used ESTIMATION REGEN the STATISTICS pa rameter controls the type of results partial or global which are available at the end of each regeneration period PARTIAL During a simulation run a call to the procedure OUTPUT or to a result access function will produce the statiscal results collected during the last regeneration period ie during the interval of time between the two last calls to the procedure SAMPLE This facility applies only to the following performance criteria globally or for each class mean service time busy percentage mean number of customer mean response time mean blocked time throughput After the end of a simulation run a call to the procedure OUTPUT or to a result access function will produce the statistical results collected during the complete simulation run ie during the interval of time between the measurement starting time and the end of the simulation GLOBAL During a simulation run a call to the procedure OUTPUT or to a result access function will produce the statistical results collected during the interval of time between the measurement starting time and the last r
195. e The other expressions are evaluated at initiation time The split mechanism is defined as a probabilistic switch between several split possibilities prob is a real expression giving the weight of each split possibility If the sum of prob values is not 1 then all prob values are normalized STATION Command Qnap2 V 9 2 The triples queue class count indicate the destination queue the class of pieces and the number of pieces resulting from each split A single customer may be split into any number of pieces which can be sent to different queues Example DECLARE QUEUE SENDER RECEIVER NETW1 NETW2 CLASS MSG SMALLPK LARGEPK STATION NAME SENDER SPLIT MSG NETW1 SMALLPK 40 WETW2 SMALLPK 60 0 8 NETW1 LARGEPK 10 0 2 A customer of class MSG is split into 100 customers of class SMALLPK with probability 0 8 40 of these new customers are sent to NETW1 and 60 to NETW2 Note SPLIT MATCH and FISSION FUSION should not be confused SPLIT is intended to work in conjunction with MATCH FISSION and FUSION can be used independently See section 4 10 for more explanations 3 7 11 MATCH parameter Syntax match parameter MATCH origin join PRIOR integer MATCH origin join WEIGHT real origin queue class_list join class count result_class Semantics The MATCH parameter is used to specify a join up of c
196. e arguments or to their number The user has to check the syntax of the concerned procedure and to modify the model according to it Error and Warning Messages Qnap2 V 9 2 050403 e 050404 e 060101 e 060103 e 060105 e 060107 User s Guide gt ERROR COMPILE INCORRECT TYPE FOR AN OPERAND OR AN ARGUMENT A data used in an operation or as a parameter of a procedure does not belong to the expected type The user has to check the syntax of the performed operation and the types of the concerned entities gt ERROR COMPILE INCORRECT NUMBER OF ARGUMENTS The arguments of a procedure are not available The error may be due either to the types of the arguments or to their number The user has to check the syntax of the concerned procedure and to modify the model according to it gt ERROR CONTROL INCORRECT SYNTAX The QNAP2 language syntax is not respected in a CONTROL block The QNAP2 algorithmic language syntax is not respected For example IF with out THEN or without 95 The user has to correct the line where the error occurred according to the algo rithmic language syntax gt ERROR CONTROL CLASS MAX NUMBER CAN NO LONGER BE EXTENDED The default maximum number of customer classes is 20 This value can be modified by the command CONTROL NMAX error message is printed if queues and or classes have already been defined when the user tries to modify this value The
197. e compact that what is possible with formatted text files 2 Library files should not be opened or closed by the user This is performed automatically by QNAP2 when required User s Guide Algorithmic Language 59 60 Input output facilities Qnap2 V 9 2 Control Language 62 Qnap2 V 9 2 3 1 Control Statements 3 1 1 Control language overview Syntax program command END command declare command station control_command terminal command exec command reboot command restart command Semantics QNAP2 program consists of different functional parts introduced by QNAP2 control state ments model initialization part and solution part The control language is similar to the algorithmic language free format similar items It uses an additional set of keywords command names command parameters and options These keywords are not reserved words nor predefined identifiers for the algorithmic language e g STATION NAME FIFO TMAX Note Only the first four characters of a keyword are significant Each command is introduced by a keyword enclosed with two slash characters The first slash of the command string must be the first non blank character of a line Therefore only one command may appear on a line QNAP2 commands are DECLARE identifiers declaration STATION work station characteristics description CONTROL QNAP2 control parameters specification
198. e ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke a a a a a a NAME SERVICE BUSY PCT CUST NB RESPONSE SERV NB kk ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke a a a a a a SOURCE 1 012 1 000 1 000 1 012 14823 User s Guide Solvers 213 214 SYST 7102 7019 8 790 8 896 14822 0 2495E 01 0 3629E 01 2 168 2 040 MONITOR 0 0000E 00 0 0000E 00 0 0000E 00 0 0000E 00 14822 ok sk ok ok ok ok ok ok ok oe ok ok coke ok ok ok cock ok ok ok ok coke ok ok ok ck ok coke ok ok ok ok ok ok coke ok ok ok ok fe 2k ok ok ck ck ok ok ok ok oko koe AUTOCORRELATION FUNCTIONS ON QUEUE MEASURES ok sk ok ok ok ok ok ok ck coke ok ok ok ok coke 2k ok ok oko ok ok ok ok ok ok ck ck coke ok ok ok ok coke ok ok ok ck ck ok ok ok ok oko ok ok ok ok AUTOCORRELATION ON QUEUE SYST Sk ok ok ok ok ok 27 ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok SK ok ok ok ok ok ok ok ok ok ORDER BLOC SERV BUSY QUEUE RES NB BLOCKED SIZE TIME TIME LENGTH TIME SERVED TIME kk ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke 1 0 021 0 003 0 003
199. e simulation duration is long enough the effect of the customers remaining in the station should be small and the formulae should be verified with a good approximation When marginal probabilities on the number of customers are requested with the MARGINAL parameter of the CONTROL command the standard report table is followed by a printout of the marginal probabilities the variance of the number of customers and the variance of the response time 5 5 3 2 Result access functions During the simulation the values returned by the result access functions depend on the par tial global option e When partial results have been requested with the STATISTICS PARTIAL parameter of the CONTROL command or the SETSTAT PARTIAL procedure the values returned by the result access functions apply to the previous sampling interval i e the time interval between the last two SAMPLE or SETSTAT SAMPLE procedure calls e When global results have been requested default option the values returned by result access functions apply to the time interval between the start of the measurements as de fined by the TSTART parameter of the CONTROL command or by the SETSTAT ON procedure and the last call to SAMPLE or SETSTAT SAMPLE GETSTAT functions for queues Syntax GETSTAT result MEAN queue class GETSTAT result MINIMUM queue class GETSTAT result MAXIMUM queue class GETSTAT result VARIANCE queue class GETSTAT result ACCURACY
200. ect event procedure priorities 1 Semantics The SET keyword is used to assign a tracing action and priority levels to objects and events object is an object or a list of objects trace specification applies to queues customer classes timers and flags It also applies to queue class pairs as in DECLARE QUEUE cpu CLASS batch PROCEDURE ENDBATCH BEGIN PRINT TIME End of batch job END SETTRACE SET cpu batch ENDSERV ENDBATCH events to trace are specified as character strings containing symbolic event names The symbolic names of the events are listed below procedureis either the identifier of a procedure without parameter or a reference to a generic procedure without parameter The constant NIL is allowed which suppresses any previously specified tracing action This is the most straightforward method to turn off the standard trace Example The following code turn offs the standard trace for all events except those related to queue 268 Generalized Trace Qnap2 V 9 2 DECLARE QUEUE PROCEDURE TRACEIT BEGIN SETTRACE DISPLAY END EXEC BEGIN SETTRACE DEFSET NIL SETTRACE SET A TRACEIT END priorities is a list of one to three integers specifying the prority level of the trace specification depending on the role of the object The first priotity level is used when the object causes the event the second one when it undergoes it the third one w
201. ed The UNIT parameter is provided to redirect the standard input output when needed Example DECLARE INTEGER I L 10 REAL R FILE F EXEC BEGIN FILASSIGN model dat OPEN F 1 amp read mode CONTROL UNIT GET F EXEC BEGIN FOR I 1 STEP 1 UNTIL 7 DO L I GET INTEGER R GET REAL END 3 8 4 CLASS parameter Syntax class_parameter CLASS queue list Note This parameter is provided for compatibility with previous QNAP2 releases and might be removed in the future When using the discrete event simulator the SETSTAT CLASS pro cedure should be used to specify the required class results Refer to section 5 5 Simulation results for details Semantics The CLASS parameter specifies for which stations detailed results must be displayed For these stations the occupation rate mean service time mean response time mean customer number and the throughput are given for each customer class User s Guide Control Language 95 These results are printed in the final report of a solution and may be used in a model by means of the result access functions with a station name and a class name as parameters The queue list expression is evaluated at initiation time e CLASS ALL QUEUE means that the results are requested for all the stations of the network objects of type QUEUE e CLASS NIL means that no results per class are requested default value Example DECLA
202. ed in two modes Global statistics are computed over the entire measurement session They are used to char acterize the steady state of the model Partial statistics are computed over the last measurement period i e between the last two sampling instants defined by the SAMPLE or SETSTAT SAMPLE procedures They are used to analyze transient states All computed results can be obtained with the result access functions presented in sec tion 5 5 3 2 5 5 1 1 Queue statistics The queue statistics are computed from the following quantities measured during the simulation run these quantities cannot be accessed by the user Tm total duration of the measurement session e T q n total duration during which station 4 contained exactly n customers e T q k n total duration during which station 4 contained exactly n class k customers e N q total number of customers having left the station at the end of a quantum a customer does not leave the station e N g k total number of class k customers having left the station q e S q total sum of the services completed in station q e S q k total sum of the services completed in station q for class k customers e 5 g total sum of the services performed in station 4 including the uncompleted services e S g total sum of the services performed in station 4 for class k customers including the uncompleted services e R q total sum of the time periods spent in station q by
203. eduling The following scheduling procedures are allowed e FIFO e LIFO PREEMPT e PS e FEFS EXCLUDE Priorities and quantum allocation may not be used When concurrency sets are used EXCLUDE scheduling e the definition of the concurrency sets should be performed either with the classes or with probabilities only Definitions mixing classes and probabilities is not allowed e all customers must belong to a concurrency set no outsiders and e the FEFS option is implied Example DECLARE CLASS C1 C2 C3 C4 Cb SCHED FEFS EXCLUDE C2 63 C4 C5 amp ok SCHED FEFS EXCLUDE 0 4 0 4 0 2 amp ok SCHED FEFS EXCLUDE 0 4 C2 0 7 amp mixing C3 0 6 C4 0 3 amp prob class C5 amp not allowed SCHED FEFS EXCLUDE C1 C2 amp C5 missing C3 C4 amp not allowed Note If concurrency sets are used then the following restrictions apply to the station 1 The capacity must be infinite 2 The service time distribution must be exponential station capacity The station capacity may be infinite default or finite If finite capacity stations are used the capacity limitation may not depend on classes only a global capacity is allowed The reject sequence REJECT parameter is limited to the SKIP procedure A finite capacity queue may not use concurrency sets Note 1 If the network is closed and contains only finite capacity stations the customer populat
204. edure 101 P procedure 150 158 parallel replications 238 Parallel Virtual Machine 238 PARTIAL option 111 252 PCUSTNB function 105 performance criteria 5 PERIOD parameter 112 225 PMULT procedure 152 predefined object types 15 PREEMPT scheduling 81 preemption 134 PRIOR parameter 83 140 Qnap2 V 9 2 PRIOR procedure 140 PRIOR scheduling 81 priority level 140 priority rules operators 41 PRIORPR solver 185 201 procedure call 52 procedure declaration 33 PS scheduling 82 223 PVM 238 QNAP2 program 4 quantum allocation 135 QUANTUM parameter 84 QUANTUM scheduling 82 QUEUE attributes 23 queue capacity 124 queue discipline 122 queue initialization 125 QUEUE object 28 queue structure 122 QUEUE type 29 queueing network 4 RANDOM parameter 108 RATE parameter 94 218 223 REAL type 31 41 REBOOT command 75 305 reference declarations 30 reference types 15 references 20 50 REGENERATION method 229 regeneration method 110 REJECT parameter 97 REPEAT clause 46 55 REPLICATION method 227 replication method 110 RESEQUENCE scheduling 138 reserved identifiers 13 339 reserved words 12 RESET procedure 161 resolution control 4 resource 158 resource creation 158 RESTART command 20 69 74 RESTORE procedure 61 75 SAMPLE 234 SAMPLE procedure 252 SAVE procedure 61 SAVERUN procedure 61 75 305 scalar types 15 User s Guide SCHED parameter 81 sema
205. egeneration point i e last call to the proce dure sample After the end of a simulation run a call to the procedure OUTPUT or to a result access function will produce the statistical results collected during the complete simulation run ie during the interval of time between the measurement starting time and the end of the simulation 3 8 13 CORRELATION parameter Syntax correlation parameter CORRELATION queue sublist integer class_sublist Note This parameter is provided for compatibility with previous QNAP2 releases and might be re moved in the future When using the discrete event simulator the SETSTAT CORRELATION procedure should be used to specify the required aut correlation coefficients Refer to section 5 5 Simulation results for details Semantics When the regeneration method is used the CORRELATION parameter controls the com putation of the auto correlation functions of the measurements made during each regeneration intervals of the simulation run These functions help in determining the validity of the indepen dance assumptions made on these measurements this assumption is used for the calculation of CONTROL Command Qnap2 V 9 2 the confidence intervals with the regeneration method If this assumption is not verified the produced confidence intervals may be meaningless e CORRELATION ALL QUEUE ALL CLASS means that the functions have to be computed for all the stations and a
206. emaphores and or resources in the list of queues argument The list_of_integers argument is the list of the numbers of P or V operations performed to the corresponding queue in the lst_of_queues argument The list_of_priority_levels and list_of_classes arguments of PMULT procedure are the lists of the classes and priority levels with which the corresponding requests are performed Note PMULT and VMULT are not implemented in the QNAP2 releases anterior to V9 1 Example SIMULOG QNAP2 01 04 95 V 9 2 C COPYRIGHT BY CII HONEYWELL BULL AND INRIA 1986 1 amp This model is to show in a simple way the difference between 2 amp PMULT and a succession of P 3 amp In the first part of the model the current customer in the User s Guide Modeling Mechanisms 139 1 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 140 Semaphores amp double station performs a request of pass grant to sem2 amp only if its first request to semi has succeeded amp Whereas both requests are performed simultaneously in the second amp part of CONTROL OPTION SOURCE RESULT TRACE DECLARE QUEUE double simplei simple2 STATION STATION STATION STATION STATION CONTROL the model with PMULT QUEUE semi sem2 NAME double 10 T
207. en this version and V8 0 The main objective of the new features is to reduce the effort required to develop a model of a complex system Some new features e g finite capacity queues could be emulated with previous QNAP2 releases but this was at the expense of programming efforts with the algorithmic language typically statements embedded in the service descriptions Other features could not be emulated even with complex algorithmic code e g user functions or would have required very heavy algorithmic code e g concurrency sets 1 New modelling mechanisms e Finite capacity queues e Multiple server stations with concurrency sets of customers e Customer resequencing e Customer split and match mechanisms e Timers 2 Simulation control mechanisms e Generalized trace e Generalized statistics e Accuracy control e Exceptions 3 Extended analytical solvers handling e Finite capacity queues e Multiple server stations with concurrency sets of customers 4 Algorithmic language extensions e User functions e Hierarchical predeclared procedures and functions The new features are presented below A few known compatibility problems with V8 0 are listed at the end of this chapter User s Guide New features 315 316 B 1 New modelling mechanisms The new modelling mechanisms are intended to make modelling simpler to QNAP2 users B 1 1 Finite capacity queues Most real world devices have a limited capacity
208. ent with the following parameter TYPE RESOURCE MULTIPLE integer The integer value specifies the number of customers that may share the resource simultane ously Only the PRIOR parameter and SCHED parameters may be used for a resource 4 12 2 procedure Syntax P customer queue class priority level Semantics The P procedure forces customer to request a resource unit from the resource queue If customer is omitted the resource is requested by the customer being served referenced by the variable CUSTOMER A new customer representing the request is created and sent to the queue associated with the resource station with the specified class and priority_level If these parameters are omitted the request is posted with the class and priority level of the requesting customer If a resource unit is available it is allocated to the customer which can then proceed with its service The statisfied request remains in the queue of the resource as long as this resource is kept by the customer If no resource unit is available the requesting customer is blocked The service of this customer is interrupted but the server on which it was working is not freed A blocked customer waiting for a resource is freed if a unit of resource becomes available 4 12 3 procedure Syntax V customer queue Semantics The V procedure releases the resource unit allocated by queue to customer If customer is omitted the default
209. eptions SETEXCEPT keyword procedures To be able to execute these operations a customer must hold a server but these operations do not consume any processing time Thus for instance resource allocation semaphore testing or customer creation are instantaneous operations on the time scale of the model The P or WAIT operations may force a customer to wait for a resource a semaphore or a flag A waiting customer can no longer be processed The server remains inactive and can not accept work demands nor execute service procedures P V The customer is said to User s Guide Modeling Mechanisms 119 120 be blocked The service continues is resumed as soon as the cause that produced the blocked state disappears see service suspension below A blocked customer keeps its server It is considered by QNAP2 as still being served The server remains inactive but occupied and can be assigned to a new customer only by means of the general allocation mechanisms see Server allocation below 4 4 3 Service Completion The service of a customer is completed e when all the work demands and the operations defined in the service have been completed The customer leaves the station and is forwarded according to the TRANSIT parameter of the station note that the expressions defining the queue and class destinations as well as the transition probabilities are evaluated only once at initiation time dynamic transitions can be spe
210. er class In this case the SERVICE parameter has to be indexed by the appropriate list of classes A non indexed service applies to all classes for which no service is specified If a class list is specified its expression is evaluated at compile time The SERVICE param eter is ignored in the case of a station defined as a resource or semaphore station A service is comprised of work demands and or object manipulation operations The work demands are expressed in work units e g number of instructions to be executed number of bytes being transferred These values are described by means of appropriate work demand procedures e g CST EXP The service rate of one server of the considered station determines the effective service time If this rate is equal to 1 1 work unit per time unit then the service time is equal to the work demand expressed in service units 1 is the default value of the RATE parameter The object manipulation operations may include synchronization procedures P and V pro cedures on semaphores TRANSIT or PRIOR procedures etc These procedures control the activity of the servers of the station The servers are blocked i e have a null instantaneous service rate if the synchronization conditions are not met The expressions and statements appearing in the SERVICE parameter are evaluated at solution time see Chapter 5 section 5 1 2 Bringing resolution into play for more details depending on the solver activated
211. erating one or several finite trajectories of the model using random number streams The required characteristics of the equilibrium or transient behaviour of the model are then estimated from the information contained in the simulated trajectories Because of the finite number and length of the generated trajectories the estimates can provide only approximate values of the required characteristics Therefore some indications on the accuracy of the estimates are needed The standard method of estimating the accuracy of a statistical estimate is to compute con fidence intervals We say that we have a confidence interval for the estimate of a characteristic if we can state that the exact value of the estimated characteristic is within the confidence interval with a specified probability This probability expressed in percent is called the con fidence level In QNAP2 confidence intervals are produced with a confidence level of 95 The confidence intervals produced are themselves estimates because the computation of exact confidence intervals would require an a priori knowledge of the estimated characteristics QNAP2 includes three methods for confidence interval estimation 1 the replication method 2 the regeneration method 3 the spectral method These methods rely on various assumptions described in the following three sub sections and have different characteristics in term of computational complexity and memory requirement The selection
212. erators apply only to boolean operands and yield boolean results An expression concerning a given object type should contain only variables of that type including references However an integer expression may include real variables and conversely Example Note DECLARE REAL 0 INTEGER I BOOLEAN BL EXEC BEGIN C 1 0 X A B C X B X A B C I BL NOT A B OR C gt D X IF A gt B THEN B ELSE A A 3 4 A 3 4 END amp amp A B C A B C A B C I NOT A lt B OR C gt D the result is B or A yields 0 yields 0 75 A gt B AND gt D is incorrect since it will be interpreted as A gt AND C gt D and AND C is meaningless The correct form is A gt B AND C gt B 2 4 22 Constants Syntax constant boolean_cst Semantics integer_cst real cst boolean cst string cst WIL TRUE FALSE The NIL constant is the value of an empty reference of any type i e referencing nothing User s Guide Algorithmic Language 41 42 2 4 3 Variables Syntax variable single variable dimensioned variable single variable simple_expression single variable id dimensioned variable subscript dimenstoned variable simple_expression dimensioned_variable_id single_variable_id identifier dimenstoned_variableid identifier subscript expression Semant
213. erted into lines which already have an INSERT or a BREAK statement REMOVE Enables removal of the code inserted on the specified lines with INSERT SHINSERT Prints out a list of lines into which INSERT blocks have been placed STP Allows simulation to be traced step by step In the case where a customer is transited from one station to another STP will show the statements of the following customer whose service has been compiled with the debugging option User s Guide The Qnap2 debugger 257 8 3 Example This section illustrates the functions described above The facilities specific to the debugger are presented as are the predefined mechanisms of QNAP2 such as the save functions and library restoration We will also see hows events are telated to each other We have used the file audition facilities to enable requests submitted to the debugger to be shown here 8 3 1 Model declaration SIMULOG QNAP2 01 04 95 V9 2 C COPYRIGHT BY CII HONEYWELL BULL AND INRIA 1986 1 CONTROL OPTION DEBUG amp Compilation under debugger 2 3 DECLARE QUEUE A B 4 INTEGER I amp number of customers on station A 5 FILE F1 amp auditor file 6 7 STATION NAME A 8 SERVICE BEGIN 9 EXP 3 0 10 I I 1 11 END 12 TRANSIT B 13 INIT 3 14 15 STATION NAME B 16 SERVICE BEGIN 17 EXP 2 0 18 1 1 19 END 20 TRANSIT A 21 22 CONTROL TMAX 20 0 23 24 EXEC BEGIN 25 FILASSIGN F1 session lis
214. esenting the request is then created and sent to the semaphore queue The request is posted with the specified class and priority_level If these parameters are omitted the request is posted with the class and priority level of the requesting customer A blocked customer requesting a pass grant is freed if a pass grant becomes available or if a FREE procedure is executed on this customer Note single customer may be forced to ask for several grants on different or on the same semaphore Preemption is meaningless in the case of a semaphore a semaphore gives only pass grants 4 11 3 procedure Syntax V queue User s Guide Modeling Mechanisms 137 Semantics The V procedure produces a pass grant for the semaphore queue If the semaphore counter is null or positive the semaphore counter is simply incremented by 1 the grant may be used later If the semaphore counter is negative meaning that some customers are waiting the request at the head of the queue is cancelled and the customer that posted this request receives the pass grant and thus may proceed with its service if it is not waiting for other reasons Note A customer may perform a V procedure on a semaphore even if it never performed a P procedure on this semaphore this is not true in the case of P and V procedures on resources Example Finite capacity queue DECLARE QUEUE 5 STATION STATION STATION STATION N
215. evaluated The following phases are defined compile time compile time corresponds to the compilation of QNAP2 commands A compile time phase terminates when the statement associated with the first encountered EXEC command has been compiled execution time execution time follows compile time It corresponds to the execution of the statement associated with the last compiled EXEC command initiation time initiation time starts when a resolution procedure is called during execution time During initiation time the called solver performs various operations in order to retrieve and check the data necessary for the analysis For example the expressions appearing in the right hand side of the TRANSIT parameters of a STATION command are evaluated only once at initiation time Control Statements Qnap2 V 9 2 solution time solution time corresponds to the analysis of the model by the requested solver For example the expressions appearing in the right hand side of the parameters SERVICE of a STATION command are evaluated at solution time The phase during which the expressions appearing in the parameters of the commands of a QNAP2 program are evaluated is specified in the next sections The details of the operations performed during initiation time and solution time are given in Chapter 5 3 1 3 Syntactic conventions Syntax integer real queue class file exception timer integer sublist real sublist queue sublist class
216. evel of a customer is modified the priority level of the requests it may have posted on semaphores or resources is not modified this also applies for the priority level of the descendant customers it may have created function call NEW CUSTOMER 4 6 3 TRANSIT procedure The TRANSIT procedure forces the priority level of a customer entering a station If this mechanism is used the PRIOR parameter of the station is not considered for the customer Example DECLARE QUEUE A B CLASS X Y INTEGER PR STATION NAME TRANSIT B SERVICE X BEGIN CST 1 TRANSIT B 3 END SERVICE Y CST 2 STATION NAME B PRIOR X 1 PRIOR Y 2 In station class customers coming from station have a priority level of 3 and class customers have 2 determined by the PRIOR parameter of the station The class X customers not coming from A have a priority level equal to 1 4 6 4 BEFCUST and AFTCUST procedures The BEFCUST and AFTCUST procedures may force the priority level of a customer entering a station if the priority parameter is present in the parameter list of the procedure If the User s Guide Modeling Mechanisms 129 destination queue has a priority scheduling discipline an error occurs if the specified priority level conflicts with the specified placement 130 Customer Priority Level Qnap2 V 9 2 4 7 Customer Creation A customer may dynamically create other customers during a service by means o
217. explicitly specified at transition time using the TRANSIT parameter Forced transitions using the TRANSIT procedure of the current customer from a source station are not allowed The queue associated with a source station may not receive customers from other stations In fact it contains only the next customer to be emitted DECLARE QUEUE B CLASS X Y amp STATION NAME 5 TYPE SOURCE TRANSIT B X SERVICE CST 20 5 A customer is created every 20 time units and is sent to station with class Station Qnap2 V 9 2 4 4 Service The service of a customer in station starts as soon a server is allocated to this customer The service performed is defined by the SERVICE parameter of the station It is made up of work demands and or of object manipulation operations described by means of QNAP2 language procedures and QNAP2 algorithmic language 4 4 1 Work demands The work demand procedures specify the amount of work requested by a customer in the station This amount of work may be a constant value procedure CST or a random value having a given distribution procedures EXP HEXP ERLANG The work demand implies a service time which may depend on the server instantaneous service rate as specified by the RATE parameter of the station The work demands and the service rate must be expressed with coherent units so that a unique time unit may be determined for the network For example e ina CPU st
218. f the NEW function with the CUSTOMER argument NEW CUSTOMER creates an object of type CUS TOMER and returns a reference to this object A newly created customer is initialized with the class and the priority level of its father but this customer is not sent to a queue CQUEUE attribute NIL it must be sent explicitly using the TRANSIT procedure FATHER attribute of customer points to the customer that created it the value of this attribute is NIL for a customer created by a source station or at initiation time by the INIT parameter of the STATION command e The SON attribute of the current customer points to the last created descendant e The SONNB function returns the number of sons created by a customer e The REFSON function returns a reference to the n alive son Example DECLARE QUEUE A B CLASS X Y REF CUSTOMER C STATION NAME SERVICE BEGIN CST 1 amp descendant creation amp with C CLASS X amp and C PRIOR 3 PRIOR 3 C NEW CUSTOMER amp is sent to B amp with class Y TRANSIT END User s Guide Modeling Mechanisms 131 4 8 JOIN and JOINC procedures Syntax JOIN n customertist JOINC customer n customer list Semantics JOIN procedure causes the current customer to wait until some of its sons have been destroyed i e transited to OUT or destroyed by a SPLIT or FISSION mechanism e If there is no parameter the j
219. f the events has been generalized It is no more limited to a standard trace message user function can be invoked on a simulation event The function is executed just after the event has occured To define a trace function a user must be able to access all the information edited by the standard trace set of new standard functions has been created to provide a reference on the entities involved in the simulation event such as the concerned QUEUE the current FLAG or the number of customers involved in the event The standard message can be mimicked by using these functions user may be interested only in specific events occurring on specific entities The gener alized trace has selective features called selective tracing facilities Different events may be associated to different user treatments including a standard edition or ignored If an event involves for instance a queue connected to a trace function and a customer connected to another trace function two user trace functions are connected to the same event but only one is performed A standard priority management has been defined but the user can specify another one to choose between several possible handling functions Some complex mechanisms can be represented easily by using the generalized trace For example e In a computer network when a node buffer is full the data transmission must be stopped until the buffer has been emptied out In a railway stat
220. flag in the list WHICHPROVOKE returns 1 if the event was caused by a customer 2 if is was caused by an exception and 3 when it was caused by a timer User s Guide Trace Facilities 271 272 EXCEPTPROVOKE returns a reference to the EXCEPTION object when the event is re lated to an exception TIMERPROVOKE returns a reference to the TIMER object that caused the event TIMERSUBJECT returns a reference to the timer that underwent the event NUMBER returns an integer argument related to the event e g number of sons involved in a JOIN n 9 3 5 Example SIMULOG QNAP2 01 04 95 V 9 2 C COPYRIGHT BY CII HONEYWELL BULL AND INRIA 1986 1 DECLARE QUEUE SRC ROBOT1 ROBOT2 TOOL 2 CLASS LARGE SMALL 3 4 STATION NAME SRC 5 TYPE SOURCE 6 SERVICE CST 1 7 TRANSIT ROBOT1 SMALL 0 6 ROBOT2 LARGE 0 4 8 9 STATION NAME ROBOT1 10 SERVICE BEGIN 11 P TOOL 12 EXP 1 5 13 TOOL 14 END 15 TRANSIT OUT 16 17 STATION NAME ROBOT2 18 SERVICE BEGIN 19 TOOL 20 EXP 2 0 21 TOOL 22 23 TRANSIT OUT 24 25 STATION NAME TOOL 26 TYPE RESOURCE 27 28 DECLARE 29 30 STRING STATMESS 0 2 passed blocked rejected 31 32 PROCEDURE RESUSE amp Trace resource usage 33 BOOLEAN REQUEST 34 BEGIN 35 REQUEST GETTRACE EVCODE GETTRACE CODENAME 36 PRINT TIME Generalized Trace Qnap2 V 9 2 37 38
221. ge 51 2 5 6 WHILE statement Syntax while_statement WHILE expression DO statement Semantics Execution of a WHILE statement causes the repeated execution of the statement following the DO clause while the boolean expression remains TRUE The boolean expression is evaluated before each execution of the statement If the expression is initially FALSE the statement is not executed Example DECLARE INTEGER N REAL 5 52 BOOLEAN BL TRUE EXEC BEGIN WHILE N lt 8 DO BEGIN N N 1 S S X 52 52 X X END WHILE BL DO BEGIN N N 1 BL FALSE END END 2 5 7 FOR statement Syntax for statement FOR single_variable list DO statement Semantics Execution of a FOR statement causes the repeated execution of the statement following the DO clause according to the values of a control variable The values of the control variable may be specified by means of a list of expressions of the same type All the list features are allowed for assigning the control value 1 STEP UNTIL clause REPEAT clause WITH clause etc The list of expressions is evaluated when entering the FOR loop and is not reevaluated at each execution of the loop If the control variable is indexed or prefixed then the index and prefix are also evaluated only once when entering the FOR statement Example DECLARE INTEGER I N REAL X L 100 52 Statements Qnap2 V 9 2 QUEUE REF QUEUE 0
222. ginal_parameter class_parameter accuracy parameter estim parameter alias parameter istart parameter tmax_parameter period_parameter test_parameter random_parameter trace_parameter entry parameter exit_parameter correlation_parameter convergence_parameter statistics_parameter The CONTROL command alters the internal control parameters of QnAP2 compilation and solution phases This command must only be used to change the default values of these control parameters The control parameters are grouped as follows input output controls OPTION printing control UNIT input output units assignment e resolution controls CLASS MARGINAL ENTRY EXIT CONVERGENCE statistics for each customer class marginal probabilities initialization sequence exit sequence numerical convergence control e simulation controls CONTROL Command Qnap2 V 9 2 TSTART TMAX PERIOD RANDOM TRACE ACCURACY ESTIMATION estimation method STATISTICS TEST CORRELATION e miscellaneous starting time of measurements during a simulation run maximum duration of the simulation test period random number generator seed event trace list of queues and classes with confidence intervals selection of the confidence intervals selection of partial or global results test sequence test of measurements independence maximum number of classes ALIAS definition of alias names 3 8
223. guage 99 100 This generator is reinitialized at the beginning of each execution time phase command The reinitialization value may be changed by the parameter RANDOM The default value of RANDOM is 413 The value of RANDOM may be an integer constant or an integer expression The integer expression is evaluated at execution time Note that the generator is not reinitialized at initiation time As a consequence if several simulation runs are launched within one EXEC command a single random stream is used throuhout the different runs so that the random stream for the second run starts where the stream for the first run ended and so on Example DECLARE QUEUE A B INTEGER I CONTROL TMAX 10 amp 3 simulations are run with independent amp random streams EXEC FOR I 1 STEP 1 UNTIL 3 DO SIMUL amp 2 simulations are run with identical amp random streams EXEC SIMUL EXEC SIMUL amp 1 simulation run with a new random amp stream CONTROL RANDOM 337 EXEC SIMUL 3 8 10 ACCURACY parameter Syntax accuracy parameter ACCURACY queue sublist class_sublist Note This parameter is provided for compatibility with previous QNAP2 releases and might be removed in the future When using the discrete event simulator the SETSTAT ACCURACY procedure should be used to specify the required confidence intervals Refer to section 5 5 Simulation results for details Sem
224. h is an integer representing the maximum number of characters in the string This message is printed if the number of characters declared for the string is less than 0 or greater than 256 The user has to check the syntax of strings declaration and the integer value given for their length gt ERROR DECLARE INCORRECT SYNTAX The QNAP2 algorithmic language syntax is not respected For example IF with out THEN or without 95 The user has to correct the line where the error occurred according to the algo rithmic language syntax gt ERROR DECLARE THIS TYPE IS UNKNOWN To declare an object instance the object type identifier is specified before the name of the instance If an unknown identifier is detected at the begining of a declaration sentence the current message is printed The user has to check the concerned identifier syntax Example 1 DECLARE foo bar 060303 gt ERROR DECLARE THIS IS UNKNOWN foo 2 3 END STOP QNAP2 END OF EXECUTION gt ERROR DECLARE THIS VARIABLE CANNOT BE INITIALIZED This error appears in a DECLARE block when a variable declared as an object attribute or a protected variable is initialized Errors and Warnings 297 The user has to modify the declaration Example 1 DECLARE OBJECT foo 2 INTEGER I 4 060306 gt ERROR DECLARE THIS VARIABLE CANNOT BE INITIALIZED 3 END 060302 gt ERROR DECLARE INCORRECT SYNTAX 4
225. he GLOBAL option is used default option then during a simulation run a call to the OUTPUT procedure or to a result access function will produce the statistical results collected between the measurement starting time and the last regeneration point i e last call to the procedure SAMPLE or SETSTAT SAMPLE 229 User s Guide Solvers After the end of a simulation run a call to the OUTPUT procedure or to a result access function will produce the statistical results collected during the complete simulation run i e between the measurement starting time and the end of the simulation The figure below illustrates the partial and global results concepts Tesponse time TSTART i SAMPLE 1SAMPLE 1 1 QUON PARTIAL GLOBAL 5 5 2 Statistics specification The default statistics specifications are the following e Basic statistics mean min max variance are computed for all queues on all standard performance indicators number of customers service time response time blocked time occupation rate e No queue statistics are computed per class e No statistics are computed for watched variables Note Using any SETSTAT keyword procedure suppresses the default specifications In this case only the requested statistics are computed Two methods are provided to specify additional statistics or to suppress unneeded ones SETSTAT keyword procedures and CONTROL parameters 5 5 2 1 CONTROL parameters
226. he letter U in order to avoid conflicts with QNAP2 commons User s Guide Interface with Fortran 247 248 7 3 Communication routines Syntax QLOADI IRTAB1 IRTAB2 101 102 IF1 IF2 IERR QLOADR IRTAB1 IRTAB2 101 142 RTAB IF2 IERR QLOADB IRTAB1 IRTAB2 101 IQ2 LTAB IF1 IF2 IERR QLOADS IRTAB1 IRTAB2 101 IQ2 CTAB IF1 IF2 IERR QSTORI ITAB IF2 IRTAB1 IRTAB2 101 102 IERR QSTORR RTAB IF2 IRTAB1 IRTAB2 101 102 IERR QSTORB LTAB IF2 IRTAB1 IRTAB2 101 IQ2 IERR QSTORS CTAB IF2 IRTAB1 IRTAB2 101 02 IERR Semantics These subroutines are provided for communication between the model and the Fortran subroutine All communication is performed between the two QNAP2 arrays passed to UTILITY and user defined Fortran arrays QLOADI is used to load an integer Fortran array with integer values stored in a QNAP2 array The arguments are the following 1 2 is used to specify which UTILITY array argument should be used 01 resp 102 is used to indicate the index of the first resp last element to read from the QNAP2 array ITAB is a user defined Fortran INTEGER array used to store the values IF1 resp IF2 is used to indicate the index of the first resp last element to store the data in the Fortran array IERR is a status code returned by QLOADI 0 means everything is
227. he server previously allocated to the customer n i e the customer which has the lower priority Example DECLARE QUEUE A STATION NAME A TYPE MULTIPLE 3 SCHED PRIOR PREEMPT 6 0 90 9 600 B arrival order customer holds a server If a customer 7 arrives having a priority level of 2 the queue becomes 6 4 9 M 2 Q Customer 7 preempts the server from customer 3 4 5 3 Station with quantum allocation In a single server station using a quantum allocation scheduling algorithm SCHED QUAN TUM the server is always allocated to the first customer in the queue When this customer has worked for a period equal to the quantum it is forced to the end of the queue and the server is allocated to the next customer in line User s Guide Modeling Mechanisms In the case of a multiple server station this mechanism applies for the first customers Note e the quantum includes only real work i e a customer that is blocked by other requests and therefore is receiving no service from the server stops the quantum decounting mechanism the quantum value may be different for each customer class refer to the QUANTUM parameter station may not use the QUANTUM scheduling together with the PREEMPT or PRIORITY scheduling Example DECLARE QUEUE A B CLASS X Y STATION NAME INIT X 2 INIT Y 1 SCHED QUANTUM 2 SERVICE X CST
228. hen it is a partner of the event 9 3 3 1 Symbolic event names e AFTCUST BEFCUST BLOCK UNBLOCK MOVE TRANSIT P V PMULT VMULT PRIOR RESET SET WAIT WAITAND WAITOR see the corresponding procedures FISSION FUSION MATCH SPLIT see the corresponding parameters of the STATION command e JOINALL JOIN on all sons JOINEND end JOIN e JOINLIST JOIN on an explicit list of sons JOINNB JOIN on a specific number of sons e ENDSERV end of service and departure of the customer This is the normal completion of the SERVICE algorithmic code The customer leaves the queue through the TRANSIT parameter of the STATION command not through the TRANSIT procedure ENDSTART end of the statistics starting period TSTART parameter of the CON TROL command e FREE FREE customer with no other argument e FREEFLAG FREE customer flag e FREEP FREE customer queue free from a blocking semaphore request e INIT initial customer creation INIT parameter of the STATION command e NEWCUST dynamic customer creation with the NEW function e SOURCE customer creation in SOURCE station through the regular source mecha nism SERV TIME begin of a work demand procedure delay TMRCANCL see SETTIMER CANCEL TMRSETTM TIMER wake up time setting TMRWAKUP TIMER wake up expiration The symbolic name ALLEV refers to all events User s Guide Trace Facilities 269 270 9 3 3 2 Defaul
229. iables of the same type may be declared Identifiers may be declared in any order Nevertheless attributes associated with a given object type must be declared before the first object of this type is created cf Data item management e g QUEUE attributes must be declared before the first queue declaration 2 3 2 Variable and array declarations Syntax variable_declaration type identifier dim init type INTEGER REAL BOOLEAN STRING max length REF object_type id object type id actual_parameter list object_type_id identifier dim bound bound bound integer cst single variable id single_variable_id identifier init sublist size integer cst single variable id actual parameter list sublist Semantics string declaration may specify the maximum length of the character string which may be given as an integer constant or an initialized integer variable The maximum length must lie betwen 1 and 256 The default maximum string length is 80 characters An object declaration may include all or part of actual parameters used to initialize the object attributes see next section for object type declarations Sublist syntax is explained in section 2 4 5 An array declaration specifies the number of dimensions and the size of the array together with an identifier A dimension is specified either by an unsigned integer n specifying the nu
230. ibution times probabilistic transitions The behaviour of the simulated model is automatically monitored during the simulation run in order to produce statistical estimations of performance criteria Two types of statistical results can be computed Queue statistics are computed on performance criteria directly related to queues service time response time blocked time utilization rate number of customers throughput User statistics are computed on user defined variables called watched variables The simula tor tracks the watched variables whenever they are modified by the algorithmic code The simulator can be used to analyze steady state as well as transient state behaviour Global statistics are computed over the entire simulation run except time intervals where the statistics are disabled in order to eliminate unwanted samples These statistics are computed under the assumptions that the model would reach a steady state if the simulation were run during an infinite period of time Therefore the interpre tation of the results of a simulation run should be carried out with respect to this basic assumption The longer the simulation run the better the statistical estimations In order to check the accuracy of the results of a simulation run QNAP2 provides facilities for computing and editing the confidence intervals of the statistical estimations Partial statistics are computed over specific time periods These stati
231. ics A variable as part of an expression may be e prefixed with an expression having the type of the object in the case of an object attribute e indexed in the case of an array Subscripts in a dimensioned variable must have values within the ranges defined at decla ration time reals are converted to integers according to the truncation rules Subscript range checking is made systematically at execution time Each object attribute may be referenced by prefixing the attribute identifier by the identifier of the object or by a reference to it This prefix may in turn be an indexed or a prefixed variable Prefixes are evaluated from left to right In the instructions describing the service performed in a station see Chapter 3 STATION command SERVICE parameter the prefix may be omitted for queue class or customer at tributes or attributes of objects whose type references these types Non prefixed queue or customer attributes are considered as refering to the current queue to the current class or to the current customer i e the customer being served dimensioned variable without subscripts is used to refer to the whole array Example DECLARE REAL X LU 10 INTEGER I CODE 5 STRING MESSAGE 30 5 CUSTOMER REAL TIMEIN QUEUE REAL SIGMA QUEUE CPU DISK REF CUSTOMER LC 5 EXEC BEGIN 5 CODE 1 2 3 4 5 amp indexed variables X LU 2 I CODE 1 4 MESSAGE CODE I 2 Expressions
232. ide Trace Facilities 263 9 1 Trace control Syntax SETTRACE ON SETTRACE OFF SETTRACE BOUNDS start end SETTRACE WIDTH 80 132 SETTRACE BRIEF SETTRACE LONG Semantics ON and OFF are used to enable and disable tracing immediately They can be used in any algorithmic code sequence BOUNDS is used to enable tracing within a given time period The two parameters represent the starting and ending times of the event trace WIDTH controls the width of the standard trace listing Only 80 and 132 are allowed corre sponding to two different presentation formats BRIEF is used to select only the event trace messages default option LONG adds the line number of the source code corresponding to each traced event The following parameters of the CONTROL command can also be used to control the trace Refer to section 3 8 CONTROL Command for details TRACE start end width BRIEF LONG OPTION N TRACE UNIT TRACE file 264 Trace control Qnap2 V 9 2 9 2 Standard Trace The standard event trace contains the following events together with their date of occurence e initialization of customers e work demands and operations performed by customers in the servers e transitions of customers expiration of timers The trace information is presented in a column form The column contents are the following col 1 customer identification col 2 queue containing the customer col 3 c
233. ify that the forced placement does not conflict with the queueing discipline conflict causes a simulation error Customer Forced Transition Qnap2 V 9 2 4 10 Customer split and match Syntax SPLIT class_list queue class count prob MATCH queue class list class count result_class PRIOR integer queue class list class count result_class WEIGHT real FISSION class list 1 queue class count prob FUSION class count result_class PRIOR integer class count result_class WEIGHT real Semantics Customers can be split and joined up via the following mechanisms SPLIT a single customer is broken up into any number of customers The resulting pieces can belong to various classes The origin of the pieces is kept for later join up with MATCH MATCH several customers representing pieces resulting from a previous SPLIT are joined up to form a single customer FISSION same as SPLIT except that the origin of the pieces is not remembered FUSION several customers are joined up to form a single customer The origin of the joined customer is ignored Note 1 MATCH must be used in conjonction with SPLIT FISSION and FUSION may be used without restriction 2 All these
234. in a station is a continuous variable the mean value makes sense only if we take into account the duration of the samples as show on the figure below e variable is said to be discrete when the computed statistics do not take time into account The response time of a queue is an example of discrete variable the samples occur at specific instants but the time spent between two samples is meaningless as illustrated below response time QNAP2 can compute the same statistics on watched variables as on queue results The statistics requests follow the same rules 5 5 1 3 Statistics control Syntax SETSTAT ON OFF stat_var_list CONTROL TSTART time Semantics All statistics can be individually controlled through the ON OFF mechanism The ON resp OFF keyword is used to turn on resp off statistics computation for stat_var_list which stands for a list of observable objects e queues e queue class couples e watched variables The TSTART parameter of the CONTROL command provides a global statistics control mechanism the statistics computation of all variables starts at time and stops at the end of 228 Simulation results Qnap2 V 9 2 the simulation TSTART is used primarily to suppress the startup period of the model i e to start statistics only when the model has reached the steady state The default value of the TSTART parameter is 0 Note The ON OFF mechanism overrides the TSTART parame
235. ing Mechanisms 115 mme LAST FIRST customer being served 116 Queue Organization Qnap2 V 9 2 4 3 Station 4 3 1 Single server station A server may be regarded as a processor performing a service for customers service is comprised of work demands and or object manipulation operations which are described in the SERVICE parameter of the station At service completion time the customer leaves the station and is forwarded to another station according to the probabilistic routing rules defined in the TRANSIT parameter The server then takes the next customer waiting if any If no customer is waiting the server becomes idle A customer leaves a station only at service completion time unless its transition is forced by a TRANSIT or MOVE procedure A server can handle only one customer at a time The service of one customer may be interrupted and resumed later if the scheduling algorithm of the server has been chosen with preemption with quantum or processor sharing Example DECLARE QUEUE A B STATION NAME TRANSIT B SERVICE CST 10 A B 4 3 2 Multiple server station The station includes several identical servers associated with the same queue Several customers can therefore be served at the same time but a given customer is handled by only one server at a time The servers are equivalent thus when a customer requires a service a selection of a server is made from the set of idle servers The nu
236. ion the number of opened ticket offices depends on the size of the waiting queue If the queue is short some ticket offices are closed Conversely if the queue gets too long some ticket offices open These examples can be generalized to the management of minimum and maximum levels for resource allocation In these two examples the generalized tracing facility can be used to catch critical events and process them appropriately The generalized trace can also be used for tailored applications such as animating a model The generalized tracing facilities are descibed in chapter 9 Tracing facilities 2 2 Generalized statistics Simulation results are statistics on all the queues defined in the model Statistics are computed on the service time the response time the blocking time the utilization rate and the number of customers The queue statistics have been generalized in several ways e Basic queue statistics are not restricted to the mean value The minimum maximum and variance are also computed automatically Marginal probabilities are not restricted to the number of customers Auto correlation coefficients can be computed on any result when the regeneration method is used to compute confidence intervals To improve simulation time memory occupation and standard report understanding statis tics can be restricted to a subset of queue and or results The selective statistics provide the user with facilities t
237. ion must be lower than the sum of station capacities 2 If the network is mixed the previous statement applies to any closed sub chain 172 Analytical Solvers Qnap2 V 9 2 service Each service has to be limited to a single work demand with either an exponential distribution identical for all the customer classes if the scheduling is FIFO or FEFS EXCLUDE e general distribution which may be distinct for each customer class if the scheduling is PS or LIFO PREEMPT or if the station is an infinite server station TYPE INFINITE In fact one can prove that for the stations accepting general service time distributions only the mean of the service distribution is significant All the available distributions lead to the same results if they have the same mean value A service must be limited to a single work demand procedure and may not include any other operation Moreover the mean service time may not be null The work demands may not depend on the network state No synchronization procedure P V WAIT may be used transition rules The transition performed at service completion time may be class dependent The class of a customer may be modified during a transition e Transition probabilities may not depend on the state of the network e A transition probability may be null no transition to the corresponding station service rate The service rate may be different for each customer class It has to be a con
238. ips to next line after reading thus ignoring the rest of the line GET is used to read one data item at a time The optional file is used to specify where to get the data The default is the predefined file FSYSGET type_id specifies the type of the data item INTEGER REAL BOOLEAN STRING or a previously declared object type The optional length argument is the number of characters to read It should be used only to read unquoted strings as all other data items are naturally delimited and the input format is normally free Example DECLARE INTEGER ITEMS 3 INTEGER I COUNT ITEMS STRING TITLE IDENT ITEMS EXEC BEGIN TITLE GET STRING FOR I 1 STEP 1 UNTIL ITEMS DO BEGIN IDENT I GET STRING 8 COUNT I GETLN INTEGER END END The first GET reads a quoted string The GET calls read 8 character strings The GETLN calls read free format integers and skip to the next line The data file should look like Data for Bristol Factory Design 1 PABCO1XY 1000 PABCO1XZ 1250 012 1570 2 6 1 2 Output procedures Syntax PRINT WRITE WRITELN file data item format 1 56 Input output facilities Qnap2 V 9 2 Semantics PRINT WRITE and WRITELN work in a very similar way The main differences are the following The default format used by PRINT is a fixed length format for all data types except strings whereas WRITE and WRITELN use a variable length format
239. ists in generating several sample path of the model studied so that these sample path are statistically independent and identical This is achieved by reseting the original initial state of the model at the beginning of each replication and by using a different random number stream for each replication In practice a single random number stream is used throughout the whole simulation run so that the random stream for the second replication begins where the stream for the first replication ended and so on This guarantees independent random number streams The value of the parameter ESTIMATION for the regeneration method is REPLICATION The number of replications is given by the argument of the keyword REPLICATION This argument is mandatory Example DECLARE QUEUE SOURCE SYST STATION NAME SOURCE TYPE SOURCE TRANSIT SYST SERVICE EXP 1 STATION NAME SYST TRANSIT OUT SERVICE HEXP 0 7 5 CONTROL TMAX 1500 ACCURACY SYST ESTIM REPLICATION 10 EXEC SIMUL User s Guide Solvers 209 210 SIMULATION WITH REPLICATION METHOD MEAN SIMULATION TIME 1500 000 NUMBER OF REPLICATIONS 10 CONFIDENCE LEVEL 0 95 sk ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok oK 2k 2k ok ok ok NAME SERVICE BUSY CUST NB RESPONSE SERV NB sk ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok
240. it by means of a two different mechanims e When the STOP procedure is explicitely called e When a requested accuracy has been obtained 5 4 4 1 Explicit stop The STOP procedure can be called in any algorithmic code sequence during simulation By this means one can stop a simulation run as soon as a given condition is met in the model Example DECLARE QUEUE A STATION NAME A SERVICE BEGIN EXP 23 5 IF A NBOUT gt 500 THEN STOP END CONTROL TMAX 1 4 In this case the simulation stops either after 10000 time units or as soon as A has performed more than 500 services The NBOUT attribute counts the number of customers having left the station since the start of simulation The STOP procedure ends the simulation in a clean way the statistical results are com puted and displayed normally The statements following the SIMUL procedure are executed normally In order to stop a model and exit from QNAP2 use the ABORT procedure 5 4 4 2 Accuracy control QNAP2 can compute confidence intervals on mean values A confidence interval is an indication on the quality of the estimation of the mean from a finite set of samples A small confidence interval indicates that the simulation was long enough to reach a steady state and provide reliable statistics Confidence intervals can be computed on queue statistics as well as user statististics In order to spare computer time the user can request to stop the simulation a
241. joe QNSLAVO 40004 40003 0x04 c william QNSLAVO c0001 40003 0x04 c jack QNSLAVO 100001 40003 0x04 c pvm gt The QNAP2 master has the number 40003 and the slaves the numbers 40004 0001 100001 You can then stop once the replications have been done pvm gt halt libpvm t40005 mxfer EOF on pvmd sock john joe You can also exit by quit In this case PVM will continue to run as a background task Here is a simple example of the resulting file You will observe that the 3 stations used joe william and jack have not simulated the same number of replications because joe was faster than william itself faster than jack SIMULOG QNAP2 01 04 95 V 9 2 C COPYRIGHT BY CII HONEYWELL BULL AND INRIA 1986 1 DECLARE QUEUE SOURCE SYST 2 3 STATION NAME SOURCE User s Guide Solvers 221 4 SOURCE 5 TRANSIT SYST 6 SERVICE EXP 1 7 8 STATION NAME SYST 9 TRANSIT OUT 10 SERVICE HEXP 0 7 5 11 12 CONTROL TMAX 150 13 ACCURACY SYST 14 ESTIMATION REPLICATION 20 15 OPTION SIMPAR 16 17 EXEC SIMUL SIMULATION WITH REPLICATION METHOD x HEAN SIMULATION TIME 150 000 NUMBER OF REPLICATIONS 20 CONFIDENCE LEVEL 0 95 Sk ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok SK 2fe 20272127272 ok ok ok ok oe oe NAME SERVICE BUSY PCT CUST NB
242. l is saved The user is then presented the system state and prompted for a decision Then the simulation goes on Example amp First simulation model STATION NAME SERVICE BEGIN IF NB gt 10 THEN BEGIN PRINT WARNING Too many customers SAVERUN TOOMANY END END END amp Second simulation model EXEC RESTORE TOOMANY DEFERRED REBOOT BEGIN amp REBOOT must follow immediately the RESTORE PRINT Simulation stopped at TIME HALT amp call the interactive debugger END User s Guide Control Language 37 STATION Command 3 7 1 Overview Syntax station command STATION name_parameter station_parameter station_parameter type_parameter copy parameter service_parameter sched_parameter init_parameter prior_parameter Tate_parameter quantum_parameter transition_parameter split_parameter match_parameter fission_parameter fusion_parameter Semantics The function of the STATION command is to describe one or several stations of the model It may be used for the initial definition of a list of stations as well as for the subsequent alterations of their characteristics The parameters of the STATION command are NAME queue identifiers TYPE station type SCHED customer scheduling INIT initial state of the queue SERVICE service description TRANSIT customer transitions SPLIT splitting and transition of customers
243. l procedure called depends on the value of the reference when the traced event occurs A user defined tracing procedure may contain any algorithmic code except simulation op erations a tracing procedure may not cause traceable events Predefined procedures are available to output the standard trace messages Predefined functions are available to obtain information about the event that triggered the procedure and the related parameters Specification of tracing actions is performed through SETTRACE keyword procedures In formation about the traced event is obtained via GETTRACE keyword functions 9 3 2 Basic concepts The following objects can be used to select the traced events 1 Queues A trace specification for a queue is considered as a default trace specification for all classes 2 Customer classes 3 Customers 4 Flags 5 Timers When an event occurs during simulation the actual tracing action performed is selected from the user specifications or from the default specifications It is clear that several tracing actions can be candidates for the same event For example when a customer in queue A forces a customer in queue B to WAIT on flag F several actions are candidates those specified with queue A with queue B with WAIT events and with flag F The selection rules are based on three levels 1 Object role causing the event undergoing the event or partner of the event 2 Priority of the tracing actions as specified
244. lass of the customer col 4 priority of the customer col 5 number of customers in the queue col 6 operation performed by the customer At each time modification the TIME value is printed Each traced event is preceded by the character gt in the first column With the LONG option the line number of the source code corresponding to each traced event is printed on a separate line Example SIMULOG QNAP2 01 04 95 V 9 2 C COPYRIGHT BY CII HONEYWELL BULL AND INRIA 1986 1 DECLARE QUEUE A B C R 2 INTEGER N 3 CLASS X Y 4 5 STATION NAME 6 SCHED PRIOR PREEMPT 7 INIT 8 PRIOR X 1 9 PRIOR Y 2 10 TRANSIT B 1 C 2 11 SERVICE EXP 1 12 13 STATION NAME R 14 TYPE RESOURCE 15 16 STATION NAME 17 TRANSIT 18 SERVICE BEGIN 19 P R 20 EXP 3 21 END 22 User s Guide Trace Facilities 265 23 STATION NAME 24 COPY B 25 26 CONTROL TMAX 100 27 TRACE 0 2 28 OPTION NRESULT 29 30 EXEC BEGIN 31 N 2 32 SIMUL 33 END INITIALISATION gt 1 A X 4 INITIAL CREATION AT QUEUE 1 gt 2 X 1 4 INITIAL CREATION AT QUEUE gt 3 Y 2 4 INITIAL CREATION AT QUEUE gt 4 A Y 2 4 INITIAL CREATION AT QUEUE A CUSTOMER QUEUE CLASS PRIOR NB OPERATION TIME 0 000 gt TIMER TSYSTRAC IS JUST ACTIVATED gt 3 Y 2 4 DELAY 0 901 UNTIL 0 901 TIME 0 901 gt 3 Y 2 3 C Y 2 1 gt c Y 2 1
245. ll the classes of the network e CORRELATION NIL means that no correlation is required default value The computation of the correlation function is performed for the stations and classes spec ified by the queue sublist and class sublist expressions The elements queue class appearing in the parameter CORRELATION must also be specified in the parameter ACCURACY The maximum order of the auto correlation function may be specified by the integer expression the default value for this order is 5 The sublist and integer expressions are evaluated at initiation time The CORRELATION parameter may only be used with the regeneration method ESTIMATION REGEN 3 8 14 PERIOD parameter Syntax pertod_parameter PERIOD real Semantics The PERIOD parameter determines the activation period of the test sequence see TEST parameter This period may be determined by a constant or by an expression which is evaluated at initiation time e If PERIOD 0 is specified then the test sequence is activated at each instant corre sponding to an event during the simulation run Therefore it is possible to permanently test the model state active wait and to perform some operations if the model is in some determined states It should be noted that this mechanism is costly and therefore should only be used if expressly required e There is no default value for the parameter PERIOD If the parameter has not been defined the test sequence if any
246. lled by forcing the priority level of a customer during a transition see procedure TRANSIT P BEFCUST and AFTCUST 4 6 2 PRIOR procedure The PRIOR procedure modifies the priority level of the customer designated by the first pa rameter of the procedure argument list PRIOR f customer integer If customer is omitted the customer to which PRIOR applies is the current customer referenced by the variable CUS If the station uses priority mechanism SCHED PRIOR the customer whose priority level is modified is placed in a new position in the queue according to its new priority level if the priority level given as an argument is equal to the previous priority level of the customer the procedure is ineffective This procedure may induce a server allocation if the preemption mechanism is used The modification of the priority level may also modify the ordering of actions in a simulation run see Chapter Simulation Example DECLARE QUEUE A B CLASS 2 Customer Priority Level Qnap2 V 9 2 STATION NAME SCHED PRIOR PREEMPT PRIOR X 1 PRIOR Y 2 PRIOR Z 3 SERVICE BEGIN CST 10 PRIOR 4 CST 1 END During the first 10 time units the customer may be interrupted by an incoming customer During the last time unit of the service the customer may not be interrupted since its priority level is higher than any other customer priority level Note If the priority l
247. llows that the debugger will be the most useful in simulation or when debugging EXEC sequences This debugger was designed with the aim of minimizing the user learning curve which explains why it has been integrated into the QNAP2 algorithmic language The Debugger functions are implemented in this language through a certain number of specific procedures User s Guide The Qnap2 debugger 255 8 22 The functions of debugger This section describes the QNAP2 debugger functions and serves as a user manual We will also see how to use the QNAP2 facilities to improve tool performance 8 2 1 Available functions The Qnap2 debugger is based on conventional debugging tool functions found in such languages as C FORTRAN The following operations are possible from first break point e place or remove other break points demand the value of a variable whatever its nature e modify a variable e execute orders written in algorithmic language within quite broad limits As the Debugger command language is integrated into QNAP2 algorithmic language the demand for the value of a variable is expressed by an order such as PRINT and an executable sequence has to be in a BEGIN END block 8 2 2 Running the debugging tool This section describes how to use the QNAP2 debugger 8 2 2 1 When constructing a model It is essential that the relevant sections are compiled with the option CONTROL OPTION DEBUG This option is cancelled by CONTR
248. ly by means of the MOVE procedure The origin station should be a simple queue i e a station without server If the origin queue is empty the MOVE procedure is ineffective Example Finite capacity queue DECLARE QUEUE A B W STATION NAME TRANSIT W SERVICE EXP 2 STATION NAME B TRANSIT A SERVICE 4 16 CONTROL TEST IF CUSTNB B lt 3 THEN MOVE W B As long as station B contains more than 3 customers the customers coming from A wait in the queue W If a free place exists in B a customer of W is forwarded to B Example Combined services DECLARE QUEUE 1 B2 STATION NAME TRANSIT B SERVICE EXP 1 STATION NAME B1 TRANSIT B2 SERVICE ERLANG 2 5 2 STATION NAME B2 200 The Markovian Solver Qnap2 V 9 2 TRANSIT SERVICE A HEXP 1 4 CONTROL TEST IF CUSTNB CUSTNB B2 0 THEN MOVE B B1 As soon as both and B2 stations are empty a customer is sent from station to 1 Therefore the B1 and B2 stations contain always only one customer at a time This station is therefore equivalent to a station in which the service would be made of an Erlang demand followed by a hyper exponential demand 5 3 4 Results The Markovian solver method computes all the performance criteria chararacterizing the steady state of the model together with the marginal probabilities of each station globally or for each customer class
249. manage files e 06010D gt ERROR CONTROL ATTEMPT TO ASSIGN PRINT TO A FILE CLOSED UR OPEN IN A WRONG MODE IGNORED CONTROL UNIT type file command is used to modify the input output files This message means that the new file specified to write the user messages FSYSPRINT is closed or opened in read mode user has to modify the command or better to use procedures FILASSIGN OPEN to manage files e 06010E gt ERROR CONTROL ATTEMPT TO ASSIGN GET TO A FILE CLOSED UR OPEN IN A WRONG MODE IGNORED CONTROL UNIT type file command is used to modify the input output files This message means that the new file specified to read data FSYSGET is closed or opened in write mode user has to modify the command or better to use procedures FILASSIGN OPEN to manage files e 060201 gt ERROR DECLARE THIS IDENTIFIER HAS ALREADY BEEN DECLARED 296 Error and Warning Messages Qnap2 V 9 2 e 060202 e 060302 e 060303 e 060306 User s Guide identifier is the name of user defined variable integer real object type user procedure or a QNAP2 key word This message is printed when the user tries to declare an identifier that has already been defined The user has to check the previous declarations and the identifier spelling gt ERROR DECLARE INCORRECT STRING LENGTH A STRING variable is defined by STRING length id string where lengt
250. mber of elements in this dimension in this case the corresponding index ranges from 1 to n or by a pair of integers n na specifying the index range limits in this dimension n must be smaller than or equal to na Integer constants may be replaced by initialized integer scalar variables Declaration Statements Qnap2 V 9 2 The enumeration order of arrays is that the rightmost index varies the most rapidly Example DECLARE INTEGER 2 3 1 2 3 4 5 6 yields T 1 1 1 T 1 2 2 T 1 3 3 T 2 1 4 T 2 2 5 and T 2 3 6 Example User s Guide DECLARE INTEGER B 1 10 REAL 1 5 2 STRING D 0 10 2 0 3 INTEGER A 10 amp equivalent to amp INTEGER A 1 10 INTEGER N 5 BOOLEAN LB N 2 amp equivalent to amp BOOLEAN LB 5 2 STRING ST amp size 80 STRING 10 ST1 amp size 10 INTEGER N 10 STRING N 572 amp size 10 amp array of 3 strings with a size 120 STRING 120 ST3 3 amp attribute of customer with size 30 CUSTOMER STRING 30 ST4 Algorithmic Language 25 2 3 3 Object type and attribute declarations Syntax object_type_declaration object_type_ref OBJECT object type id formal parameter attribute declaration END object type ref identifier object type id identifier formal parameter identifier attribute declaration type id variable declaration type id identifier ad
251. mber of servers in a station may not be modified during solution time Example DECLARE QUEUE A B STATION NAME MULTIPLE 2 SERVICE CST 10 TRANSIT B A B B User s Guide Modeling Mechanisms 117 118 4 3 3 Infinite server station The customers entering an infinite server station always find an idle server Therefore they never wait the response time of such a station is equal to its service time Such a station may be regarded as a pure delay Note that a multiple server station may be equivalent to an infinite one if the number of customers in the network can never exceed the number of servers of the station for instance in the case of a closed network DECLARE QUEUE A B STATION NAME INFINITE SERVICE CST 10 3 TRANSIT B A A customer entering into station A is sent to station B after a constant delay of 10 3 time units 4 3 4 Source station A source or generator station works as an infinite source of customers The intervals between two successive customer generations are defined by the SERVICE parameter A source station may also be regarded as a simple server station which has been initialized with an infinite number of customers When a customer has completed its service in this station it is sent in the network according to the routing rules defined by the TRANSIT parameter of the SOURCE station The class of the generated customers must be
252. ment must be part of the same compound statement in a SERVICE pa rameter a TEST parameter or an EXEC command All statements may be labelled provided they are parts of a compound statement Example DECLARE LABEL LA LB LC INTEGER I EXEC BEGIN Statements Qnap2 V 9 2 IF lt 3 THEN GOTO LA ELSE GOTO LB LA I I 2 GOTO LC LB I 0 LC PRINT 1 END amp error IF gt 0 THEN GOTO 2 5 5 IF statement Syntax if statement IF expression THEN statement ELSE statement Semantics Execution of an IF statement causes the evaluation of the boolean expression following the keyword IF If the expression is TRUE execution continues with the statement in the THEN clause otherwise execution continues with the statement in the ELSE clause if present or with the statement following the IF statement itself if the ELSE clause is not present Up to 10 levels of IF statements may be nested The following statement IF expri THEN IF expr2 THEN stmti ELSE stmt2 is interpreted as IF expri THEN BEGIN IF expr2 THEN stmti ELSE stmt2 Example DECLARE CLASS BATCH INTEGER N EXEC BEGIN IF CLASS BATCH THEN BEGIN N N 1 IF N gt 20 THEN N 0 END ELSE N N 1 END In the preceding example the syntax would have been incorrect if the END had been followed by This rule is a common trap for QNAP2 beginners User s Guide Algorithmic Langua
253. message is printed if QNAP2 cannot close a file using the CLOSE procedure The reason is given in a following message The problem is often due to bad access rights to the considered file for the user gt ERROR INTER THE DATA WHICH HAS BEEN GIVEN IS NOT CORRECT TRY AGAIN LINE NUMBER The QNAP2 procedures GET and GETLN read values of specific types on a file The current message means that the data being read do not belong to the ex pected type New read operations can be performed depending on the value of the ERRRETRY file attribute The user is advised to check that the read data belong to the expected type gt ERROR INTER FILE IS NOT WELL BUILT Errors and Warnings 301 302 e 0BOCO8 e OBOEO5 e OBOFO7 e 0 0605 e OBOGOA This message is printed when an input output operation is performed on a file which has not been assigned user has to assign and open FILASSIGN and OPEN procedures the file gt ERROR INTER FORMAT WIDTH EXCEEDS BUFFER SIZE FILE The QNAP2 procedures GET and GETLN read a value on a file with a specific format The format specifies the number of characters to be read This number must be lower than the buffer size user has to modify the reading format in order to clear this error message gt ERROR INTER END OF FILE DETECTED ON FILE This message means that a reading operation is requested on a file that has been entirely read The user has to check
254. mp V9 3 325 C 1 New features of QNAP2 V9 1 327 C 2 New features of QNAP2 V9 2 321 C 3 New features of QNAP2 93 321 D Reserved Identifiers 329 E Index 333 viii Qnap2 V 9 2 Introduction Qnap2 V 9 2 1 1 Overview QNaP2 can be defined as a system for describing handling and solving queueing network models It is comprised of a specification language which is used for the description of the models under study and the control of their resolution and of several resolution modules or solvers implementing the different techniques currently available User s Guide Introduction 3 4 1 22 Language The language of QNAP2 allows the user to describe the following items The network configuration A queueing network consists of a set of stations one or several servers and one queue through which circulate customers according to given routing rules the customers may be distributed into several classes characterizing different behaviours and different processing in the stations The processing done by each station The processing done by a station may be described by a simple time duration defined by its probability distribution or by a complex algorithm which may include synchronization operations network resolution control The resolution control specifies the initializations or up dates of the parameters of the model under study
255. mple a queueing network consisting of two stations and B is described and analysed by the solver MVA with various specifications of stations and B DECLARE QUEUE A B CLASS X Y REAL T 2 TX 1 5 TY 0 5 REAL R 2 2 3 RX 2 3 4 RY 2 4 3 INTEGER N 3 STATION NAME B TYPE INFINITE User s Guide Solvers 177 TRANSIT A SERVICE CST 1 STATION NAME TRANSIT B SERVICE EXP T SOLVEC MVA STATION NAME SINGLE SCHED LIFO PREEEMPT SERVICE X CST TX SERVICE Y CST TY SOLVEC MVA STATION NAME SCHED A PS SOLVEC MVA STATION NAME A TYPE INFINITE SOLVEC MVA 5 2 7 5 Tracing facilities When the TRACE option is set only the standard intermediate results of SOLVE are produced no specific intermediate results 178 Analytical Solvers Qnap2 V 9 2 5 2 8 Mean Value Analysis Normalized Convolution Algorithm MVANCA 5 2 8 1 Overview MVA and NCA were developed in order to avoid the computation of the normalizing constants which may lead to numerical instabilities MVANCA yields exact results 5 2 8 2 Bibliography REISER Mean Value Analysis and Convolution Method for Queue Dependent Servers in Closed queuing Networks Performance Evaluation Review 1 1 Jan 1981 DRIX P Etude d algorithmes de r solution de r seaux de files d
256. ms were too rigid In the following pages you will find examples of generation of GNUPLOT files for curves and bar charts plotting GNUPLOT is a powerful chart generation and display tool which is included in the Modline product These examples are integrated to the QNAP2 examples files User s Guide Graphics and QNAP2 277 10 1 Procedure GPLOCUR This procedure is an example of GNUPLOT files generation procedure that can replace the old PLOCUR QNAP2 procedure for curves plotting Procedure code DECLARE FILE pc_datafile FILE pc_gnuplotfile PROCEDURE GPLOCUR filename nb_curves nb_points x y title legend amp Arguments STRING filename INTEGER nb_curves nb_points REAL x nb_curves nb_points y nb_curves nb_points STRING title legend nb_curves GNUPLOT file name number of curves number of points abscissae ordinates chart title legends BR BR BR BR amp amp Preconditions must be checked by the caller amp filename must be a legal file name amp nb curves gt 1 amp nb points 1 amp Local variables INTEGER icurve ipoint STRING pref datafile ext datafile name datafile BEGIN pref datafile amp data file name prefix ext_datafile dat amp data file name extension FILASSIGN pc_gnuplotfile filename OPEN pc_gnuplotfile 3 WRITELN pc_gnuplotfile set title title WRITELN pc_gnuplotfile set aut
257. n 80 columns or L132 for an output on 132 columns Example amp the trace is active during the whole simulation CONTROL TMAX 2000 TRACE 0 2000 L132 EXEC SIMUL amp the trace is active from the beginning amp and until time 500 with 132 columns CONTROL TRACE 0 500 EXEC SIMUL amp the trace starts at time 500 up to amp the end of the simulation run CONTROL TRACE 500 EXEC SIMUL amp the trace is active during the whole simulation CONTROL OPTION TRACE EXEC SIMUL 3 8 17 NMAX parameter Syntax nmas parameter NMAX integer Semantics The NMAX parameter is used to increase the maximum number of classes available in a model This parameter must be specified before the first declaration of a queue or of a class and may not be subsequently changed User s Guide Control Language 105 The default value is NMAX 20 The value of the NMAX parameter may be specified as a constant or an expression which is evaluated at compile time 3 8 18 ENTRY parameter Syntax entry_parameter ENTRY statement Semantics The ENTRY parameter describes an instruction sequence that must be executed before each analysis of the model just before the solution starts In this instruction sequence the user may initialize variables used in station descriptions or perform various printing ENTRY cancels previous definitions default value The statement associated
258. n illegal at run time when used with an improper solver they imply no a priori restriction on the resolution capabilities of QNAP2 since the SIMUL procedure will work on any legal QNAP2 model User s Guide Modeling Mechanisms 111 4 2 Queue Organization 4 2 1 Queue structure Customers belonging to the same queue are chained by pointers a pointer to the previous customer towards the beginning of the queue PREVIOUS attribute and a pointer to the next customer towards the end of the queue NEXT attribute The first customer in a queue is pointed to by the FIRST attribute of the queue For instance when a SINGLE SERVER queue is busy FIRST points to the customer which is being served The last customer in the queue is pointed to by the LAST attribute of the queue In an empty queue FIRST LAST NIL Both the pointer to the customer preced ing the first customer and the pointer to the customer following the last one are empty FIRST PREVIOUS LAST NEXT NIL customer NB customer 2 customer 1 NEXT NIL NEXT NEXT PREVIOUS PREVIOUS PREVIOUS NIL Example The following example searches in a queue for the customer having the highest value of attribute X X gt 0 The search begins with the FIRST customer DECLARE QUEUE A CUSTOMER INTEGER X REF CUSTOMER C CMAX INTEGER XMAX EXEC BEGIN MAX 0 C A FIRST WHILE C lt gt WIL DO BEGIN IF gt XMAX THEN BEGIN CMAX XMAX END
259. n is also equivalent to STATION NAME SERVICE EXP 0 25 SERVICE X EXP 0 28 Example Dependent service rate DECLARE QUEUE A REAL TAB 4 23 1 24 1 35 4 48 7 STATION NAME RATE TAB SERVICE EXP 1 The instantaneous service rate depends on the number of customers being in the station The mean work demand being one work unit the service time of one customer equals the inverse of the service rate For 1 customer the service rate is 23 1 2 customers 24 1 3 35 4 4 48 7 3 7 15 CAPACITY parameter Syntax capacity_parameter CAPACITY class_list integer 88 5 Command Qnap2 V 9 2 Semantics The CAPACITY parameter specifies the maximum number of customers allowed in the station The capacity may be different for each customer class The default capacity is infinite If a class list is specified its expression is evaluated at compile time The expression defining the capacity is evaluated at initiation time If no class list is specified the maximum capacity is a global capacity applying to all customer classes If a class specific capacity is specified as well as a global capacity the smallest capacity prevails Example STATION NAME STORAGE CAPACITY largei large2 7 CAPACITY small 100 CAPACITY 10 The STORAGE station can hold at most 10 items including no more than 7 largel and 7 Jarge2 items
260. n this expected time is known i e the process is either e a customer performing a work demand procedure or an armed timer When this is not the case the returned value is 1 0 PRSTATUS returns the status of the process as an integer code 0 spleeping i e idle timer or waiting customer 1 waiting for its wake up time 2 current process 3 customer blocked by a synchronization operation REPLINB and CURREPLI are used with the replication method REPLINB returns the number of replications CURREPLI returns the number of the current replication Simulation results Qnap2 V 9 2 Macro Processing 240 Qnap2 V 9 2 6 1 Macro statement definition Syntax macro_definition MACRO macro id param id END macro_id identifier param_ d identifier Semantics This mechanism is intended to facilitate the writing of frequently used instruction sequences This mechanism is part of the syntactic analyzer and therefore may be used to write algorithmic sequences and control language sequences A macro definition begins with a MACRO statement specifying the identifier of the macro together with a list of dummy arguments and ends with a END statement The macro identi fiers do not have to be declared The dummy arguments may be used in the body of the macro definition to represent identifiers or constants These identifiers are meaningless outside the macro statement and do not have to be declared e
261. ncluded in the estimate of the variance User s Guide Solvers 217 218 5 4 7 Parallel Replications 5 4 7 1 Presentation When the confidence intervals are computed by the replication method the replications can be started in parallel on several workstations The various files used by QNAP2 when running must be visible by NFS of each machine used The QNAP2 installation directory and the user s home directory must also be installed by NFS on each machine The principle of parallel replications is as follows the main QNAP2 executable master divides the running of the replications between several slave executables on each of the workstations used To get different replications after each replication the slave executables possess different random germs These are read in the ranpar dat which is in the QNAP2 delivery directory Communication between the master and slave processes is done by the PVM Parallel Virtual Machine software version 3 2 PVM 3 2 Parallel Virtual Machine System 3 2 University of Tennessee Knoxville TN Oak Ridge National Laboratory Oak Ridge TN Emory University Atlanta GA Authors A L Beguelin J J Dongarra G A Geist W C Jiang R J Manchek B Moore and V S Sunderam C 1992 All Rights Reserved Warning The version of the PVM software used by QNAP2 is slightly different from the standard version so as to allow for the environment variables specific to MODLINE Make sure you
262. neral queuing networks IBM J of Res and Dev May 1975 pp 283 294 MERLE D Algorithmes de calcul des probabilites stationnaires d un r seau de files d attente Rapport de Recherche INRIA 279 mars 1978 62 pages MERLE D Contribution l tude d un analyseur de mod les de files d attente These de Docteur ingenieur INPL Nancy oct 1978 LE BOUDEC J Y BCMP extension to Multiserver Stations with Concurrent Classes of Customers In Proceedings of Performance 86 and ACM Sigmetrics Performance Evaluation Review Special Issue Vol 14 No 1 May 1986 pp 78 91 MUSSI Ph and NAIN Ph Description and Specifications for New Product Form Queueing Network Stations ESPRIT Project 2143 IMSE report R 5 5 3 V1 March 1989 5 2 6 3 Application stipulations network topology The network may be open closed or mixed with some topological con straints see below customer classes Several customer classes may be used having different service requirements and different routing rules station types The following station types are allowed e simple server e multiple server e infinite server source Resources semaphores flags and simple queues stations without service may not be used Note If the number of servers of a multiple station is always greater than or equal to the number of customers in the network this station is treated as an infinite station User s Guide Solvers 171 sch
263. ng at the head of the queue Customers with equal priority levels are ordered according to a LIFO discipline M 6 9 2 3 9 LAST FIRST RESEQUENCE The customers are ordered in the exact order that they departed from the reference queue The order in which they arrive at the resequencing queue has no importance A customer arriving before its preceeding customers simply waits in the queue until all its preceeding customers arrived customer arriving after its succeeding customers seizes the server User s Guide Modeling Mechanisms 113 114 4 2 3 Queue capacity The default queue capacity is infinite Limited capacity queues can be specified with the CAPACITY parameter of the STATION command This does not change the basic queue organization The CAPACITY attribute of QUEUE objects returns the capacity limit or 1 if the capacity is not limited queue CAPACITY returns the global limit queue CAPACITY class returns the limit for the specified class Note As the queue capacities are evaluated during initiation time this attribute should not be used until solution time Example STATION NAME STORAGE CAPACITY 20 SERVICE BEGIN PRINT STORAGE CAPACITY amp yields 20 END EXEC PRINT STORAGE CAPACITY amp undefined result Customers which cannot fit into a limited capacity station are rejected A customer can be rejected due to several reasons e It was normally completing a service in another st
264. no probabilistic or priority MATCH only one join up specification is allowed for each MATCH class results and marginal probabilities may not be requested User s Guide Solvers 191 192 PROC3 i i i i PR CI i MID JOIN i i S E TH 240 SRC FORK PROC4 JOINUP OUT ry co one sob Je gt Too PROC2 i i i 22 i A i Figure 5 1 Series parallel example This queueing network corresponds to the second sample nap2 model dual stage split match network The main restrictions are on the network topology a series parallel network starts at a single point the SOURCE queue and ends at a single point the OUT queue A customer exiting a station can be simply transited to the next queue serial construct or it can be split to a group of queues parallel construct A customer entering a queue can be joined up with other customers No loops are allowed a customer may not be transited to a station where it has already been served Figure 5 1 shows a typical series parallel network 5 2 13 4 Application stipulations summary station scheduling service distinct global dependent type time serv time dependent serv rate distribution per class serv rate per class SINGLE FIFO SOURCE Example In this example a simple series par
265. ntax terminal command TERMINAL Semantics The TERMINAL command allows interactive work with QNAP2 provided that QnaP2 runs on a timesharing system Thus a whole QNAP2 program or part of it may be input and executed interactively Example The first part of the program describing the model under study is in a file assigned as QNAP2 input The commands controlling the analysis of the model are read from the terminal amp model description STATION NAME A amp the remaining part of the amp program is read amp from the terminal TERMINAL amp terminal input amp an analytic solution of amp the model is requested EXEC SOLVE amp station A is modified STATION NAME SERVICE EXP 5 amp a new analysis amp is requested EXEC SOLVE Note Use of the TERMINAL command should be restricted to very short uses As it is not possible to change a previous input line typing errors are sometimes un recoverable User s Guide Control Language 69 3 5 RESTART Command Syntax restart_ommand RESTART Semantics The RESTART command is used to restore the initial state of QNAP2 It clears the data and the workspace associated with the current model and it starts the analysis of a new independent model in the same program on the default FORTRAN unit No declaration nor result is transmitted from the previous model in order to work with submodels sharing data and res
266. nterval to the estimated mean falls below rel error The simulation is stopped when all results are satisfactory Note that confidence intervals must have been requested with the ACCURACY keyword CORRELATION is used within the regeneration method to request the computation of auto correlation coefficients order is the maximum order of the auto correlation function The default order is 5 the maximum allowed is 20 Note that confidence intervals must have been requested with the ACCURACY keyword MARGINAL is used to request the computation of marginal probabilities histograms intervals is the number of intervals start is the lower bound of the first interval width is the width of the intervals QNaP2 computes the fraction of samples which fall within each interval as well as those falling below the lower bound or above the upper bound Note When used on a queue or queue class couple these procedures apply to all queue standard results Restricted queue statistics Syntax SETSTAT result MEAN queue_list class_list SETSTAT result CORRELATION queue_list class_list order SETSTAT result MARGINAL queue_list class_list intervals start width SETSTAT result ACCURACY queue list class_list SETSTAT result PRECISION queue_list class_list rel_error where result is the name of a standard queue result BLOCKED for the blocked time of customers BUSYPCT for the utilization rate of the station CUSTNB f
267. null work demand for example CST 0 may be used to force customers to give their turn to customers of the same priority level 5 5 4 1 Tracing facilities The discrete event simulator provides a full set of event tracing facilities These tracing facilities are described in detail in chapter 9 5 5 4 2 Model state information discrete event simulator maintains a large set of information during the simulation process Part of these information is directly available from the predefined variables e g TIME and the object attributes e g NB attribute of QUEUEs Other information is available via GETSIMUL keyword functions User s Guide Solvers 237 238 Syntax GETSIMUL FIRSTPROC GETSIMUL NEXTPROC process GETSIMUL WAKETIME process GETSIMUL PRSTATUS process GETSIMUL REPLINB GETSIMUL CURREPLI Semantics FIRSTPROC returns a reference REF ANY to the first process in the event list It can be a reference to a customer or a timer It usually references the current process except when the current process is an exception In this case the first process is the customer or timer that waits to become the current process NEXTPROC returns a reference to the process following process in the event list process must be a REF ANY pointing at a customer or a timer obtained with a previous call FIRSTPROC or NEXTPROC WAKETIME returns the expected wake up time of the specified process Note that this is meaningful only whe
268. o change in future QNAP2 releases It is better to rely on the symbolic event names NAMECODE and CODENAME used to convert event codes INTEGERs respec tively to and from symbolic names STRINGs EVSTATUS returns the status of the event e g whether a WAIT was blocking or not DELAY returns the actual delay requested by a work demand procedure It may be used only for work demand events SERVTIME DISTRI returns the numeric code of the work demand procedure It may be used only for work demand events SERVTIME Generalized Trace Qnap2 V 9 2 PARDISTR returns the nth parameter of the work demand procedure It may be used only for work demand events SERVTIME CCLASS and CPRIOR return respectively a reference to a class and an integer e g the previous class and priority level of the customer undergoing a forced TRANSIT to a new class with a new priority level CPROVOKE and QPROVOKE return a reference to the customer that caused the opera tion and a reference to the queue that caused the operation usually the queue containing that customer CSUBJECT and QSUBJECT return a reference to the customer that underwent the op eration and a reference to the queue that underwent the operation usually the queue containing that customer These keywords may be used only for events involving exactly one subject customer or queue CSECONDR and QSECONDR return a reference to the customer that was a partner in
269. o concurrency sets e no limited capacity stations e FIFO single server station with general service time distribution Note ITERATIV approximates constant distributions by Erlang 5 distributions with the same mean 5 2 11 4 Application stipulations summary station scheduling service distinct global dependent type time serv time dependent serv rate distribution per class serv rate per class SINGLE exponential general PREEMPT general general MULTIPLE FTO exponential general ENTE ewenr no yes oY Example In this example a queueing network consisting of two stations A and B is described and analysed by the solver ITERATIV with various specifications of stations A and B 186 Analytical Solvers Qnap2 V 9 2 User s Guide DECLARE STATION STATION EXEC STATION EXEC STATION EXEC STATION EXEC STATION EXEC STATION EXEC STATION QUEUE A B REAL T 2 1 5 TY 0 5 REAL R 2 2 3 RX 2 3 4 RY 2 4 3 INTEGER N 3 NAME B TYPE INFINITE INIT TRANSIT A SERVICE CST 1 NAME RATE R TRANSIT B SERVICE EXP T SOLVE ITERATIV NAME RATE 1 SERVICE CST T SOLVE ITERATIV NAME MULTIPLE 3 RATE R SERVICE EXP T SOLVE ITERATIV NAME A TYPE SINGLE SCHED LIFO PREEEMPT SERVICE CS
270. o select which statistical results are interesting on which variable Two selection levels appear on variables and on statistics The minimum set of statistical results is mean variance minimum and maximum values Then the user can request marginal probabilities confidence interval or simulation run length control Simulation control Qnap2 V 9 2 A set of functions is available to specify which statistical results must be computed on which variable The name of the function specifies the statistical results to compute The standard results provided by a simulation concern only queues and classes Most often users need other statistical information such as the network response time In previous releases users had to write their own code to collect data and compute statistics This code was typically embedded in the service descriptions In V9 0 the generalized statistics are not restricted to queues User statistics be com puted on any user variable declared as a watched variable also called statistical variable The algorithmic language interpreter tracks any change in the value of the variable and computes the requested statistics The generalized statistics are described in section 5 5 Simulation results 2 3 Accuracy control QNAP2 can compute confidence intervals on any queue result or statistical variable The confi dence intervals are used to characterize the accuracy of the mean values When the simula
271. of procedures may be declared e Normal procedures e Forward procedures e Generic procedures User s Guide Algorithmic Language 33 2 3 8 1 Normal procedures Syntax procedure_declaration PROCEDURE procedure id formal_parameter local_declaration compound statement procedure id identifier formal parameter identifier local declaration VAR variable declaration label declaration Semantics The formal parameter list is placed immediately after the procedure identifier The param eters must also be declared before the description of the procedure body The procedure body is a compound statement 1 an algorithmic code sequence enclosed betwen the BEGIN and END keywords section 2 5 Statements for details Parameters are normally passed by value ie changing the value of the formal in the procedure body has no effect on the actual parameter Parameters may be passed by reference when declared with the VAR keyword In this case changing the value of the formal parameter in the procedure body immediately affects the actual parameter local variable identifiers may be used in other procedures or as global variable or as object attributes without interference procedure can be called within any executable algorithmic code sequence e g an EXEC command or the SERVICE parameter of a STATION command Example DECLARE PROCEDURE HELLO Procedure
272. oin operation concerns all the sons created by the current customer e When used with an integer parameter n the current customer waits until n sons have been destroyed e When used with a explicit customer list the current customer waits until all the specified sons have been destroyed The JOINC procedure is similar to JOIN except that it applies to the specified customer rather than the current customer JOINC is used to force another customer to wait until its sons have been destroyed 132 JOIN and JOINC procedures Qnap2 V 9 2 4 9 Customer Forced Transition 4 91 TRANSIT procedure Syntax TRANSIT customer queue class priority level The TRANSIT procedure forces the transition of the specified customer into the specified queue with the specified class and integer prioritytevel If customer is omitted the TRANSIT proce dure applies to the current customer referenced by the predefined variable CUSTOMER If the customer is being served it loses its server Its service is terminated and cannot be resumed If the destination queue is OUT the customer is destroyed Example DECLARE QUEUE A B C CLASS X Y STATION NAME A TRANSIT B 1 C Y 1 amp this description is also equivalent to STATION NAME SERVICE BEGIN EXP 3 IF DRAW 0 5 THEN TRANSIT B ELSE TRANSIT C Y amp not reached END Note A blocked customer or a customer holding resources may not be destroyed
273. ok ok ok ok ok ok ok ok ok oe oe SOURCE 1 009 1 000 1 000 1 009 1486 SYST 7277 7206 6 507 6 579 1482 0 21 1 01 0 2821 01 1 083 1 024 kk kk ke ke ke ke ke ke ke ke a a a a a a OF SIMULATION MEMORY USED 4555 WORDS OF 4 BYTES 1 75 OF TOTAL MEMORY Note In order to limit the cost of the simulation run a trade off has to be found between the length of each replication and the number of replications If the steady state behaviour of the model is looked for each replication should be long enough to ensure that the steady state is effectively reached and then it is better to have longer replications and a smaller number of replications The reverse is true if the simulation is run to analyse the transient behaviour of the model Then shorter replications and a larger number of replications are preferable 5 4 6 2 The regeneration method The basic principle is to split the simulation run into several successive intervals so that the model behaviour in these intervals be statistically equivalent and independent Thus there are as many independent sub simulations as there are intervals and the results within each simulation sub run are consi
274. ok ok ok ok ok ok ok ok oK ok ok ok ok ok E E ok ok ok ok ok ok ok ok ok ok ok ok AUTOCORRELATION ON QUEUE SYST Sk ok ok ok ok ok 27 ok ok ok ok ok ok ok ok ok ok oK ok ok ok ok ok E E ok ok ok ok ok ok ok ok ok ok ok ok ORDER BLOC SERV BUSY QUEUE RES NB BLOCKED SIZE TIME TIME LENGTH TIME SERVED TIME Sk ok ok ok ok ok 27 ok ok ok ok ok ok ok ok ok ok oK ok ok ok ok ok E E ok ok ok ok ok ok ok ok ok ok ok ok 1 0 000 0 131 0 174 0 265 0 289 0 279 0 000 2 0 000 0 068 0 083 0 020 0 006 0 122 0 000 000 0 004 0 021 0 013 0 026 0 095 0 000 4 0 000 0 002 0 014 0 054 0 063 0 078 0 000 5 0 000 0 139 0 123 0 060 0 025 0 068 0 000 Sk ok ok ok ok ok 27 ok ok ok ok ok ok ok ok ok ok oK ok ok ok ok ok E E ok ok ok ok ok ok ok ok ok ok ok ok END OF AUTOCORRELATION COMPUTATIONS User s Guide Solvers 215 216 OF SIMULATION MEMORY USED 4641 WORDS OF 4 BYTES 1 78 OF TOTAL MEMORY The results show that the independence assumption is satisfied with this model with intervals of length 100 Note It is important
275. ommand e parameter 1 maximum number of iterations e parameter 2 threshold of the convergence test 5 2 10 6 Tracing facilities When the TRACE option is set only the standard intermediate results of SOLVE are produced no specific intermediate results User s Guide Solvers 185 5 2 11 The Iterative solver ITERATIV 5 2 11 1 Overview ITERATIV was developed in order to solve closed queueing networks including stations hav ing a FIFO discipline and a non exponentially distributed service time Therefore this solver implements one of the main restriction of the solver CONVOL ITERATIV is an approximate solver it does not in general give the exact solution of the network but it does produce exact results if all the service times are exponential The basic principle of this method is to replace the network with the non exponential service times by an equivalent network with exponential service times The criteria used to build this equivalent model are the conservation of the total number of customers in the model and the conservation of the throughputs in the network 5 2 11 2 Bibliography MARIE Methodes it ratives de r solution de modeles math matiques de systemes informa tiques Informatique 12 2 1978 5 2 11 3 Application stipulations The application stipulations of this solver are identical to those of the solver CONVOL with the following additions e closed network e mono class network n
276. on Qnap2 V 9 2 1 6 Running QNaP2 user can run the QNAP2 executable in the following way QNAP2V9 input qnp o output lis 1 library lib where e input qnp is the name of the file containing the model it is assigned to the QNAP2 predefined file FSYSINPU e output lis is the name of the file into which the execution results are to be written it is assigned to the QNAP2 predefined FSYSOUTP if no name is given the results are printed on to the screen e library lib is the name of the default QNAP2 library file it is assigned to the QNAP2 predefined file FSYSLIB if no name is given there is no default library file User s Guide Introduction 9 10 Running QNAP2 Qnap2 V 9 2 Algorithmic Language 12 Qnap2 V 9 2 2 1 Tokens Tokens are the smallest meaningful units of text in a QNAP2 program They are classified as special symbols e reserved keywords e identifiers labels e numbers e character strings 2 1 1 Syntax conventions In this manual the QNAP2 language syntax is described using a Backus Naur like form acc syntactic element a may be replaced by a means that element a may be omitted ab curly braces are used for grouping alb means that a or b is present alb means that either a or b is present or nothing is present a means that a may be repeated alb means that a and b may be repeated or omitted e g aora bora a bor b b b a alb means th
277. on classes one or several transition probabilities relative or absolute Each element of a 3 uple may be a constant an expression or a sublist In the case of sublist elements the sublists must have the same number of elements However the last element of the last sublist of transition probabilities may be omitted its absolute value is then computed as the complement to 1 of the sum of the other probabilities The second element of the 3 uple may be omitted if no class transitions are considered User s Guide Con rol Language 81 The elements of the 3 uples appearing TRANSIT parameter are evaluated at initiation time no dynamic evaluation during solution time The optional class list in the left hand side references the classes from where in the current queue the transition is described This list is evaluated at compile time If no class is specified in the TRANSIT parameter the values given apply for all the classes for which no explicit transition rule is specified In the case of an open queueing network the predefined queue OUT is used to name the network exit where customers are destroyed A SOURCE station creates customers of various classes that may be routed to stations and classes according to fixed probabilities Example amp use of absolute probabilities DECLARE QUEUE A B C STATION NAME SERVICE EXP 5 TRANSIT A 0 5 0 3 amp use of relative probabilities TRAN
278. operations destroy the input customer s and create new customers There is no father son relationship between the input and output customers The destroyed customers are considered as if they had performed a TRANSIT to the OUT queue This may cause a parent customer waiting with JOIN or JOINC to be freed 3 These operations work only with pure CUSTOMER objects Sub types of CUSTOMER are split into CUSTOMERs not into sub type objects Customers resulting from a SPLIT can be split again The origin of all successive SPLITs is kept A MATCH operation needs not join up all pieces that resulted from a SPLIT Partial join ups can be performed Several SPLIT and FISSION possibilities may be specified The selection is performed with a probabilistic switch Several MATCH and FUSION possibilities may be specified When several join ups are possible simultaneously the selection is performed either via integer priority levels PRIOR option or via a probabilistic switch WEIGHT option User s Guide Modeling Mechanisms 135 SPLIT and FISSION replace the TRANSIT parameter of the splitting station cus tomers perform their service normally They are split after completion of their service Join ups are performed at the input of a station The resulting customer performs its service normally When only part of the customers required for a join up have reached the station they wait before the station They are considered as being in no queue
279. or the number of customers in the station RESPONSE for the response time of the station SERVICE for the service time of the servers 232 Simulation results Qnap2 V 9 2 These procedures restrict statistics to specific results the specified queues with class specific results on the specified classes The MEAN keyword is used to request the computation of basic statistics only mean min max variance The use of the other keywords is exactly the same as explained above Miscellanous Syntax SETSTAT CANCEL stat var list Semantics CANCEL is used to cancel any previous statistics specification on the given variables 5 5 3 Statistical outputs QNAP2 provides a standard statistics report at the end of the simulation This report contains the standard results on each queue Additional results on queues and watched variables are available through result access functions 5 5 3 1 Standard report The standard report is automatically produced at the end of a simulation run it contains all the performance criteria characterizing the stations of the network globally all classes together or for each customer class CONTROL OPTION NRESULT can be used to suppress printing of the standard report Alternately the OUTPUT procedure can be used to print the standard report on demand The standard report is a table with one line for each queue showing the mean results all classes together When class specific results are
280. orbidden here amp including DECLARE OBJECT CONTENT REF CONTAINER RCONTAIN END 2 3 3 4 Aditional attribute declaration The aditional attribute declaration statement is intended for adding new attributes to user defined object types or predefined object types such as QUEUE CLASS FLAG and CUS TOMER 28 Declaration Statements Qnap2 V 9 2 An additional attribute is declared by writing the object type identifier followed by the at tribute type identifier for example QUEUE INTEGER or QUEUE REAL for queue attributes of type integer or real An attribute may be a simple variable or a dimensioned one Notes 1 Attributes of a given object type must be declared before the first object of that type or any of its sub types is created 2 This feature is not not allowed for FILE TIMER and EXCEPTION object types as there are predeclared objects of these types 3 Using specific attributes corresponds to an old fashioned use of QNAP2 We recommend to avoid such declarations whenever possible because they violate object oriented design principles Example DECLARE QUEUE INTEGER N M QUEUE 5 5 QUEUE REAL TMIN g OBJECT 10 INTEGER CCW 2 REF QUEUE DEVICE REAL SEEK SEARCH END f9 amp amp CUSTOMER REF 10 CIO amp CUSTOMER REAL TIO amp declaration of QUEUE attributes declaration of a new object type with its attributes declaration of CUSTOMER
281. oscale WRITELN pc gnuplotfile plot FOR icurve 1 STEP 1 UNTIL nb curves DO BEGIN 218 Procedure GPLOCUR Qnap2 V 9 2 name_datafile CONVERT icurve STRING ext_datafile FILASSIGN pc_datafile name_datafile OPEN pc_datafile 3 FOR ipoint 1 STEP 1 UNTIL nb_points DO BEGIN WRITELN pc datafile x icurve ipoint y icurve ipoint END amp for CLOSE pc_datafile WRITE pc_gnuplotfile name datafile WRITE pc_gnuplotfile title legend icurve WRITE pc_gnuplotfile with linespoints IF icurve lt nb_curves THEN WRITE pc_gnuplotfile WRITELN pc_gnuplotfile END for WRITELN pc_gnuplotfile pause 1 Press return to continue CLOSE pc_gnuplotfile END amp proc User s Guide Graphics and QNAP2 279 280 10 2 Procedure GPLOBAR This procedure is an example of GNUPLOT files generation procedure that can replace the old PLOHIS QNAP2 procedure for bar charts plotting Procedure code DECLARE FILE ph_datafile FILE ph_gnuplotfile PROCEDURE GPLOBAR filename nb_bars nb_subparts x title legend amp Arguments amp STRING filename amp GNUPLOT file name INTEGER nb_bars amp number of bars nb_subparts amp number of bar parts REAL x nb_bars nb_subparts amp values STRING title amp chart title legend nb_bars amp legends amp Preconditions must be checked by the caller
282. other more specific tools For example e Simulation can be used to study the evolution of a railway system An external user controlled signal generates breakdowns and pauses the simulation Then it is up to the user to decide which parameters must be modified for example parking or repairing the train blocking the railway line access When done another signal is sent to QNAP2 to resume the simulation e Manufacturing systems modelling is often incorporated in a more general environment including an animation tool for a better understanding of the system evolution The animation can be performed on line with new trace facilities With the exception mecha nisms a user interested in a particular aspect of the model can stop the animation go on event after event modify interactively some parameters check the results or stop the simulation execution Exceptions are described in section 4 14 Exceptions 320 Simulation control Qnap2 V 9 2 B 3 Analytical solvers The analytical solvers of QNAP2 provide an effective means to solve models They provide accurate results with a very small computation time especially compared to simulation Two existing analytical solvers have been extended to handle finite capacity queues and multiple server stations with concurrency sets Queueing networks including finite capacity queues can be solved with the CONVOL and MVANCA methods Queueing networks including multiple server stations with
283. pacity stations e no dependent service rates e marginal probabilities may not be requested 5 2 10 4 Application stipulations summary station scheduling service distinct global dependent type time serv time dependent serv rate distribution per class serv rate per class SINGLE FIFO exponential PRIOR PREEMPT exponential LIFO PREEMPT general general PS no INFINITE Example In this example a queueing network consisting of two stations A and B is described and analysed by the solver PRIORPR with various specifications of stations A and B DECLARE QUEUE A B CLASS X Y REAL 2 TX 1 5 TY 0 5 REAL R 2 2 3 RX 2 3 4 RY 2 4 3 INTEGER W 3 STATION NAME Analytical Solvers Qnap2 V 9 2 SCHED PRIOR PREEMPT PRIOR X 1 PRIOR 2 INIT TRANSIT SERVICE X EXP TX SERVICE Y EXP TY CONTROL CLASS B STATION NAME TRANSIT B SERVICE EXP T SOLVEC PRIORPR STATION NAME SINGLE SCHED LIFO PREEEMPT SERVICE X CST TX SERVICE Y CST TY SOLVEC PRIORPR STATION NAME SCHED PS SOLVEC PRIORPR STATION NAME INFINITE SOLVEC PRIORPR 5 2 10 5 Control of numerical convergence The convergence of the solver may be controlled by the two first parameters of the parameter CONVERGENCE of the CONTROL c
284. pear and allows you to go on However we would like to hear about all problems you encounter with QNAP2 in order to fix bugs and make the product better We would also be pleased to hear about problems with the documentation When you think there is a bug and you want to report it make sure you provide us with all the necessary information The very best information is a short model reproducing the problem with a listing of the output produced by QNAP2 If this is not possible then it will be very difficult for us to understand what happened and correct the problem When you report bug you should also fill in the bug report form on next page This basic information will help us register the bug and track it User s Guide Errors and Warnings 311 QNAP2 PROBLEM REPORT Status Ref Date QNAP2 version Name Hardware Organization Operating system Phone E mail Fax Address Suspected problem origin tick one Software Documentation Environment Symptoms Abort Unexpected results QNAP2 error message Other System error message Severity level tick one Blocking Minor Major e g unavailable functionality Nice to have e g spelling error Description please include a sample model 312 Problem reporting Qnap2 V 9 2 New features 314 Qnap2 V 9 2 This appendix presents the new features of QNaP2 release 9 0 Experienced users should read this appendix in order to survey the differences betwe
285. phore 150 semaphore creation 150 separators 14 server allocation 133 service completion 131 SERVICE parameter 43 86 service rate 86 94 service suspension 131 Service times 6 SET procedure 161 SIMPAR 238 SIMUL procedure 173 260 Simulation 5 simulation 222 single server 127 SKIP procedure 97 solution time 67 SOLVE procedure 177 SOLVE procedure 173 solver 173 solvers 5 source station 128 SOURCE station type 20 SPECTRAL method 236 spectral method 110 SPLIT parameter 91 147 SPLITMAT solver 185 209 statement simple statement compound statement 50 static initialization 20 31 station 4 STATION command 32 43 77 STATISTICS parameter 111 STEP UNTIL clause 46 55 string operator 49 STRING type 31 subscripts 43 syntactic conventions 68 TERMINAL command 72 TEST parameter 113 218 TEST sequence 225 THEN clause 42 TIMER object 28 TIMER type 29 TMAX parameter 108 223 TRACE 203 trace facilities 289 Index 337 338 TRACE parameter 114 183 192 194 197 200 206 208 220 tracing facilities 183 261 TRANSIT parameter 88 TRANSIT procedure 141 145 217 TSTART parameter 107 TYPE parameter 80 types 15 UNIT parameter 102 UNSET procedure 161 UTILIT subroutine 269 UTILITY procedure 269 V procedure 151 158 variable 43 variable declaration 23 variables 43 variables default values 32 VCUSTNB function
286. pointless interactive run User request INSERT 11 amp insertion of code on line 11 User request IF I 2 THEN SAVERUN MODEL User request GU Debugger 0 0 09 MODEL SAVED ON FILE FSYLIB MODEL The model is saved in the state where it was when SAVERUN was called we shall see during retrieval the break points and the inserted blocks are also saved 8 3 5 Removal of an inserted block Debugger SHINSERT User request INSERT ON LINE 11 User request REMOVE 11 amp removal of block inserted in 11 User request GU 8 3 6 Step by step execution Debugger HALT ON BREAK POINT BEFORE LINE 9 User request STP amp single line step Debugger STEP BEFORE LINE 18 Note that with the station customer being blocked by the time constant the station B customer becomes the current customer and processing continues on line 18 User s Guide The Qnap2 debugger 259 260 User request STP Debugger STEP BEFORE LINE 19 User request STP Debugger STEP BEFORE LINE 10 The customer at station B is in turn blocked by a time delay Once again customer A becomes the current customer User request STP Debugger STEP BEFORE LINE 11 8 3 7 Cancelling a specified break point User request CANCELBR 9 amp removal of break point on 9 User request G0 As no further break point is defined the simulation continues up to its normal end 8 3 8 Restoring the context saved during
287. pression dimensioned_variable list Semantics Variables and expressions used in an assignment should be of the same type However integer and real numbers may be mixed If a real expression is assigned to an integer variable the value assigned is the integer part of the real number rounded towards zero In the case of references the expressions may contain only references of the same type i e referencing objects of the same type In the case of an assignment with a dimensioned variable QNAP2 checks that the list length is less than or equal to the dimensioned variable length Trailing unassigned elements are not modified The assignment is made according to the enumeration rule specified in the section 2 2 1 Arrays or dimensioned variables Example amp amp declarations amp DECLARE INTEGER LI 20 REAL BOOLEAN B2 REF QUEUE PQ QUEUE INTEGER AI 48 Statements Qnap2 V 9 2 Note QUEUE A REF CUSTO REF QUEUE assignmen BEGIN LI 10 R 23 Bi PQ 2 LI C C NE PQ AI PQ IF LI 0 LI 1 5 END MER DISK 10 ts 123 4 LSE 2 gt 3 XT 36 AI 0 THEN A ELSE DISK LI 1 TEP 1 UNTIL 10 Conversion rules may induce problems that should be emphasized Example Note Forgetting the DECLARE EXEC T EXEC U DECLARE REAL EXEC BEGI U U INTEGER I N 4 amp U 4 0 3 4 amp
288. ption PREEMPT preemption a customer being served is preempted by an arriving customer having a higher priority level the service of the preempted customer is resumed when this customer is reallocated a server EXCLUDE mutual exclusion this option applies to multiple server stations or infinite stations Two customers belonging to the same concurrency set may not be served simul taneously See below the definition of concurrency sets FEFS first eligible first served this option should be used only with the EXCLUDE option FEFS specifies that when several customers are waiting in the queue of a multiple server station with concurrency sets the first eligible customers seize the servers even if there are uneligible customers waiting before them Without FEFS default behaviour the first customer in the queue seizes a server The second one is served only if it is eligible If not then the server stays idle even if there are eligible customers behind QUANTUM quantum allocation a server is allocated to customers for fixed length pe riods defined by the associated real number The quantum value can be specified with the QUANTUM parameter of the STATION command PS processor sharing all the customers are served simultaneously with a service rate di vided by n if n is the current number of customers in the station It can be seen as the mathematical limit of the QUANTUM discipline when the quantum value tends to zero
289. queue class GETSTAT result CORRELATION stat var n GETSTAT result MARGINAL stat var n where result stands for the required result SERVICE RESPONSE BLOCKED CUSTNB BUSYPCT MEAN MAXIMUM MINIMUM and VARIANCE return the corresponding value ACCURACY returns the confidence interval CORRELATION returns the n coefficient of the auto correlation function 234 Simulation results Qnap2 V 9 2 MARGINAL returns the probability that the result falls within the n interval as specified with SETSTAT MARGINAL Example DECLARE QUEUE SYSTEM PRINT Response time of the system GETSTAT RESPONSE MEAN SYSTEM GETSTAT RESPONSE ACCURACY SYSTEM Queue throughput Syntax SERVHB queue class queue NBOUT class queue NBIN class MTHRUPUT queue class Semantics SERVNB and NBOUT both return the number of served customers customers that have left the station NBIN returns the number of customers that entered the station i e NBOUT NBIN yields the number of customers that are still in the station MTHRUPUT returns the mean throughput computed as the number of served customers divided by the observation period GETSTAT functions for watched variables Syntax GETSTAT MEAN stat_var GETSTAT MAXIMUM stat_var GETSTAT MINIMUM stat_var GETSTAT VARIANCE stat_var GETSTAT ACCURACY stat_var GETSTAT CORRELATION stat_var n GETSTAT MARGINAL stat_var n Semantics U
290. r flow of 0 02 customers per time unit and to station B with class Y having a probability of 0 8 Example User s Guide Control Language 83 84 amp usage of list DECLARE QUEUE CPU DISK 10 STATION NAME CPU TRANSIT DISK 1 REPEAT 10 The transitions to each disk are made with equal probability Example DECLARE QUEUE CPU DISK 3 REAL PROB 3 STATION NAME TRANSIT CPU DISK 1 STEP 1 UNTIL 3 PROB OUT Note that the corresponding sublists have the same number of elements Transition to DISK 1 with probability PROB 1 transition to DISK 2 with probability PROB 2 transi tion to DISK 3 with probability PROB 3 transition to OUT with probability 1 PROB 1 PROB 2 PROB 3 Example DECLARE INTEGER NC 10 QUEUE CPU A CLASS CX NC REAL PX NC STATION NAME TRANSIT CPU A REPEAT NC CX PX Since A is not an array REPEAT NC is mandatory in order to assign the transitions to station A in the classes CX i with the probabilities PX i 3 7 10 SPLIT parameter Syntax split parameter SPLIT class_list queue class count prob Semantics The SPLIT parameter must be used in place of the TRANSIT parameter to specify a customer split Different splits can be specified for each class split specification without class_list applies to all classes for which no split is defined If a class_list is present it is evaluated at compile tim
291. r syntax an expression is made up of constants variables or function calls connected by logical or arithmetical operators or by parentheses Expression evaluation is performed from left to right inside sets of parentheses according to the following operator priority rules e logical negation NOT highest priority e exponentiation operator e type operators IS IN e multiplication operators AND e addition operators OR e relational operators lt gt lt gt lt gt The operators and apply only to primaries of type INTEGER or REAL They yield an integer result if both operands are integers and a real result otherwise Note that the operation 4 5 yields 0 and 6 5 yields 1 The operators and lt gt may be used with any data provided that both parts of the relation have the same type In all cases the result is boolean The operators lt gt lt and gt may be used with integer real or boolean data only assuming that TRUE FALSE Conditional expressions are composed of expressions of the same type inside THEN clause and ELSE clause The is used to specify that a reference to an object should point at an object of a sub type The result of the expression is a reference to the object of the sub type 40 Expressions Qnap2 V 9 2 The IS and IN operators are used to check the type of an object The result of the expression is a boolean The AND OR and NOT op
292. ration point However it may still be considered as an approxi mate regeneration point as in the next example where hyper exponential inter arrival times are assumed However one may question the validity of the confidence intervals which are obtained be cause of the approximate regeneration points used Indeed the statistical independence of the intervals must be thoroughly assessed before meaningful interpretations of the confidence in tervals are made For this purpose one can request the computation of the autocorrelation functions on the basic quantities used in the derivation of the standard performance criteria This is done with the CORRELATION parameter of the CONTROL command The value of the parameter CORRELATION is the list of queues for which autocorrelation functions are re quested The maximum order of the autocorrelation functions is defined by an integer following the list of queues the default value for the order is 5 Example DECLARE QUEUE SOURCE SYST MONITOR STATION NAME SOURCE TYPE SOURCE TRANSIT SYST SERVICE HEXP 1 5 STATION NAME SYST TRANSIT MONITOR SERVICE HEXP 0 7 5 STATION NAME MONITOR TRANSIT OUT SERVICE IF SYST NB 0 THEN SAMPLE CONTROL TMAX 15000 ACCURACY SYST ESTIM REGENERATION CORRELATION SYST SIMUL X SIMULATION WITH REGENERATIVE METHOD TIME 15000 00 NB SAMPLES 2459 CONF LEVEL 0 95 kk ke ke ke k
293. reated as soon as its identifier is declared Example DECLARE INTEGER L 10 creation of an array of ten integer elements INTEGER N 12 creation of an integer variable with initial value of 12 SP 9 BR amp REAL RM creation of an array Types Qnap2 V 9 2 amp of 12 real elements Objects except objects of type CUSTOMER or of any type referencing type CUSTOMER may be created either through the static declaration facility or dynamically using the NEW function a reference to the created object is returned as the function value Example DECLARE amp declaring an object type amp identifier with formal parameters OBJECT NODE N T INTEGER N QUEUE CPU QUEUE DISK N amp attributes of the object type REAL T END DECLARE INTEGER I QUEUE A an object of type QUEUE is created an array of 10 references is created a reference to an object of type NODE is created REF QUEUE PROC 10 REF NODE RND SP B9 BR amp NODE 5 10 2 ND1 ND2 amp static creation of 2 objects amp of type NODE EXEC RND NEW NODE 3 0 5 amp dynamic creation of an object amp of type NODE EXEC FOR I 1 STEP 1 UNTIL 10 DO PROC I NEW QUEUE amp dynamic creation of amp 10 objects of type QUEUE An object deletion mechanism is provided with the DISPOSE procedure The RESTART command removes all objects Objects of type CUSTOMER or of any type
294. reference Objects are initialized in the following way Generally the default attribute values for all objects are set according to the above rule Queues all attributes are set to the above listed values except for those mentioned in the description of the STATION command in Chapter 3 Class the attribute ICLASS is set to the rank of the class with respect to its order of creation Customers all attributes are set to the above listed values Flags flags are set in the state reset flag STATE FALSE Files the attribute FILASSGN is an empty string and the attribute OPENMODE is set to Zero 32 Declaration Statements Qnap2 V 9 2 Example DECLARE INTEGER I J K 4 REAL TIMEIN STAT 0 5 1 2 5 8 TIMEOUT 2E3 BOOLEAN OK TRUE BAD QUEUE CPU DISK REF QUEUE Q CPU QA STRING MESSAGE WORK IS DONE amp The preceding initializations are equivalent amp to the following sequence of statements BEGIN I 0 J 0 K 4 TIMEIN 0 STAT O STAT 1 STAT 2 STAT 3 STAT 4 TIMEOUT 2E3 0 TRUE BAD FALSE Q CPU QA NIL MESSAGE WORK IS DONE END M oe M M 2 37 Label declarations Syntax label_declaration label_id Example LABEL label id identifier DECLARE LABEL L1 L2 2 3 8 Procedure declarations Procedure declarations allow the use of user coded subroutines Three types
295. referencing type CUSTOMER can be created only during the simulation process As a part of the simulator they may be created e through a source station station type SOURCE e through a static initialization inside stations parameter INIT e through calls to the NEW function User s Guide Algorithmic Language 21 22 They may be destroyed e by the end of the simulation during a simulation by a transition into the predefined OUT queue 2 2 5 References A reference may refer to all the objects of the same type created in a program The type of these objects is determined at reference declaration time References may be used whenever an object of the corresponding type or one of its sub types is required Example Types DECLARE QUEUE CPU1 CPU2 REF QUEUE RQ QUEUE OBJECT NODE STRING NAME END REF NODE RN NODE PARIS NEWYORK TOKYO LONDON EXEC BEGIN RQ RN LONDON END When sub types are used the following rules apply 1 A reference to a sub type can be used with all the type features without restriction This is simply of consequence of the fact that an object of a sub type e g a NODE has all the features of the type e g QUEUE Example RN can be used as a reference to a QUEUE object RN NB RN FIRST are valid expressions NB and FIRST are attributes of QUEUE objects so they are also attributes of NODE objects A reference to a type can be used with a
296. rent for each class of customers If a class list is specified its expression is evaluated at compile time The RATE parameter without class specification is the nominal service rate of the server The parameter RATE if associated with a class list gives a multiplicative coefficient of the nominal rate for the customers of the classes in the list The general form of the RATE parameter is e RATE 41 42 4 nominal rate with a a for i gt n e RATE 21 25 En class coefficients with for j gt n The instantaneous service rate for class z customers is given by the formula a z when the station contains exactly customers and j class x customers A rate is specified by a constant or an expression The default values are RATE 1 0 and RATE ALL CLASS 1 0 User s Guide Con rol Language 87 The expressions defining the rates in RATE parameter evaluated at initiation time no dynamic evaluation during solution time dy i luation during solution ti Example Constant rate DECLARE QUEUE A CLASS X Y 7 REAL RX 0 9 STATION NAME RATE 20 RATE X RX SERVICE EXP 5 The nominal service rate of station A server is 20 The mean service time of class Y and Z customers is therefore 0 25 time units The service rate for class X customers is 20 0 9 18 Therefore the mean service time for class X customers is 5 18 0 28 time units The preceding descriptio
297. riables INTEGER REAL BOOLEAN STRING REF or not allowed Example DECLARE REF ANY RANY QUEUE Q CLASS CL EXEC BEGIN RANY Q RANY CL END User s Guide Algorithmic Language 31 2 3 6 Static initializations INTEGER REAL BOOLEAN or STRING variables may be initialized at declaration time with expressions of the same type Similarly references may be initialized with object expressions These expressions are evaluated at declaration time when the item being initialized is created On the other hand variables declared as attributes may not be statically initialized Array elements may be initialized by specifying a list of constants of the same type This list should have at most as many elements as in the array The implicit assignment rule is that the rightmost index varies the most rapidly and the leftmost index the least rapidly cf section 2 2 1 Arrays or dimensioned variables Example DECLARE INTEGER 43 7 2 INTEGER L 10 1 2 3 4 5 M 100 REAL R 0 2 2 10 20 30 40 50 60 QUEUE A B REF QUEUE Q A Elements L 6 L 7 are initialized with value 0 The elements of R are R 0 1 10 R 0 2 20 R 1 1 30 R 1 2 40 R 2 1 50 R 2 1 60 The reference Q references queue A Unless explicitly specified variables are initialized with the following default values e integers 0 reals 0 booleans FALSE e strings empty e references NIL empty
298. ring is performed modulo 1 000 000 Other objects are referred to by their identifier A 1 2 Qnap2 behaviour A 1 2 1 Error during compilation If a severe error occurs then the subsequent EXEC blocks are not processed and in particular solvers are not called and saving is not possible This is intended to avoid launching a long simulation or destroying data with an incorrect model A 1 2 2 Error during simulation A severe error stops the simulation and aborts the EXEC block containing the call to the SIMUL procedure A SAVERUN may be performed automatically if an error occurs during the simulation The SAVERUN is performed if the user answers Y to the last question of the startup procedure DO YOU WANT QNAP2 TO A SAVE IN CASE OF ERROR Y N N It is possible to restore the context of the simulation when the error occurred with the RESTORE procedure see section 2 6 2 The restored state is the state of the model just before the error occured This facility is useful as a debugging tool The cause of the error may be found in the REBOOT command Example EXEC RESTORE QNAPSERR DEFERRED REBOOT BEGIN FOR RQ ALL QUEUE DO PRINT RQ RQ NB END User s Guide Errors and Warnings 289 2 Error Warning Messages 290 Error and Warning Messages Qnap2 V 9 2 A 2 1 Introduction This section describes the most important QNAP2 error messages Each message is described in the following w
299. s gt ERROR COMPILE INCORRECT MIXED TYPES This message means that a value of a specific type integer real reference to an object is assigned to a variable of another type For example when a WITH operation uses a reference the type of which is different from the type of the listed entities The user has to ensure that the types of the concerned entities are the same possibly by using the operators IS IN or gt ERROR COMPILE INCORRECT TYPE FOR AN OPERAND OR AN ARGUMENT A data used in an operation or as a parameter of a procedure does not belong to the expected type The user has to check the syntax of the performed operation and the types of the concerned entities gt ERROR COMPILE THIS IDENTIFIER HAS NOT BEEN DECLARED OR IS NOT KNOWN IN THIS CONTEXT Error and Warning Messages Qnap2 V 9 2 e 050207 050208 e 05020F e 050200 User s Guide An identifier is the name of a user defined variable integer real object type user procedure or a QNAP2 key word QNAP2 does not recognize the printed identifier in the model source code The user has to declare the identifier ifit has not been already done and or to check its spelling gt ERROR COMPILE THIS VARIABLE CANNOT BE MODIFIED It is forbidden to modify the internal variables used by QNAP2 such as the number of customers in a station or the address of an object entity The user has to check the validity of the variable
300. s soon as a given accuracy has been reached Example Accuracy control is requested on all statistics of queue SYSTEM service time response time number of customers blocked time The simulation stops when the confidence interval falls below 10 of the mean estimate SIMULOG QNAP2 01 04 95 V 9 2 C COPYRIGHT BY CII HONEYWELL BULL AND INRIA 1986 User s Guide Solvers 205 1 DECLARE QUEUE USER SYSTEM 2 3 STATION NAME USER 4 INIT 10 5 SERVICE EXP 1 6 TRANSIT SYSTEM 7 8 STATION NAME SYSTEM 9 SERVICE ERLANG 1 5 10 TRANSIT USER 11 12 MACRO SYSACC RESULT 13 GETSTAT RESULT MEAN SYSTEM 8 14 100 GETSTAT RESULT ACCURACY SYSTEM 15 GETSTAT RESULT MEAN SYSTEM 8 4 16 END 17 18 CONTROL 10000 19 OPTION NRESULT 20 PERIOD 500 21 ESTIMATION REGENERATION 22 TEST BEGIN 23 SAMPLE 24 PRINT TIME SYSACC CUSTNB SYSACC RESPONSE 25 END 26 27 EXEC BEGIN 28 SETSTAT QUEUE SYSTEM 29 SETSTAT ACCURACY SYSTEM 30 SETSTAT PRECISION SYSTEM 0 10 31 END 32 33 EXEC SIMUL 500 0 4 15136 24 0885 4 40630 22 6948 1000 4 04608 5 10046 4 39679 0 43161 1500 4 20035 7 73749 4 55322 6 74523 2000 4 29807 6 96052 4 65108 6 20286 2500 4 46929 9 12489 4 82378 8 38488 3000 4 56533 8 37858 4 94440 8 20136 3500 4 84544
301. s to execute an operation at the present time transition work demand If several customers are candidates to be the current customer the simulator selects first the customer with the highest priority level If several candidates have the same priority level the simulator selects the one for which the operation was planned first When a customer has been elected as the current customer the simulator performs all the operations associated with this customer until one of the following events occurs e ihe customer calls a work demand procedure even if the value of this demand is null e end of a quantum e the customer enters a station where it cannot seize any server e the customer performs a P WAIT JOIN procedure on a semaphore or on a resource or on a flag and this procedure is effective 1 blocks the customer e the customer performs a V SET FREE TRANSIT or MOVE procedure activating a customer with a higher priority level e ihe customer performs a PRIOR procedure giving to another customer a higher priority than itself Note 1 all the operations executed in a model transitions server allocations procedure calls are instantaneous on the time scale of the model Only the work demands cause the current time to progress 2 it should be noted that a customer remains current customer after a transition if it seizes a server in the station it enters and if its priority level is not decreased 3 a
302. ser s Guide Solvers 235 MEAN MAXIMUM MINIMUM and VARIANCE return the corresponding value ACCURACY returns the confidence interval CORRELATION returns the coefficient of the auto correlation function MARGINAL returns the probability that the variable falls within the interval as specified with SETSTAT MARGINAL Example DECLARE WATCHED INTEGER PKSIZE PRINT Packet sizes fall between GETSTAT MINIMUM PKSIZE and GETSTAT MINIMUM PKSIZE Miscellanous The following result access functions are provided for compatibility with earlier QNAP2 releases Their use is discouraged as the GETSTAT keyword functions are more general MSERVICE queue class mean service time CSERVICE queue class service time confidence interval MBUSYPCT queue class mean occupation rate CBUSYPCT queue class occupation rate confidence interval MRESPONSE queue class mean response time CRESPONSE queue class response time confidence interval VRESPONSE queue class variance of the response time MBLOCKED queue class mean blocked time CBLOCKED queue class blocked time confidence interval MCUSTNB queue class mean number of customers CCUSTNB queue class number of customers confidence interval VCUSTNB queue class variance of the number of customers PCUSTNB n queue class marginal probability on the number of customers MAXCUSTNB queue class maximum number of
303. served simultaneously even if there is an idle server Note that this is meaningful only for multiple server stations and infinite stations A customer belonging to no concurrency set is not concerned it can seize an idle server whatever customer the other servers are busy with When a customer cannot seize a server due to concurrency a subsequent customer may seize it the server is allocated to the next eligible customer The concurrency sets can be used together with the other ordering mechanisms FIFO LIFO PRIOR PREEMPT PS The concurrency sets are numbered in the order they are declared with the EXCLUDE option The first set is numbered 1 The customer attribute CONCSETN yields the number of the concurrency set to which the customer belongs It yields zero if the customer belongs to no concurrency set at all or if no concurrency sets are defined for the station This attribute can be used only in simulation Note that it is assigned as soon as the customer enters the station Example DECLARE QUEUE A CLASS X Y 7 STATION NAME A TYPE MULTIPLE 2 SCHED PRIOR PREEMPT FEFS EXCLUDE X Y PRIOR Z 2 TRANSIT NEW CUSTOMER A X TRANSIT NEW CUSTOMER A X TRANSIT NEW CUSTOMER A Y TRANSIT NEW CUSTOMER A Y TRANSIT NEW CUSTOMER A Z TRANSIT NEW CUSTOMER A Z The preceeding statements yield the following ordering assuming the queue was empty User s Guide Modeling Me
304. sms have been intro duced in order to simplify this The four keywords below are implemented as new parameters of the STATION command SPLIT and MATCH should be used together SPLIT breaks down a customers into pieces MATCH joins all or part of the pieces together FISSION breaks a customer into pieces which cannot be joined up It is similar to SPLIT but the information about the original single customer is not kept FUSION joins any set of customers into one The split match features are described in section 4 10 Customer split and match B 1 5 Timers Timers are new simulation processes Simple timers could be emulated in previous versions of QNAP2 with queues and the algorithmic language In V9 0 timers provide a simple and efficient way to control time related events independently from the queueing network Timers can be used for example to control response times e schedule periodic events e schedule rare events at a controlled date e g a device failure Timers can be activated at a given absolute or relative time or periodically A procedure called the handler is associated to each timer When a timer reaches its activation time the handler is automatically called by QNAP2 The handler is a user written procedure enabling full control of the model with all the power of the algorithmic language User s Guide New features 317 318 B 2 Simulation control B 2 1 Generalized trace The treatment o
305. st exact and numerically safe solver It im plements the mean value analysis approach developed by M Reiser Its conditions of application are more restrictive than those of CONVOL MVANCA mean value analysis and normalized convolution algorithms MVANCA is a fast exact and numerically safe solver It implements an hybrid method based on the mean value analysis and the normalized convolution algorithms proposed by M Reiser Its conditions of applications are more restrictive than those of CONVOL User s Guide Solvers 169 170 HEURSNC Schweitzer Neuse and Chandy heuristic algorithms HEURSNC is fast approximate and numerically unsafe solver It implements a heuristic proposed by Schweitzer Neuse and Chandy Its conditions of application are more restrictive than those of CONVOL PRIORPR Veran algorithm for preemptive priority scheduling PRIORPR is a fast approximate and numerically safe solver It implements an algorithm developed by M Veran for the solution of closed multiclass queueing networks with preemptive priority scheduling ITERATIV Marie iterative algorithms ITERATIV is a fast approximate and numer ically unsafe solver It implements a heuristic developed by R Marie It applies to closed mono class networks with non exponential FIFO servers DIFFU Gelenbe and Pujolle diffusion algorithms DIFFU is a fast approximate and numerically safe solver It implements a heuristic developed by E Gelenbe and
306. stant service rate except in the following cases where it may depend on the number of customers in the station for a single server FIFO station the service rate may depend on the total number of customers in the station RATE a1 05 n service rate is equal to a if the station contains exactly customers or for i gt n for a single server station with PS or LIFO PREEMPT discipline the service rate of a given customer class may depend on the total number of customers in the station and or on the number of customers of this class Rosey T ME RATE 1 9 n RATE C ari ara Gr Class customers service rate is a n The class dependencies may be used only in a closed network User s Guide Solvers 173 5 2 6 4 Application stipulations summary station scheduling service distinct global dependent type time serv time dependent serv rate distribution per class serv rate per class SINGLE FIFO exponential PREEMPT general MULTIPLE EXCLUDE exponential general INFINITE yes SOURCE not relevant exponential no no no general ee Example In this example a queueing network consisting of two stations A and B is described and analysed by the solver CONVOL with various specifications of stations A and B DECLARE QUEUE A B CLASS X Y REAL T 2 TX 1 5 TY 0 5 REAL R 2 2 3 RX 2 3 4 RY 2 4 3 INTEGER N 3 S
307. stics are used to analyze transient states startup period transitions between two steady states or systems with a non stationary behaviour e g daily activity profile Discrete event simulation may be used for the analysis of any model specified in the language of QNAP2 with a few exceptions described in the next section Therefore the simulation and language features of QNAP2 provide facilities comparable to those found in general purpose simulation languages GPSS SIMULA SIMSCRIPT 5 4 2 Bibliography LEROUDIER J and PARENT M Discrete Event Simulation of Computer System for Per formance Evaluation Rapport de recherche IRIA 177 Juin 1976 5 4 3 Application stipulations All the mechanisms described in chapter 4 may be used including processor sharing scheduling PS scheduling The principle is that all the customers in the station with the PS scheduling share the servers Restriction Synchronization procedures cannot be used in this case P WAIT WAITAND WAITOR JOIN JOINC If synchronizations are mandatory PS can be approximated by a QUANTUM scheduling with a small quantum value compared to the mean service time Simulation Qnap2 V 9 2 5 4 4 Control of simulation length The TMAX parameter specifies the maximum duration of a simulation run measured on the time scale of the model When the current time reaches the value TMAX the simulation is stopped However the simulation may be stopped before this lim
308. sub type feature provided that a the user explicitely specify that the reference must point at a sub type object b the pointed object be acceptable at run time i e be of the specified sub type or one of its sub types Example RQ may be used as a reference to a NODE object as follows RQ NODE NAME is a legal expression because the operator explicitely states that RQ must point at a NODE or a sub type of NODE run time check is performed to ensure that this is the case Qnap2 V 9 2 The fictitious type ANY is used to define reference any object type REF ANY variable must always be used in conjunction with the operator Example DECLARE REF ANY RA EXEC BEGIN RA LONDON RA NODE NAME London City A REF ANY may point at any object so the first statement is legal The second one is legal only by virtue of the The two operators IS and IN are provided for run time type checking Refer to section 2 4 Expressions or to the reference manual for details User s Guide Algorithmic Language 23 24 2 3 Declaration Statements 2 3 1 Overview Syntax declaration_statement variable_declaration attribute_declaration object_type declaration label_declaration procedure_declaration Semantics The declaration statements must follow a DECLARE command see Chapter 3 Control Language In each declaration statement one or more identifiers of var
309. sublist file_sublist exception_sublist timer_sublist integer list real list queue list class list file list exception list timer list Semantics LEG UE dq dedos a expression expression expression expression expression expression expression sublist sublist sublist sublist sublist sublist sublist list list list list list list list If an integer a real a string or a reference to an object is needed in a command language syntax definition a constant or an expression of the same type may be used as well User s Guide Control Language 65 3 2 DECLARE Command Syntax declare command DECLARE declaration_statement Semantics The purpose of the DECLARE command is to introduce a list of declarations for the identifiers used in QNAP2 program This command must be followed by the declaration statements whose syntax is described in the corresponding paragraph in Chapter 2 The DECLARE command may occur several times in a program if for instance new identifiers must be declared the identifiers have to be declared before being first encoun tered and may not be redeclared except after a RESTART command The evaluation of the expressions appearing in a DECLARE command is done at compile time Example DECLARE QUEUE A B STATION NAME TRANSIT SERVICE EXP 2 STATION NAME TRANSIT SERVICE EXP 5
310. t tracing actions Syntax SETTRACE RESET object event SETTRACE DEFSET Levent procedure SETTRACE DEFRESET event SETTRACE DISPLAY Semantics The RESET keyword is used to cancel a previous trace specification on a given object and restore the default tracing action The DEFSET keyword is used to specify a default tracing specification to be applied when no specific tracing action has been specified for a given object The DEFRESET keyword is used to cancel a previous default trace specification and restore the standard tracing action The DISPLAY keyword is used to print the standard trace message It can be used only inside a user defined tracing procedure 9 34 GETTRACE functions The GETTRACE keyword functions can be used inside trace procedures to obtain information about the traced events The available keywords are briefly listed below Note 1 The trace procedure is always executed after the traced event 2 The available information depends on the traced event Only EVCODE CODENAME NAMECODE and EVSTATUS always return a value possibly meaningless for EVSTA TUS 3 A request to unavailable information is an error and stops the simulation 4 The exact meaning of each keyword with respect to the actual event is listed in the Reference Manual with each event symbolic name EVCODE returns the numeric code of the event as an integer Note The values of these numeric codes are likely t
311. ter TSTART is the default start ing time for all statistics The ON and OFF keywords explicitely start and stop statistics as soon as they are invoked Example DECLARE WATCHED INTEGER SIZE amp Size of I 0 requests QUEUE DISK CONTROL TMAX 1000 TSTART 100 EXEC BEGIN SETSTAT DISCRETE SIZE SETSTAT ON SIZE SETSTAT QUEUE DISK SIMUL END In this example the statistics on the watched integer variable SIZE begin at TIME 0 whereas statistics on queue DISK begin only at TIME 100 5 5 1 4 Partial results Syntax CONTROL STATISTICS PARTIAL GLOBAL SETSTAT PARTIAL stat_var_list Semantics When the regeneration method is used the STATISTICS parameter of the CONTROL command and the SETSTAT PARTIAL procedure control the type of statistical results which are available at the end of each regeneration period If the PARTIAL option is used during a simulation run a call to the OUTPUT procedure or to a result access function will produce the statistical results collected during the last regen eration period i e during the interval of time between the last two calls to the SAMPLE or SETSTAT SAMPLE procedures After the end of a simulation run a call to the OUTPUT procedure or to a result access func tion will produce the statistical results collected during the complete simulation run i e during the interval of time between the measurement starting time and the end of the simulation If t
312. tering a station with preemptive scheduling may cause a lower priority customer to be rejected The reject statement is executed by the rejected customer 3 7 17 COPY parameter Syntax copy parameter COPY queue Semantics The COPY parameter defines one or several identical stations by copying the parameters of another station at compile time The parameters SCHED SERVICE TRANSIT INIT RATE PRIOR TYPE and QUAN TUM of the template station are copied into the corresponding parameters of the station s identified by the NAME parameter The queue list expression defining the target stations is evaluated at compile time Example DECLARE QUEUE DKO DK1 DK2 CPU CLASS X Y 90 STATION Command Qnap2 V 9 2 STATION NAME DKO TRANSIT CPU SERVICE EXP 10 SCHED LIFO PREEMPT PRIOR X 2 PRIOR Y 1 STATION NAME DK1 COPY DKO STATION NAME DK2 COPY DKO PRIOR Y 0 The station is identical to station DKO and station DK differs only by the PRIOR Y parameter Note If the station used as reference COPY parameter is altered during the model description these modifications are not reflected in the copied stations User s Guide Control Language 91 3 8 CONTROL Command 3 8 4 Overview Syntax control command control parameter Semantics CONTROL control_parameter option parameter unit parameter nmax_parameter mar
313. ternal events an exception object must be connected to the external event Once connected the exception is automatically raised when the external event occurs The applicable external events are operating system dependent Refer to the QNAP2 installation guide for the list of external events available on your system Exception objects have the following attribute DEFHANDLER reference to the handler procedure The predeclared exceptions are the following SIMSTART resp SIMSTOP is raised automatically at the beginning resp end of the simulation The default handler is empty Note As opposed to the ENTRY and EXIT parameters of the CONTROL command SIM START and SIMSTOP are considered part of the simulation When used with the repli cation method the ENTRY and EXIT sequences are executed only once before and after the whole set of simulations whereas SIMSTART and SIMSTOP are raised once for each simulation Furthermore synchronization operations are not allowed in the ENTRY and EXIT sequences SIMACCUR is raised automatically when all the statistical variables for which a required accuracy has been specified see section 5 4 4 2 Accuracy control on page 205 are User s Guide Modeling Mechanisms 149 satisfactory The default handler is the STOP procedure The user can replace the default handler to perform additional controls and decide whether the simulation be actually stopped Note If the user handler does
314. the file contents and the reading operations already per formed on it gt ERROR INTER UNABLE TO OPEN FILE This message is printed when QNAP2 does not succeed in opening a file because of the system The user has to check he can access the file gt ERROR SUPER UNABLE TO OPEN FILE FOR RESTORE OPERATION This message is printed when QNAP2 does not succeed in opening a file in which an execution context has been saved The user has to check he can access the file gt ERROR SUPER MODEL NOT FOUND ON RESTORE FILE This message means that the restore operation failed for one of the following reasons e the string specified for the save operation is different from the string speci fied for the restore operation e an error occurred during the file reading The user has to read the file attribute ERRSTATUS to get more information about the error Error and Warning Messages Qnap2 V 9 2 check that the strings specified for the SAVE and RESTORE operations are the same e OBOGOB gt ERROR SUPER SPACE SIZES NOT IDENTICAL WORDS FOR SAVE WORDS RESTORE The QNAP2 versions used for the model save and restore are different the differ ence is the size of the QNAP2 memory space The user has to modify the size of the QNAP2 memory space so that the QNAP2 executable used to restore the model has the same size as the executable used to save it OBOGOD gt ERROR SUPER VERSION OF
315. the operation and a reference to the queue that was a partner in the operation usu ally the queue containing that customer These keywords may be used only for events involving exactly one partner customer or queue LCLASSNB returns the number of classes involved in the event It may be used only with the PMULT event CLLISTGET n returns the nth class in the list LCUSTNB returns the number of customers involved in the event It may be used only when the event involves a list of customers JOIN JOINC CLISTGET n returns the nth customer in the list LNUMNB returns the number of integers involved in the event It may be used only with the PMULT or VMULT events NUMLISTGET n returns the value of the nth integer in the list LPRIONB returns the number of priorities involved in the event It may be used only with the PMULT event PRILISTGET n returns the value of the nth priority in the list LQUNB returns the number of queues involved in the event It may be used only when the event involves a list of queues BLOCK UNBLOCK PMULT VMULT QLISTGET n returns the nth queue in the list FLAG returns a reference to the flag involved in the event This keyword may be used only for events involving one flag SET RESET WAIT FREE from a single flag LFLAGNB returns the number of flags involved in the event It may be used only when the event involves a list of flags WAITOR WAITAND FLISTGET n returns the nth
316. thematical solvers available in the current QNAP2 version are activated by the fol lowing procedures e SOLVE procedure analytical solvers exact and approximate MARKOV procedure markovian solver exact SIMUL procedure event driven simulation approximate The exact solvers produce the exact theoritical values of the performance criteria character izing the model The approximate solvers produce an estimate of the exact solution but this approximation is generally sufficient in practical cases Studying a model by means of an event driven simulation SIMUL procedure consists in reproducing the behaviour of the different model components stations and customers or more precisely one sample of the possible behaviours of the model components in the case of a stochastic model With some caution a simulation can produce a good estimate of the model performance criteria and can therefore be regarded as an approximate solver 5 1 2 Bringing resolution into play Before calling a solution method the user may select a sub model by using the NETWORK procedure which defines the sub network on which the solution method is applied The pa rameters of the stations belonging to the sub network should reference only stations within the same sub network Example DECLARE QUEUE A B C STATION NAME TRANSIT BEGIN amp this statement NETWORK A B amp is incorrect because SOLVE amp references C which is
317. tion length increases the number of samples increases too and the accuracy becomes better An approximation can be applied to long simulations the confidence intervals is approxi mately proportional to the inverse of the square of the simulated time A first simulation could provide confidence intervals on the mean value of the variables from these intervals length an approximated simulation run length could be computed by the user to obtain a specific accuracy on the results but an automatic mechanism is better In V9 0 the user can specify the required accuracy for selected statistical results The simulation is automatically stopped whend the required accuracy is reached In order to prevent endless simulations the maximum simulation run length is specified by the user The accuracy control mechanism is designed to spare simulation time Confidence intervals can be computed on any queue result as well as on statistical variables so the simulation run length control facility is available on all model outputs The accuracy control mechanism is described in section 5 4 4 2 Accuracy control B 2 4 Exceptions In QNAP2 communications between the modelling tool and the environment are possible either through file I O or by calling an external program These facilities have been extended to handle asynchronous signals i e interprocess sig nals key strokes real or CPU timers New mechanisms have been implemented QNAP2 for e
318. tistics speci fications The keyword indicates which feature of the functionality is called Example SETSTAT QUEUE CPU DISK This procedure call requests that standard queue statistics be computed on the CPU and DISK stations The major functionalities that now have structured identifiers are the following e Statistics specification SETSTAT keyword procedures e Result access functions GETSTAT keyword functions e Timer control SETTIMER keyword procedures e Exception control SETEXCEPTION keyword procedures e Simulation control information GETSIMUL keyword functions e Generalized trace specifications SETTRACE keyword procedures e Traced event information GETTRACE keyword functions 322 Algorithmic language Qnap2 V 9 2 5 Compatibility with V8 0 Qnar2 V9 0 is compatible with V8 0 All the functionalities of V8 0 are available in V9 0 Some new functionalities replace older ones The new ones are designed to be more powerful than the old ones The old functionalities still exist in V9 0 but they might be suppressed in the future Users are encouraged to use the new features The obsolete features are the following e CONTROL parameters for statistics specification should be used only with analytical solvers With the discrete event simulator most CONTROL parameters are overridden by SET STAT keyword procedures Mixing CONTROL parameters with SETSTAT keyword procedures is not recommended as the CONTR
319. tly specified the test sequence is Simulation Qnap2 V 9 2 executed whenever an event is processed by the simulator the condition is then continuously tested A test sequence is defined within the CONTROL command by the TEST parameter Whenever the specified regeneration state is reached the computation of the partial statistics on the last interval must be requested explicitly using the QNAP2 SAMPLE procedure The function of SAMPLE is the computation of partial statistics on the last regeneration interval and of global statistics and confidence intervals using the information collected from the beginning of the simulation up to the current regeneration point In this way partial results on the simulation are available before the simulation run is completed However these intermediate results are not output unless explicitly requested by a call to the procedure OUTPUT or through the results access functions The regeneration method is specified by the parameter ESTIMATION REGENERATION Example DECLARE QUEUE SOURCE SYST STATION NAME SOURCE TYPE SOURCE SERVICE EXP 1 TRANSIT SYST STATION NAME SYST TRANSIT OUT SERVICE HEXP 0 7 5 CONTROL TMAX 15000 ACCURACY SYST ESTIM REGENERATION PERIOD 0 5 IF SYST NB 0 THEN SAMPLE EXEC SIMUL X SIMULATION WITH REGENERATIVE METHOD TIME 14998 52 NB SAMPLES 4363 CONF LEVEL 0 95 kk kk ke
320. to recall that the independence assumption between the consecutive intervals created by the regeneration points is essential for the correct estimation of confidence intervals Meaningless confidence intervals would be produced if the independence is not verified 5 4 6 3 spectral method The basic principle of the two previous methods is to build a set of independent and identi cally distributed samples and to apply standard statistical techniques for estimating confidence intervals The spectral method is somewhat diferent in the sense that it does not rely on the independence assumption and applies to correlated samples provided that the identical dis tribution property is satisfied Indeed the correlation is explicitly taken into account in the estimation of the confidence intervals As a consequence the confidence intervals produced by the spectral method are most often larger than those produced by the regenerative method because of the effect of correlation in the variance of the point estimates The main advantage of the spectral method over the two previous methods is that the user needs not bother with the choice of specific parameters number of replications regeneration state the method applies to the analysis of the stationary behaviour of any simulated model The value of the parameter ESTIMATION for the spectral method is ESTIMATION SPECTRAL The parameter of the spectral method can be specified by the argument of the ke
321. to the algo rithmic language syntax gt WARNING SUPER HAS BEEN ADDED BEFORE THIS ELEMENT QNAP2 adds at the end of the preceding algorithmic statement To avoid this warning message the user has to add in the source file Error and Warning Messages Qnap2 V 9 2 gt WARNING SUPER SOME STATEMENTS ARE SKIPPED UNTIL SOME COMMAND OCCURS This message is printed after every message that occurs during the analysis of a command content This message warns the user that the analysis of the model goes to the next command block The user has to correct the error to get a complete analysis of the model e OJOHOA gt ERROR SUPER CANNOT LAUNCH EXECUTION SOME FATAL ERRORS OCCURED This message is printed if the compilation of the algorithmic code of the EXEC command has failed The user has to correct the compilation errors e ORO101 gt WARNING SIMUL ARITHMETIC UNDERFLOW ON TIME MANAGEMENT A SERVICE DELAY IS TOO SMALL COMPARED WITH TIME The QNAP2 real variables are in simple precision Internally the simulation time is managed in double precision 5 if you have a long simulation time with small delays there may be losses of precision on the user managed variables The preceding message means that the user will have to take care of the validity of the manually computed time dependent results The user is advised to use the standard results computed by QNAP2 and not to build simulation
322. ults the NETWORK procedure should be used Example amp model 1 DECLARE QUEUE A B C CLASS X Y STATION NAME EXEC SIMUL RESTART amp model 2 DECLARE QUEUE A B C D EXEC SOLVE END amp end of the physical program 0 RESTART Command Qnap2 V 9 2 3 6 REBOOT Command Syntax reboot_ommand REBOOT statement Semantics The REBOOT command can be used immediately after a deferred RESTORE procedure call The reboot statement can be used to perform some initializations before resuming the execution at the point where the SAVERUN was performed The reboot statement may include any algorithmic language operation that was allowed at the point where the SAVERUN was performed This includes customer manipulation and settings of simulation options e g TRACE TMAX if the SAVERUN was performed during simulation This feature has several interesting applications For example e Debugging when an error condition is detected QNAP2 can optionally save the model for later debugging The user may also detect error conditions and save the model e Variant analysis A first simulation is performed until some condition is reached e g steady state component failure and the model is saved The simulation can be resumed from the save point with different options e Interactive simulation control the simulation runs until some condition is reached e g decision point and the mode
323. user is allowed to modify the maximum number of classes only if neither queues nor classes have been defined before gt WARNING CONTROL HAS BEEN ADDED BEFORE THIS ELEMENT QNAP2 adds at the end of the preceding algorithmic statement To avoid this warning message the user has to add in the source file gt ERROR CONTROL BAD FILE OR LOGICAL UNIT SPECIFICATION CONTROL UNIT type file command is used to modify the output file This message means that the new output file must be explicitly defined Errors and Warnings 295 user has to modify the command or better to use procedures e g FILASSIGN to manage files e 060108 gt ERROR CONTROL ATTEMPT TO ASSIGN OUTPUT TO A FILE CLOSED OR OPEN IN A WRONG MODE IGNORED CONTROL UNIT type file command is used to modify the input output files This message means that the new output file FSYSOUTP is closed or opened in read mode The user has to modify the command or better to use procedures FILASSIGN OPEN to manage files e 06010 gt ERROR CONTROL ATTEMPT TO ASSIGN INPUT TO A FILE CLOSED OR OPEN IN A WRONG MODE IGNORED CONTROL UNIT type file command is used to modify the input output files This message means that the new input file FSYSINPU where the modele code is read is closed or opened in write mode The user has to modify the command or better to use procedures FILASSIGN OPEN to
324. ustomers representing pieces of a customer that was previously split with the SPLIT parameter All the expressions are evaluated at initiation time origin references the split specification that created the pieces join specifies the number of pieces of each class required to form the resulting customer of class result_class Partial joins are allowed i e it is not mandatory to join all pieces simul taneously Several join specifications can be provided The selection can be performed with integer priority levels deterministic switch or real weights probabilistic switch Example DECLARE QUEUE SENDER RECEIVER NETW CLASS MSG SMALLPK LARGEPK STATION NAME RECEIVER MATCH SENDER MSG SMALLPK 100 MSG SENDER MSG LARGEPK 10 MSG User s Guide Control Language 85 100 customers of class SMALLPK 10 customers of class LARGEPK are joined up into one customer of class MSG Note SPLIT MATCH and FISSION FUSION should not be confused SPLIT is intended to work in conjunction with MATCH FISSION and FUSION can be used independently See section 4 10 for more explanations 3 7 12 FISSION parameter Syntax fission parameter FISSION class_list queue class count prob Semantics The FISSION parameter must be used in place of the TRANSIT parameter to specify a customer fission Different fission possibilities can be specified for each class
325. with an ENTRY parameter is executed at the beginning of solution time in the case of a simulation run with the replication method the ENTRY statement is executed once only at the beginning of the first replication Example DECLARE QUEUE A B C INTEGER MA MB MC REAL PA PB PC STATION NAME A TRANSIT PB PC A amp CONTROL ENTRY BEGIN PRINT MA MB MC MA MB MC MB PB MA MB MC PC MC PC PC MA MB MC END EXEC BEGIN MA 10 MB 20 30 SOLVE MA 20 SOLVE END FOR MC 50 100 DO SOLVE The statements associated with the ENTRY parameter are executed at each call to the SOLVE procedure In this sequence the transition probabilities PB and PC are computed as functions of variables MA MB and MC 106 CONTROL Command Qnap2 V 9 2 3 8 19 EXIT parameter Syntax exit_parameter EXIT statement Semantics The EXIT parameter describes an instruction sequence that is to be executed after each solution of the model when returning from the solution procedure In this sequence the user may compute additional results or perform some printing EXIT cancels previous definitions default value The statement associated with an EXIT parameter is executed at the end of solution time in the case of a simulation run with the replication method the EXIT statement is executed once only at the end of the last replication E
326. with coefficients in table t rates service rates may only depend on the current number of customers in the station globally or per class Station types resources semaphores flags and simple queues without service specification are not allowed scheduling quantum scheduling is not allowed In addition to these basic assumptions there are some additional functional limitations described in the next section Note that if the analytical solvers apply the computation time is always smaller than with the Markovian solver or with the simulator MARKOV and SIMUL procedures Since QNAP2 includes a large set of analytical solvers an automatic dispatching facility is built in which searches for the most appropriate solver depending on the characteristics of the model Nevertheless the user may request the invocation of any specific solver controlled dispatching mode 5 2 2 Functional limitations 5 2 2 1 Definitions This paragraph describes various terms used or implied throughout the description of the ana lytical solvers sub chain a sub chain is a set of pairs station class which communicate with one another according to the transitions described in the model For instance the pair station A class X communicates with the pair station B class Y if a customer being in station A with class X may reach the station B with class Y after one or more transitions Analytical Solvers Qnap2 V 9 2 Sub chains contain distinct
327. xample DECLARE QUEUE A B C REAL LRESPONS 20 INTEGER N CONTROL EXIT BEGIN LRESPONS N MRESPONS C PRINT MRESPONS A MRESPONS B PRINT END OF ANALYZIS END OPTION NRESULT FOR N 1 STEP 1 UNTIL 20 DO SOLVE 3 8 20 ALIAS parameter Syntax alias_parameter ALIAS identifier identifier Semantics The ALIAS parameter is used to add new names to existing identifiers or keywords com mand or parameter names except aliases themselves The first identifier is the alias given to the second identifier Current implementation restricts key words to be non reserved ones e g BEGIN END ALL WITH Several aliases may be given to a given identifier Example French aliasing DECLARE QUEUE A CPU CONTROL ALIAS NOM NAME User s Guide Control Language 107 DEBIT THRUPUT GESTION SCHED ALIAS PAPS FIFO STATION NOM CPU GESTION PAPS In this example CONTROL ALIAS N NOM is not permitted since NOM is an alias of NAME 108 CONTROL Command Qnap2 V 9 2 Modeling Mechanisms 110 Qnap2 V 9 2 4 1 Introduction This chapter describes the main mechanisms used in a queueing network model queue disci plines service disciplines synchronization procedures Some features are meaningful only when some particular solver is to be used e g SIMUL MARKOV Although some of these features may be redundant or eve
328. xception handling The exception concept available in some standard languages or systems is offered to QNAP2 users through EXCEPTION objects This facility is extended to standard exception handling An exception is connected on one side to an external signal and on the other side to the corresponding treatment In QNAP2 the external signals are defined in a model by a standard name The availability of this name depends on the software installation and on the host machine because the operating system must allow users to handle the signal When the external signal occurs a user exception handler is executed before the treatment of the next simulation event Exception mechanisms QNAP2 are also intended to handle some internal conditions such as the beginning and the end of simulation These conditions are connected to standard internal exceptions The exception connected to the beginning of the simulation can be used to perform initial izations especially if confidence intervals are computed with the replication method User s Guide New features 319 Another standard internal exception is connected to the simulation run length control Its treatment is invoked when the requested accuracy has been reached The user can display the outputs or resume the simulation if he hopes a better accuracy The exception mechanisms are used especially if QNAP2 is incorporated in a more general environment to exchange data and orders with
329. y STEWART W J MARCA Markov Chain Analyser Rapport IRISA No 45 Juin 1976 127 pages STEWART W J Comparison of Numerical Techniques in Markov Modeling 21 2 Feb 1978 pp 144 152 SAAD Y Krylov subspace Methods for Solving large Unsymmetric Linear Systems Mathemat ics of Computation 37 155 July 1981 pp 105 126 SAAD Y Variation on Arnoldi method for computing eigenelements of large unsymmetric matrices Linear agebra and applications 34 1980 pp 269 295 5 3 3 Application conditions 5 3 3 1 Network topology The network must be a closed network no source nor exit queue It may contain one or several customer classes 5 3 3 2 Station types The following station types are allowed e simple servers e multiple servers e infinite server e simple queue station without service Resources or semaphores are not allowed User s Guide Solvers 197 5 3 3 3 Scheduling The following scheduling disciplines are allowed e FIFO or LIFO with or without priorities with or without preemption e PS processor sharing Finite quantum is not allowed 5 3 3 4 Services Each service should include only one single work demand which may be distributed according to a general distribution The work demand procedure may be followed or preceded by statements defining some dependencies see below The permitted distributions are EXP m exponential m mean m c2 hyper exponential m
330. y confidence intervals e transient state analysis 2 Markov chain analyser e exact results e steady state analysis 3 exact analytical solvers e analytical results based on the theorem developed by Baskett et al convolution algorithms e mean value analysis algorithms 4 approximate analytical solvers e iterative methods e diffusion approximations e heuristic approaches these approaches yield the standard performance criteria utilization factor mean queue length mean response time throughput which characterize the stationary behaviour of the network under study Mathematical methods may be applied only under restricted conditions These conditions are automatically checked by QNAP2 before any treatment Simulation is the only general resolution method but it may be costly to use in terms of processing requirements The solvers are described in chapter 5 Solvers User s Guide Introduction 5 6 1 4 Program example Consider a network is comprised of three stations A B and C Each station has one FIFO server default option Service times at station A and C are independent exponentially distributed random variables with respective means 5 0 and TC Station has a constant service time equal to 3 Example Program example amp declaration of the model elements DECLARE QUEUE A B C INTEGER N REAL TC amp description of the stations STATION NAME A INIT N SERVIC
331. y the usual result access functions GETSTAT keyword 5 2 13 2 Bibliography F BACCELLI A M MAKOWSKI Synchronization in Queueing Networks Proc IEEE Vol 77 No 1 Jan 1989 F BACCELLI BADEL Z LIU Interim Report on Parallel Fork Join Network Solvers Esprit Project 2143 IMSE Report D5 5 1 1990 F BACCELLI Z LIU Survey of Comparison Methods and Algorithms for Parallel Fork Join Networks Esprit Project 2143 IMSE Interim report R5 5 5 1990 F BACCELLI A JEAN MARIE Z LIU A New Solver for Sertes Parallel Fork Join Networks Esprit Project 2143 IMSE Interim report R5 5 10 1991 F BACCELLI A JEAN MARIE Z LIU P NAIN Interim Report on New Solvers for Series Parallel Networks and Sensitivity Analysis of Product Form Networks Esprit Project 2143 IMSE Report D5 5 3 1991 5 2 13 3 Application stipulations The application stipulations of the solver SPLITMAT are identical to those of CONVOL with the following additions e open series parallel network no loops feed forward network e only one source station with exponential service time distribution e FIFO single server stations with exponential service time distribution e no dependent service rates no class dependent service time distributions e probabilistic transitions are not allowed e no limited capacity stations e in SPLIT specifications only one piece can be sent to each destination queue e no probabilistic SPLIT e
332. yword SPECTRAL This parameter defines the value of the first measurement interval of the spectral method It is optional and the default value TMAX 512 is used if no argument is given Example DECLARE QUEUE SOURCE SYST STATION NAME SOURCE TYPE SOURCE TRANSIT SYST SERVICE EXP 1 STATION NAME SYST TRANSIT OUT SERVICE HEXP 0 7 5 CONTROL TMAX ACCURACY 15000 SYST EXEC SIMUL Simulation Qnap2 V 9 2 X SIMULATION WITH SPECTRAL METHOD TIME 15000 00 NB SAMPLES 512 CONF LEVEL 0 95 kk ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke a a a a a a NAME SERVICE BUSY PCT CUST NB RESPONSE SERV NB kk ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke a a a a a a SOURCE 1 007 1 000 1 000 1 007 14896 SYST 7131 7081 5 676 5 715 14896 0 2668E 01 0 2784E 01 1 659 1 752 kk ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke ke a a a a a a END OF SIMULATION MEMORY USED 5864 WORDS OF 4 BYTES 2 25 OF TOTAL MEMORY The results show that the confidence intervals obtained with the spectral method are some what larger than with the regeneration approach This was to be expected because no assump tion on the independence of the samples is made and as a consequence covariance terms are i
Download Pdf Manuals
Related Search
Related Contents
VAMPSET manual ILS975_9150D_91275_12150D Installation and Setup Guide.indd Samsung CLP-365W värvilised laser (18 / 4 lk/min) Kasutusjuhend Samsung NP-X65 montacargas para movimentação cobre mastro Samsung 24" minimalistliku disainiga LED monitor koos metalse alusega Kasutusjuhend MEMORIA DE TERMINACIONES VENTURA UsEr ManUal Copyright © All rights reserved.
Failed to retrieve file