& ex2 for 576 & multi-class version of ex1 /declare/ integer n_disk = 2; & global variables class integer n_term; & one var per class class real trans(n_disk); & dimension n_disk must be init. queue real serv_t; & param for every queue queue.serv_t & will serve for all & classes if equal class real cpu_t, term_t; & different for each class at cpu and terminals class string cl_name; queue cpu,terms,disk(n_disk); & station identifiers class dbase1, dbase2, admin; & class ids ref class r_class; & a var ranging over the classes & /station/ name=cpu; sched = ps; service = exp(cpu_t); & here, cpu_t stands & for class.cpu_t transit(all class) = disk(1 step 1 until n_disk), trans(1 step 1 until n_disk), terms, 1; & where list, rel. prob. list, where list, prob list ..; & all class causes the statement to be indexed by class implicitly & /station/ name = disk(1 step 1 until n_disk); transit = cpu; & classes are implicit if homogeneous service = exp(serv_t); & /station/ name = terms; init = n_term; & params here do not have to be init type = infinite; & standard types infinite, multiple, etc. & default type is single server service = exp(term_t); & classes are implicit transit = cpu,1; & /control/ class = all queue exit = begin & a procedure exec every time it runs print(" "); & blank line print ("class, throughput"); print(dbase1.cl_name, mthruput(terms,dbase1)); print(dbase2.cl_name, mthruput(terms,dbase2)); print(admin.cl_name, mthruput(terms,admin)); &mthruput(station,class) is a reserved var end; & /exec/ begin &init variables dbase1.cl_name:= "data-base class 1"; dbase2.cl_name:= "data-base class 2"; admin.cl_name:= "administrator"; & dbase1.trans:= 9,0; dbase2.trans:= 0,4; admin.trans:= 13,16; & dbase2.n_term:=10; admin.n_term:=1; & dbase1.cpu_t:=0.2; dbase2.cpu_t:=0.1; admin.cpu_t:=1.5; & dbase1.term_t:= 20; dbase2.term_t:= 30; admin.term_t:=120; & disk(1).serv_t:= 0.012; disk(2).serv_t:= 0.018; & & loop for multiple solutions for dbase1.n_term:=5,10 do begin & init variables for each if necessary (none here) print("no of terminals = ", dbase1.n_term); solve; & qnap decides what solver to use (MVA by preference) print(" "); & blank line print ("class, throughput"); print(dbase1.cl_name, mthruput(terms,dbase1)); print(dbase2.cl_name, mthruput(terms,dbase2)); print(admin.cl_name, mthruput(terms,admin)); &mthruput(station,class) is a reserved var end; end; /terminal/