Short Guide to the Ideas of QNAP2 Nov 7 99 1. Data Structures and Objects (a) variables of types {integer | real | boolean | string} may be scalar or arrays. Array dimensions may be parameters read in at run-time. (b) model objects of types {queue | customer | class | flag} may be scalar or arrays themselves, and may have attributes which are scalar or array variables, or pointers, or objects. Some of these attributes are automatic, and others may be added by DECLARE statements. For example: /DECLARE/ QUEUE REAL t....... adds an attribute t to every QUEUE object in the model, which can be accessed as "queuename.t". 2. Service stations are instances of queues and servers. They have a lot of automatic parameters. Each service station is defined in a section headed /STATION/ and includes: NAME = a queue name; SCHED = {FIFO | LIFO | PS PRIOR}; SERVICE = EXP(mean); or = some other canned procedure, or a BEGIN...END block in the QNAP2 algorithmic language (see the refernce manual) that calculates a value of the service time. TRANSIT = {station, value of probability} repeated; or = {(list of stations),(list of values of probability)}; or = other forms including classes of customers. TYPE = {SINGLE_SERVER | INFINITE | MULTIPLE(n) | RESOURCE | SOURCE}; INIT = no. of tokens at the station The queue name in NAME may be an array, in which case the range of indices for the instances is given as "NAME = name(i STEP 1 UNTIL j)" There is a default station OUT to give an exit, which does not have to be defined. A SOURCE type station generates arrivals at intervals defined by the SERVICE statement, with a class set on leaving (in the TRANSIT statement) 3. Classes are treated as objects like queues, and can have a lot of parameters attached to them (example p 29): -- the service times at stations -- the class size -- their transition probabilities on leaving each station ALL CLASS is a list of all classes. 4. Program layout /DECLARE/ is just one block with all the object classes and variable types, and global variable instances /STATION/ is a block for each station declaring instances /CONTROL/ describes the initialization and termination --- an initial printout in a statement ENTRY = procedure --- the ending and reporting in a EXIT = begin.... end procedure (IMPORTANT for multiclass systems, it you want the automatic output to give details by class, is to include a statement in CONTROL: /control/ class = all queue) See example p 50. There is an automatic output which is recommended. For custom output to supplement it, printing uses a statement print("string" [,list of expressions]); and the expressions may use the following reserved variables which contain results: mthruput(station [,class]) mbusypct(...) mresponse (...) (wait plus service) mcust_nb (...) mservice (...) mblocked(....) (wait only) /EXEC/ gives the detailed control of the flow of the solution, including initialization and solution and reporting. It may consist of just the one statement SOLVE, or it can include a loop iterating over sets of parameter values. There can be several EXEC blocks. If the program cannot find a suitable solver it will simulate the system; beware of this as it can take a long time. Analytic solution takes seconds, simulation can take hours. As well as SOLVE, which invokes a range of analytic methods, there are commands SIMUL and MARKOV. There is a default output summary with results for each station, which will be printed unless it is suppressed by the command in the /control/ block of "option = nresult;", after which it could be reinstated by /exec/ output; 5. Notes on syntax for TRANSIT in QNAP2 The syntax (p 3.20 in the Reference manual) is TRANSIT [(class list)] = transition list transition list = {queue sublist [,class sublist], real sublist} one or more times. You can have a s many of these statements as you like so the simple way is to put in one for each class The brackets do not appear; [..] means optional The sublists must be of the same length; if of length one the statement can have the forms: TRANSIT (all_class) = queue TRANSIT (class0) = queue1,class1,prob1, queue2,class2,prob2, etc TRANSIT (class0) = queue1,prob1, queue2,class2,prob2, etc 6. Programming Use lower case for all characters. No tabs if you use emacs as an editor Invoke as qnap2 outputfile There are facilities for taking parameters from a file, or from the keyboard, but they are really hard to use with unix Fortran. There is a User Guide, full of examples, and a Reference Manual which describes the syntax of all statements.