Home

SPNP User`s Manual Version 6.0 - Duke ECE

image

Contents

1. TARVI Punicast 1 Ree a0 or al T110 bio T L 01 0001 TARV L Punicast L N gt L 1 a0 or al T L 10 bio 2 4 Yon C 1 doi A Er en ey A ne ne re ay H TARV PAR TAR PCS tOUT POUT TCS i TARVO eaf Pbroad 7 A Nek 1 H g0 orgl RE O o o Ne gt Yoff N PAR PCS sign POUT dio i kel N is the number of active unicast flows and determines the number of components in the dotted rectangle at the left side of the figure Figure 10 11 Accurate SRN Model for the BUS define rateOUT 5000 int K 2 double lambda 0 9 mu 1 beta 1 1 int BN 40 x Buffer Size int QLEN double g0 0 01 g1 0 05 d01 0 5 d10 0 5 double a0 0 01 a1 0 05 b01 0 5 b10 0 5 prototype guard functions int guardARV int guardARVI 0 int guardARV2 0 int guardARV3 int guardARV4 0 int guardBST int guardBMD int guardBLG 0 x prototype rate functions double rateARVO double rateARVI double rateARV2 double rateARV3 double rateARV4 117 void options iopt lOP PR RGRAPH VAL NO iopt lOP PR MC VAL NO iopt lOP PR DERMC VAL NO iopt lOP PR PROB VAL NO ioptIOP_PR PROBDTMC VAL_NO iopt OP PR DOT VAL_NO topt IOP_PR_MERG_MARK VAL_YES 10pt IOP_PR_FULL_MARK VAL_NO iopt lOP USENAME VAL NO iopt lOP DEBUG VAL NO ioptlOP P
2. 37 void ac init void ac_reach reward rate double tokenNo return mark p_1 double rd return mark p_2 0 1 0 void ac_final solve INFINITY pr_expected Average Token Number in pl pr_expected steady state prob lace p_1 that pl 38 lace p_2 is empty tokenNo LA rd Chapter 5 Specialized Output Functions A state of a Markov chain is called transient if during an infinitely long observation time period the system visits this state only finitely often In other words there is a nonzero probability that the system will never return to this state A state is defined as recurrent if the system visits this state infinitely often during an infinitely long observation period A recurrent state is called positive recurrent or non null recurrent if its average recurrence time is finite Otherwise it is defined as a null recurrent state A Markov chain is irreducible if every state can be reached by every other state A CTMC is ergodic if it is irreducible and positive recurrent SPNP was initially aimed at the steady state solution of SRNs whose underlying CTMC is ergodic There are a number of measures which could be considered unusual but closely related to steady state In particular they do not require the implementation of a new solver they can be computed either from the steady state probabilities or by solving a sl
3. n 0 p strtok sline do if strlen p gt 12 x a prob is longer than 12c 4 probs n atof p x printf prob e n probs n n p strtok char NULL while p nleft n if nleft r probs n nleft nleft return r return 1 00 void loadprob char sfName int i j bFound char sfNameFull 32 sMsg 100 static ME xcurmark LogMsg MSG PLAIN loading init prob sprintf sfNameFull Ss rg sfName if fpRG fopen sfNameFull r NULL fclose fpRG fclose fpPrb LogMsg MSG_EXIT load_init_prob could not open rg file 195 l sprintf sfNameFull Ss prb sfName if fpPrb fopen sfNameFull r NULL fclose fpPrb LogMsg MSG_EXIT load_init_prob couldnot open prb file x read headers of rg and prb read_rg_head read_prb_head for i 0 i lt nstates i printf before next_marking n next_marking printf after next_marking n printf r Sd i for curmark FirstCanonic curmark NULL curmark NextCanonic curmark x if Prob i gt 0 then prob of i th marking is set if Prob initlcurmark index gt 0 continue if curmark index lt 0 continue bFound 1 for j 0 j lt nplace j if curmark mk idx j markingiji bFound 0 break if bFound break x find the same mar
4. Fox and Glynn uniformization Stiff uniformization RS 6000 Linux VMS system VAX The description will apply mainly to UNIX based systems A basic knowledge of the stochastic Petri net SPN formalism and Markov chains is assumed The reader should consult 24 25 if unfamiliar with some Petri net PN concepts The Markovian SPN model we adopt is best described in 5 6 7 but it may be useful to consult 1 FSPN model we assume is best described in 8 while the non Markovian SPN model is best described in 11 but enhanced with the list of distributions of this manual For a reference on the C language see 13 For further information on Markov chains performance modeling and reliability modeling see 3 31 while for performability modeling see 27 28 33 Markov and Markov reward model solution techniques are surveyed in 26 Sensitivity analysis of Markov and Markov reward models is discussed in 2 and the sensitivity analysis of SRN models is discussed in 21 Several papers have appeared in the literature where SPNP was used some of these papers are listed in Appendix B A 6 hour long VHS tape for a course on Putting Stochastic Petri Nets to Work by K S Trivedi and G Ciardo can be ordered from USC ITV by calling 1 213 740 0119 Although model hierarchies are not built into SPNP hierarchical SRN models can be exercised using a UNIX shell file and submodels can communicate information
5. SPNP file smod3t c include lt stdio h gt include lt string h gt include lt math h gt include user h include misc h x global variables int NBUF 32 int NTK 8 int NRR 1 int NMRR 2 int NER 3 double larvrate 3 double harvrate 6 double rateTMMPPOI 0 01 double rateTMMPP10 0 02 double rateTTK 5 double rateTTX 18 double rateTMTX 18 double prbtVPN 0 8 double prbtBE 0 2 double prbtRT 128 double my_prbtRT 128 char nameFP 128 double FPprecision 0 000001 int TIpolicy 1 int TIp3th 1 char linktype 128 int ntoken 0 prototype guard functions int guard tRT 0 int guard tBP 0 int guard tMBP 0 141 int guard tBE int guard tVPN int guard tMWT 0 prototype rate functions double rate TARV 0 prototype cardinality functions int cardinality MWT void LoadConfig FILE fp char sstr 100 ptr int 1 nodata 0 sprintf sstr Ss cfg modelname if fp fopen sstr r NULL perror Can not Open the Config File exit 1 while fgets sstr 100 fp if xsstr xsstr n continue if strncmp sstr Size of Buffer 15 ptr strchr sstr sscanf ptr 1 Sd amp NBUF continue if strncmp sstr Size of Leaky Bucket Token Pool 32 ptr strchr sstr sscanf ptr 1 Sd amp NTK continue if
6. else return prbtVPN x larvrate else return 0 0 double get_prbVPN2BE if mark pHQ NBUF return 1 0 else return 0 0 double get_prbB VPN2BE if mark pHQ NBUF amp amp mark pMMPP return 1 0 else return 0 0 double get_prbNB VPN2BE if mark pHQ NBUF amp amp mark PMMPP return 1 0 Ise return 0 0 double get_BE2VPN if mark pTK mark pHQ gt TIp3_th if mark pMMPP return prbtBE x harvrate else return prbtBE larvrate 149 else return 0 0 double get_prbBE2VPN if mark pTK mark pHO gt TIp3 th return 1 0 else return 0 0 double get_prbBBE2VPN if mark pTK mark pHo gt Tlp3_th amp amp mark pMMPP return 1 0 else return 0 0 double get_prbNBBE2VPN if mark pTK mark pHo gt TIp3 th amp amp mark pMMPP return 1 0 else return 0 0 double get_prbBEMPTY if mark pTK mark pHO mark pRR amp amp mark pMMPP return 1 0 else return 0 0 double get_prbNBEMPTY if mark pTK mark pHO mark pRR amp amp mark pMMPP return 1 0 else return 0 0 double get_prbBust if mark pMMPP return 1 0 else return 0 0 void ac final double delta 0 0 tmp prbtRT maxvalue total_prbtRT 0 0 double prbVPN2BE h prbVPN2BE 1 proBE2VPN h 0 prbBE2VPN I 0 double prbBust FILE f
7. jarc tmm2f 1 mm2up oarc tmm2f 1 mm2dn larc tsw2f1 sw2up oarc tsw2f1 sw2dn larc tpr2f1 pr2up oarc tpr2f1 pr2tmp larc tpr2f1 pr2tmp oarc tpr2f1 pr2dn1 larc tpr2f2 pr2tmp oarc tpr2f2 pr2dn2 iarc tpr2f2 dbup oarc tpr2f2 dbdn larc tmm2r mm2dn oarc tmm2r mm2up larc tsw2r sw2dn oarc tsw2r sw2up larc tpr2r pr2dn1 oarc tpr2r pr2up harc tpr2r mmidn harc tpr2r mm2dn harc tpr2r swldn harc tpr2r sw2dn iarc tdb 1 dbup oarc tdb 1 dbdn iarc tfefl feup oarc tfefl fedn int assert x count the number of states in which the failure of the database by itself has caused system failure This excludes the states in which the database has been corrupted by a failing processor Y if mark dbdn 1 amp amp mark pridn2 0 amp amp mark pr2dn2 0 count return RES_NOERR void ac_init fprintf stderr nExample from Heidelberger amp Goyal n n 103 void ac_reach double reliab x if the database is failed 4 if mark dbup 0 return 0 0 x if the front end is failed d if mark feup 0 return 0 0 x if both the processing sub systems are failed if mark mm1lup 0 mark swlup 0 mark prlup 0 amp amp mark mm2up 0 mark sw2up 0 mark pr2up 0 return 0 0 retur
8. void ac_init void void ac_reach void A CSPL file must contain functions ac_init and ac_reach SPNP calls ac_init before starting the reachability graph construction The function void pr_net_info void is always called in function ac_init to output information about the model under study to the out file This is especially useful when the number of places or transitions is defined at runtime Calls to bind can also be used here to assign numeric values to parameters as previously discussed in section Define and use parameters The function ac_reach is instead called after the reachability graph construction has completed The function void pr_rg_info void can be used in function ac_reach to output information about the reachability graph to the out file Note this does not affect the generation of the rg file Calls to bind can also be used here to assign numeric values to parameters as previously discussed In addition the function void pr_parms void can be called here to print the names of parameterized transitions along with the parameter names and current values to the out file 4 5 Function ac_final void ac_final void A CSPL file must contain function ac_final Function ac_final is designed for a user to flexibly define outputs CSPL provides a set of functions for this purpose the simulation case will be treated separately in Chapter 6 29 e solve
9. SA 10 07 Mb 2 beta 2 beta 2 beta See Os _3 gamma defines three parameters a 6 and y and timed transition t with rate timed transition ts with a marking dependent rate 10 0 mark p 6 and immediate transition tz with weight y Before solving the model the parameters are assigned with numeric values by calling the bind function where the name of the parameter and its value are given For example in bind alpha bind beta bind gamma 1 0 N 2 0 75 a B and y are assigned a values V where N may be set by user input 2 0 and 0 75 respectively 4 2 9 Functions to define an FSPN e fplace The function void fplace char n BRefer to Sec 10 14 and Sec 10 15 for examples 20 defines a a fluid place or a transition with name n The same restrictions as for place and transition names apply fbound The function void fbound char SpS double b defines the upper bound on the fluid level of fluid place p to be b The lower bound is always 0 finit The function void finit char SpS double 1 defines the initial fluid level in fluid place p to be l instead of the default 0 fbreak The function void fbreak char p double defines a threshold in fluid place p to be l Several threshold may be defined in the same place by calling fbreak for multiple times This function allows to change parameters after level l is
10. e Markovian model 124 e Dependent marking rates e Priorities 10 10 4 SPNP File LA c include lt stdio h gt include user h x corresponds to birth death model in the papers define PLST 2 x Short Packet Size define PLMD 4 x Medium Packet Size 4 define PLLG 32 x Long Packet Size define cl 0 342 define c2 0 093 define c3 0 565 define rateOUT 5000 int K 3 double lambda 0 9 mu 1 beta 1 1 int BN 40 x Buffer Size int QLEN double g0 0 01 gl 0 05 beta_01 0 5 beta_10 0 5 double a0 0 01 a1 0 05 alpha_01 0 5 alpha_10 0 5 x prototype guard functions int guardARV int guardtl int guardt2 int guardTunicast int guardBST 0 int guardBMD 0 int guardBLG prototype rate functions double rateARVO double rateTunicast void options iopt OP PR RGRAPH VAL NO 10pt IOP_PR MC VAL_NO 10pt IOP_PR DERMC VAL_NO 10pt IOP_PR_PROB VAL_NO 10pt IOP_PR PROBDTMC VAL_NO iopt OP PR DOT VAL NO ioptdOP PR MERG MARK VAL VES 10pt IOP_PR_FULL_MARK VAL_NO ioptIOP_USENAME VAL_NO ioptIOP_DEBUG VAL_NO 10pt IOP_PR_MARK_ORDER VAL_CANONIC iopt OP PR RSET VAL NO ioptl OP PR MC ORDER VAL_FROMTO 125 ioptIOP_SENSITIVITY VAL NO ioptIOP_MC VAL_CTMC ioptIOP_SSMETHOD VAL_SSSOR iopt IOP_TSMETHOD VAL_FOXUNIF ioptIOP_ITERATIONS 20000 fopt FOP_PRECISION le 13 fopti FOP ABS RET M0 0 0 iop
11. e sens e expected e set_prob_init e pr_mcinfo e pr_std_average e pr_std_cum_average e pr_expected e pr cum expected e pr time avg expected e pr mtta and pr newmtta e pr_mtta fun e pr_cum_abs e pr_value e pr_message Descriptions of these function are given below e solve void solve double t Funciton solve must be used at least once before any other function called to solve the Markov chain numerically at time t The value given to f can be a positive real number for transient analysis or the value INFINITY for steady state analy sis Calls to solve can be invoked repeatedly for different solution times and can be interleaved with user requested output Calls to bind can also be used here to re assign numeric values to parameters as previously discussed solve must be called again to re solve the new model 10 Whenever solve is called after a previous call to bind the reachability graph and Markov chain will be reconstructed followed by another call to ac_reach 30 e void pr_mc_info void pr_mc_info void Function void pr_mc_info can be called in ac final to output data about the Markov chain and its solution e pr_std_average void pr_std_average void Function pr std average computes for each place the probability that it is not empty and its average number of tokens for each timed transition the probabil ity that it is enabled and its
12. This option specifies the method by how vanishing markings are managed and eventually eliminated e Specifying VAL_REDNEVER means that the stochastic process being considered explicitly regards the vanishing markings as ordinary states With this option only a steady state solution is possible Using an embedded DTMC measures related to 1mmediate transitions are computed and vanishing non absorbing loops present no problems e Specifying VAL REDAFTERRG means that the reachability graph constructed in cludes explicitly the vanishing markings but these are then eliminated numerically before generating the underlying CTMC With this option any type of solution is possible and vanishing non absorbing loops present no problems but measures related to immediate transitions are not computed e Finally specifying VAL REDONTHEFLX means that vanishing markings are elim inated during the reachability graph construction With this option any type of so lution is possible but vanishing non absorbing loops are considered an error and measures related to immediate transitions are not computed 58 Users are strongly encouraged to use VAL_REDONTHEFLY as this usually results in the fastest solution and the lowest memory requirements However there are rare patho logical cases where this option will actually results in larger memory requirements than VAL_REDNEVER 7 IOP_OK_ABSMARK IOP_OK_VANLOOP IOP OK TRANS MO and IOP_OK_VAN_M0
13. end set coverage for reconfiguration can be set as default or specific phase Coverage default 0 9999 end set number of point to obtain result in each phase Number of Step default 10 0 8 2 7 4 7 end set period of each phase Phase Time default 672 0 48 1 17520 3 26280 end set CPU requirement for system working in each phase CPU Requirement default 3 1 2 322 end 189 set the number of CPU down will cause system down CPU Down Cause Fail default 2 1 4 10 17 5 Shell File t csh This shell file is used to run the example First use SPNP package to compile the cspl file pms c then run f csh to get the result bin csh set Model pms foreach nPhase 0 1 2 3 4 set ModelName Model _ SnPhase pms spn ModelName end 10 18 Extensions to SPNP In the use of SPNP to solve real world problems we often generate a system model that is too big to be solved by SPNP A solution which has been used extensively in the previous examples is dividing the model into several SPNs and solving it by iteratively execution of these SPNs In the following two techniques we have been developed for this task will be introduced 10 18 1 Fixed point iteration Suppose we have two submodels M and M which are all SPNs Some parameters of M depend on the statistical behavior of Mi and M also has some parameters depend on M To solve this kind of interconnected models fix
14. nput Ds 0 0s into down state n pr expected dt ime60vs10 dtime60vs10 pr message n n pr message n This is what actually used pr message and fed into upper level n pr message nPut D into up state Ds 0 0s into down state n pr expected dtime5vs10 dtimeSvs10 hold_cond cond5vs10 times5vs10 pr value MTTFeq timesSvs10 0 pr value MTTReq timesSvs10 1 pr value ofm 1 expected dtimeSvs10 8766x60 timesSvs10 0 x8766 pr mc info pr_std_average VMI and SBI module gsbvscl c include lt stdio h gt include user h x global variables x all the rates are in the format 1 0 MTTF or 1 0 MTTR unit 1 Hour double lambdaP 1 0 120000 0 hardware failure rate for HSP double lambdaT 1 0 4000 0 transient sw failure rate for HSP x reboot time for HSP fault active HSP failed unsuccessful detection 4 x standby HSP working 1 min double betal 1 0 1 0 60 0 x coverage for reboot betal double q 0 80 double q x coverage for reboot beta double r repair rate of Ps Fn Bus NSP DSP in lost redudency partial outage total outage double rrLr 1 0 24 0 double rrPo 1 0 8 0 double rrTo 1 0 4 0 prototype reward functions 168 double dtime int cond x prototype guard functions prototype rate functions double rHsp2_Ds double rDs_hsp2 double rDs_FC
15. readerwriterbuffer c xTime Jul 04 97 Pk include user h int n k void options iopt IOP_SIMULATION VAL_YES iopt lIOP SIM CUMULATIVE VAL VES iopt OP SIM STD REPORT VAL VES liopt lOP SIM SEED 345983453 iopt IOP_SIM_RUNS 100000 fopt FOP_SIM_LENGTH 20 fopt FOP SIM CONFIDENCE 95 n input Total Processes k input Max Reading Processes int fun return mark p2 int gun return mark p3 gt 0 amp amp mark p2 gt 0 1 0 void net place p0 place p1 place p2 place p3 place p4 place p5 init p0 n init p5 k rateval t0 4 0 unifval t1 1 0 2 0 normval t 2 2 0 0 5 rateval t3 1 0 unifval t 4 1 0 2 0 normval t5 3 0 1 0 imm t6 guard t 6 gun policy t 1 PRS policy t 2 PRD larc t0 p0 oarc t0 p1 larc t1 p1 larc t1 p5 oarc t1 p2 harc t1 p3 larc t2 p2 oarc t2 p0 oarc t2 p5 larc t3 p0 oarc t3 p3 larc t4 p3 miarc t4 p5 k oarc t4 p4 larc t5 p4 oarc t5 p0 moarc t5 p5 k viarc t6 p2 fun voarc t6 p5 fun voarc t6 p0 fun void ac_init pr net_info int assert return 1 void ac_reach double eff return mark p2 gt 6 1 0 void ac_final pr_cum_expected More than in p2 eff 154 10 14 Hybrid System reactor temperature control sys tem 10 14 1 Source
16. 4 2 3 Rate dependent function iii ii 10 11 11 12 14 16 4 3 44 4 5 4 6 4 2 4 Marking dependent function 4 2 5 Specify marking dependent enabling functions 4 2 6 Specify marking dependent firing rates or firing weights 4 2 7 Specify marking dependent arc cardinalities 4 2 8 Define and use parameters 4 2 9 Functions to define an FSPN 4 2 10 Functions for non Markovian SPNs Function assert Functions ac_init and ac reach Function acfinalO A complete example 5 Specialized Output Functions 6 Discrete Event Simulation 6 1 6 2 6 3 6 4 6 5 Standard discrete event simulation 6 1 1 Current limitations of the simulator 6122 examples 452 3 518s 2 Ola Blain mo Importance splitting for rare events 621 Example es 0 3 4 a Importance sampling Regenerative simulation Regenerative simulation with importance sampling 7 Available Options 7 1 Options for intermediate files iv 16 17 17 18 19 20 23 28 29 29 36 39 43 8 9 7 2 Options for analytic numeric solution 53 7 3 Options for simulative solution 55 7 4 Miscellaneous options 58 Format o
17. 48 Execution of a model in iSPN 75 expected 32 fbound 21 fbreak 21 fcondition 23 fiarc 21 File functions in iSPN 72 finit 21 finput 11 texbffinput 10 fire 3 fliarc 22 floarc 22 fmark 22 fmiarc 21 fmoarc 21 foarc 21 fopt 10 fplace 20 fviarc 21 fvoarc 21 gamdep 25 gamfun 25 gamma distribution 25 gamval 25 geomdep 23 geometric distribution 24 geomfun 23 geomval 23 guard 4 guard 17 halting_condition 14 harc 13 hold_cond 41 hyperdep 26 hyperdep_is 48 hyperexponential distribution 26 hyperfun 26 hyperfun_is 48 hyperval 26 hvperval is 48 hvpo exponential distribution 27 hvpodep 26 hvpofun 26 hvpoval 26 iarc 13 imm 12 immediate transition 4 12 importance sampling 47 importance splitting 46 inf 21 inhibitor arc 4 14 init 12 input 11 texbfinput 10 input arc 3 14 iopt 10 logndep 24 lognfun 24 lognormal distribution 24 lognval 24 loop 5 mark 16 marking dependent 4 5 16 17 mharc 14 miarc 14 moarc 14 208 Modification of the SRN in iSPN 70 MRM 1 multiplicitv 3 14 negative binomial distribution 26 negbdep 26 negbfun 26 negbval 26 net 11 non null recurrent 39 normal distribution 24 normdep 24 normfun 24 normval 24 null recurrent 39 oarc 13 options 9 output arc 3 14 pardep 27 pardep is 48 Pareta distribution 27 parfun 27 parfun is 48 parm 19
18. After the model is executed the CSPL code is shown again To view the output switch to the Run Programs page 9 To view the StdErr files pull the top edge of the message window in the Run Pro grams page down 75 10 Other files like the Log and the Reachability Graph files can be displayed by click ing the RMB anywhere in the message window The Run Programs page has model selection information path and filename of project a menu for file view edit and execute operations a message window for StdOut all out put message and a message window for StdErr error messages see Figures 9 8 9 9 Menu A A 3 ml A 23 En Figure 9 8 Run Programs menu Model Selection gt gt gt Path mp vishnus File jispn gph c E i Figure 9 9 Model Selection menu From the Run Programs page 1 Click Sel to select model to be run 2 Click Run to run the model 3 Click Edt to view edit the CSPL file for the selected model When Edt is clicked the emacs editor is invoked 4 Click Sav to save the C SPN log rg out files 5 Click Clr to clear all messages in StdOut 76 9 6 Viewing output Output can be observed in two ways one is textual as was described in the previous section and the other way is graphical in the form of line graphs Graphs are viewed in the Plots page The Plots page opens with a menu for the graphing functions mouse bindings graph definition and model selection ar
19. IOP SSMETHOD This option specifies the numerical steady state solution method for the process e VAL SSSOR for Steady State SOR Successive Overrelaxation 29 e VAL _GASEI for Steady State Gauss Seidel 29 e VAL POWER for Steady State Power Series Algorithm 35 SOR is usually the fastest method but there are cases where SOR does not converge while Gauss Seidel converges and vice versa The Power Series Algorithm has a better convergence performance than the other two but the the rate is much slower IOP SSDETECT This option specifies whether or not we wish to use steady state detection in transient analysis for stiff Markov chains In this option the numerical transient probabilities of underlying stiff CTMC are obtained through the uniformization with steady state detection of the underlying DTMC and computation of Poission probabilities using the method of Fox and Glynn The readers can find details in 18 e VAL YES for transient solution using steady state detection default e VAL NO for not using steady state detection FOP SSPRES This option specifies the required precision for the steadv state detection IOP TSMETHOD This option specifies the numerical transient state solution method for the CTMC e VAL_TSUNIF for Transient Solution using Standard Uniformization e VAL FOXUNIF for Uniformization using the Fox and Glynn method for computing the Poisson probabilities 54 IOP_CUMULATIVE This option
20. continue if strncmp sstr _nvanmark 8 sscanf sstr 11 3d amp num nState num continue if strncmp sstr _reachset 8 num nState 1 for i 0 i lt num i fgets sstr 100 fp if xsstr continue sscanf sstr Sd amp np ptr strchr sstr _ if ptr v nState continue ptr for j 0 j lt nPlace j sscanf ptr Ss nstr if xnstr initPV np nToken j 0 else sscanf nstr Sd amp initPV np nToken j ptr strstr ptr nstr ptr strlen nstr break j fclose fp void LoadProb char xsModelName LE fp char sstr 100 ptr nstr 40 c int i np double ttime 184 sprintf sstr Ss prb sModelName if fp fopen sstr r NULL perror Can not Open the Output File of Last Phase exit 1 while fgets sstr 100 fp if strncmp sstr _t ime 5 sscanf sstr 8 S1 amp ttime if ttime pTime nPhase 1 continue fgets sstr 100 fp np 0 while fgets sstr 100 fp ptr sstr while 1 sscanf ptr Ss nstr if Istrlen nstr break sscanf nstr SdSc 1lf amp i amp c amp initPV np prob np if np gt nState break ptr strstr ptr nstr ptr strlen nstr if ptr sstr gt strlen sstr break else if strstr ptr break if np gt nState break brea
21. exit 1 182 while fgets sstr 100 fp if xsstr 4 xsstr n continue if strncmp sstr Number of Phase 16 ptr strchr sstr sscanf ptr 1 Sd amp ntPhase continue if Istencmp sstr Number of CPU 14 ptr strchr sstr sscanf ptr 1 Sd amp TNUM continue if strncmp sstr Failure Rate 13 LoadP fp void failrate 1 continue if strncmp sstr Repair Rate 12 LoadP fp void reprate 1 continue if strncmp sstr Number of Step 15 LoadP fp void xjnumvp 0 continue if strncmp sstr Coverage 9 LoadP fp void x coverage 1 continue if strncmp sstr Phase Time 11 LoadP fp void x pTime 1 continue if strncmp sstr CPU Requirement 15 LoadP fp void upreq 0 continue l if strncmp sstr CPU Down Cause Fail 20 4 LoadP fp void downreq 0 continue j fclose fp void LoadState char xsModelName FILE xfp char sstr 100 ptr nstr 10 int i j num np 183 sprintf sstr Ss rg sModelName if fp fopen sstr r NULL perror Can not Open the Output File of Last Phase exit 1 while fgets sstr 100 fp if lstrncmp sstr _ntanmark 8 sscanf sstr 11 3d amp num nState num continue if strncmp sstr _nabsmark 8 sscanf sstr 11 3d amp num nState num
22. harc T101 PON1 oarc T201 PON2 larc T210 PON2 harc T201 PON2 oarc T301 PON3 iarc T310 PON3 harc T301 PON3 oarc T401 PON4 larc T410 PON4 harc T401 PON4 oarc TARVO PARV oarc TARV1 PARV oarc TARV2 PARV oarc TARV3 PARV oarc TARV4 PARV iarc CST PARV iarc tMD PARV iarc tLG PARV oarc tST PST oarc tMD PMD oarc tLG PLG iarc tBST PST iare t LST PST iarc t BMD PMD iarc t LMD PMD iarc t BLG PLG larc t i Gu p iG moarc tBST PBUF PLST moarc tBLG PBUF PLLG moarc tBMD PBUF PLMD iarc tEOUT PBUF T moarc tEOUT PEOUT 3 iarc TOUT PEOUT harc tEOUT PEOUT int assert return RES_NOERR void ac_init void ac_reach void ac_final double Ilp mlp slp pal int dBN BN 20 if dBN lt 1 dBN 1 solve INFINITY Ilp expected LLP mlp expected MLP slp expected SLP Loss Prob pr value pr value pr value pr value Loss Prob Loss Prob Loss Prob of Short Packets S slp of Medium Packets M mlp of Long Packets L llp of total Packets T cl slp c2 mlp c3 x Ilp for QLEN 0 QLEN lt BN QLEN dBN pql ex pected QL fprint
23. hsp0_F E larc hsp0_hspl1 hspo oarc hsp0_hsp1 hsp1 larc hspls_hsp0s hspls oarc hspls_hsp0s hsp0s larc hspls_hsp2 hspls oarc hspls_hsp2 hsp2 iarc hsp0s_hspl1s hsp0s oarc hsp0s_hspls hspls larc hspOs_F hspOs oarc hsp0s_F F iarc F_hsplss F oarc F_hsplss hsplss larc hsplss_hsp2 hsplss oarc hsplss_hsp2 hsp2 3 void assert void ac_init void ac_reach void ac_final double t for t 0 t lt 50000 t 30000 solve t pr expected dtime dtime pr expected dtimeFC dtimeFC pr expected dtimeF dtimeF solve INFINITV pr expected dt ime dtime pr expected dt imeFrC dtimeFC pr expected dt imeF dtimeF pr expected tsodpm tsodpm pr hold_cond test cond hold_cond cond times pr value times0 times 0 pr value times1 times 1 pr value tsodpm computed from times times 1 times 1 times 0 8766 60 pr message nlook at state FC n hold_cond condFC timesFC pr value t ime sFCO timesFC 0 167 pr value timesFC1 timesFC 1 pr value dtimeFC computed from timesFC timesFC 1 timesFC 1 timesFC 0 8766 60 pr message nlook at state F n hold_cond condF timesF pr value t imesF0O timesF 0 pr_value t imesF1 timesF 1 pr value dt imeF computed fromtimesF timesF 1 timesF 1 timesF 0 8766 60 pr message
24. int assert return RES_NOERR void ac_init void ac_reach Ada void ac_final double Ilp mlp slp pal solve INFINITY llp expected LLP mlp expected MLP slp expected SLP pr value Loss Prob of Short Packets S slp pr value Loss Prob of MediumPackets M mlp pr value Loss Prob of Long Packets L llp pr value Loss Prob of total Packets T cl slp c2 x mlp c3 x Ilp for QLEN 0 QLEN lt BN QLEN BN 20 pql expected QL fprintf Outfile nProb for Queue Len gt 3d 12g n QLEN pq QLEN BN 1 pql expected QL fprintf Outfile nProb for Queue Len d 12g n BN pql pr_std_average 10 12 Performance anlysis of Multi Protocol Label Switch ing Network 10 12 1 Source X Zang and K S Trivedi The Label Allocation Table Recovery and Differentiated Service in Multi Protocol Label Switching Network Internal technical report Duke University 10 12 2 Description In this example system n input links and one output link are considered see Fig 10 14 The traffic on each input link is bursty There are two types of traffic on each input link i e higher priority VPN traffic and lower priority best effort traffic All these incoming traffics will be switched to one output link There are n 1 queues at the output
25. le 8 The above code causes the markings to be printed in lexical order instead of the default canonical order and the precision for a numerical solution is set to le 8 10 4 1 2 Functions to accept runtime inputs int input char msg double finput char msg Functions input and finput accept input from standard input during run time while function option is called Function input accepts an integer value while function fin put accepts a floating point value Example int num customers options num customers input Number of customers The above CSPL code causes the following message specified by the string parameter msg INPUT Number of customers int gt to be displayed on the screen more precisely on the stderr stream then SPNP waits for the user to type a value The input value is accepted by SPNP and is printed in the out file together with the string msg This is useful to recall the set of values input to a particular CSPL file to generate the current output The returned input value can be assigned to any variable declared by the user and can be used in the rest of the CSPL file Note be sure to use the variable after the desired value is assigned 4 2 Function net void net void A valid CSPL file must contain function net Function net calls a set of functions to define an SRN The following description starts with a small set of functions to de
26. 0 If you wish to let SPNP per form as many runs as needed to achieve the specified relative error which should then be strictly between zero and one you should assign IOP_SIM_RUNS to 0 or not assign anything to it and then specify FOP_SIM_ERROR If neither is defined the default is then to run until a 10 relative error is reached at least five runs are always performed in this case e Random generator IOP_SIM_SEED allows to change the seed of the random generator 45 6 1 1 Current limitations of the simulator The current limitations of the simulator are the following e The FSPNs iplemented are linear FSPNS which means that the rates of the flows from or in fluid places are linear between two firing of transitions or until a bound has been hit in a fluid place e The guards the flows can depend only on the discrete marking the bounds of fluid places and thresholds in fluid places and not on the whole state space and function fbreak doesn t allow yet to take into account the increasing or decreasing property of the fluid level to modify consequently the rates or guards e The cumulative measures to be computed can not involve a fluid place as they are computed by the sum of the measure in the current state multiplied by the time to the next event a firing of a transition or a fluid event i e a bound is hit in a fluid place 6 1 2 Examples See Section 10 13 and Section 10 14 6 2 Importance splitting for rare e
27. 00301161 double lambda22 0 00301 161 int rl 5 int r2 5 double mul 2 73 double mu2 2 73 int K1 16 int K2 16 double e 0 0001 x prototype reward functions double Qlen1 double Earrival double Qlen2 double ELR double PFull prototype guard functions int gar2 int garl prototype rate functions double RErl double Rarl double REr2 double Rar2 x prototype cardinality functions int R2 int dep12 int RI void options ioptIOP_PR _RGRAPH VAL_NO iopt lOP PR MC VAL NO ioptIOP_PR DERMC VAL_NO iopt IOP_PR_PROB VAL _NO ioptIOP_PR PROBDTMC VAL_NO ioptIOP_PR_DOT VAL_NO ioptIOP_PR MERG_MARK VAL_YES 10pt IOP_PR_FULL_MARK VAL_NO ioptIOP_USENAME VAL_NO ioptIOP_DEBUG VAL_NO iopt lOP PR MARK ORDER VAL_CANONIC ioptIOP_PR_RSET VAL_NO iopt IOP_PR_MC_ORDER VAL_FROMTO e NUMERICAL SOLUTION chosen ioptIOP_SENSITIVITY VAL_NO ioptIOP_MC VAL_CTMC iopt lOP SSMETHOD VAL SSSOR ioptIOP_TSMETHOD VAL_FOXUNIF ioptIOP_ITERATIONS 2000 fopt FOP_PRECISION 0 000001 fopt FOP_ABS_RET_MO 0 0 ioptIOP_CUMULATIVE VAL XES 106 ioptIOP_SSDETECT VAL_YES iopt lOP OK ABSMARK VAL NO ioptdOP OK VANLOOP VAL_NO ioptlOP OK TRANS MO VAL XES ioptIOP_OK_VAN_MO VAL_YES iopt IOP_ELIMINATION VAL_REDONTHEELY x REWARD Functions double Qlen1 return double
28. B Tuffin D S Chen and K S Trivedi Comparison of Hybrid Systems and Fluid Stochas tic Petri Nets Technical Report Center for Advanced Computing and Communication Duke University 1999 10 14 2 Description The net is shown in Figure 10 19 It represents a reactor temperature control system The reactor core temperature rises at a linear rate To control the temperature a rod chosen randomly between two is put into the reactor core when the temperature reaches 550 degrees The rod is then removed when the temperature falls back to 510 degrees Re G 60 x 10 Xi Y Temperature Figure 10 19 FSPN model of reactor temperature control example 10 14 3 Features e This is an FSPN e The flows are marking dependent and linear 155 10 14 4 SPNP File reactor c This example is from Comparison of FSPNs and HS by Bruno Tuffin el tdk include user h int c3 c4 void options iopt lOP SIMULATION VAL_YES ioptIOP_SIM_CUMULATIVE VAL_YES ioptIOP_SIM_STD_REPORT VAL_YES iopt IOP_SIM_SEED 345983453 iopt IOP_SIM_RUNS 10000 fopt FOP_SIM_LENGTH 1000 fopt FOP_SIM_CONFIDENCE 95 fopt FOP_FLUID_EPSILON 0 00000001 double f return 0 1 double fp return 0 1 double g1 return 50 0 double g2 return 56 0 double g3 return 60 0 int g_decrease c3 fcondition Temperature F GE 550 0 return c3 int
29. Distributed Systems Houston 1992 2 M Balakrishnan A Puliafito K S Trivedi and I Viniotis Buffer Sizing for Avail able Bit Rate ABR Traffic in an ATM Switch IEEE International Conference on Communications 1995 Full version submitted to the J of Telecomm Systems Baltzer Science Publishers Zurich 3 M Balakrishnan and K S Trivedi Stochastic Petri Nets for the Reliability Anal ysis of Communication Network Applications with Alternate Routing Reliability Engineering and System Safety special issue on Reliability and Safety Analysis of Dynamic Process Systems Vol 52 No 3 pp 243 259 1996 4 LR Chen and R Betapudi A Petri net model for the performance analysis of trans action database systems with continuous deadlock detection 1994 ACM SIGAPP Symp on Applied Computing SAC 94 March 1994 5 I R Chen and T W Tsao A reliability model for real time expert systems IEEE Transactions on Reliability Dec 1994 6 H Choi and K S Trivedi Approximate Performance Models of Polling Systems using Stochastic Petri Nets Proceedings of the IEEE INFOCOM 92 Florence Italy May 4 8 1992 7 G Ciardo and K S Trivedi Solution of Large Generalized Stochastic Petri Net Models in Numerical Solution of Markov Chains W J Stewart ed Marcel Dekker New York 1991 8 G Ciardo J Muppala and K S Trivedi Analyzing Concurrent and Fault Tolerant Software using
30. ELR ELR pr expected PFu11 PFull pr expected Earrival Earrival ispn count ispn count intvl 10 7 Criticalitv Importance and Birnbaum Importance 10 7 1 Source R M Fricks and K S Trivedi On Computing Importance Measures Using Reward Mod els VII Simposio de Computadores Tolerantes a Falhas VII SCTF pp 169 183 Camp ina Grande Brazil Jul 1997 10 7 2 Description A novel technique for computing importance measures in state space dependability models is introduced here Specifically reward functions in a Markov reward model are utilized for this purpose in contrast to the common method of computing importance measures 110 through combinatorial models and structure functions The following simple example is used to show how to calculate Criticality Importance and Birnbaum Importance 10 7 3 Features e Define function with a Stochastic Petri net e Reward based measures 10 7 4 SPNP File sun c include lt stdio h gt include user h x k x REWARD RATE FUNCTIONS x A Criticality double Q1 return mark p1 1 1 0 double Q20 return mark p2 1 1 0 double Q30 return mark p3 1 1 0 double QQ return Q10 Q20 Q30 gt 2 1 0 Birnbaum 4 double g11 return 1 Q20 Q30 gt 2 1 0 double g10 return 0 Q20 Q30 gt 2 71 0 double g21 return Q10 1 030 gt 2 71 0 double g20 return Q1
31. Research Vol 48 pp 155 184 1994 J K Muppala G F Ciardo and K S Trivedi Stochastic reward nets for reliability prediction Communications in Reliability Maintainability and Serviceability An International Journal published by SAE International Vol 1 No 2 pp 9 20 July 1994 C W Ro and K S Trivedi Performability Analysis of Handoff Calls in Per sonal Communication Networks Proc Sixth International Conference on Com puter Communications and Networks IC3N 97 Las Vegas Nevada Sept 1997 H Sun X Zang and K S Trivedi A stochastic reward net model for performance analysis of prioritized DQDB MAN Computer Communications Vol 22 No 9 pp 858 870 June 1999 H Sun X Zang and K S Trivedi Performance of Broadcast and Unknown Server BUS in ATM LAN Emulation Technical Report Center for Advanced Computing and Communication Duke University 1999 H Sun X Zang and K S Trivedi A Performance Model of Partial Packet Discard and Early Packet Discard Schemes in ATM Switches Technical Report Center for Advanced Computing and Communication Duke University 1999 L Tomek and K S Trivedi Fixed Point Iteration in Availability Modeling in Informatik Fachberichte Vol 91 Fehlertolerierende Rechensysteme M Dal Cin ed Springer Verlag Berlin 1991 L Tomek J K Muppala and K S Trivedi Modeling correlation in software recov ery blocks IEEE Transa
32. SRN the vanishing markings are still present and probabilities are given instead of rates the matrix is stochastic 8 3 The prb file This file describes the transient and steady state probability for each tangible marking it corresponds to the result of the CTMC solution even when the actual solution used a DTMC It can be generated if the option IOP PR PROB is set to VAL_YES The format is as following _firstindex 0 63 _nstates lt same value as in input gt _method lt method actually used gt _precision lt the reached precision gt iterations lt the actual number of iterations gt time lt _INFINITY gt lt time_point gt _probabilities lt state gt lt prob gt lt state gt lt prob gt lt state gt lt prob gt lt state gt lt prob gt _derprobabilities lt state gt lt prob gt lt state gt lt prob gt lt state gt lt prob gt lt state gt lt prob gt _cumprobabilities lt state gt lt prob gt lt state gt lt prob gt lt state gt lt prob gt lt state gt lt prob gt _dercumprobabilities lt state gt lt prob gt lt state gt lt prob gt lt state gt lt prob gt lt state gt lt prob gt 64 Chapter 9 User guide for iSPN 9 1 Introduction 9 1 1 Organization of this guide The guide assumes the user already has some experience with SPNP It is intended for first time users
33. These options specify respectively whether absorbing markings transient vanishing loops a transient initial marking and a vanishing initial marking are acceptable or not e If VAL NO is specified the program will stop if the condition is encountered e If VAL_YES is specified the program will signal such occurrences but it will con tinue the execution if it is possible FOP ABS RET MO This option specifies the value of the rate from each absorbing marking back to the initial marking If this rate is positive these markings will not correspond to absorbing states in the CTMC This is useful to model a situation that would otherwise require a large number of transitions to model this restart Of course the numerical results will depend on the value specified for this option IOP DEBUG Setting this option to VAL_YES causes SPNP to output on the stderr stream the mark ings as thev are generated and the transitions that enabled them This feature is extremelv useful when debugging an SRN FOP FLUID EPSILON This option specifies the e for which to values concerning the level in a fluid place are considered identical if they difference is smaller than This value is introduced to prevent numerical round off mistakes 59 FOP TIME EPSILON This option specifies the e for which to values of time are considered identical if they dif ference is smaller than e This value is introduced to prevent numerical round
34. and Computer Science Applications Prentice Hall Inc Englewood Cliffs 1982 K S Trivedi and V G Kulkarni FSPNs Fluid Stochistic Petri Nets In 4th Inter national Conference on Applacations and Theory of Petri Nets pages 24 31 1993 K S Trivedi J K Muppala S P Woolet and B R Haverkort Composite perfor mance and dependability analysis Performance Evaluation 14 3 4 197 215 Feb 1992 205 34 B Tuffin and K S Trivedi Implementation of importance splitting techniques in stochastic petri net package Technical report Duke University Durham NC 1999 35 W B van den Hout The Power Series Algorithm A Numerical Approach to Markov Processes Tilburg University 1996 206 Index absorbing marking 4 ac_final 29 ac_init 29 ac_reach 29 accumulated 39 affected 13 arc 3 assert 28 beta distribution 25 betdep 25 betfun 25 betval 25 bind 19 binodep 25 binofun 25 binomial distribution 26 binoval 25 Cauchy distribution 27 caudep 27 caudep is 48 caufun 27 caufun is 49 cauval 27 cauval is 48 Creation of the SRN in iSPN 69 CSPL 1 7 detdep 23 deterministic transtions 23 detfun 23 detval 23 diarc 22 dmharc 22 dmiarc 22 dmoarc 22 dharc 22 doarc 22 dvharc 22 dviarc 22 207 dvoarc 22 enable 3 enabled 16 ergodic 39 Erlang distribution 27 erldep 27 erldep is 48 erlfun 27 erlfun is 48 erlval 27 erlval is
35. b2 rateval t1_1 al rateval t1_2 a2 ratefun tar1 Rarl guard tarl garl imm Er_in1 priority Er_in1 20 probval Er_in1 1 ratefun Er_trans1 RErl imm Er_out1 priority Er_out1 20 probval Er_out1 1 ratefun tar2 Rar2 guard tar2 gar2 imm Er_in2 priority Er_in2 20 probval Er_in2 1 ratefun Er_trans2 REr2 imm Er_out2 prioritv Er out2 20 probval Er_out2 1 x ARC d oarc t2_1 mmpp_1 iarc t1_1 mmpp_1 oarc t2_2 mmpp_2 larc t1_2 mmpp_2 harc t2_1 mmpp_1 harc t2_2 mmpp_2 oarc tarl bufl iarc Er inl buf1 voarc Er_in1 Er_token1 R1 larc Er_trans1 Er_token1 oarc Er transl Er stagel viarc Er_outl Er_stagel Rl voarc Er_out1 buf2 dep12 oarc tar2 buf2 larc Er_in2 buf2 voarc Er_in2 Er_token2 R2 larc Er_trans2 Er_token2 oarc Er_trans2 Er_stage2 viarc Er_out2 Er_stage2 R2 harc Er_in1 Er_token1 harc Er_in1 Er_stagel harc Er_in2 Er_token2 harc Er_in2 Er_stage2 T 109 int assert return RES_NOERR void ac_init void ac_reach J void ac_final float ispn count 0 0 intvl 10 0 while ispn count lt 200 0 solve ispn count pr expected Queue Len1 Qlen1 pr expected Queue Len2 Qlen2 pr expected
36. compared against each other on one plot or viewed simultaneously The graphical output format is created in such a Way that it may be viewed by other vizualization packages such as gnuplot or xvgr Welcome Graph Interface Alun Programs Pl Debugging Browse Example Credits Help One Reliability Relisbiity graph to display details Figure 9 4 The output page Previously debugging was a difficult task due to the textual environment Opening many intermediate files created during the compilation of SPNP was necessary in order to know the validity of the CSPL file One of these intermediate files rg is important for finding bugs in the model description if they exist This file is a description of the reachibility graph and is displayed in a tree format as a part of iSPN The debugging feature is based on navigation of the reachability graph result ing in an innovative function of iSPN that should provide improved efficiency in the development of stochastic Petri net models 68 iSPN also offers the user the unique ability to efficiently and selectively browse a database of old SPNP models This specialized browser provides an easy way of or ganizing SPNP programs which can be very beneficial even for the more seasoned use rs The following sections describe how to use these capabilities of iSPN 9 4 The Petri net editor The Petri net editor handles the
37. correct path of the global interpreter 83 9 11 Programming resources The selection of the script based approach is due to three of its main benefits Tcl Tk provides a higher level interface to X than most standard C library toolkits Development of the IDEAS environment will be fast because of fast turnaround aiding the debbuging process and refinement of the interface The user interface is clearly isolated from the rest of the application making the overall design easy to maintain and expand 9 11 1 Tel version tcl7 4 Tcl stands for Tool Command Language Tcl is really two things a scripting language and an interpreter for that language Tcl was designed and crafted by Prof John Ousterhout of U C Berkeley Tcl can be used in commercial applications for free The interpreter has been ported from UNIX to DOS and Macintosh environments As a scripting language Tcl is similar to other UNIX shell languages which let you execute other programs Tcl provides enough programmability variables control flow procedures that we can build up complex scripts that assemble existing programs into a new tool tailored to our needs 9 11 2 Tk version tk4 0 Tk is a toolkit for window programming It was designed for the X window system Tk shares many concepts with other windowing toolkits Tk provides a set of Tcl commands that create and manipulate widgets A widget is a window in a graphical user interface that has a particular appea
38. creation of the SPN The WORK AREA which constitutes the major portion of the screen is where the user designs his stochastic Petri net Icons of the various objects used in SPN design appear in the Objects menu see Figure 9 5 E create modify base Figure 9 5 The objects menu At all times the mouse bindings are displayed above the Objects menu For large PNs which extend beyond the bounds of the Work Area the user can get a global view of the design in the Global Design window see Figure 9 6 iSPN provides numerous functions to simplify design of Petri nets see Figure 9 7 Creation of the SRN To create an SPN 1 Click on Create 2 Select object 69 Figure 9 6 The global view Figure 9 7 The iSPN menu 3 Move the cursor into the Work Area and click The object appears in green and a table appears next to the Work Area for the object parameters 4 Press Return to confirm operation 5 Repeat for each object SPN modification Features for SPN modification can be broadly categorized into 1 Parameter modification 70 2 Physical object modification Parameter modification involves altering the parameters already assigned to a specific object To change the value of an object 1 Click Modify 2 Select the object in the Work Area 3 Modify the attributes of the object in the table Physical object modification deals with changing the position and shape of the objects iSPN prov
39. current phase Many practical systems are actually phased mission systems e g the voyage of an aircraft can be divided into several phases such as take off cruise and landing each with completely different reliability requirements and behaviors Compared with single phased systems the reliability analysis of PMS is much more complex because of the dependence across phases The dynamic structure and configura tion of the PMS usually requires a distinct model for each phase which also increases the complexity of modeling and analysis Here SPNP is used to analyze the PMS Fig 10 23 shows a general model scheme of a PMS Here we assume that the only deterministic activities in PMS are the phase changes At a high abstraction level the model of a PMS is composed of two logically separate subnets e system subnet This subnet called system net SN represents components in the system and their interactions which evolve according to the events that modify system states As seen in the Figure 10 23 this subnet is a pure SRN that contains only exponentially distributed and immediate transitions e phase subnet This subnet describes the phase changes It is represented by a DSPN and is called the phase net PhN The PhN contains all the deterministic transitions of the overall DSPN model and may contain immediate transitions as well 10 17 3 SPNP File pms c include user h include lt string h gt define MAXPHASE 30 s
40. defined by the X protocol including mouse and keyboard events Tk widgets have default bindings so you do not have to program in detail by yourself You can also arrange for events to occur after a specified period of time with the after command Event bindings are structured into a simple hierarchy of global bindings class bindings and instance bindings An example of a class is Button which is all the button widgets The Tk toolkit provides the default behavior for buttons as bindings on the button class You can supplement these bindings for an individual button or define global bindings that apply to all bindings You can even introduce new binding classes in order to group sets of bindings together The binding hierarchy is controlled with the bindtags command The basic structure of a Tk script begins by creating widgets and arranging them with a geometry manager and then binding actions to the widgets After the interpreter processes the commands that initialize the user interface the event loop is entered and the application begins running 9 11 3 Tix version Tix4 0 4 Tix the Tk Interface Extension is an extensive set of over 40 mega widgets including ComboBox Motif style FileSelectBox MS Windows style FileSelectBox PanedWindow NoteBook Hierarchical List Directory Tree File Manager and many more Tk only pro vides a set of primitive widgets that may be tedious to work with In constrast Tix delivers powerful higher lev
41. e VAL SPLIT if we are using splitting e VAL IS if we are using importance sampling In implementation e VAL REG if we are using regenerative simulation In implementation e VAL ISREG if we are using regenerative simulation with importance sampling In implementation e VAL_THIN if we are using thinning with independent replications In implemen tation e VAL_BATHIN if we are using thinning with batches and then a single run In implementation e VAL_ISTHIN if we are using thinning with importance sampling In implementa tion The length of the replications or of the batches is given by FOP SIM LENGTH for the regenerative simulation FOP_SIM_LENGTH is not used his option specifies when IOP_SIM_SPLIT VAL_YES if we are using the RESTART method or the splitting one which don t estimate the same thing IOP_SIM_SEED This option specifies the value of the seed of the random generator Default value is 52836 IOP SIM CUMULATIVE This option specifies whether to collect data as time averages or point of time estimates 56 IOP SIM STD REPORT This option specifies whether the standard report is printed to the out file in simulation IOP SPLIT LEVEL DOWN This option is specific to the splitting method IOP SIM SPLIT RESTART VAL NO It specifies the number d of levels the simulation must cross down to stop the simulation path to reduce the computational time IOP SPLIT RESTART FINISH This option
42. g_increase c4 fcondition Temperature FLQ 510 0 return c4 void net place No_rod place Rod_1 place Rod_2 init No_rod 1 fplace Temperature finit Temperature 512 0 fbound Temperature 550 0 fbreak Temperature 510 0 inf T2 iarc T2 No_rod oarc T2 No_rod floarc T2 Temperature f g1 inf T1 iarc T1 Rod_1 oarc T1 Rod_1 fliarc T1 Temperature fp g2 inf T3 iarc T3 Rod_2 oarc T3 Rod_2 fliarc T3 Temperature fp g3 imm t1 probval t1 1 0 guard t 1 g_ decrease imm t2 probval t2 1 0 guard t2 g increase imm t 4 probval t4 1 0 guard t4 g decrease imm t 3 probval t3 1 0 guard t3 g_increase larc t1 No_rod oarc t1 Rod_1 larc t2 Rod_1 o0arc t2 No_rod larc t3 Rod_2 o0arc t3 No_rod larc t4 No_rod oarc t4 Rod_2 void ac_init pr net_info l int assert return 1 void ac_reach void ac_final 156 10 15 Dual tank example 10 15 1 Source G Ciardo D M Nicol and K S Trivedi Discrete Event Simulation of Fluid Stochastic Petri Nets JEEE Transactions on Software Engineering 25 2 207 217 1999 The parameters have been changed to have rare events 10 15 2 Description The system described in Figure 10 20 contains two tanks One and Two of respective maximal capacity b and b2 A fluid flows with rate rin f
43. if mark P_DOWN gt DOWNREQ amp amp mark P_UP gt 0 return 1 else return 0 int VFUpO return mark P_UP int VFDown return mark P_DOWN double RFSysDown if mark P_FAIL return 0 0 else return 1 0 void SetInitProb int nph int i j char tstr 20 if nph for i 0 i lt nState i if initPV i prob lt 0 00000001 continue sprintf tstr IT_IP d i imm tstr probval tstr initPV i prob miarc tstr P_ LPH TNUM for j 0 j lt nPlace j if initPV i nToken j moarc tstr sPlace j initPV i nToken j else imm IT_IP probval IT_IP 1 0 miarc IT_IP P_LPH TNUM moarc IT_IP sPlace 1 TNUM j void net place P_LPH init P_LPH TNUM SetInitProb nPhase place P_UP place P_DOWN place P_SPARE place P_FAIL ratedep T_FAIL FAILRATE P_UP iarc T_FAIL P_UP 187 oarc T_FA ratedep T_ F iarc T_RE oarc T_RE imm IT_R probval IT IL P_DOWN REPAIR REPRATE P_DOWN PAIR P_DOWN PAIR P_UP ECS _RECS C guard IT_RI priority IT larc IT_RE oarc IT_RI ECS GFRec _RECS 10 CS P_SPARI ECS P_UP E l imm IT RI probval IT_ ECF RECF 1 C guard IT_RECF GFRec priority IT_RECF 10 CE p _ SPARE a fa F larc
44. is specific to the RESTART method i e IOP SIM SPLIT RESTART VAL NO It specifies that every path will continue up to the simulation time given by FOP_SIM LENGTH or up to reaching an upper thershold not only the last one as in the usual RESTART method IOP SPLIT PRESIM This option specifies when we are using importance splitting techniques if we determine the thresholds by running a presimulation IOP SPLIT PRESIM RUNS The option specifies the number of independent paths to use to estimate each threshold when the presimulation is required for importance splitting methods IOP SPLIT NUMBER This option specifies if IOP SPLIT _PRESIM VAL _NO the number of thresholds must be used to apply importance splitting methods These thresholds must be specified in table FOP SPLIT THRESHOLDS 1 IOP SPLIT NUMBER in function setup 57 FOP SIM LENGTH This option specifies the time to run for each simulation iteration No default is assumed so the user has to specify a value for it whenever IOP SIMULATION is VAL YES FOP SIM CONFIDENCE This option specifies the required confidence for the simulation a number between zero and one Currently only 90 95 or 99 can be specified FOP SIM ERROR If IOP SIM RUNS is 0 or left unspecified the simulator takes this error as the stopping criterion it will run until the error precision is reached It must be a value between 0 0 and 1 0 7 4 Miscellaneous options IOP ELIMINATION
45. language In the latest version V6 0 the user can specify non Markovian SPNs and Fluid Stochas tic Petri Nets FSPNs Such SPNs are solved using discrete event simulation rather than by analytic numberic methods Several types of simulation methods are available stan dard discrete event simulation with independent replicarions or batches importance split ting techniques splitting and Restart importance sampling regenerative simulation with out or with importance sampling and thinning with independent replications batches or importance sampling Since a graphical user interface iSPN is now available the need for the knowledge of C language further diminishes 11 Contents Preface 1 Introduction 2 Notation and Terminology 2 1 2 2 2 3 Petri net and stochastic Petri net ZA gt Bag ve mie be ee 242 Petri et sven ou 2 1 3 Stochastic Petri net 2 1 4 Important feature for SPNP marking dependence Non Markovian SPN Fluid Stochastic Petri net 3 Getting Started With SPNP 3 1 32 Installation and run Output files 4 The CSPL Language 4 1 4 2 Function options 4 1 1 Functions to set option values 4 1 2 Functions to accept runtime inputs Function net 4 2 1 Functions to define a simple SRN 4 2 2 An example using the power of ANSIC
46. link 1 e n for the higher priority VPN traffic flows and 1 shared by the lower priority best effort traffic flows Each input link uses a leaky bucket to regulate the higher priority VPN traffic The excess VPN traffic can be merged into the shared best effort queue On the other hand the excess capacity of VPN can also be used by best effort traffic on the same input link 137 Round robin or weighted round robin WRR policy is used to serve the higher priority VPN traffic VPN LSP s traffic Tad 2 27 ET 8 75 27974 72 best effort traffic Label Switch Router a b On Om VPNa Y Output Link KAN A ee Input Link 3 VPN Sc Figure 10 14 Example system 10 12 3 Features e Utilizing model decomposition e Fixed point iteration e Script file for execution 10 12 4 SPN model for LSN A model directly modeling LSN will be too large to be solved To simplify the analysis we assume that the percentage of the higher priority traffic is identical for all input links and the packet size distribution is equal for the traffic on all links Then the model can be decomposed into three parts tagged link aggregated link and best effort queue Table 10 1 gives the guards for transitions in the SPN models in Fig 10 15 Fig 10 16 and Fig 10 17 10 12 5 Files list 1 Perl script file for fixed point iteration bin env perl NIT 200 Mod
47. mark buf1 double mark Er_token1 double mark Er_stagel1 rl double Earrival double ret_val ret_val mark mmpp_2 7 lambda21 lambda22 if mark Er_token1 1 ret_val rI mul return ret_val double Qlen2 return double mark buf2 double mark Er_token2 double mark Er_stage2 rl j double ELR double ret val if Qlen20 e gt K2 ret_val mark mmpp_2 lambda21 lambda22 if mark Er_token1 1 ret_val rl mul return ret_val else return 0 double PFull if Qlen2O e gt K2 return 1 0 else return 0 GUARD Functions 4 int gar2 107 ere ne oe int garl return Qlen1 e lt K1 x RATE Functions double RErl return r1 mul double Rar if mark mmpp_1 return lambdal 1 else return lambdal 2 double REr2 return r2 mu2 double Rar2 if mark mmpp_2 return lambda21 else return lambda22 x CARDINALITY Functions int R2 return r2 int dep12 if K2 Qlen2 t e lt 1 return 0 else return 1 int R1 108 return r1 void net x PLACE place mmpp_1 init mmpp_1 1 place mmpp_2 init mmpp_2 1 place buf1 place Er_token1 place Er_stagel place buf2 place Er_token2 place Er_stage2 x TRANSITION rateval t2_1 bl rateval t 2_2
48. mark busAUp mark dspBUp mark busBUp if upNsp lt numNspFcMin 0 00001 capNsp double upNsp numNspFcMin else capNsp 1 if upDsp lt numDspFcMin 0 00001 capDsp double upDsp numDspFcMin l else capDsp 1 if cap gt 0 99999 cap capNsp lt capDsp capNsp capDsp GUARD Functions x RATE Functions double rrfPsfO calCap if cap lt 0 00001 return rrTo else return rrLr double rrfBus calCap if cap lt 0 00001 return rrTo 176 else return rrPo x CARDINALITY Functions void net x PLACE place hspUp init hspUp 1 place hspDn place bpUp init bpUp 1 place bpDn place psfUp init psfUp numPsf place psf place busA init busA place bus place bus init busB place bus place nsp p u init nspA place nsp place nsp init nspB place nsp place dsp init dspA u u numNspA n p numNspB n j numDspA place dsp place dsp init dspB place dspB n p numDspB Dn TRANSITION ratedep hspFail frHsp hspUp ratedep hspRepr rrHsp hspDn ratedep bpFail frBp bpUp ratedep bpRepr rrBp bpDn ratedep psfFail frPsf psfUp ratefun psfRepr rrfPsf ratedep busAFail frBus busAUp ratefun busARepr rrfBus ratedep busBF ail frBus busBUp ratefun bu
49. marking dependent enabling function or a guard is probably a better choice Marking dependent functions can be used to specify the firing rate of a timed transition or the firing probability of an immediate transition 2 2 Non Markovian SPN A major restriction to the SRN model described previously is that the transitions are either immediate or exponentially distributed Therefore some other distributions have been in troduced in SPNP in the last a few years When a transition has a general distribution of firing time the SPN is called a Non Markovian SPN This complicates the numeric analytic or simulative method used to solve the model At the present time the transitions can have constant uniform geometric Weibull normal lognormal Erlang even the hyperexponen tial distributions The complete list of distributions implemented and being implemented in SPNP can be found at the beginning of Chapter 6 Here again the distribution parameters can be marking dependent 2 3 Fluid Stochastic Petri net SPNP also can simulate and solve FSPNs FSPN is an fluid extension to SRN parrallel to the fluid queueing network extension to ordinary queueing network The main difference between SRNs and FSPNs is that in addition to ordinary discrete places a FSPN can also have fluid places containing a real fluid level between zero and an upper bound possibly infinity An input or output arc connected to a fluid place removes or adds fluid contin
50. numPsf 3 int numPsfUpMin 2 x minimum number to make system up number of NSPs on bus A and B int numNspA 4 int numNspB 4 int numNsp 8 int numNspFcMin 4 x minimum number to make system full capacity int numNspUpMin 1 number of DSPs on bus A and B int numDspA 2 int numDspB 2 int numDsp 4 int numDspFcMin 2 x minimum number to make system full capacity 4 int numDspUpMin 1 failure rate of HSP double frHsp failure rate of backplane double frBp 1 0 6000000 0 x failure rate of power supply fan double frPsf 1 0 80000 0 x failure rate of bus double frBus 1 0 300000 0 failure rate of NSP 171 double frNsp 1 0 100000 0 change later x failure rate of DSP 4 double frDsp 1 0 100000 0 x change later x repair rate of backplane double rrBp 1 0 6 0 repair rate of Ps Fn Bus NSP DSP in lost redudency partial outage total outage double rrLr 1 0 12 0 double rrPo 1 0 8 0 double rrTo 1 0 4 0 double rrHsp rrNsp rrDsp x global variables for computing capacity double dnNsp dnDsp upNsp upDsp double capHsp capBp capPsf capBus double capNsp capDsp cap capacity x prototype reward functions double uodpm double tpodpm double ofm double tsodpm double tsodpmHsp double tsodpmBp double tsodpmPsf double tsodpmBus double tsodpmNspQ double tsodpmDsp void calCap calculate cap
51. of the integrated Stochastic Petri Net Package SPN 9 1 2 Conventions used in this chapter The following conventions are followed in the manual 1 All buttons are displayed in boldface 2 A click is always left mouse button unless explicitly mentioned otherwise 3 LMB left mouse button MMB middle mouse button RMB right mouse button 9 2 iSPN 9 2 1 Why iSPN Interaction with computers has come a long way since the arcaic textual interfaces There is now substantial literature on human computer interaction HCI a research subject widely recognized as a vital component of successful computer applications But when we evaluate HCIs currently available on analytical modeling packages we see the enor mous gap between their interfaces and modern HCI trends The developers of analytic modeling packages need to deliver beneficial services to the user and del iver them in a usable way This paper suggests an approach of delivering this next generation of modeling tools with improved HCI The approach is followed in the development of an integrated environment for modeling using Stochastic Petri Nets named iSPN Careful consideration 65 was given to the design and implementation of iSPN to facilitate the creation of SPN mod els iSPN increases the power of SPNP the Stochastic Petri Net Package by providing a means of rapidly developing stochastic reward nets SRNs the model type used for input Input to SPNP is specified usin
52. off mistakes and is needed when using importance splitting simulation methods 60 Chapter 8 Format of the Intermediate Files This section explains how to interpret the data in the intermediate files generated during the analysis of an SRN 8 1 The rg file This file describes the reachability graph corresponding to the SRN It can be generated if the options IOP_PR_RSET and IOP PR _RGRAPH are set to VAL_YES The format of the information is as the following _nplace lt number of places gt _ntrans lt number of transitions gt _places _transitions lt tr gt lt transition name gt lt tr gt lt transition name gt _ntanmark lt number of tangible non absorbing markings gt _nabsmark lt number of tangible absorbing markings gt _nvanmark lt number of vanishing markings gt _nvanloop lt number of transient loops gt _nentries lt number of arcs in the reachability graph gt _reachset lt mk gt lt 1b1 gt lt pl gt lt tk gt lt pl gt lt tk gt lt mk gt lt 1b1 gt lt pl gt lt tk gt lt pl gt lt tk gt reachgraph lt mk gt lt mk gt lt tr gt lt val gt lt mk gt lt tr gt lt val gt lt mk gt lt mk gt lt tr gt lt val gt lt mk gt lt tr gt lt val gt 61 where lt mk gt 1s the integer index of a marking non negative for tangible markings nega tive for vanishing markings an
53. pMWT rateval TMTX rateTMTX imm tBE D guard t BP guard BP priority tBP 20 probval tBP 1 imm tMWT guard EMWT guard MWT priority tMWT 20 147 probval tMWT 1 imm tMBP guard t MBP guard MBP priority t MBP 20 probval tMBP prbtRT 0 oarc TTX pRC iarc TTX pRR iarc tBP pRR oarc t BP pRC miarc tMBP pRC NRR moarc tMBP pRR NRR iarc TMTX pMTX oarc TMTX pMWT viarc tMWT pMWT cardinality MWT moarc tMWT pRR NRR for 1 i lt NMRR i sprintf rt t RT_ d i imm rt guard rt guard RT prioritv rt 20 probval rt prbtRT i miarc rt PRC NRR moarc rt pMTX 1 int assert return RES_NOERR void ac_init void ac_reach double get_prbtRT if mark pTK ntoken amp amp mark pHQ gt ntoken mark pTK gt ntoken amp amp mark pHQ ntoken return 1 0 else return 0 0 double get_though if mark pHo lt NBUF if mark pMMPP return prbtVPN x harvrate else return prbtVPN x larvrate else return 0 0 148 double get_arrival if mark pMMPP return harvrate else return larvrate double get_util if mark pTK lt NTK return 1 0 else return 0 0 double get_VPN2BE if mark pHQ NBUF if mark pMMPP return prbtVPN x harvrate
54. parameters k and alpha k times the number of tokens in place p and alpha times the number of tokens in place p and the marking dependent function f and g Recall that the Pareto density fpar is given by fpar x ak x k for x gt 0 and a k gt 0 Functions void cauval char t double alpha double beta void caudep char t double alpha double beta char p void caufun char t double f O double 9 0 define a transition with a firing time following a Cauchy distribution with respective parameters alpha and beta alpha times the number of tokens in place p and betaa times the number of tokens in place p and the marking dependent function f and g Recall that the Caucy density fog is given by _ 5 8 x a 27 Cau z for x gt 0 8 gt 0 and oo lt a lt 4 3 Function assert int assert void A valid CSPL should contain function assert Function assert is a boolean marking dependent function called by SPNP during the reachability graph construction to check the validity of each newly found marking It returns either RES ERROR if the marking is illegal or RES_NOERR if the marking is thought to be legal The check on the legality of a marking is performed using the same functions used to achieve marking dependency namely mark and enabled The check is by its own nature incomplete since it is not usually feasible to specify all the conditions that must hold or not hold in a ma
55. parameters thereby disabling sensitivity analysis and sens ALL 0 will enable sensitivity analysis for all defined parameters once again 4 6 A complete example As an example consider an SRN as shown in Figure 4 2 with two places p and po and two transitions with exponentially distributed firing times 12 and t21 The rate of the first 36 transition is determined by the function myval to be 7 3 times the number of tokens in Place p while the rate of the second transition is the constant 1 0 The SPNP input file is shown as following include user h Global variables int N void options iopt IOP_SSMETHOD VAL_SSSOR iopt IOP PR FULL MARK VAL_YES iopt IOP PR MARK ORDER VAL CANONIC iopt IOP PR MC ORDER VAL TOFROM iopt IOP PR MC VAL_YES iopt IOP MC VAL_CTMC iopt IOP PR PROB VAL_YES iopt IOP PR RSET VAL VES iopt IOP PR RGRAPH VAL YES iopt IOP_ITERATIONS 2000 iopt IOP CUMULATIVE VAL NO fopt FOP ABS RET M0 0 0 fopt FOP PRECISTON 0 00000001 N input Pleas nter the token number N place place p_l P 2 M A trans t 12 trans t 21 init p_1 N timed transition ratedep t_12 7 3 p 1 rateval t_21 1 0 Tarc t IO pe a Tarea pa Gare tE 12 Mo 21 72 Care EL 218 pe TL int assert return RES NOERR
56. place p and the marking dependent function fun e Functions void unifval char t double lower double upper void unifdep char t double lower double upper char p void uniffun char double f double 9 0 define a transition t with firing time uniformly distributed in the interval with lower and upper bounds given respectively by lower and upper lower times the number of tokens in place p and upper times the number of tokens in place p or the marking dependent function f and g e Functions void geomval char t double vall double val2 void geomdep char double vall double val2 char p void geomfun char t double f double 9 0 9See Sec 10 13 for example 23 define a transition t with geometrically distributed firing time with respective pa rameter vall vall times the number of tokens in p and marking dependent function f and with respective time step given by val2 val2 times the number of tokens in place p or the marking dependent function g The probability to have value n x val2 foralln gt 1 is then val1 1 val1 l e Functions void weibval char t double vall double val2 void weibdep char t double vall double val2 char p void weibfun char t double f double 9 0 define a transition with Weibull distributed firing time with respective parameters vall and val2 vall times the number of tokens in place p and val2 times the number of tok
57. proc mem needed 1 lt k lt 16 f k lt 1 fprintf stderr ERROR at least one processor is needed k gt 1 exit 1 7 gt 16 fprintf stderr ERROR only 16 processors are available k lt 16 exit 1 int entrfir La mark procup 0 kk mark memup 0 kk mark swup 0 return 0 if mark procup lt k mark memup lt k mark swup 0 return 1 else return 0 int apfl return mark procup int amfl return mark memup int asfl return mark swup void net place procup init procup 16 place procdn place memup init memup 16 place memdn place swup init swup 1 place swdn timed transition 4 ratedep t rpr 0 0000689 procup ratedep t rmm 0 000224 memup rateval t rsw 0 0002202 immediate transition imm trflr priority trflr 100 guard t rflr entrflr probval tr ir 1 0 larc trpr procup oarc trpr procdn iarc t rmm memup oarc t rmm memdn iarc trsw swup oarc trsw swdn 97 viarc trflr procup apfl voarc trflr procdn apfl viarc trflr memup amfl voarc trflr memdn amfl viarc trflr swup asfl voarc trf1r swdn asfl int assert return RES_NOERR void ac_init void ac_reach pr rg info double reliab if mark procup
58. reached at place p inf The function void inf char t declares a transition defined only by fluid flow when enabled The functions void fiarc char t char p void foarc char t char p void fmiarc char t char p double mult void fmoarc char t char p double mult void fviarc char t char p double funo0 void fvoarc char t char p double f func 21 define an input arc from fluid place p to transition t or a fluid output arc from tran sition t to fluid place p with fluid flow rate given by 1 the constant mult or the marking dependent function func respectively e The functions void fliarc char char p double f double 9 0 void floarc char t char p double f double 9 0 define an input arc from fluid place p to transition t or a fluid output arc from tran sition to fluid place p with linear fluid flow given by the marking dependent func tions f and g i e in place p the differential equation when discrete marking is m is with respect to time 7 dx 7 dT f m zp r g m e In the same way the functions void diarc char t char p void doarc char char p void dharc char t char p void dmiarc char char p double mult void dmoarc char t char p double mult void dmharc char char p double mult void dviarc char t char p double f func void dvoarc char t char p double func O void
59. return 1 else return 0 RATE Functions double rate ARV2 double m v u t x e intS 0 if mark POUT gt S S mark PAR mark PCS m Sx ml m2 v Sx vl v2 u S xul u2 t S x vlxtl v2 xt2 v x u sqrt v v v e x X 2 x sqrt 4 x x 2 rate AH m sqrt v e rate AL m sqrt v x e if mark PAON return rate AH else return rateAL double t01 double m v u t x e int S 0 if mark POUT gt S S mark PAR mark PCS m S ml m2 v S x vl v2 u S xul u2 t S x vl x tl v2 xt2 v x u sqrt v v v e x x 2 x sqrt 4 x x x 2 theta0 1 t 1 e return theta0 l double t100 134 double m v u t x e int S 0 if mark POUT gt S S mark PAR mark PCS m Sxml m2 VS x vl v2 u S ul u2 t S x vil tl v2 xt2 v x u sqrt v v x v e x x 2 x sqrt 4 x x x 2 thetal e t x 1 e return thetal void net x PLACE place PAR place PCS place POUT place PARV place PST place PMD place PLG place PBUF place PEOUT place PAON x TRANSITION rateval TARV lambda guard TARV guardARV rateval TAR mu rateval TCS beta imm tOUT priority t OUT 20 probval tOUT 1 ratefun TARV2 rateARV2 guard TARV2 guardARV2 imm
60. s oarc TAR PCS1 iarc tCS PCSL moare tCS PCS2 3 iarc TCS PCS2 hare tCS PCS2 oarc Yon Pbroad larc Yoff Pbroad harc Yon Pbroad oarc Tbroad PARV oarc TARV1 Puon oarc TCS Pdepart oarc Tuon Puon larc Tuoff Puon larc t1 Puon miarc t1 Pdepart 3 iarc t2 Puoff miarc t2 Pdepart 3 oarc Tuoff Puoff iarc Tuon Puoff oarc Tunicast PARV iarc tSTI PARV iarc tMDI PARV iarc t LGI PARV oarc tSTI PST oarc tMDI PMD oarc t LGI PLG iarc t S1 O ps My iarc ESTL PS mj iare tMDO PMD iarc tMDL PMD iarc t LGO PLG larc t GL P iG moarc t STO PBUF PLST moarc t LGO PBUF PLLG moarc tMDO PBUF PLMD iarc LOUT me TPBUF moarc LOUT POUT 3 larc TOUT POUT hare tOUT POUT int assert 129 return RES_NOERR void ac_init void ac_reach void ac finalQ double Ilp mlp slp pal solve INFINITY IIp expected LLP mlp expected MLP slp expected SLP pr value Loss Prob of Short Packets S slp pr value Loss Prob of MediumPackets M mlp pr value Loss Prob of Long Packets L lp pr value Loss Prob of total Packets T cl slp c2 x mlp c3 x Ilp for QLEN 0 QLE
61. use of different tools and techniques In International Conference on Petri Nets and Performance Models Melbourne Australia Dec 1991 Y Ma C W Ro and K S Trivedi Performability analysis of channel allocation with channel recovery strategy in cellular networks In Proceedings of the 7th IEEE International Conference on Universal Personal Communications ICUPC 98 Flo rence Italy October 1998 M Malhotra J K Muppala and K S Trivedi Stiffness tolerant methods for tran sient analysis of stiff Markov chains Microelectron Relib 34 11 1825 1841 1994 J K Muppala and K S Trivedi Composite Performance and Availability Analysis using a Hierarchy of Stochastic Reward Nets In G Balbo and G Serazzi editors Computer Performance Evaluation Modelling Techniques and Tools pages 335 350 Elsevier Amsterdam 1992 J K Muppala and K S Trivedi Numerical transient analysis of finite markovian queueing systems In U N Bhat and I V Basawa editors Queueing and Related Models pages 262 284 Oxford University Press 1992 J K Muppala and K S Trivedi GSPN models Sensitivity analysis and applications In Proceedings of the 28th ACM Southeast Region Conference pages 24 33 Apr 1990 204 22 23 24 25 26 27 28 29 30 31 32 33 J K Muppala S P Woolet and K S Trivedi Real time performance in the presence of failures IEEE Computer May 1991
62. val2 vall times the number of tokens in place p and val2 times the number of tokens in place p or the marking dependent function f and g The density is then Vx gt 0 yal Quall rall 1 val2xt T vall Functions void betval char double vall double val2 void betdep char t double vall double val2 char p void betfun char t double 0 double 9 0 define a transition t with beta distribution with respective parameters vall and val2 vall times the number of tokens in place p and val2 times the number of tokens in place p or the marking dependent function f and g The density is then VO lt x lt 1 1 veal 1 1 B vall val2 ge l Functions void poisval char t double vall double val2 void poisdep char double vall double val2 char p void poisfun char t double f O double 9 0 define a transition with Poisson distribution with respective parameters vall and val2 vall times the number of tokens in place p and val2 times the number of tokens in place p or the marking dependent function f and g The probability to have value k x val2 VO lt k is then given by wal1 kle velit Functions void binoval char t double vall double val2 double val3 void binodep char t double va 1 double val2 double val3 char p void binofun char t double f double 9 0 double 0 25 define a transition t with binomial distributionwith respective paramet
63. values for global variables x prototype cardinality functions void options iopt lOP PR RGRAPH VAL NO iopt lOP PR MC VAL NO ioptIOP_PR DERMC VAL_NO ioptIOP_PR PROB VAL_NO iopt IOP_PR_PROBDTMC VAL _NO ioptIOP_PR_DOT VAL_NO ioptIOP_PR MERG_MARK VAL_YES ioptIOP_PR FULL_MARK VAL_NO ioptIOP_USENAME VAL_NO ioptIOP_DEBUG VAL_NO ioptIOP_PR MARK_ORDER VAL_CANONIC iopt IOP_PR_RSET VAL_NO ioptIOP_PR MC_ORDER VAL_FROMTO NUMERICAL SOLUTION chosen ioptIOP_SENSITIVITY VAL_NO ioptIOP_MC VAL_CTMC iopt lOP SSMETHOD VAL SSSOR ioptIOP_TSMETHOD VAL_FOXUNIF ioptIOP_ITERATIONS 2000 fopt FOP_PRECISION 0 000001 fopt FOP_ABS_RET_MO 0 0 ioptIOP_CUMULATIVE VALNO ioptIOP_SSDETECT VAL_YES ioptIOP_OK_ABSMARK VAL_NO iopt IOP_OK_VANLOOP VAL_NO ioptIOP_OK TRANS_MO VAL _YES ioptIOP_OK_VAN_MO VAL_YES iopt IOP_ELIMINATION VAL_REDONTHEFLY some computation r lambdaT lambdaP lambdaT q x REWARD Functions double dtime double dtime dtime double mark Ds double mark FC dtime x 876660 return dtime 169 int cond if mark hsp2 0 return 1 else return 0 double times 2 x GUARD Functions RATE Functions double rHsp2_Ds return lambdaP lambdaT double rDs hsp20 return beta1 q double rDs_FC return betal 1 q x CARDINALITY Functions void net
64. void caudep_is char t double alpha double beta char p 48 void caufun_is char t double 0 double 9 0 void probval_is char t double val void probdep_is char t double val char p void probfun_is char 7 double func The parameters are defined in the same way than when defining the actual distributions of the transitions It is sometime interesting to modify the parameters of the importance sampling dis tribution if some conditions are verified for example if a set of states is reached Such conditions are given by the user by calling many times if there are many conditions func tion resampling f Then the firing times are resampled using the new paprameters This is called dvnamic importance sampling 6 4 Regenerative simulation Regenerative simulation is used to estimate steady state measures It is called by setting IOP SIM RUNMETHOD to VAL REG In the current implementation the user must specify the regenerative state as the initial state and be sure that this state is regenerative The number of used regenerative cycles may be specified by IOP_SIM_RUNS or the de sired precision by FOP_SIM_ERROR FOP_SIM_LENGTH is not used for this type of simulation 6 5 Regenerative simulation with importance sampling Regenerative simulation with importance sampling is also used to estimate steady state measures It is called by setting IOP SIM RUNMETHOD to VAL_ISREG It combines regenerative simula
65. x Handoff_in rate d lam_d 0 5 x call duration 120 seconds lam_f 0 000016677 mur 0 0167 void net parameters parm lam_h_i pam lam_n place T place B place R place CP init CP t_channel x timed trans rateval t_n 1 0 useparm t_n lam_n rateval t_h_i 1 0 useparm t_h_i lam_h_i ratedep t_d lam_d T ratedep t_ lamf T ratedep t_h_o lam_h_o T rateval t_r mu_r immed trans imm t_1 priority t_1 100 probval t_1 1 0 x ARC form timed trans miarc t_n CP g c 1 oarc t_n T moarc t_n CP g c larc t_ h_ i CP n oarc t_ r r 4 MT iarc t _h ON WE oarc E ho un CP iarc t LU T oarc it ASA CP y iarc EF En T oarc WE lt En B oarc Ei WUR iarc ta L RM oarc ES TN CP mys x ARC for immediate trans iarc E 1 f B iarc t 1 CP oarc t 1 Le T gt assign parameters bind lam h_i lamhi bind lam n lam_n 114 int assert return RES_NOERR void ac_init void ac_reach double BHO L mark CP 0 return 1 0 else return 0 0 double BN if mark CP lt g c return 1 0 else return 0 0 double ACh return mark CP double hotput return rate t_h_o average failure arrival rate 4 double ftput return ra
66. x PLACE x Active HSP Standby HSP place hsp2 x no fault no fault init hsp2 1 place Ds x fault not covered reboot no fault place FC x reboot failed repair no faul 4 x TRANSITION 4 ratefun hsp2_Ds rHsp2_Ds ratefun Ds_hsp2 rDs_hsp2 ratefun Ds_FC rDs_FC rateval FC_hsp2 rrPo ARC larc hsp2_Ds hsp2 oarc hsp2_Ds Ds larc Ds_hsp2 Ds oarc Ds_hsp2 hsp2 iarc Ds FC Ds oarc Ds_FC FC iarc FC_hsp2 FC oarc FC_hsp2 hsp2 void assert void ac_init void ac_reach 3 void ac_final solve INFINITY 170 pr expected dt ime dtime pr message n n pr message n This is what actually used pr message and fed into upper level n pr_message nequivalents for the subsystem n hold_cond cond times pr_value MTTFeq times 0 pr value MTTReq times 1 pr value ofm 1 expected dtime 8766 60 times 0 x8766 pr message nequivalent DPM computed from MTTFeq and MTTReq n pr value DPMeq times 1 times 1 times 0 8766 60 pr mc_info pr std_average 10 16 5 SPNP File for System level SPN model gsb c include lt stdio h gt include user h x global variables x all the rates are in the format 1 0 MTTF or 1 0 MTTR unit 1 Hour global variables for other parts of the system number of power supply fan modules int
67. 0 t 30000 solve t pr expected dtime dtime pr expected dtimeFC dtimeFC pr expected dtimeF dtimeF pr expected tdpm tdpm y solve INFINITV 178 pr expected uodpm uodpm pr message n n pr expected tpodpm tpodpm pr expected tpodpmNsp tpodpmNsp pr expected tpodpmDsp tpodpmDsp pr expected tpodpmBus tpodpmBus pr value podpm expected tpodpm expected tsodpm pr_value podpmNsp expected tpodpmNsp expected tsodpmNsp pr_value podpmDsp expected tpodpmDsp expected tsodpmDsp pr value podpmBus expected tpodpmBus expected tsodpmBus pr message n n pr expected t sodpm tsodpm pr expected t sodpmHsp tsodpmHsp pr expected t sodpmBp tsodpmBp pr expected t sodpmPs f tsodpmPsf pr expected t sodpmBus tsodpmBus pr expected t sodpmNsp tsodpmNsp pr expected t sodpmDsp tsodpmDsp pr message n n pr message nequivalents for the UO unweighted of the system n hold_cond condUo timesUo pr value UO Feq timesUo 0 pr value UO Req timesUo 1 pr value UO OFM 1 expected uodpm 8766 60 timesUo 0 x8766 pr message nequivalent DPM computed from MTTFeq and MTTRea n pr value UODPMeq timesUo 1 timesUo 1 timesUo 0 8766 60 pr_message n Xa pr message nequivalents for the TSO of the system n hold_cond condTs
68. 0 0 Q30 gt 2 1 0 double g31 return Q1 Q20 1 gt 2 71 0 double g30 return Q10 Q20 0 gt 2 7 1 0 void node failure down lambda float lambda char failure down rateval failure lambda place down oarc failure down harc failure down lak SPNP FUNCTIONS A void options 10pt IOP_PR_RGRAPH VAL_NO iopt lOP PR MC VAL NO iopt IOP_ITERATIONS 10000 fopt FOP_PRECISION 0 000000000001 void net 111 node t1 p1 0 001 node t2 p2 0 002 node t3 p3 0 003 int assert return RES_NOERR void ac_init void ac_reach void ac finalQ double b1 b2 b3 q solve 20 bl expected g11 expected g10 b2 expected g21 expected g20 b3 expected g31 expected g30 printf Birnbaum n printf cl fAn bl printf c2 S n b2 printf c3 f n b3 q expected Q printf Criticality n printf c1 3 n b1 expected Q1 q printf c2 n b2 expected Q2 q printf c3 n b3 expected Q3 q 10 8 Channel recovery scheme in a cellular network 10 8 1 Source Y Ma C W Ro and K S Trivedi Performability Analysis of Channel Allocation with Channel Recovery Strategy in Cellular Network Proceedings of IEEE 1998 International Conference on Universal Personal Communications ICUPC 98 Florence Italy 5 9 Oc tober 1998 10 8 2 Description The net is shown in Figure 10 10 112 C
69. 00001 dt 1 else dt 0 dt x 8766x60 return dt int condTso calCap if cap lt 0 00001 return 1 else return 0 double timesTso 2 x total system outage caused by HSP double tsodpmHspO double dt calCap if capHsp lt 0 00001 dt 1 else dt 0 dt x 8766x60 return dt double tsodpmBp double dt calCap if capBp lt 0 00001 dt 1 else dt 0 dt 8766x60 return dt double tsodpmPsf double dt calCap if capPsf lt 0 00001 dt 1 else dt 0 dt x 8766 60 return dt double tsodpmBus double dt calCap if capBus lt 0 00001 dt 1 else dt 0 dt x 8766 60 175 return dt double tsodpmNspO double dt calCap if capNsp lt 0 00001 dt 1 else dt 0 dt x 8766x60 return dt double tsodpmDspO 4 double dt calCap if capDsp lt 0 00001 dt 1 else dt 0 dt x 8766x60 return dt void calCap cap 1 if mark hspUp 0 capHsp 0 cap 0 else capHsp 1 if mark bpUp 0 capBp 0 cap 0 else capBp 1 if mark psfUp lt numPsfUpMin capPsf 0 cap 0 l else capPsf 1 llif mark busAUp 0 amp amp mark busBUp 0 capBus 0 cap 0 Helse capBus 1 capBus mark busAUp mark busBUp 2 0 if capBus lt 0 00001 cap 0 upNsp mark nspAUp mark busAUp mark nspBUp mark busBUp upDsp mark dspAUp
70. 1 enall guard t fef1 enall immediate transitions imm tpr1f1 priority tpr1f 1 100 imm tpr1f2 priority tpr1 2 100 imm tpr2f1 priority tpr2 1 100 imm tpr2f2 priority tpr2 2 100 parameters for the transitions rateval tmm1 1 1000 2400 rateval t sw1 1 1000 2400 ratedep tpr1f 1 1000 2400 prlup rateval tmm1r 1000 rateval t sw1r 1000 rateval tprir 1000 rateval tmm2 1 1000 2400 rateval t sw2 1 1000 2400 ratedep tpr2f1 1000 2400 pr2up rateval tmm2 r 1000 rateval t sw2r 1000 102 rateval tpr2r 1000 rateval t db 1 rateval t fef L 1000 2400 L 1000 2400 probval tpr1f1 coverage probval tpr1 2 1 0 coverage probval tpr2f1 coverage probval tpr2 2 1 0 coverage input and output arcs larc tmm1f 1 mmlup oarc tmm1f1 mmldn larc tsw1f1 swlup oarc tsw1f1 swldn larc tpr1f1 prlup oarc tpr1f1 prltmp larc tpr1f1 prltmp oarc tprifl prldni larc tpr1f2 prltmp oarc tpr1f2 prldn2 iarc tprif2 dbup oarc tpr1 2 dbdn larc tmmlr mml1dn oarc tmmir mmlup larc tswlr swldn oarc tswlr swlup larc tprlr prlidn1 oarc tprlr prlup harc tprir mmidn harc tprir mm2dn harc tprir swidn harc tprir sw2dn
71. 1 8 mark p3 0 7 eff pr std_average x default measures 10 2 Software Performance Analysis 10 2 1 Description This example models the following piece of software A Statements PARBEGIN Bl statements B2 IF condl THEN C statements ELSE DO D statements WHILE cond2 88 END IF PAREND The corresponding SPN model is shown in Figure 10 2 Figure 10 2 SPN for Example 10 2 10 2 2 Features e Probability and rate functions e Priorities for immediate transitions e Reward functions e Transient analysis with multiple time points 10 2 3 SPNP File example2 c include user h x This example corresponds to the following piece of software 89 A statements PARBEGIN Bl statements B2 IF cond THEN C statements ELSE DO D statements WHILE cond IFEND PAREND options Transient analysis ioptIOP_TSMETHOD VAL TSUNIF x rates and probabilities are defined as functions double rate00 return 1 0 double rate1 return 0 3 double prob2 return 0 4 double prob3 return 0 6 double rate4 return 0 2 double rate5 return 7 0 double prob6 return 0 05 double prob7 return 0 95 double prob8 return 1 0 net place p0 init p0 1 place p1 place p2 place p3 place p4 place p5 place p6 place p7 place p8 priorities associated with tr
72. 2 4 237 254 July 1991 8 G Ciardo D M Nicol and K S Trivedi Discrete Event Simulation of Fluid Stochastic Petri Nets IEEE Transactions on Software Engineering 25 2 207 217 1999 9 G Ciardo and K S Trivedi Solution of large generalized stochastic petri net models In W J Stewart editor Numerical Solution of Markov Chains Marcel Dekker 1991 10 G Ciardo and K S Trivedi A decomposition approach for stochastic reward net models Performance Evaluation 18 1 37 59 1993 203 11 12 13 14 15 16 17 18 19 20 21 Computer Science Department College of Willian and Mary On the Simulation of Stochastic Petri Nets J B Dugan K S Trivedi R M Geist and V F Nicola Extended stochastic Petri nets Applications and analysis In E Gelenbe editor Performance 84 pages 507 519 Elsevier Science Publishers B V North Holland Amsterdam Netherlands 1985 S P Harbison and G L Steele Jr C A Reference Manual Prentice Hall 3 edition 1991 G Horton V Kulkarni D Nicol and K S Trivedi Fluid Stochastic Petri nets The ory Application and Solution European Journal of Operational Research 105 184 201 1998 R A Howard Dynamic Probabilistic Systems Volume II Semi Markov and Deci sion Process John Wiley and Sons New York NY USA 1971 H Kantz and K S Trivedi Reliability modeling of the mars system A case study in the
73. Browse examples The Browse Examples page allows the user to browse through a database of examples All the user needs to do is 1 Select a file from the left side of the window 2 The CSPL code for the file is displayed 3 Click Run to execute the model 9 9 Help The following are the ways in which iSPN provides on line help for the user 1 iSPN provides hyperlink help for its users The sixth page of iSPN is the Help page which gives detailed information about the various functions in the pages 2 Balloon help for all pages If the mouse is positioned over a button for a certain amount of time a window pops up giving a brief description of the button 3 Fl help If F1 is pressed with the mouse positioned over a button hypertext help is pulled up for the button 4 Mouse bindings At all times the mouse bindings are displayed Adjacent to the mouse buttons are messages telling the user what function the corresponding button carries out iSPN follows a color convention A blue message corresponds to a single click a red one to a double click and a green one to a Ctrl click 5 Message bar When any operation is carried out a message appears at the bottom of the iSPN window informing the user of the status of the operation Again a color convention is followed Messages in green are OK messages while those in red mean that there is an error 9 10 How to install iSPN in a unix environment A version of Tcl Tk wi
74. Dieter atoi p l void read prb head char xp read _nstates while feof fpPrb fgets sline MAXLINE fpPrb if p strstr sline _nstates break l if feof fpPrb fclose fpRG fclose fpPrb LogMsg MSG_EXIT read_prb_head reaches EOF unexpected strtok p skip _nstates p strtok char NULL nstates atoi p printf nstates d n nstates read _time while feof fpPrb fgets sline MAXLINE fpPrb if p strstr sline _t ime break if feof fpPrb fclose fpRG fclose fpPrb LogMsg MSG_EXIT read_prb_head reaches EOF unexpected strtok p skip _time d p strtok char NULL timeO atof p printf t imeO f n time0 x go to the start of probs while feof fpPrb fgets sline MAXLINE fpPrb if p strstr sline _probabilities break if feof fpPrb fclose fpRG fclose fpPrb LogMsg MSG_EXIT read_prb_head reaches EOF unexpected 194 static int n nleft 0 static double probs 10 to store probs read in one line double next probabilitvO char xp double r x printf next_probability n A if nleft r probsin nleft nleft return r fgets sline MAXLINE fpPrb if feof fpPrb fclose fpRG fclose fpPrb LogMsg MSG_EXIT next_probability reaches EOF unexpected
75. ES SE BEREN tal re o ct ae and ir Aa we ey Via eg 100 10 5 4 SPNP File example5 c 101 10 6 ATM network under overload 104 VOGT SOURCE arran te ee Gee Er ta Ue Getta a UF be rie ign geal a 104 10 6 2 Descriptio sus ir ea a Se aS a an SE 105 1065 BEATLES an hr Veld Arre traded Medien Nog Le De Blk oe 105 10 64 SENP BSE A heen a Mes 105 10 7 Criticality Importance and Birnbaum Importance 110 LOS SOURCE is ls M erre M de le Es Heals Mi Menan SAR ee 110 10272 DeSCHpHON 22 zh Yo dus Te Het eh der Bee eo a b MER R 24 110 10 37 Featutess 3233 4 A el LR RS AG SMES AE Ew BRA 111 10 74 SPNP Pile SUING ta Di Gods Stu E un he eagle it da 111 10 8 Channel recovery scheme in a cellular network 112 LORS AL SOURCE St ete ns Ans Bedek Bt eee nue 112 10 8 2 Description er 2 544 4 ie a dee bodies See Beken dass dus 112 10835 PEATEs e E TI DU ASUS TURIN wR MINES een RES 113 10 84 SPNP File icupc98 c 0 0 0 0 113 10 9 Accurate Model for the BUS in ATM LAN emulation 116 LO DSL SOURCE oe A A aS A i AL L Re Mea KEE 116 10E Description say yu ee Se AS A AURAS SUR Ge Gu ee Goren 116 10 9 37 Features CR rs Be ee ee ae ee alae a ee a 116 10 94 SPNP Fl LANG a Lira la Sos ose Gr Bae ant Gratis 116 10 10Birth death Model for the BUS in ATM LAN emulation 124 FOR SOUS SY LG 322233 8 332 8 14 Bit EU AAS een RES 124 10 10 2 De
76. I Mura A Bondavalli X Zang and K S Trivedi Dependability modelling and evaluation of phased mission systems a DSPN approach In 70th International Con ference on Modeling Techniques and Tools for Computer Performance Evaluation Performance Tools 98 Palma de Mallorca Spain Sep 1998 Submitted T Murata Petri nets Properties analysis and applications In Proceedings of the IEEE pages 541 580 April 1989 J L Peterson Petri Net Theory and the Modeling of Systems Prentice Hall Inc Englewood Cliffs 1981 A L Reibman R M Smith and K S Trivedi Markov and Markov reward model transient analysis An overview of numerical approaches European Journal of Op erational Research 40 257 267 1989 R Sahner K S Trivedi and A Puliafito Performance and Reliability Analysis of Computer Systems An Example Based Approach Using SHARPE Software Package Kluwer Academic Publishers 1995 R M Smith K S Trivedi and A V Ramesh Performability analysis measures an algorithm and a case study IEEE Trans Comput 37 4 406 417 Apr 1988 W J Stewart Introduction to the Numerical Solution of Markov Chains Princeton University Press 1994 L Tomek and K S Trivedi Informatik fachberichte vol 91 Fehlertolerierende rechensysteme In M Dal Cin editor Fixed Point Iteration in Availability Modeling Springer Verlag Berlin 1991 K S Trivedi Probability and Statistics with Reliability Queuing
77. IOP_SPLIT_RESTART_FINISH which means that each retrial is finished at simulation time T see 34 To determine the thresholds where the path will be split there are two possibilities e either they are determined by the user by assigning in options the option IOP_SPLIT_ PRESIM to VAL_NO then assigning the number of thresholds to IOP SPLIT NUMBER and finally setting the thresholds values in table FOP_SPLIT_THRESHOLDS If this table is not specified the thresholds are chosen uniformly between the initial value in place p and value x e Or he runs a presimulation IOP_SPLIT_PRESIM VAL_YES We run then at each level a standard discrete event simulation using number of independent runs is given by IOP SPLIT PRESIM RUNS For further details about importance splitting and its implementation in SPNP see 34 6 2 1 Example See Section 10 15 6 3 Importance sampling Importance sampling is a method particularly efficient to estimate rare events though it can be used to improve the accuracy of every simulation The basic idea is to modify the firing time distribution in order to reduce the variance of the measure we wish to compute The bias induced by this change of measure is then corrected by the introduction of a function called the likelihood ratio tranparent in the outputs Importance sampling is called by setting IOP SIM RUNMETHOD to VAL IS The net is defined as usual with the corresponding firing distributions In the current
78. IT_RE oarc IT_RI E CF P_DOWN imm IT_SHUTDOWN probval IT_SHUTDOWN 1 guard IT_SHUTDOWN GFShutdown priority I T_SHUTDOWN 10 iarc TT_SHUTDOWN P_UP oarc IT_SHUTDOWN P_SPARI E F gt imm IT_SYSFAIL1 probval IT_SYSFAIL1 1 guard IT_SYSFAIL1 GFSysfailu priority IT_ SYSFAIL1 100 viarc IT_SYSFAIL1 P_UP VFUp voarc IT_SYSFAIL1 P_FAIL VFUp imm IT SYSFAIL2 probval IT_SYSFAIL2 1 guard IT_SYSFAIL2 GFSysfail priority IT_ SYSFAIL2 10 viarc IT_SYSFAIL2 P_DOWN VFDown voarc IT_SYSFAIL2 w P_FAIL VFDown int assert return RES_NOERR void ac_init pr_net_info information on the net structure void ac_reach pr rginfo x information on the reachability graph void ac_final 4 double ttime tstep phaseTime NUMVP for ttime 0 ttime lt phaseTime ttime tstep solve ttime pr expected System Fail RFSysDown 188 solve phaseTime pr mc_info pr std_average x default measures 10 17 4 Configuration File pms cfg set number of phase Number of Phase 7 set total number of CPU Number of CPU 4 set failure rate of CPU can be set as default or specific phase Failure Rate default 0 00001 0 0 001 2 0 0001 4 0 0001 end set repair rate of CPU can be set as default or specific phase Repair Rate default 0 001
79. If inconsistencies exist between the definition of the predefined functions and their us age they will be discovered Note To save typing you can define the aliases lias spnp make f PATH TO SPNP spnp obj Makerun SPN 7 lias spnpcheck make f PATH_TO_SPNP spnp obj Makerun lint SPN w w 66j99 assuming that is your history character and type regardless of your current direc tory spnp filename spnpcheck filename 3 2 Output files The intermediate files generated by the package and the final results will be in the same directory as where filename c is and where you issued the command Files have differ ent extensions according to the kind of information they carry If your CSPL file is named test c then the following files will be generated e test o obtained when compiling test c e test spn executable file obtained by linking the package object files together with test o e test rg containing the reachability graph information composition of each marking description of the transition firings between them etc e test mc containing the numerical CTMC DTMC corresponding to the SRN e test parmname me containing the numerical derivative of CTMC with respect to parameter parmname one file is generated for each parameter defined in test c e test prb containing the numerical results of the analysis of the underlying CTMC the transient or steady state probabilities for each tangi
80. LMB Note Use this with caution However as a protection against errors the entire worksheet can be restored to its original condition To restore the worksheet 1 Click Clear 73 2 Doubleclick in the Work Area with MMB Grid Draws a grid on the worksheet Anchor snap object to the closest grid point 9 4 3 Environment control functions An interesting feature of SPNP is its flexibility of operation allowing the user to tailor its functioning to his her own needs It allows the user to change the operating environment This is done in iSPN by 1 Click model 2 Click environment 3 Select features 9 4 4 Information functions Information functions allow the user to obtain information about his her design iSPN provides a number of ways to view information Identify Display information about the object over which the mouse pointer is posi tioned Browse Display information about all objects in a tabular form 1 When an object is selected from the table it is highlighted in green in the Global View 2 After selection when OK is clicked the Work Area is restored with the selected object highlighted in green Display Allow user to select the information he she wants to have displayed on the screen next to the objects 74 9 4 5 ESPN model In SPNP v6 a very powerful function is introduced That is Fluid Stochastic Petri Net FSPN Fluid places and arcs are introduced into ordinary SPN
81. N lt BN QLEN 5 pql expected QL fprintf Outfile nProb for Queue Len gt 3d 12g n QLEN pql OLEN BN 1 pql expected QL fprintf Outfile nProb for Queue Len d 12g n BN pql pr_std_average 10 11 MMPP Model for the BUS in ATM LAN emulation 10 11 1 Source H Sun X Zang and K S Trivedi Performance of Broadcast and Unknown Server BUS in ATM LAN Emulation Technical Report Center for Advanced Computing and Communication Duke University 1999 10 11 2 Description The net shown in Figure 10 13 represents a performance model of the Broadcast and Un known Server BUS in the ATM LAN emulator It is an simplification of Example 10 9 130 where the superpositiom of multiple MMPPs is approximated by a two state MMPP tSTI cl Ton 90 N TARV2 tMDI TOUT Pon V eZ Mor PAR tLGI 3 21 Toff 810 c3 TARVI PAR TAR PCSI CS PCS2 TCS OKE u 3w N PAR PCSI sign PCS2 is the number of active unicast flows N determines the parameters of the subnet in the dotted rectangle Figure 10 13 MMPP Model for the BUS in ATM LAN emulation 10 11 3 Features e Markovian model e Dependent marking rates e Priorities 10 11 4 SPNP File LANE c include lt stdio h gt include user h corresponds to MMPP model in paper define PLST 2 x Shor
82. OP_PR_RSET VAL_YES iopt OP PR RGRAPH VAL VES ioptdOP ITERATIONS 20000 fopt FOP_ABS_RET_MO 0 0 fopt FOP_PRECISION 0 00000001 void net place p0 init po 1 place p1 place p2 place p3 place p4 rateval t 0 1 0 rateval t1 3 0 rateval t 2 7 0 rateval t3 9 0 rateval t 4 5 0 larc t0 p0 oarc t0 p1 oarc t0 p2 larc t1 p1 oarc t1 p3 larc t2 p2 oarc t2 p4 larc t3 p3 oarc t3 p1 larc t4 p3 jarc ta p4 oarc t 4 p0 int assert if mark p3 gt 5 return RES_ERROR 87 else return RES_NOERR void ac_init fprintf stderr nExample from Molloy s Thesis n n pr netinfo x information on the net structure void ac_reach fprintf stderr nThe reachability graph has been generated n n pr rginfo x information on the reachability graph general marking dependent reward functions double ef00 return double mark p0 double ef1 return double mark p1 double ef2 return rate t2 double ef3 return rate t 3 double eff return rate t 1 1 8 double mark p3 x 0 7 void ac_final solve INFINITY pr mc_info x information about the Markov chain pr expected mark p0 ef0 pr expected mark p1 ef1 pr expected rate t2 ef2 pr expected rate t3 ef3 pr expected rate t1
83. ORDER VAL_TOFROM ioptIOPMC VAL_CTMC iopt IOP_PR_RSET VAL_YES iopt OP PR RGRAPH VAL VES ioptdOP CUMULATIVE VAL NO fopt FOP_PRECISION 0 00000001 l int enall if the database is failed Y if mark dbup 0 return 0 x if the front end is failed if mark feup 0 return 0 x if both the processing sub systems are failed 4 if mark mm1up 0 mark swlup 0 mark prlup 0 amp amp mark mm2up 0 mark sw2up 0 mark pr2up 0 return 0 return 1 void net x first processing subsystem place mmlup init mmlup 1 place swlup init swlup 1 place prlup init prlup 2 place mmidn place swidn place pritmp place pridn1 place pridn2 second processing subsystem place mm2up init mm2up 1 place sw2up init sw2up 1 101 place pr2up init pr2up 2 place mm2dn place sw2dn place pr2tmp place pr2dn1 place pr2dn2 database place dbup init dbup 1 place dbdn frontend place feup init feup 1 place fedn guard tmm1 1 enall guard tsw1f1 enall guard tpr1f1 enall guard tmml r enall guard t swlr enall guard tprir enall guard tmm2f1 enall guard tsw2f1 enall guard tpr2f1 enall guard tmm2 r enall guard t sw2r enall guard tpr2r enall guard t dbf
84. Packet Leaving Rate 100 round robin Round Robin Weight 7 Maximum Waiting Time 1 traffic interation policy Traffic Interaction Policy 3 Policy III Threshold 1 fix point iteration Fix Point Iteration File smod3ta itp Fix Point Precision 0 0001 152 10 13 Simulation example reader and writer sharing buffer 10 13 1 Source Computer Science Department College of Willian and Mary On the Simulation of Stochastic Petri Nets The parameters have been changed to have rare events 10 13 2 Description The net shown in Figure 10 18 represents a set of N operating processes in an operating system sharing a buffer in sharing or writing mode Up to K lt N processes are allowed to read the buffer Once a process is in the ready to write state the operating system informs the other processes that are ready to read that they should wait because the buffer will be modified In the same way all the processes that already are in the reading state should exit at once because the data is out of date Figure 10 18 Reader and Writer sharing buffer 10 13 3 Features e Involves non exponential distributions e Use of discrete event simulation 153 e Use of resampling policies 10 13 4 SPNP File readwrite c ARR gt e o lt e a Dc a o lt IEEE IE IEEE EEE III a ak 2 2 lt xTitle A example of reader and writer sharing buffer xFile
85. R MARK ORDER VAL_CANONIO iopt OP PR RSET VAL NO ioptdOP PR MC ORDER VAL_FROMTO iopt IOP_SENSITIVITY VAL_NO iopt lOP MC VAL_CTMC iopt lOP SSMETHOD VAL SSSOR ioptdOP TSMETHOD VAL FOXUNIF iopt IOP_ITERATIONS 20000 fopt FOP_PRECISION le 13 fopt FOP_ABS_RET_MO0 0 0 1opt IOP_CUMULATIVE VAL YES ioptIOP_SSDETECT VAL_YES 10pt IOP_OK_ABSMARK VAL_NO 10pt IOP_OK_VANLOOP VAL_NO opt IOP_OK_TRANS_MO VAL_YES 10pt IOP_OK_VAN_MO VAL_YES 10pt IOP_ELIMINATION VAL_REDONTHEFLY x REWARD Functions double QL 0 if mark PBUF gt QLEN return 1 0 else return 0 1 double MLP 0 if mark PBUF gt BN PLMD return 1 0 else return 0 double SLP if mark PBUF gt BN PLST return 1 0 else return 0 double LLP if mark PBUF gt BN PLLG return 1 0 else return 0 GUARD Functions 4 118 int guardARV int n 0 if mark POUT gt 0 n 1 if mark PAR mark PCS n lt K return 1 else return 0 int guardARVI 0 int n 0 if mark POUT gt 0 n 1 n mark PAR mark PCS if n gt 0 return 1 else return 0 int guardARV2 0 int n 0 if mark POUT gt 0 n 1 n mark PAR mark PCS if n gt 1 return 1 else return 0 int guardARV3 int n 0 if mark POUT gt 0 n 1 n mark PAR mark PCS if n gt 2 return 1 else return 0 int g
86. SDETECT VAL_YES iopt lOP OK ABSMARK VAL NO iopt lOP OK VANLOOP VAL_NO 10opt IOP_OK_TRANS_MO VAL_YES 10pt IOP_OK_VAN_MO VAL_YES iopt IOP_ELIMINATION VAL_REDONTHEFLY some computation r lambdaT lambdaP lambdaT x REWARD Functions double dtime double dtime dtime double mark Ds exp betal xtR 163 double mark D exp delta tR double mark hsp0s exp beta tR double mark hsp0 exp beta tR double mark FC x 1 0 double mark F x1 0 dtime 876660 return dtime double dtime60vs100 double dtime dtime double mark Ds double mark D exp delta tR double mark hsp0s double mark hsp0 double mark FC x 1 0 double mark F 1 0 dtime 876660 return dtime double dtimesvs100 double dtime dtime double mark Ds double mark hsp0s double mark hsp0 double mark FC x 1 0 double mark F 1 0 dtime x 876660 return dtime int cond if mark hsp2 0 amp amp mark hsp1 0 amp amp mark hspls 0 amp amp mark hsplss 0 return 1 else return 0 double times 2 int condFC if mark FC 1 return 1 else return 0 double timesFC 2 int condFO if mark F 1 return 1 else return 0 double timesF 2 int cond5vs100 if mark hsp2 0 amp amp mark hsp1 0 amp amp mark hspl
87. SIM_RUNMETHOD VAL_REPL VAL_BATCH VAL_RESTART VAL SPLIT VAL_IS VZ TOP_SIM_SEED non negative int IOP_SIM_CUMULATIVE VAL_YES VAL_NO IOP_SIM_STD_REPORT VAL_YES VAL_NO IOP_SPLIT_LEVEL_DOWN non negative double IOP SPLIT PRESIM VAL_YES VAL_NO IOP SPLIT NUMBER non negative double IOP SPLIT RESTART FINISH VAL_YES VAL NO IOP SPLIT PRESIM RUNS non negative double FOP SIM LENGTH FOP SIM CONFIDENCE FOP SIM ERROR non negative double non negative double non negative double Table 7 3 Available simulative options Default IOP_ELIMINATION L_REDONTHEFLY VAL REDAFTERRG L_REDNEVER VAL_REDONTHEF LY IOP OK ABSMARK VAL_YES VAL VAL_NO IOP_OK_VANLOOP VAL_YES VAL VAL NO IOP OK TRANS MO VAL_YES VAL VAL_YES TOP_OK_VAN_MO VAL_YES VAL VAL_YES FOP_ABS_RET_MO non negative doubl 0 0 IOP_DEBUG VAL_YES VAL_N VAL_NO FOP_FLUID_EPSILON non negative double 0 000001 FOP_TIME_EPSILON non negative double 0 000001 Table 7 4 Miscellaneous options 7 1 Options for intermediate files IOP_PR_RSET and IOP_PR_RGRAPH These options specify whether the reachability set and graph should be printed In addition to VAL YES and VAL NO VAL TAN can be used for IOP_PR_RSET which indicates that only the tangible markings should be printed IOP PR MARK ORDER This option specifies the order in which the markings are printed 51 e With VAL_CANONIC order markings are printed in the order they are f
88. SPNP User s Manual Version 6 0 Contact information Professor Kishor S Trivedi Center for Advanced Computing and Communication CACC Department of Electrical and Computer Engineering Duke University Durham NC 27708 USA phone 919 660 5269 fax 919 660 5293 kst ee duke edu September 1999 Preface The Stochastic Petri Net Package SPNP is a versatile modeling tool for performance dependability and performability analysis of complex systems Input models based on the theory of stochastic reward nets are solved by efficient and numerically stable algorithms Steady state transient cumulative transient time averaged and up to absorption measures can be computed Parametric sensitivity analysis of these measures is possible Some degree of logical analysis capabilities are also available in the form of assertion checking and the number and types of markings in the reachability graph Advanced constructs such as marking dependent arc multiplicities guards arrays of places and transitions are available The modeling complexities can be reduced with these advanced constructs In addition the expressiveness of the package is enhanced The most powerful feature of SPNP is the ability to assign reward rates at the net level and subsequently compute the desired measures of the system being modeled Although no previous knowledge of the C language is necessary to use SPNP the modeling description language is CSPL a C like
89. Stochastic Reward Nets Journal of Parallel and Distributed Com puting 15 255 269 1992 9 G Ciardo and K S Trivedi A Decomposition Approach for Stochastic Petri Net Models International Conference on Petri Nets and Performance Models Mel bourne Australia December 1991 also Performance Evaluation Vol 18 No 1 pp 37 59 July 1993 198 10 11 12 13 14 15 16 17 18 19 20 21 G Ciardo L Cherkasova V Kotov and T Rokicki Modeling a Scalable High Speed Interconnect with Stochastic Petri Nets Proceedings of the 6th Int Workshop on Petri Nets and Performance Models PNPM 95 Durham NC USA Oct 1995 C Constantinescu and K S Trivedi Dependability Modeling of Real Time Sys tems Using Stochastic Reward Nets Microelectronics and Reliability Vol 35 No 6 pp 903 914 1995 R Fricks C Hirel S Wells and K S Trivedi The Development of an Integrated Modeling Environment Proceedings of the 1st World Congress on Systems Simula tion WCSS 97 Singapore Sept 1997 S Greiner A Puliafito G Bolch and K S Trivedi Performance Evaluation of Dynamic Priority Operating Systems Proceedings of the 6th Int Workshop on Petri Nets and Performance Models PNPM 95 Durham NC USA Oct 1995 C Hirel S Wells R Fricks and K S Trivedi iSPN an Integrated Environment for Modeling Using Stochastic Petri Nets Tools Demonstrat
90. TMC this file describes the CTMC derived from your SRN the vanishing markings are absent and only numerical rates appear The format is _firstindex 0 _nstates lt number of states gt _nentries lt number of arcs in the CTMC gt _order lt _FROMTO or _TOFROM gt _matrix lt state gt lt state gt lt rate gt Se lt state gt lt rate gt 62 lt state gt lt state gt lt rate gt His lt state gt lt rate gt _initstate lt state gt lt prob gt lt state gt lt prob gt lt state gt lt prob gt lt state gt lt prob gt _iterations lt maximum number of iterations gt _precision lt requested precision gt _method lt requested solution method gt _time lt _INFINITY gt lt time_point gt All entries enclosed in square brackets are optional Any of the statements shown after the matrix description can repeat The transition rate matrix is described by rows If FROMTO is in effect al Des 82152 12 100 means that the transition rate from state 7 to state 5 is 0 4 to state 8 is 1 2 to state 12 is 100 0 The first index is 0 so if the number of states is 15 they will be identified as 0 1 2 14 If the order is TOFROM the transpose of the transition rate matrix will be printed In our example there will be rows 5 a ETO ae hot 8 ee Ex eee a 12 Sass 7 100 ue If IOP MC has value VAL_DTMC this file describes the DTMC derived from your
91. The function is useful in the transient analysis of phase mission systems A future version will break the limitation that both Petri nets have the same state space and place names It is supposed to able to read user specified rules of mapping from the state space of input Petri net to the current Petri net Module loadprob c Author Yonghuan Cao ycao ee duek edu Changes 10 13 1999 initial version Functions static internal void read_rg_head void void next_marking void 191 void read_prb_head void double next_probability void global can be called from outside void loadprob char xsfName include sysinclude h include port n include const h include type h include var h include options h include reach h include cspl h include rdc h include viti BEEN include lt string h gt include lt math h gt define MAXPLACE 64 define MAXPLNAME 32 define MAXLINE MAXPLACEX8 static FILE fpRG xfpPrb static int nplace 0 static int nstates 0 static double time0 0 00 static char splace MAXPLACE MAXPLNAME static int idx MAXPLACE static int marking MAXPLACE static char sline MAXLINE void read_rg_head int 1 char xp read _nplace while feof fpRG fgets sline MAXLINE fpRG if p strstr sline _nplace break 3 if feof fpRG fclose fpRG fclose fpPrb LogMsg MSG EXIT read_
92. _YES 10pt IOP_ELIMINATION VAL REDONTHEFLY ml b01 xal b10 x a0 b01 b10 vl al a0 x al a0 x b01 b10 b01 b10 x b01 b10 ul al al xal bO1 a0 aO x a0 b10 b01 b10 ul ul 3 x ml vl ml x ml x ml 132 tl 1 b01 b10 m2 d01 x gl d10 g0 dO1 d10 v2 gl g0 x gl 80 x d01 d10 d01 d10 x d01 d10 u2 gl gl x gl x d01 gO x gO gO x d10 d01 d10 u2 u2 3 x m2 v2 m2 x m2 m2 t2 1 dO1 d10 x REWARD Functions double QL O if mark PBUF gt QLEN return 1 0 else return 0 double MLP if mark PBUF gt BN PLMD amp amp enabled TARV2 return 1 0 else return 0 double SLP if mark PBUF gt BN PLST amp amp enabled TARV2 return 1 0 else return 0 double LLP if mark PBUF gt BN PLLG amp amp enabled TARV2 return 1 0 else return 0 GUARD Functions int guard ARV int n 0 if mark POUT gt 0 n l if mark PAR mark PCS n lt K return 1 else return 0 int guardARV2 if rateAL 4 0 0 mark PAON return 1 else return 0 int guardBST if mark PBUF lt BN PLST return 1 else return 0 133 int guardBMD O if mark PBUF lt BN PLMD return 1 else return 0 j int guardBLG 0 4 if mark PBUF lt BN PLLG
93. a versatile modeling tool for solution of Stochastic Petri Net SPN models The SPN models are described in the input language for SPNP called CSPL C based SPN Language The CSPL is an extension of the C programming language 13 with additional constructs which facilitate easy description of SPN models The full power and generality of C is available but a working knowledge of C is sufficient to use SPNP effectively The SPN models specified to SPNP are actually SPN Reward Models or Stochastic Reward Nets SRNs 6 7 which are based on the Markov Reward Models MRM paradigm 15 28 Fig 1 1 shows the taxonomy of SRN models and the solution method implemented in SPNP Markov Reward Model provides a powerful modeling environment for e Dependability Reliability Availability Safety analysis e Performance analysis e Performability modeling A number of important Petri net constructs such as marking dependency variable car dinality arc and enabling functions or guards 6 facilitate the construction of models for complex systems The package also allows logical analysis on the Petri net whereby any general assertions defined on the Petri net are checked for each marking of the net The SRN may be solved to obtain either steady state metrics or transient metrics The package allows the specification of custom measures although a standard set of measures are avail able The measures are defined in terms of reward rates ass
94. ace PMD place PLG place PBUEF place POUT 127 place Pbroad place Puon place Puoff place Pdepart x TRANSITION 4 rateval TARV1 lambda guard TARV1 guardARV rateval TAR mu rateval TCS beta imm tCS priority tCS 20 probval tCcs 1 ratefun Tbroad rateTbroad rateval Yon beta_01 rateval Yoff beta_10 ratedep Tuon alpha01 Puoff ratedep Tuoff alpha_10 Puon ratefun Tunicast rateTunicast guard Tunicast guardTunicast imm t1 probval t1 1 priority t1 20 imm t2 probval t2 1 priority t2 20 guard t2 guardt2 imm t STI priority t STI 20 probval tSTI cl imm tMDI priority tMD1 20 probval tMDI c2 imm tLGI priority t LGI 20 probval t LGI c3 imm t STO priority t STO 40 probval tsTO 1 guard tSTO guardSTO imm tMDO priority tMDO 40 probval tMDO 1 guard tMDO guardMDO imm tLGO priority tLGO 40 probval tLGO 1 guard tLGO guardLGO imm tSTL priority t STL 20 probval tSTL 1 imm tMDL priority tMDL 20 probval tMDL 1 128 imm tLGL priority t LGL 20 probval t LGL 1 imm tOUT priority t OUT 20 probval tOUT 1 rateval TOUT rateOUT lx ARC oarc TARV1 PAR iarc TAR PAR
95. acity 4 void calVar int condTo int condTso prototype guard functions x prototype rate functions double rrfPsf double rrfBus x prototype cardinality functions void options ioptIOP_PR _RGRAPH VAL_NO iopt lOP PR MC VAL NO iopt lOP PR DERMC VAL NO iopt lOP PR PROB VAL NO iopt lOP PR PROBDTMC VAL NO ioptIOP_PR_DOT VAL_NO ioptIOP_PR MERG_MARK VAL_YES ioptIOP_PR FULL_MARK VAL_NO ioptIOP_USENAME VAL_NO ioptIOP_DEBUG VAL_NO ioptIOP_PR MARK_ORDER VAL_CANONIO 172 10pt IOP_PR_RSET VAL_NO topt IOP_PR_MC_ORDER VAL_FROMTO x NUMERICAL SOLUTION chosen iopt IOP_SENSITIVITY VAL_NO ioptIOP_MC VAL_CTMC ioptIOP_SSMETHOD VAL_SSSOR iopt IOP_TSMETHOD VAL_FOXUNIF iopt OP ITERATIONS 2000 fopt FOP_PRECISION 0 000001 fopt FOP ABS RET MO O O iopt lOP CUMULATIVE VAL NO ioptIOP_SSDETECT VAL_YES 10pt IOP_OK_ABSMARK VAL_NO topt IOP_OK_VANLOOP VAL_NO ioptdOP OK TRANS MO VAL XES 10pt IOP_OK_VAN_MO VAL_YES 10pt IOP_ELIMINATION VAL_REDONTHEFLY some computation cal Var void calVar double eq FILE xpp char command 120 run gsbhsp char cmdvsc 120 system command if pp popen grep MTTFeq gsbhsp out awk print 4 r NULL perror popen exit 1 nee S141 amp eq printf 3 12 n eq fclose pp frHsp 1 eq if pp popen grep MTTReq gsbhsp out awk p
96. ample models the C mmp system designed at CMU The architecture of the system is shown in Figure 10 5 The corresponding SPN model is shown in Figure 10 6 processors hi memories INTER CONNECTION NETWORK Figure 10 5 The C mmp Architecture 10 4 3 Features e Enabling functions e Variable multiplicity arcs e Reward based measures e Transient analysis 95 Z r Gr 6 procup memup swup tir yyy fc e trpr trmm trsw procdn VY memdn swdn A va va Transition Transition Enabling Function Enabling Function L E 27 lt eN i a lt rs 0 A memup swup gt 0 nn moon procup gt amp procup a ee memup gt trfir memup rs mean oe swup gt trfir amp swup ne man Figure 10 6 SPN for Example 10 4 10 4 4 SPNP File example4 c include user h include lt math h gt This is a model of the C MMP multiprocessor system adopted from Blake Reibman and Trivedi Sensitivity Analysis of Reliability and Performability Measures for Multiprocessor Systems ACM SIGMETRICS 1988 A int k extern int abs extern double pow void options 10pt IOP_SSMETHOD VAL_SSSOR 10pt IOP_TSMETHOD VAL_TSUNIB 10pt IOP_OK_TRANS_MO VAL_YES 10pt IOP_MC VAL_CTMC ioptIOP_ITERATIONS 20000 fopt FOP_ABS_RET_MO 0 0 fopt FOP_PRECISION 0 00000001 96 k input Input minimum number of
97. ansitions imm t2 priority t2 1 imm t3 priority t3 1 imm t6 priority t6 1 imm t7 priority t7 1 imm t8 priority t8 1 x rate and probability functions ratefun A rate0 ratefun B1 ratel probfun t2 prob2 probfun t3 prob3 ratefun C rate4 ratefun D rate5 probfun t 6 prob6 probfun t 7 prob7 probfun t 8 prob8 iarc A p0 oarc A p1 oarc A p3 larc B1 p1 oarc B1 p2 1 larc t2 p3 oarc t2 p4 larc t3 p3 oarc t3 p5 90 larc C p4 oarc C p6 larc D p5 oarc i DB OW 1 larc t6 p7 oarc t6 p6 jarc t7 p7 oarc t7 p5 larc t8 p2 larc t8 p6 oarc t8 p8 assert return RES_NOERR ac_init fprintf stderr nSoftware modeling example n n ac_reach double rfunc return mark p8 ac_final inti x Transient analvsis with multiple time points 4 x reward function for i 1 i lt 10 i solve double i pr expected probability of completion rfunc for i 10 i lt 20 i 2 solve double i pr expected probability of completion rfunc for 1 20 1 lt 50 i 5 solve double i pr expected probability of completion rfunc 10 3 M M m b queue 10 3 1 Description This example models a finite buffer M M m b queue shown in Figure 10 3 The corre sponding SPN is shown
98. aracteristics normally available only in sophisticated two dimensional graphical editors and a lot of new features designed specifically for the SPNP environment iSPN also provides a textual interface through the Run Programs page see Figure 9 3 which is necessary if we wish to accommodate several categories of users The user can select his model edit it and execute it without having to switch between different appplications like a text editor and SPNP Beginners may feel more comfortable using the Petri Net editor whereas experienced SPNP users may wish to input their models using CSPL directly Even if the textual input is the option of choice a lot of new facilities are offered through the integrated environment In both cases the SPNP control module provides everything a user needs to run and control the execution of SPNP without having to switch back and forth among distinct environments i e the UNIX command or a text 67 editor Mivieome Graph interisse Eur Programs Esos Debugging Browse Example Credits de Model Selection Path woven T runs Maker un DIR opt file mane i make f tens chorea Takerun DIR opt l Sider OUT File Figure 9 3 The execution page In the Plots page the user can view SPNP s results in the GUI application iSPN s own graphing capabilitv allows the results of experiments to be graphicallv displaved in the same environment Different combinations of input data mav be
99. average throughput The average throughput E 7 for Transition a is defined as EM gt p p i p a i iE R a where R a is the subset of reachable markings that enable Transition a p i is the probability of marking i and p a i is the rate of Transition a in marking i e pr_expected void pr_expected char string double f func Q Function pr_expected requires the specification of a string which is written to the out file and of a marking dependent reward function func returning a double precision floating point number For example the following function ac_final void ac_final pr_expected utilization util will print EXPECTED utilization 3 2 31 to the out file if the expected value of the reward function util is 3 2 The reward function util returning a double double precision floating point num ber must have been defined prior to its usage in pr_expected using the functions mark and enabled to express marking dependency In addition to the functions mark and enabled the function double rate char as defined previously can also be used to refer to the marking dependent rate of Transition t We provide an example to illustrate how to write a marking dependent reward func ton The following function util double util return mark p_1 mark p_7 mark p 3 1 would define the utilization as the weighted by the probability o
100. ble marking the cumulative sojourn times in transient states up to the solution time and the derivatives with respect to defined parameters of the aforementioned measures e test prbdtme containing the numerical results of the embedded DTMC e test out containing the requested output according to what is specified in test c using the provided functions e test log contains all the output messages produced by the package during model solution e test dot contains a description of the Petri net in the dot graph language Chapter 4 The CSPL Language The CSPL languange can be defined as a system for describing handling and solving Stochastic Reward Nets SRNs The syntax and the semantics of CSPL are based on the ANSI C language Moreover a correct CSPL file is a correct ANSI C file too What distinguishes CSPL from ANSI C is a set of predefined functions for the specification and solving of SRNs Familiarity with ANSI C languange will be a great advantage for a user to exploit most of the features of the CSPL language However it should be without difficulty for a user to be able to define and solve his her SRNs under study with the help of this manual especially the examples provided within it Any legal ANSI C construct is allowed in the CSPL language as needed User defined variables and functions can be used in a CSPL file In particular all the standard C library functions such as fprintf fscanf log exp et
101. bution The portion of CSPL file in Figure 4 1 allows the run time definition of the number of stages in a subnet corresponding to an Erlang distribution The size of the arrays of ph Places and th transitions is determined respectively as max 1 and max at run time using the predefined input function You will see a message on the terminal Please type number of phases int gt and the variable max will be set to the number you type say 6 Then seven places with names pho phe will be defined with no tokens in them initially Six transitions will be defined with names th the Finally a sequence of both input and output arcs pho th thi ph the phe will be defined as well 14 int max void options ee input number of phases void net int i char auxplace 20 auxtrans 20 sprintf auxplace ph 0 place auxplace for i 1 i lt max 1 sprintf auxtrans th d i sprintf auxplace ph sd i place auxplace trans auxtrans rateval auxtrans 2 0 iarc auxtrans auxplace oarc auxtrans auxplace Figure 4 1 An Erlang subnet 15 4 2 3 Rate dependent function A rate dependent function is a C function which makes call s to functions referring to SRN entity entities and returns either an integer value or a double value Rate dependent functions are used to specify for instance output measures which will be descr
102. c can be called in CSPL if necessary A CSPL file must contain the following five basic functions options e net e assert e ac_init e ac_reach e ac_final Each function listed is designed to carry out one or several certain task s by calling some relevant subroutines functions These tasks are related to the definition and solving processes of stochastic reward nets In the following sections we will discuss the function above and the other related subroutines in detail Simple examples will be given to illustrate their usage 4 1 Function options void options void A valid CSPL file must contain the options function Function options calls the following subroutins e iopt e foptO e input and e finput to set options which will affect the way of describing and solving SRN A detailed list of these options can be found in Chapter 7 Availabe Options 4 1 1 Functions to set option values void iopt IOP_TYPE option int val void fopt FOP_TYPE option double val Functions iopt and fopt set option indexed as option with value v There are two kinds of options integer options and float options more precisely options with double precision floating point values A user is advised to be aware of the difference and use the correct type while setting options Example void options iopt IOP_PR_MARK_ORDER VAL_LEXICAL fopt FOP_PRECISION
103. cate the actual logic of the model In these cases the definition of a marking dependent enabling function or guard is probably a better choice The function void guard char t int func defines the enabling function of Transition t to be the marking dependent function func instead of the default the constant function returning 1 in all markings For example if we defined a function int gt OQ return mark p_1 gt 2 mark p 2 we can then use it in Guard E 1 ot to guarantee that t is disabled when p does not contain more than twice as many tokens as p2 does 4 2 6 Specify marking dependent firing rates or firing weights Occasionally it is useful to define the firing rate or firing weight of a transition as a marking dependent quantity The simplest way is to define it as a quantity proportional to the 17 number of tokens in a place The functions void ratedep char 7 double val char p void probdep char f double val char p define the firing rate or firing weight of Transition f to be val times the number of tokens in Place p Note it is an error for a firing rate or firing weight to be evaluated to zero in a marking where the transition is enabled Hence this method can not be used when Place p is not an input place for t and can become empty In many other cases though a more general type of marking dependency is required This is achieved by defining a marking depende
104. cted time a condition holds true or false in steady state void hold_cond cond times int cond double times 2 void pr_hold_cond string cond char string int cond cond must be a marking dependent function returning VAL_YES if the condition holds in the marking VAL_NO otherwise On return times VAL_YES and times VAL_NO respectively contain the expected length of time the condition holds or does not hold in steady state The idea behind this measure is to be able to condense a large Markov chain into a two state process Normally the process is not a Markov chain but the two state Markov chain whose transition rates are 1 times VAL_YES and 1 times VAL_NO can at least be considered an approximate representation of it The description of how this measure is computed gives additional insight Define S and to be the sets of markings where the condition is true and false respectively and define T to be the set of tangible markings If IOP MC has value VAL_CTMC times VAL_YES and times VAL_NO 4 are computed respectively as Nm Nm kESYNT kESn OT nd Se 32 YA Au ie SYNT jESnNT iESnNT jESyNT where is the transition rate from marking 2 to marking j If IOP MC has value VAL_DTMC times VAL_YES and times VAL_NO are computed respectively as 2 Ti Em n La kESYNT ker and FEST keT PiQi j Pii j D pit gt ie Sy JE Sn iESn jESy where a is the transition probability from marking 7 to mark
105. ctions on Software Engineering Special Issue on Software Reliability 19 11 November 1993 L Tomek V Mainkar R Geist and K Trivedi Reliability analysis of life critical real time systems Proceedings of the IEEE January 1994 L Tomek and K S Trivedi Analyses Using Stochastic Reward Nets in Software Fault Tolerance M Lyu ed John Wiley amp Sons 1994 K S Trivedi Y Ma and J J Han Performability analysis of fault tolerant RF link design in wireless communications networks invited paper in Proc of the 13th European Simulation Multiconference ESM99 Warsaw Poland June 1999 K S Trivedi S Hunter S Garg and R M Fricks Reliability Analysis Tech niques Explored Through a Communication Network Example in Proceedings of the Computer Aided Design Test and Evaluation for Dependability Conference CADTED 9 6 Beijing China July 1996 pp 110 120 201 45 B Tuffin D S Chen and K S Trivedi Comparison of Hybrid Systems and Fluid Stochastic Petri Nets Technical Report Center for Advanced Computing and Com munication Duke University 1999 46 C Y Wang D Logothetis I Viniotis and K S Trivedi Transient Behavior of ATM Networks under Overloads Proceedings of the IEEE INFOCOM 96 San Francisco CA pp 978 985 March 1996 202 Bibliography 1 M Ajmone Marsan G Conte and G Balbo A class of generalized stochastic Petri nets for the performance eva
106. cumulatively from zero to FOP_SIM_LENGTH The simulator collects four standard measures Probability that a place is not empty Average number of tokens in a place Probability that a transition is enabled Throughput of a transition The default value of IOP SIM CUMULATIVE is VAL_YES Another way to collect statistics is by calling in ac_final functions pr_expected char msg double f which computes the average instan tanenous value at time IOP SIM LENGTH for the user defined function f pr_cum_expected char msg double f which computes the average cu mulative value for the user defined function f from time 0 to time given by IOP_SIM_LENGTH Thus option IOP_SIM_CUMULATIVE saves the call of a lot of functions pr cum expected but does not prevent the user from computing instantaneous measures function ac_final can be empty if the values the user is looking for are an output of IOP SIM CUMULATIVE e Data confidence interval FOP SIM CONFIDENCE specifies the confidence to be used when computing the confidence intervals Possible values are 9070 95 99 and the default value is 95 e Number of iterations IOP_SIM_RUNS specifies the maximum number of simulation runs to be performed to obtain meaningful statistics FOP_SIM_ERROR specifies the target half width of the confidence interval relative to the point estimate You can provide the exact number of runs or batches The default value is
107. d lt 1b1 gt is a code _T for tangible non absorbing _A for tangible absorbing _V for vanishing marking not in a loop _L for vanishing marking in a transient loop lt p1 gt is the non negative integer internally assigned to each place in the same order of definition in the CSPL file lt tr gt is the non negative integer internally assigned to each transition in the same order of definition in the CSPL file lt t k gt is the positive number of tokens in a place and lt val gt is the transition rate or probability in the marking So for example this row in the reachability set specification 3_A O 1 6 5 means that marking 3 an absorbing tangible marking has one token in place O and five tokens in place 6 while this row in the reachability graph specification 4 4 22 0 237 6 5 034 means that marking 4 a vanishing marking goes to marking 4 by firing transition 2 with probability 0 7 and to marking 6 by firing transition 5 with probability 0 3 of course both transition are immediate If the option IOP_PR_FULL_MARK is turned on the format for the description of the reachability set is instead _reachset lt placel gt lt place2 gt lt placeN gt lt mk gt lt lbl gt lt t k gt lt tk gt he lt tk gt lt mk gt lt lbl gt lt tk gt lt tk gt SGN lt tk gt 8 2 The mc file This file can be generated if the option IOP_PR_MC is set to VAL_YES If IOP MC has value VAL_C
108. dvharc char t char p double f func O define an input arc from fluid place p to transition t or a fluid output arc from tran sition t to fluid place p or an inhibitor arc from place p to transtion t with fluid impulse or level in the inhibitor case given by 1 the constant mult or the marking dependent function func respectively e An additional marking dependent function is available to inquire about the state of a fluid place double fmark char p returns the fluid level in fluid place p e Finally the function 22 int fcondition char fpl char rel double val return TRUE if fmark f pl satisfies the relation with val FALSE otherwise Here rel must be one of F_EQ equals F_NQ non equals F_GT greater than F_LT less than F_GE greater or equal F_LQ less or equal a relational operator This may be useful for user defined function and guards 4 2 10 Functions for non Markovian SPNs As an alternative to the functions used to define a timed or immediate transition the fol lowing functions can be used to define timed transitions with non exponential distribution of the firing time These can appear only in models solved by discrete event simulation e Functions void detval char t double val void detdep char t double val char p void detfun char t double fun define a transition with constant firing time given respectively by val the constant val times the number of tokens in
109. e operational The database and the front end should also be operational The processing sub system is functional as long as the memory the switch and at least one of the processors is functional When a processor fails with probability c it fails without disturbing the system However with probability 1 c the failing processor corrupts the database causing it to fail and consequently rendering the system unoperational The pro cessors memories and switches can be repaired while the system is up The memories and 99 pridnl pridn2 mm2up sw2up feup G pr2up pr2dn1 pr2dn2 Enabling Function Enabling Function O o y O all dbup 1 A feup 1 A prlup gt 0 A H mmlup gt 0 A swlup gt 0 V pr2up gt 0 A mm2up gt 0 A sw2up gt 0 Figure 10 8 SPN for Example 10 5 switches receive priority over the processors for repair The corresponding SRN model is shown in Figure 10 8 10 5 3 Features e Global variables e Enabling function e Reward based functions e Transient analysis 100 10 5 4 SPNP File example5 c x This is a petri net model of the database system example from the paper on sensitivity by Hiedelberger and Goyal include user h double coverage 0 99 int count 0 void options 10pt IOP_SSMETHOD VAL_SSSOR ioptIOP_PR MARK_ORDER VAL_CANONIC ioptIOP_PR MC_
110. eas Model Figure 9 10 Plots model selection menu The model selection see Figure 9 10 area handles various file functions Open Open an existing isp file for execution Save Save the current isp file or the igp graphical output file Save As Save the current file under a different name Environment Change operating environment of SPNP Once a isp file has been opened to create a graph 1 Click Create 2 Assign meanings to the graphs and the symbol which must appear on the graph 3 Define the function derivative function if any and reward rates for the graph 4 Input the time of execution the time interval and the time unit 5 Click OK if all is well Cancel to cancel and Clear to clear all fields 6 When OK is clicked Run highlights in green if all the fields have been correctly entered 7 Click Run 8 If there are no syntax errors in the file an OK message is signalled If there are errors a list of errors is displayed 9 Execution environment of SPNP can be modified through the Environment button 77 10 Click Mapping The CSPL file is displayed 11 Click Execution The Run Programs page is brought up and the model executed 12 After model execution the graphical output is displayed 9 6 1 Graphing functions Menu Model Display Figure 9 11 Graphing functions Combo Used to combine two or more graphs in the same display window A maxi mum of f
111. echnology Conference VTC 96 Atlanta Georgia USA 28 April 1 May 1996 J K Muppala and K S Trivedi Composite performance and availability analysis using a hierarchy of stochastic reward nets In G Balbo Ed Proc Fifth Int Conf on Modelling Techniques and Tools for Computer Performance Evaluation Torino Italy 1991 322 336 J K Muppala S P Woolet and K S Trivedi Real time systems performance in the presence of failures IEEE Computer May 1991 J K Muppala A Sathaye R Howe and K S Trivedi Dependability Modeling of a Heterogeneous VAXcluster System Using Stochastic Reward Nets in Hardware and Software Fault Tolerance in Parallel Computing Systems D Avresky ed Ellis Horwood Ltd pp 33 59 1992 J K Muppala and K S Trivedi Numerical transient analysis of finite Marko vian queueing systems In Basawa and Bhat Eds Queueing and Related Models Oxford University Press 1992 262 284 J K Muppala S P Woolet and K S Trivedi On Modeling Performance of Real Time Systems in the Presence of Failures in Readings in Real Time Systems Y H Lee and C M Krishna eds pp 219 239 IEEE Press 1993 200 33 34 35 36 37 38 39 40 41 42 43 44 J K Muppala Varsha Mainkar Vidyadhar Kulkarni and K S Trivedi Numerical computation of response time distributions using stochastic reward nets Annals of Operations
112. ed point iteration have to be used 1 Set error bound e as a small real number 2 Initialze the unknown parameters of Mi Pu P19 Pim to some reasonable random values Pe 21 3 Execute Mi compute the parameters PO PQ Paba 0 required by Ma 4 Set k 1 190 5 Execute Mo with the parameters obtained from last step and compute the parameters PR pb PE gt Im 6 Execute M with the new set of parameters and compute PS l P Pees ey 7 If Y Pk PR 1 lt e then stop else set k k 1 and goto step 5 Under a very general condition we can prove that the solution always exists but the uniqueness of the solution is not guaranteed See 4 However the meaning of practical problems often has uniqueness itself so the justification is enough for the practical use of fixed point iterations 10 18 2 Initial probability reload The function void loadprob char fname is usually used before a transient anaylsis to set initial probabilities to the current Petri nets from a Petri net that shares 1 the same place names and 2 the same state space Input parameter char fname specifies the file name no extension needed of the reachbility graph file rg and the prabability file prb Both files must exist in the same directory to make a successful call The function is suggested to be called in the cspl file before the function solve which invokes a transient analysis
113. ee lve dey i lia ele 84 941 1 Tel Gersi n tel A 2 4 24 ondes S die BREE ER RU 84 9112 TE version RO Yarn ee ae eo ele Oe ee 84 9 11 3 Tix version Tix4 0 4 La bu se aus USA st Bie des 85 10 Examples 86 10 1 Molloy s example 2 0 heg Ben are Ares AE Ah 86 LOT L SOURCE ore ae 882 A es EGO O O 8 ate sn lee 86 LO T 2 DESCHIPHOM Yad Me Be a A SE lum irae ee 86 LOPS Peatures lt hu eon que a he DUR us DURE aS t 87 10 1 4 SPNP File examplel c BIES mia li lee 87 10 2 Software Performance Analysis 88 1024 Description ecs veren wend oe BA e BR ede ae B 88 1022 BEAU A ILE Arn Ge A AA ES 89 10 2 3 SPNP File example2 c see WE We EE 89 10 3 MIMI PO QUEUE ndr eert tente dE den OE ERE ERA 91 10 3 1 Description soy un er ane a es ROE Aras ERE EE A RR 91 10 3 2A Features y 4 ka ote en Be ee NS ROE ae alae De ets 91 10 3 3 SPNP File example3 c a anna ned eR Ata a 92 10 4 C mmp system performability analysis 95 vi VOEL SOUE arrest o dls ak the ns ak ds He aol a 95 1O42 Description 0 So EA A ERE WEE KES 95 104 3 Feature sie zen icin gr aagi ia i eA E a A E E E ATE ir r Gea 95 10 4 4 SPNP File example4 c 5 4 van ow fi ala fi a 96 10 5 Database system availability analysis 99 OST SOURCE Li oere Re Pe dat eee a pet Bons sl du a nds 99 10 5 2 Description rte E Ae We tele it KG 99 WO
114. eibval_is 48
115. el widgets that fit the needs of your application With Tix you can for get about the frivolous details of the Tk widgets and concentrate on solving your problems at hand Professional Look and feel Tix defines configurations options that are very close to the standard Motif look and feel If you like the ease of programming with Tcl Tk but want your program to have an industrial standard look and feel Tix is the answer Rapid Prototyping New Widgets The Tix Intrinsics API makes it possible to write new custom designed widgets using Tcl exclusively It typically reduces the efforts of developing a new widget by a factor of ten or more 85 Chapter 10 Examples 10 1 Molloy s example 10 1 1 Source M K Molloy Performance Analysis Using Stochastic Petri Nets IEEE Trans Comput C 31 9 Sept 1982 913 917 10 1 2 Description The net is shown in Figure 10 1 Figure 10 1 SPN for Example 10 1 86 10 1 3 Features e Assertion on place p3 e Reward based functions to compute expected values e Default measures e Steady state analysis 10 1 4 SPNP File examplel c This example adapted from M K Molloy s IEEE TC paper include user h void options ioptIOP_SSMETHOD VAL_GASED 10pt IOP_PR_FULL_MARK VAL_YES iopt IOP_PR_MARK_ORDER VAL_CANONIC ioptdOP PR MC ORDER VAL TOFROM opt IOP PR_MC VAL_YES iopt OP PR PROB VAL VES ioptIOP_MC VAL_CTMC iopt I
116. elName smod3t SPN ModelName spn 138 J i tati LL me AA AN A 1 0 ka k aon DJ j Pawt tawt T atx gt atx Figure 10 15 Decomposed SPN model for a tagged link Figure 10 16 Decomposed SPN model for the aggregated links 139 trip tia Tik tip tLidis Figure 10 17 Decomposed SPN model for the best effort queue Guard Policy I Guard Policy 77 Guard Policy 111 HPeng lt Bing Ping lt Bing to dk eg En as Policy 1 as Policy 7 Ping gt Bing 0 0 HPing 0 or Pr O as Policy I as Policy I 1 AP lt Bang Pang lt Bang tap Pang gt Path as Policy 1 as Policy 7 IE gt Bang hO ea a el Pang 0 or Patk 0 as Policy I as Policy I FTI CE E E tps 0 1 T HPLia gt Brig as Policy I as Policy I Table 10 1 Guards of transitions for the SPN in Fig 10 15 Fig 10 16 and Fig 10 17 140 Tagged ModelName t Aggregated ModelName a for i 0 1 lt NIT i print Fix Point Iteration i for Tagged Links n system SSPN STagged 0 or die finish error exec Tagged print Fix Point Iteration i for Aggregated Links n system SSPN SAggregated 0 or die error exec Aggregated
117. ens in place p or the marking dependent function f and g The density is then is then Vx gt 0 vall x val2gval2 1 valia e Functions void normval char t double vail double val2 void normdep char double vall double val2 char p void normfun char t double f double 9 0 define a transition with a normally distributed firing time with respective parame ters vall and val2 vall times the number of tokens in place p and val2 times the number of tokens in place p or the marking dependent function f and g This nor mal distribution is truncated by considering only non negative values Parameters vall and val2 are the expectation and variance of the non truncated distribution e Functions void lognval char t double vall double val2 void logndep char t double vall double val2 char p void lognfun char t double f double 9 0 define a transition t with lognormally distributed firing time with respective param eters vall and val2 vall times the number of tokens in place p and val2 times the number of tokens in place p or the marking dependent function f and g The density is then Vx gt 0 V2rval2x en x vall 2val2 e Functions 24 void gamval char double va 1 double val2 void gamdep char t double vall double val2 char p void gamfun char t double f double 9 0 define a transition t with gamma distribution with respective parameters vall and
118. ers vall val2 and val3 vall times the number of tokens in place p val2 times the number of tokens in place p and val3 times the number of tokens in place p or the marking dependent function f g and h The probability to have value k x val3 VO lt k lt vall is then given by vall k 1 val2 val2 e Functions void negbval char t double vall double val2 double val3 void negbdep char t double vall double val2 double val3 char p void negbfun char t double f double g double h Q define a transition t with negative binomial distribution with respective parameters vall val2 and val3 vall times the number of tokens in place p val2 times the number of tokens in place p and val3 times the number of tokens in place p or the marking dependent function f g and h The probability to have value k x val3 Vk gt 0 is then given by T vall k AH 1 val val24 T oall k D Re e Functions void hyperval char t double vall double val2 double val3 void hyperdep char t double vall double val2 double val3 char p void hyperfun char t double f double 9 0 double A 0 define a transition t with 2 stage hyperexponential distribution with respective rates vall val2 and probability val3 to choose stage 1 vall times the number of tokens in place p val2 times the number of tokens in place p and val3 as the probability to choose stage 1 or the marking dependen
119. f Outfile AnProb for Queue Len gt d 12g n QLEN pql QLEN BN 1 pql expected QL fprintf Outfile nProb for Queue Len d 12g n BN pql pr_std_average 123 10 10 Birth death Model for the BUS in ATM LAN emu lation 10 10 1 Source H Sun X Zang and K S Trivedi Performance of Broadcast and Unknown Server BUS in ATM LAN Emulation Technical Report Center for Advanced Computing and Communication Duke University 1999 10 10 2 Description The net shown in Figure 10 12 represents a performance model of the Broadcast and Un known Server BUS in the ATM LAN emulator It is an simplification of Example 10 9 where the aggregation of the flows of the unicast traffic is approximated by a birth and death process Yon Bor Tbroad tSTI PST tSTO Pbroad l l ec e a T bO or bl ani VA DI PMD tMDO tOUT TOUT PL EN TAS ae PN al i awe E My L po 7 NS e M 31 tLGL H rates and guards for the transitions within dashed frame gt H transition rate 2 3 1 Tunicast Puon al Puoff a0 3 P depart H _ Tuon Puofti 01 of Ne SS i Tuoff Puona 10 i IN PRA Ol transition guard cs PCS2 tes WA JEN EN 3 u Puon gt 0 4 y C f SLA j 2 Puon 0 H 3w Figure 10 12 Birth death Model for the BUS in ATM LAN emulation 10 10 3 Features
120. f each marking average of the product of the number of tokens in Place p and p plus the number of tokens in Place p3 times 1 2 expected double expected double f func Q Function expected can be called in function ac_final The return value can be used in more complex expression using pr_expected would print the value but the value itself would not be made available and then be used in the function ac_final Note Apparently similar operations have different stochastic interpretations hence different results if performed at the event or at the expected value level Continuing the previous example in function pr_expected double ep 1 return mark p_1 double ep 3 return mark p_3 double ep_7 return mark p_7 32 void ac_final x expected ep_1 expected ep_7 expected ep_3 1 2 printf Sf x will produce a different result from the one computed using util because of the dependence existing in general between the number of tokens in p and p3 pr_std_cum_average pr_cum_expected and pr time avg expected Besides the expected values of the functions defined earlier transient analvsis also allows the computation of the expected accumulated values over the interval 0 t where t is the time point of interest The corresponding functions are pr_std_cum_average for computing the expected accumulated values and pr cum expected for comput ing
121. f the Intermediate Files 61 Sal MNE AX Mer o SB GT A T Rake IE acl ae AD ci 61 8 24 Thee TE ges doer gh tin arcs yl e A nen aldi 62 8 37 The DID Te a eue en ue ae A AS a NS Se e 63 User guide for iSPN 65 IX Introduction SELS aber E eas a nasale did ca 0342324 65 9 1 1 Organization of this guide eus de ee 65 9 1 2 Conventions used in this chapter 65 OEE EE 65 92 1 Why SPN o A RE B SEN S N a 65 9 3 lt ISPN tert acl s dau ween a ta B ia tte al wanen Sede dea 66 94 The Petri net editor L 13 yt SSE ERR ERE e 69 OA Filefunetions 3 1 gene ds ad Ann Mla Ab tee EE a 24 72 94 2 Miscellaneous functions 0 0 0 0 0 u0 0 73 9 4 3 Environment control functions 74 9 4 4 Information functions 74 OAS FSPN modeli se 8 gt oe EAT DIS A ee KE SE Gee 75 9 5 Ex cution of the model oa wk ew eS 75 9 6 Viewing output 33 62 E OY EA ENS OR OOS 71 9 6 1 Graphing functions 4 4 av eet en a ee vas 78 9 6 2 Graph definition functions 80 Od DEDUR CINE lt x Lu Be Coste Be ME do kite deu Mets Us de ns ee 80 9 7 1 Reachability graph traversal 81 9 8 Browse examples Ts oe anew A AS ote far SA 82 gt Sah ae tal hurt D u M D 8 0 Ourdan PO pa Oe A b ar a ne 82 9 10 How to install iSPN in a unix environment 82 9 11 Programming resources 81 de bina
122. ferent from exponential distribution Generally three functions are available to define one distribution with different kinds of parametrizations constant with xxxval marking dependent with xxxdep and function dependent with xxxfun The list of dis tributions and their definition functions are provided below For more details see Section 4 2 10 e Exponential rateval ratedep ratefun e Constant Or deterministic including zero that is immediate transitions detval detdep detfun e Uniform unifval unifdep uniffun e Geometric geomval geomdep geomfun e Weibull weibval weibdep weibfun e truncated Normal normval normdep normfun e Lognormal lognval logndep lognfun e Erlang erlval erldep erlfun e Gamma gamval gamdep gamfun e Beta betval betdep betfun e truncated Cauchy cauval caudep caufun e Binomial binoval binodep binofun e Poisson poisval poisdep poisfun e Pareto parval pardep parfun e Hyperexponential 2 stage hyperval hyperdep hyperfun 43 e Hypoexponential 2 or 3 stage hvpoval hypodep hypofun The following types will be added to the package later e Negative Binominal negbval negbdep negbfun e Cox2 e Loglogistic e Defective exponential e Triangular When using simulation the reachability graph is not generated but the asse
123. ficulties timed and immediate transitions cannot have the same priority Another way to disable a transition is the inhibitor arc An inhibitor arc from place p to transition with multiplicity m will disable in any marking where p contains at least m tokens If these two constructs are not sufficient to describe a particular mechanism the marking dependent enabling function also called a guard with each transition can be used if this function evaluates to 0 in a marking then the transition is disabled If we ignore timing we can imagine an ordinary Petri net as a Stochastic Petri net where all transitions have the same priority where no inhibitor arcs are present and where the enabling functions are identically equal to 1 A marking is tangible if it enables no immediate transition it is called a vanishing marking otherwise A marking which does not enable any transition is absorbing hence it is tangible by definition A maximal set of vanishing markings that are mutually reach able by immediate transition firings is called a loop of vanishing markings A loop is said to be absorbing if no marking in it reaches a marking outside the loop otherwise the loop is transient An absorbing loop is considered an error Transient loops are not a problem their interpretation is clear and they are easily and correctly managed by the package but if you know that your SRN should not contain a transient loop you should look for them since t
124. fine a simple SRN followed by an example to construct a relatively complex SRN 11 4 2 1 Functions to define a simple SRN The following funcitons are sufficient to define a simple SRN without extended features of marking dependent enabling rates weights and cardinalities etc e place and init The function void place char p defines a place with name p A name is legal if 1 its length is between 1 and MAX_NAME_LENGTH as defined in the file const h typically 20 2 it is composed of the characters 0 9 a z A Z _ only 3 the first character is in a z A Z All names must be distinct that is it is an error to have two places two transitions or a place and a transition having the same name The function void init char p int 7 defines the initial number of tokens in Place p to be n By default places are other wise initially empty e imm The timed transitions are automatically defined when their rates or distributions are defined see the following However immediate transitions must be defined by void imm char e rateval and probval The functions void rateval char t double val void probval char t double val define the firing rate of timed transition t and the firing weight unnormalized prob ability of immediate transition t as a constant value val Function rateval or its more general versions illustrated in the following sections implicitly defines the timed t
125. fine r21 0 97 define rout 1 int cl c2 c3 c4 void options iopt lOP SIMULATION VAL_YES iopt IOP_SIM_SPLIT VAL_YES iopt IOP_SIM_SPLIT_RESTART VAL_YES iopt lOP SPLIT PRESIM VAL XES iopt lOP SPLIT PRESIM RUNS 1000 iopt lOP SPLIT RESTART FINISH VAL NO iopt lOP SIM CUMULATIVE VAL NO ioptIOP_SIM_STD_REPORT VAL_YES iopt IOP_SIM_SEED 345983453 iopt IOP_SIM_RUNS 0 fopt FOP_SIM_ERROR 0 1 fopt FOP_SIM_LENGTH 100 fopt FOP SIM CONFIDENCE 95 fopt FOP_FLUID_EPSILON 0 00000001 fopt FOP_TIME_EPSILON 0 00000001 the following option stands if iopt IOP_SIM_SPLIT_RESTART VAL_YES iopt IOP_SPLIT_LEVEL_DOWN 4 the following options stand if iopt IOP_SPLIT_PRESIM VAL_NO iopt lOP SPLIT NUMBER 6 FOP SPLIT THRESHOLDSI FOP SPLIT THRESHOLDSI FOP SPLIT THRESHOLDSI FOP SPLIT THRESHOLDSI FOP SPLIT THRESHOLDSI 1 0 429032 2 0 666285 3 0 095069 4 1 161825 5 1 376134 158 FOP_SPLIT THRESHOLDS 6 1 595820 double fuprin return rinxmark Up double fdnrin return rinxmark Down double f21 double val c4 fcondition Two F_GT 0 cl fcondition One F_LT bound1 val c4 cl r21 rout rin 0 return val dani fout f c4 fcondition Two F GT 0 c2 fcondition One F_GT 0 return c4 rout c2 rout rin int gstop c3 fcondition Two F_EQ bound2 return c3 mark Down int gstart return mark Up void net p
126. g CSPL C based SPN Language but iSPN removes this burden from the user by providing an interface for graphical representation of the model The development uses the scripting language Tcl Tool Command Language devel oped by Prof John Ousterhout of U C Berkeley and extension Tk a toolkit for X win dows The selection of the script based approach is due to three of its main benefits e Tcl Tk provides a higher level interface to X than most standard C library toolkits e The user interface is clearly isolated from the rest of the application making the overall design easy to maintain and expand e The use of Tcl Tk makes this application portable to all platforms 9 3 iSPN interface iSPN mimics the look and feel of real file cabinet drawers by using windows with title tabs to ease the sorting of overlapping windows The design model of iSPN is i user centered and involve users as much as possible so that they can influence it i1 integrates knowledge and expertise from the different disciplines that contribute to HCI design and iii be highly iterative so that testing can be done to check that the design does indeed meet users requirement modeling environments graphical browse output examples welcome 7 SPNP display iSPN control fo SPNP Y credits Petri net translator display editor database manager nomenc
127. g time of transition s if it remains enabled after some other transition t fires pol should be PRI PRS or PRD The default is set to be PRS for non memoryless distribution of s with PRD for exponential distribution e iarc oarc harc miarc moarc and mharc The functions void iarc char 1 char p void oarc char t char p void harc char char p 2This function is used mainly in simulation Please refer to the example of reader and writer sharing buffer in Sec 10 13 13 void miarc char char p int mult void moarc char t char p int mult void mharc char 1 char p int mult define respectively an input arc from Place p to Transition t an output arc from Transition t to Place p or an inhibitor arc from Place p to Transition t with multi plicity one or mult a positive int e halting_condition The function void halting_condition int gfunc defines the halting condition gfunc for the SPN When this function evaluates to zero the marking is considered absorbing 4 2 2 An example using the power of ANSI C So far we have introduced convenient functions to get runtime input and basic functions to define an SRN The purpose of this section is to illustrate how to take advantage of the flexibility of ANSI C to facilitate the definition of a complex system with those simple CSPL functions we have so far introduced We show an example Figure 4 1 which defines a subnet of Erlang distri
128. gt k amp amp mark memup gt k amp amp mark swup 1 return 1 0 else return 0 0 double reward_rate double m l temp if mark procup gt k amp amp mark memup gt k amp amp mark swup 1 1 min double mark procup double mark memup m max double mark procup double mark memup temp pow 1 0 1 0 m 1 return m 1 0 temp else return 0 void ac final double time_pt for time_pt 500 0 time_pt lt 5000 0 time pt 500 0 solve time_pt prexpected Reliability reliab pr expected Expected Reward reward rate pr_cum_expected Expected Accumulated Reward reward rate 98 10 5 Database system availability analysis 10 5 1 Source P Hiedelberger and A Goyal Sensitivity Analysis of Continuous Time Markov chains using Uniformization Computer Performance and Reliability G lazeolla P J Courtois and O J Boxma Eds Elsevier Science Publishers B V North Holland Amsterdam 1988 10 5 2 Description This example is a model of a database system shown in Figure 10 7 E a gt Figure 10 7 The Database System Architecture The system consists of a front end FE a database DB and two processing sub systems Each processing sub system consists of two processors P a memory M and a switch S For the system to be functional we need at least one of the processing sub systems to b
129. h 1 Figure 10 10 SPN for a channel recovery scheme in a cellular network 10 8 3 Features e Fixed point iteration The handoff arrival rate A of transition t equals to the throughput of transition which is used to represent the departure of handoff calls e Reward based functions to compute expected values Default measures Steady state analysis Use of parameters and late binding By parm useparm and bind to reuse the SPN model 10 8 4 SPNP File icupc98 c This is the SPNP source code for the first recovery scheme adopted from Ma Ro and Trivedi Performability Analysis of Channel Allocation with Channel Recoverv Strategv in Cellular Networks In Proceedings of IEEE 1998 International Conference on Universal Personal Communications ICUPC 98 Florence Italy 5 9 October 1998 A include user h include lt math h gt define MAX_ITERATIONS 6 define MAX ERROR le 7 x Global variables double lam_n lam h o lam d lam_f h_b mur lam hi tmp int t channel g_c sym FILE sl in sl diff 113 void options iopt IOP_SSMETHOD VAL_SSSOR iopt IOP_TSMETHOD VAL_TSUNIEF iopt IOP_OK_TRANS_MO VAL_YES ioptIOP_MC VAL_CTMC ioptJOP_ITERATIONS 20000 fopt FOP_ABS_RET_MO 0 0 fopt FOP PRECISION MAX ERRORxI1e 3 t channel 28 gc l lam_n 10 x New call arrival rate lam_h_o 0 33 handoff every 5 minutes lamh 0 2
130. he firing time of each transition Additional constructs are often present as well In the Generalized Stochastic Petri net model 1 only two distri bution types are allowed exponential and deterministic with value 0 Transitions with an associated exponential distribution are said to be timed transitions with zero time dis tribution are said to be immediate In the Extended Stochastic Petri net model 12 the transitions are classified in a similar way but an arbitrary distribution can be associated to each timed transition If two or more conflicting transitions should fire at the same moment this event has a O probability if the distribution is continuous a probability mass function must specify the probability that a subset of transitions will actually fire The version of SPN that we deal with is known as the stochastic reward net SRN The parameters of an exponential or general distribution are said to be marking depen dent if they can be different in each marking This is allowed by our definition we will show how to describe this marking dependency Additional constructs are used to selectively disable a transition in a marking which would otherwise enable it A priority is associated with each transition If S is the set of transitions enabled in a marking and if the transition with the highest priority among them is k then any transition in S with priority lower than that of transition k will be disabled To avoid theoretical dif
131. hey could be the manifestation of a modeling error The reachability graph contains an arc for each different transition enabled in each marking in particular self transitions with equal input bags and output bags are allowed by the definition of the model so arcs with coinciding source and destination may be present in the reachability graph These arcs are ignored during the solution steps 2 1 4 Important feature for SPNP marking dependence An important feature of the SRN model is the marking dependent arc multiplicities en abling functions firing probabilities and firing rates SPNP is the software package that supports the specification and the solving of the SRN models Arcs can have a multiplicity which is not constant but rather it is a function of the marking This possibility was defined because it may allow substantial reductions in the size of the reachability graph it also may allow to model in a compact way behaviors that would otherwise require complex subnets A typical example is the case where all the tokens from place p must be moved to place q when transition t fires An input arc from p to t and an output arc from t to q both with marking dependent multiplicity equal to the number of tokens in place p are enough to model this behavior Without this construct the reachability graph would contain all the intermediate arcs and markings corresponding to the movement of tokens one by one Perhaps even more importantly if
132. ibed in the following sections The following function defined only for exponential distributions can be used in marking dependent functions double rate char tr which returns the rate of transition fr in the current marking if it is enabled in the current marking and 0 otherwise 4 2 4 Marking dependent function A marking dependent function is a C function which makes call s to functions referring to SRN entity entities and returns either an integer value or a double value Marking dependent functions are used to specify marking dependent firing rates firing weight arc cardinalities and output measures which will be described in the following sections The following two functions can be used in marking dependent functions e mark The function int mark char p returns the number of tokens in Place p e enabled The function int enabled char f returns 1 if Transition t is enabled in the current marking 0 otherwise The following code defines a marking dependent function f 3Refer to Examples 10 1 10 3 10 4 and 10 8 4Refer to Examples 10 3 and 10 11 16 double f return mark p_1 mark p_2 7 3 This function f returns a value of 7 3 times the product of the number of tokens in Places p and po 4 2 5 Specify marking dependent enabling functions At times inhibitor arcs or transition priorities can specify a given behavior only through awkward subnets that only obfus
133. ides the following means for object modification Copy 1 Click on Copy 2 Select the area to be copied from the Work Area 3 Click to acknowledge 4 Move the cursor to a different location in the Work Area and click The object is automatically copied Move 1 Click Move 2 Use the LMB to select a single object to move or the MMB for a group of objects 3 Move cursor to the desired position and click to place object group Delete 1 Click Delete 2 Use the LMB to select a single object to move or the MMB for a group of objects 3 Double LMB click to delete Rotate This is used to rotate the transitions for a clearer and neater model However a rotated transition does not change the functionality of the model in any way 71 1 Click Rotate 2 Click on the transition to rotate Each click rotates the transition by 45 degrees in the clockwise direction Arc This function changes the shape of the arc It comes in handy when an arc intersects other objects By clicking on intermediate points on the arc it can be re routed so that it does not cross over objects To re route the arc 1 Click on Arc 2 Click on the arc with the MMB and while holding the button down reposition the arc When the arc is repositioned it consists of a number of line segments This can be changed by using the Shape function 1 Click Shape 2 Click on the intermediate points to smoothen out the vertices 9 4 1 File funct
134. ightly different non homogeneous linear system These measures were defined and implemented to perform decomposition iteration techniques allowing the approximate solution of SRNs whose state space is too large to be studied directly 9 10 They are accumulated pr_accumulated hold_cond pr_hold_cond and set_prob0 double accumulated m function f unction double m function double f function void pr_accumulated string function char string double f function O respectively return and print the expected value of the accumulated reward up to ab sorption according to some initial state probabilitv distribution reward rate assignment and absorbing marking definition In the accumulated function the reward rate assign ment is specified by function and the absorbing markings are defined by m function if m function evaluates to 0 0 then the marking is considered absorbing In the pr accumulated function function specifies both the reward and the absorbing marking if function eval uates to 0 0 then the marking is considered absorbing The specification of the absorbing markings requires some attention Since the SRNs normally managed by the package are 39 ergodic no absorbing markings may be present The underlying stochastic process is then modified for the computation of this measure only so that markings whose reward is null are assumed absorbing their outgoing arcs in the Markov chain are ignored If absorb
135. imple mentation the only distributions for which the sampling distribution can be changed and the list of new distributions which can be used is the following e Exponential 47 e Uniform e Weibull Erlang truncated Cauchy e Pareto e Hyperexponential 2 stage Probabilities This is done by calling the following functions after the transition has been defined void rateval_is char t double val void ratedep_is char 7 double val char p void ratefun_is char t double func void unifval_is char t double ower double upper void unifdep_is char double lower double upper char p void uniffun_is char t double f O double 9 0 void weibval is char t double vall double val2 void weibdep_is char double vall double val2 char p void weibfun_is char t double f double 9 0 void hyperval_is char t double vall double val2 double val3 void hyperdep_is char t double vall double val2 double val3 char p void hyperfun_is char t double 0 double 9 0 double 7 0 void erlval_is char t double vall double val2 void erldep_is char t double vall double val2 char p void erlfun_is char double f 0 double 9 0 void parval_is char t double k double alpha void pardep_is char t double k double alpha char p void parfun_is char t double 0 double 9 0 void cauval_is char t double alpha double beta
136. in Figure 10 4 10 3 2 Features e Both steady state and transient analysis 91 Figure 10 3 The M M m b Queue trin ee Transition Rate Function Function trserv buf p if buf lt m mpu otherwise Figure 10 4 SPN for Example 10 3 e Marking dependent firing rates e Assertions e General reward specification 10 3 3 SPNP File example3 c This example models a Multi server FCFS queue with finite buffer x An M M m b queue include user h Global variables double lambda double mu int b int m int method void options method input Input 0 1 for Steady state Transient analysis if method 0 ioptIOP_SSMETHOD VAL_SSSOR else if method 1 iopt IOP_TSMETHOD VAL_TSUNIF else 92 fprintf stderr ERROR Illegal method specification exit 1 opt IOP_PR_FULL_MARK VAL_YES opt IOP_PR_MARK_ORDER VAL_CANONIC iopt IOP_PR MC_ORDER VAL_TOFROM iopt IOP_PR MC VAL_YES ioptIOP_MC VAL_CTMC iopt IOP_PR PROB VAL_YES iopt IOP_PR_RSET VAL_YES iopt lOP PR RGRAPH VAL_YES iopt IOP_ITERATIONS 20000 iopt IOP_CUMULATIVE VAL _NO fopt FOP_ABS_RET_MO 0 0 fopt FOP_PRECISION 0 00000001 lambda finput Enter lambda mu finput Enter mu b input Enter the number of buffers m input Enter the number of servers 1x Marking dependent firing rate double rate serv if mark b
137. ing 7 p is the steady state probability of marking j for the DTMC and hy is the holding time in state k for the CTMC It is interesting to notice that DTMC and CTMC solution may give different results for this measure The reason is not due to an error nor to numerical roundoff or trunca tion Rather it is intrinsic to the different approaches If the condition holds in tangible markings m and mg and it does not hold in vanishing marking ma a path mj M2 M3 in the reachability graph is treated differently by the two approaches The DTMC solution considers the holding time as terminated and restarted every time the path is traversed while the CTMC solution does not know that the condition stops holding even if for a null amount of time when a transition from mi to m3 occurs this information is discarded together with m2 when eliminating the vanishing markings The holding time computed by the DTMC solution can be shorter than the one computed by the CTMC solution In practically all interesting applications the condition holds or does not hold for a positive amount of time with probability one so no inconsistencies can arise 42 Chapter 6 Discrete Event Simulation In addition to a numeric analytic solution SPNP allows to use discrete event simulation to study the behavior of a system at or up to a point of time The specification of the SPN model is done in CSPL For simulation however the firing time distributions can be dif
138. ing markings do indeed exist in the original SRN function as well as mfunction must evaluate to zero in them otherwise the accumulated reward would be infinite Each call to accumulated or pr_accumulated requires the solution of a non homogeneous linear system having as many variables as the non zero reward markings so it can be expensive The results obtained from calls to accumulated or pr_accumulated is dependent on the initial state probability vector When the initial marking is tangible the state corre sponding to this marking has the initial probability of 1 and all the other states have an initial probability of 0 If the initial marking is vanishing the initial probability vector over the states of the CTMC is automatically computed by the program Alternatively the user is allowed to define the initial probability vector over the markings of the SRN using the function void set probO scale function int scale double f function where scale is either VAL_YES or VAL_NO and the reward rate assignment is given by function At present user defined initial probability vector is allowed only over the set of tangible markings Unless the default value for the initial probability is desired set_prob0 must be called before each call to accumulated or pr_accumulated Let s define p as the value returned by function on marking i and T as the steady state probability for marking i 7 0 if marking is vanishing A call to set pr
139. ion Joint Conference PNPM 97 and PERFORMANCE 97 Saint Malo France June 1997 S Hunter T Phillip and K S Trivedi Combined Performance and Availability Analysis of a Switched Network Application IEEE International Conference on Communications ICC 97 Montr al Qu bec Canada 8 12 June 1997 O C Ibe and K S Trivedi Stochastic Petri Net Models of Polling Systems IEEE Journal on Selected Areas in Communications Vol 8 No 9 pp 1649 1657 Dec 1990 O C Ibe K S Trivedi A Sathaye and R C Howe Stochastic petri net modeling of vaxcluster system availability in Proceedings of the International Conference on Petri Nets and Performance Models Kyoto Japan December 1989 O C Ibe and K S Trivedi Stochastic Petri Net Analysis of Finite Population Vacation Queueing Systems Queueing Systems Theory and Applications Vol 8 No 2 pp 111 128 1991 O C Ibe H Choi and K S Trivedi Performance Evaluation of Client Server Systems IEEE Transactions on Parallel and Distributed Systems Vol 4 No 11 November 1993 pp 1217 1229 F J Jaimes Romero D Mu oz Rodriguez C Molina and H Tawfik Modeling Recource Management in Cellular Svstems Using Petri Nets IEEE Trans Veh Technol Vol 46 No 22 pp 298 312 Mav 1997 H Kantz and K S Trivedi Reliabilitv Modeling of the MARS Svstem A Case Study in the Use of Different Tools and Techniques Interna
140. ions All file functions like save open etc are accessed through the model button When the model button is clicked the Work Area is replaced by a screen with various file options Brief descriptions of the file functions are given below 1 New Create a new worksheet 2 Open Open an existing worksheet 3 Save Save the current worksheet 4 Save As Save the current worksheet under a different name The user has the option of saving the worksheet with information such as Project Name Version Reference and Date Last Modified There is also a Comment Area where the user can provide a brief description of the Petri Net 72 9 42 Miscellaneous functions A number of other functions are provided for ease of design These functions are Zoom Zooms in to out of worksheet Map In cases where the Petri net does not fit in the Global Work Area the map function is used to cut add space to the design sheet To add space 1 Click Map 2 Doubleclick on the Work Area with the MMB 3 Each doubleclick adds space all around the Work Area To delete space 1 Click Map 2 Doubleclick on the Work Area with the LMB 3 Each double click deletes space all around the Work Area Note that initial design space is the minimum available Space cannot be deleted with out first adding space Refresh Redraw worksheet Clear Clear worksheet To clear worksheet 1 Click Clear 2 Doubleclick in the Work Area with the
141. ions apply to parameters as well For implementation reasons the allowable number of defined parameters is limited to MAX_PARMS defined in const h The function void bind char x double val sets the value of parameter x to val until the next call This function can also be called multiple times in function ac final to bind x to different values and compute the corre sponding measures The function void useparm char t char x associates the rate or weight of Transition t to the parameter x This function can be called multiple times for a single transition which can then have in full generality a rate of the form n Mm Let i 1 where m is the value of a marking dependent function evaluated in marking m n is the number of different parameters associated to t and k is the number of times the i th parameter x has been associated with f A parameter may provide itself a value for the rate or weight of a transition To do so we begin by defining its rate or weight to be one it was what procedures ratenoval and probnoval did in SPNP 5 0 they have been removed as they are equivalent to defining the rate or probability to be one For example TRefer to sensi c in the example CSPL files 19 parm alpha parm beta parm gamma rateval ratedep t useparm t_ useparm t_ useparm t_ ME ME probval useparm ta useparm t_ tar 2067 1 alpha
142. k fclose fp void LoadPhaseParameter char xsPhase char ptr int n if ptr strchr modelname _ NULL printf Wrong Model Name n exit 1 sscanf ptr 1 Sd amp n nPhase n strncpy sPhase modelname ptr modelname x sPhase ptr modelname 0 LoadConfig sPhase phaseTime pTime n UPREQ upreq n DOWNREQ downreg n FAILRATE failrate n REPRATE reprate n 185 C coverage n NUMVP double numvp n if m sprintf sPhase ptr modelname _ d n 1 l void options char LastPhase 20 topt IOP_TSMETHOD VAL TSUNIF ioptdOP PR FULL MARK VAL_YES x iopt IOP_ELIMINATION VAL_REDAFTERRO opt IOP_OK_TRANS_MO VAL_YES 10pt IOP_OK_VAN_MO VAL_YES ioptdOP OK VANLOOP VAL VES 10pt IOP_PR_MARK_ORDER VAL_CANONIC 10pt IOP_PR_MC_ORDER VAL_TOFROM 10pt IOP_PR_MC VAL_YES 10pt IOP_PR PROB VAL_YES 10pt IOP_MC VAL_CTMC iopt IOP_PR_RSET VAL_YES iopt IOP_PR_RGRAPH VAL_YES ioptIOP_ITERATIONS 20000 fopt FOP_ABS_RET_MO 0 0 fopt FOP_PRECISION 0 00000001 LoadPhaseParameter LastPhase if nPhase LoadState LastPhase LoadProb LastPhase int GFRec L mark P_UP lt UPREQ return 1 else return 0 int GFShutdown La mark P_UP gt UPREQ return 1 else return 0 int GFSysfail if mark P_DOWN gt DOWNREQ return 1 else return 0 int GFSysfailu 186
143. king if bFound Prob initlcurmark index next_probability printf e n Prob_init curmark gt index A else sprintf sMsg load init prob marking d is not found 1 LogMsg MSG PLAIN sMsg fclose fpRG fclose fpPrb LogMsg MSG PLAIN loading finished 196 Appendix A Differences Between last versions of SPNP A 1 Command Differences Between SPNP Version 4 and Version 5 SPNP Commands Version 4 Version 5 parameters void options iopt lOP METHOD VAL SSSOR iopt lOP METHOD VAL TSUNIF iopt lOP SSMETHOD VAL SSSOR iopt IOP_TSMETHOD VAL TSUNIF rate tvpe double net Of void net assert int assert ac_init void ac_init ac_reach void ac_reach reward_type double ac final Of void ac_final no special command solve INFINITY time value time pt solve time point A 2 Command Differences Between SPNP Version 5 and Version 6 e Functions ratenoval and probnoval have been removed rateval char 1 0 and probval char t 1 0 must be used instead e The FSPNs the discrete event simulator and the importance splitting methods have been added 197 Appendix B SPNP Applications In this section we list some papers in which SPNP was used The list does not include all the paper where SPNP was used 1 G Agrawal Availability of Coding Based Replication Schemes Eleventh IEEE Symposium on Reliable
144. lace On place Of f place Up place Down init On 1 init Up 1 fplace One finit One 0 0 foound One bound1 fplace Two fbound Two bound2 inf Fil1 inf Use inf Xfer imm Stop probval Stop 1 0 guard Stop gstop imm C Start probval Start 1 0 guard Start gstart rateval Fail 0 1 rateval Repair 1 larc Fi11 0n oarcc Fi11 0n fvoarc Fi11 One fuprin fvoarc Fi11 Two fdnrin iarc Stop On oarc Stop Off iarc Start Off oarc Start On larc Xfer Up oarc Xfer Up fviarc Xfer Two f21 fvoarc Xfer One f21 larc Use Up oarc Use Up fviarc Use One fout iarc Fail Up oarc Fail Down iarc Repair Down oarc Repair Up void ac_init pr net_info int assert return 1 void ac_reach double eff return fmark Two gt 2 0 1 0 void ac finalQ splitting Two 2 0 159 10 16 Equivalent failure rate and repair rate computation in hierarchical model 10 16 1 Source M Lanus L Yin Bedrock Availability Analysis In Proc Motorola SES99 Software Engineering Symposium June 1999 This source might not be available to outside Mo torola The system configuration data and code shown in the example have been modified due to confidential reason M Lanus L Yin K S Trivedi Hierarchical Decomposition and Aggregation
145. lature E control DATA mm control data BASE Figure 9 1 SPN main software modules 66 iSPN opens with the WELCOME page The Center for Advanced Computing and Communication CACC logo is displayed See Appendix for more information on CACC The major components of the iSPN interface see Figure 9 1 are a Petri net editor which allows graphical input of the stochastic Petri nets and an extensive collection of visualization routines to analyze output results of SPNP and aid for debugging Each module corresponds to a page in the software iSPN provides a high level input format to CSPL which provides great flexibility to users 1SPN is capable of executing SPNP with two different file formats 1 files created in the CSPL C based Stochastic Petri net Language and ii files created us ing iSPN s Petri Net editor an integrated environment for Stochastic Petri Net modeling Welcome Graph Interface Run Programs PI Debugging Browse Example Credits Help Global Design Figure 9 2 The petri net editor The Petri net editor which is the software module of iSPN that allows users to graph ically design the input models introduces a new way of programming SPNP the user can draw the SRN model and establish all the necessary additional functions i e rewards rates guard function etc through a common environment The Petri Net editor provides several ch
146. le cta EE 157 10 15 SOUS Le Behe LE Med Ye Be ene bth Bee enti ae baba bals 157 10 159 Desciption es s e ana a ja ew Rew ew ee 157 Ord PO A Se aes de IN A E 157 10 15 4 SPNP File splitting c ess ds es SUN GMA Ae a 157 10 16Equivalent failure rate and repair rate computation in hierarchical model 160 TOOL SOURCE Li LE seen dae f leet ee ee a AE a dues 160 1002 Description s 33 12 LM TEL IR EN See 4 160 LOMME SPEARS sure ER ln L tenis Ati en RUSSE 161 10 16 4 SPNP Files for Module level Markov chain model 161 10 16 5 SPNP File for System level SPN model gsb c 171 10 17 Analysis of Phased Mission Systems PMS with DSPN 179 LOL LS Greece oe ee hs Ce ae te Ee BE 179 10 17 2 Description Last eerde Beens ae am es de 180 10 17 3 SPNP File DSC Li LE LS it ed ae Send 180 10 17 4 Configuration File pms cfg 189 TOITS Shel PIS E dh ee 4 Sar ne lee Sia ey x Darla ER 190 l10 18ExtensionstoSPNP tar hod Goh ne Mis re 190 10 18 1 Fixed point iteration 190 10 18 2 Initial probability reload 191 A Differences Between last versions of SPNP 197 A l Command Differences Between SPNP Version 4 and Version 5 197 A 2 Command Differences Between SPNP Version 5 and Version 6 197 B SPNP Applications 198 Bibliography 203 Index 207 Chapter 1 Introduction The Stochastic Petri Net Package SPNP is
147. lse lity that queue is half full probhalffull for time_pt 0 1 time pt lt 1 0 time_pt 0 1 solve time pt pr expected Avera pr expected Avera pr expected Utili ge Queue Length qlength ge Throughput tput zation util this case corresponds to buf having b tokens pr expected Proba bility of rejection probrej this case corresponds to buf having zero tokens pr expected Proba bility that queue is empt y probempty this case corresponds to buf having b 2 tokens pr expected Proba bility that queue is half full probhalffull for time pt 1 0 time pt lt 10 0 time pt 1 0 solve time pt pr expected Avera pr expected Avera pr expected Utili ge Queue Length qlength ge Throughput tput zation util this case corresponds to buf having b tokens pr expected Proba bility of rejection probrej this case corresponds to buf having zero tokens pr_expected Proba bilitv that queue is empt y probempty this case corresponds to buf having b 2 tokens pr expected Proba bilitv that queue is half full probhalffull 94 10 4 C mmp system performability analysis 10 4 1 Source J T Blake A L Reibman and K S Trivedi Sensitivity Analysis of Reliability and Per formability Measures for Multiprocessor Systems Proc 1988 ACM SIGMETRICS Santa Fe NM 1988 10 4 2 Description This ex
148. luation of multiprocessor systems ACM Transactions on Computer Systems 2 2 93 122 May 1984 2 J T Blake A L Reibman and K S Trivedi Sensitivity analysis of reliability and performance measures for multiprocessor systems In Proceedings of the 1988 ACM SIGMETRICS Conference on Measurement and Modeling of Computer Sys tems Santa Fe U S A May 1988 3 LL G Bolch S Greiner H de Meer and K S Trivedi Queueing Networks and Markov Chains Modeling and Performance Evaluation with Computer Science Application Wiley amp Sons 1998 4 H Choi and K S Trivedi Approximate performance models of polling systems using stochastic Petri nets In Proceedings of IEEE Infocom 92 11th Annual Joint Conference of the IEEE Computer and Communication Societies Florence Italy May 1992 5 LL G Ciardo A Blakemore Jr P F Chimento J K Muppala and K S Trivedi Au tomated generation and analysis of Markov reward models using stochastic reward nets In C Meyer and R Plemmons editors Linear Algebra Markov Chains and Queuing Models volume 48 pages 145 191 Springer Verlag 1993 6 1 G Ciardo J K Muppala and K S Trivedi SPNP Stochastic Petri Net Package In Proceedings of 3rd International Workshop on Petri Nets and Performance Models pages 142 150 Kyoto Japan Dec 1989 7 G Ciardo J K Muppala and K S Trivedi On the solution of GSPN reward models Performance Evaluation 1
149. n 1 0 void ac_final double time pt solve INFINITY for time_pt 0 1 time_pt lt 1 0 time_pt 0 1 solve time pt pr expected Reliability reliab pr value No of States in which DB caused failure double count 10 6 ATM network under overload 10 6 1 Source Chang Yu Wang D Logothetis K S Trivedi and I Viniotis Transient Behavior of ATM Networks under Overloads Proceedings of the IEEE INFOCOM 96 San Francisco CA pp 978 985 March 1996 104 10 6 2 Description This example models ATM networks under overloads The SPN is shown in Figure 10 9 rerouting time t2_1 tar l buf1 i mmpp 1 4 ii b a A t2 2 mmpp_2 Z b ti 2 er JU ERAS EP i Rate Function Guard Function if Gfmmpp M else bu fi Dae Prerouteli lt K if mmpp2 Af else Az bu fo do HPseroli lt Ko Figure 10 9 SPN for Example 10 6 10 6 3 Features e Transient analysis e Marking dependent firing rates e Guard function e General reward specification 10 6 4 SPNP File atm c include lt stdio h gt include user h x global variables double a1 0 0269163 105 double a2 0 0269163 double b1 0 00672908 double b2 0 00672908 double lambdal 1 1 5058 double lambda21 1 5058 double lambda12 0
150. nt function of type double The functions void ratefun char 7 double func void probfun char t double func define the firing rate or firing weight of Transition f to be the value of marking dependent function func evaluated in the current marking 4 2 7 Specify marking dependent arc cardinalities The functions void viarc char t char p int func void voarc char t char p int func void vharc char t char p int f unc define respectively an input arc from Place p to Transition t an output arc from Transition tto Place p or an inhibitor arc from Place p to Transition f with multiplicity given by the marking dependent function func We choose to define vhare for completeness but it is usually more efficient to use an guard function instead gt These functions are used extensively in Example 10 10 and 10 16 SRefer to Examples 10 4 10 6 10 12 10 13 and 10 15 for their usage 18 4 2 8 Define and use parameters To perform sensitivity analysis the rate and weights of one or more transitions must be defined as a function of a double parameter SPNP will then be able to compute the derivatives of the requested output measures with respect to this parameter This requires to define parameters and to connect them to the rate or weights of transitions The function void parm char x defines the existence of a parameter x The usual naming conventions for places and tran sit
151. o timesTso pr value TSO MTTFeq timesTso 0 pr_ value TSO MTTReq timesTso 1 pr_value TSOFM 1 expected tsodpm 8766x60 timesTso 0 x8766 pr message nequivalent DPM computed from MTTFeq and MTTRea n pr value TSODPMeq timesTsoll timesTso 1 timesTso 0 8766 60 pr mc info pr_std_average 10 17 Analysis of Phased Mission Systems PMS with DSPN 10 17 1 Source I Mura A Bondavalli X Zang and K S Trivedi Dependability modeling and evalua tion of phased mission systems a DSPN approach In Proc IFIP International Confer ence on Dependable Computing for Critical Applications DCCA 7 pages 299 318 San Jose California January 1990 179 10 17 2 Description Many systems used in the control and management of critical activities perform a series of tasks that are accomplished in sequence The operational life of these systems consists of consecutive non overlapping time periods called phases during which the system con figuration success criteria and component behavior may vary from phase to phase These variations may be due to different tasks in each phase or different conditions of the envi ronment as Well as different dependability requirements and failure scenarios In order to accomplish their missions systems need to change their configuration over time to adopt suitable one in accordance with the performance and dependability requirements of
152. ob0 with scale equal to VAL_NO defines the initial state probability for state to be proportional to p Pi gt Pj A call to set_prob0 with scale equal to VAL_YES defines the initial state probability for state 2 to be proportional to p T Pii 0 ne ATI The definition of this second function mav at first seem arbitrarv it is instead both useful and intuitive Assume that given an ergodic SRN in steadv state we want to know how long we need to wait before a token arrives in Place p The following portion of CSPL accomplishes this double one return 1 0 40 double empty return mark double full return mark p p void ac_final set prob0 VAL _ YES empty pr_accumulated Wait time full set_prob0 VAL_YES one pr_accumulated Wait time full The first output gives the waiting time given that no token is in p while the second output gives the unconditional waiting time that is including the possibility that a zero waiting time is required when a token is already in p If IOP SENSITIVITY has the value VAL_YES the sensitivities derivatives with respect to the model parameters will be provided for the measurements given by accumu lated and pr_accumulated See the previous section for the definitions of parm useparm and bind which are required for sensitivity analysis Functions hold_cond and pr_hold_cond respectively compute and print the expe
153. ociated with the markings of the SRN Parametric sensitivity analysis allows the user to evaluate the effect of changes in an input parameter on the output measures This is useful in system optimization and bottle neck analysis The discrete event simulation facility may be used to solve large Markovian SPNs and non Markovian SPNs Basic Fluid Stochastic Petri Nets FSPNs 8 14 32 whose analytic numerical solution is not supported in the current version can also be sim ulated and results are reported in a way similar to those for the numerical solution Note that if the SPN is solved using simulation the reachability graph will not be generated This manual describes SPNP Version 6 01 running under the UNIX system on a vari ety of platforms VAX Sun 4 5 and Ultra Convex Gould NeXT CRAY AIX system 1 Stochastic Reward Net SRN Models Markovian Nets Non Markovian Nets Generate all Markings tangible vanishing Generate Reward i rates for tangible Markings L Z Extended Ragehabilly Discrete Event Simulation DES Eliminate vanishing Wa KA Markings Markov Reward Model MRM Batch Regenerative Independent l means simulation replications analvtic numeric methods Steady state transient sain NEON Rara ST plitting 2 ESE SOR Gauss Power Sid unifor eidel ethod mization Figure 1 1 Taxonomy of SRN models and analysis methods
154. of State based Availability and Performability Models for Telecommunications Systems submitted to IEEE Transactions on Reliability 10 16 2 Description The Markov chain shown in Figure 10 21 models a sub system module which has 1 1 hot standby redundancy It models the details of hardware software failure of active standby component switch over coverage reboot and repair Due to the complexity it is easier to use Markov chain rather than SPN However any Markov chain can be implemented in SPN by simply converting states into places transitions into SPN transitions and arcs The system level SPN model in Figure 10 22 has a 2 state Markov chain 2 place 2 transition SPN for each sub system module The equivalent failure rate and repair rate MTTF and MTTR are computed at lower level model and fed into the system level model Compared to the brutal force approach this hierarchical approach largely reduces the num ber of states at the system level This approach is an exact technique not an approximation for steady state measurement like Downtime Performance Measurement DPM as defined in Bellcore RQSM The interaction of system level model and lower level model is done by system calls 160 and parsing the output file of lower level model The computation of equivalent rates is done by partitioning the states into Up states and Down states The key functions are hold cond and pr_value Figure 10 21 Markov Chain model f
155. on about the reachability graph There are also options for zooming in out and identification of repeated markings A brief description of the usage of the page is given below OPEN The OPEN button allows the user to open rg files Once a rg file has been opened the reachability graph is graphically displayed in the window 80 INFO The INFO button provides the user with the salient and important information about the reachability graph Place and Transition Areas These are present in order to identify the various places and transitions presented in the PN model Zoom In Out This allows the user to zoom in or out of the reachability graph Identify When Identify is on moving the mouse pointer over a marking highlights all repeti tions of the marking 9 7 1 Reachability graph traversal The markings of the reachability graph are displayed in cyan with the current marking in green The graph can be traversed either by using the cursor keys or the mouse The user can also view the changes in the PN model This is done in the following way 1 Click Open 2 Select the rg file 3 Click OK 4 Press F2 on the keyboard 5 A message box appears asking whether the user wishes to open a isp file 6 Click OK 7 Select the isp file corresponding to the rg file 8 The PN model appears in the window 9 The user can switch between the Petri net and the reachability graph by using the F2 and F3 keys 81 9 8
156. or 1 1 hot standby redundancy modules 10 16 3 Features e Computation of equivalent failure rate and repair rate e Hierarchical Model e Markov chain modeling details of 1 1 hot standby redundancy e Availability measurement Downtime Performance Measurement DPM 10 16 4 SPNP Files for Module level Markov chain model HSP module gsbhsp c include lt stdio h gt ttinclude user h global variables x all the rates are in the format 1 0 MTTF or 1 0 MTTR unit 1 Hour double lambdaP 1 0 180000 0 hardware failure rate for HSP d double lambdaT 1 0 4000 0 transient sw failure rate for HSP 161 Total Total Partial Partial DPM OFM DPM OFM VMI System HSP HSP 440 MRM Module Level 141 MRM 140 MRM Figure 10 22 SPNP model for the system double muCr 1 0 4 0 x repair rate for Critical HSP fault double muNe 1 0 12 0 x repair rate for Non Critical HSP fault x repair rate for non critical HSP fault after having repaired critical x HSP fault double muNcS 1 0 x reboot time for HSP fault active HSP failed unsuccessful detection 4 x standbv HSP working 1 min double betal 1 0 1 0 60 0 x reboot time for HSP fault 777 d double beta 1 0 1 0 60 0 x Active HSP fault detection switching to standby HSP delay time 5 sec double delta 1 0 4 0 3600 0 coverage for the above detection switching double c 0 98 x c
157. ound in a breadth first search starting from the initial marking and in increasing order of enabled transitions indices It is the most natural order and it is particularly helpful when debugging the SRN e With VAL LEXICAL order markings are printed in increasing order where mark ings are compared as words in a dictionary for example 2_T 3 2 4 1 5 1 comes before 3_A 3 2 4 3 6 1 This order may be useful when searching for a particular marking in a large rg file With the VAL_CANONIC order an editor with search capabilities is usually adequate for this purpose e With VAL MATRIX order markings are printed in the same order as the states of the two internal Markov chains the DTMC corresponds to the vanishing markings and the CTMC corresponds to the tangible markings This corresponds to the fol lowing ordering vanishing tangible non absorbing and tangible absorbing each of these groups ordered in canonical order IOP PR MERG MARK This option specifies whether the tangible and vanishing markings should be printed out in one merging list or two separate lists IOP PR FULL MARK This option specifies whether the markings are printed in long format where some of the markings have zero number of tokens in all the places or short format where for each printed out marking there is at least one place which has non zero tokens IOP USENAME This option specifies whether the names should be used to indicate the places and
158. our graphs can be displayed at any given time in any given display window 1 Click Combo 2 A combine window is displayed beneath the Menu Select the graphs to be combined and click OK 3 The selected graphs are displayed in the display window Display controls the display window parameters The user can control the scale crosshairs legend and the grid 1 Click Display 2 Select options for each display window 3 Click OK Func Print Prints the output to printer 78 Figure 9 12 The Plots menu 79 9 6 2 Graph definition functions Modify Used to modify the graph definitions 1 Click Modify 2 Select the graph to be modified 3 Make the changes in the Modification Area 4 Click OK 5 For the changes to take effect the model must be rerun Click Run Identify This is used to identify the graphs 1 Click Identify 2 Click with the MMB on any of the display windows The graph details are displayed below the mouse bindings Note Positioning the mouse over any point of the graph will display the value at that point 9 7 Debugging This page as the name implies is used for debugging purposes The reachability graph plays a very important role in debugging a model The general layout of the page is as follows A major part of the window is dedicated to the reachability graph On the left of the reachability graph area are buttons for opening rg files and displaying informati
159. overage for reboot betal double q 0 80 coverage for reboot beta double r Fraction of transient sw faults that are manifest in Standby HSP double alpha 0 2 threshold for counting the unavailability of the HSPs double tR 10 0 3600 0 prototype reward functions double dtime double dtimeFC double dtimeF x prototype guard functions 162 prototype rate functions double rHsp2_DQ double rHsp2_hsp1 double rD_hsp1 0 double rD_DsQ double rDs_hsp2 double rDs_FC double rHsp1_hsp1s double rHsp1_hsp2 double rHsp1_hsp0 double rHspO_F double rHsp0_hsp1 double rHsp1s_hspOs double rHsp0s_hsp1s double rHspOs FO x values for global variables x prototype cardinality functions void options ioptIOP_PR _RGRAPH VAL_NO ioptIOP_PR MC VAL_NO ioptIOP_PR DERMC VAL_NO ioptIOP_PR_PROB VAL_NO iopt IOP_PR_PROBDTMC VAL _NO ioptIOP_PR_DOT VAL_NO ioptIOP_PR MERG_MARK VAL_YES iopt lOP PR FULL MARK VAL NO ioptIOP_USENAME VAL_NO ioptIOP_DEBUG VAL_NO ioptIOP_PR MARK_ORDER VAL_CANONIC ioptIOP_PR_RSET VAL_NO ioptIOP_PR MC_ORDER VAL_FROMTO NUMERICAL SOLUTION chosen ioptIOP_SENSITIVITY VAL_NO ioptIOP_MC VAL_CTMC ioptIOP_SSMETHOD VAL SSSOR ioptIOP_TSMETHOD VAL_FOXUNIF ioptIOP_ITERATIONS 2000 fopt FOP_PRECISION 0 000001 fopt FOP_ABS_RET_MO 0 0 ioptIOP_CUMULATIVE VALNO ioptIOP_S
160. p char sstr 100 int 1 solve INFINITY 150 sprintf sstr s itp modelname if fp fopen sstr w NULL perror Can not Open the Fix Point Data File exit 1 for ntoken 0 ntoken lt NRR ntoken ere expected get_prbtRT maxvalue max fabs my_prbtRT ntoken fabs tmp_prbtRT my prbtRT ntoken tmp_prbtRT maxvalue fabs my prbtRT ntoken maxvalue if maxvalue gt delta delta maxvalue total_prbtRT tmp_prbtRT fprintf fp 12e n tmp_prbtRT my_prbtRT NRR 1 0 total_prbtRT fprintf fp 12e n 1 0 total_prbtRT fclose fp pr std_average if delta lt FPprecision printf Fix Point Precision Satisfied n if strncmp linktype Tagged 6 prbBust expected get_prbBust fprintf Outfile nProb of VPN getting through 12e n expected get_though prbt VPN x expected get arrival fprintf Outfile nUltilization of VPN 12e n expected get_util prbVPN2BE h expected get prbBVPN2BE prbBust prbVPN2BE I expected get prbNBVPN2BE 1 prbBust fprintf Outfile nTraffic fromVPN to Best Effort 12e n expected get VPN2BE fprintf Outfile nProb of Traffic from VPN to Best Effort 12e n expected get prbVPN2BE fprintf Outfile nProb of Traffic from VPN to Best Effort at Busty 12e n prbVPN2BE h fprintf Outfile nProb of Traffic from VPN to Best Effort at Non Busty 12e n
161. parval 27 parval is 48 Petri net 3 place 3 12 place 12 poisdep 25 poisfun 25 Poisson distribution 25 poisval 25 policy 13 positive recurrent 39 pr accumulated 39 pr_cum_abs 34 pr_cum_expected 33 45 pr expected 31 45 pr_hold_cond 41 pr_mc_info 31 pr_message 35 pr_mtta 34 pr_mtta fun 34 pr_net_info 29 pr_parms 29 pr_rg_info 29 pr_std_average 31 pr std cum average 33 pr time avg expected 33 pr value 35 prioritv 4 prioritv 13 probdep 18 probdep is 49 probfun 18 probfun is 49 probnoval 19 probval 12 49 rate 16 rate dependent 16 ratedep 18 ratedep is 48 ratefun 18 ratefun is 48 ratenoval 19 rateval 12 rateval is 48 reachabilitv set 4 reachable 4 recurrent 39 regenerative simulation 49 regenerative simulation with importance sampling 49 resampling 49 RESTART 46 reward function 32 sensitivitv analvsis 19 set prob0 40 set prob init 34 simulation 43 solve 30 splitting 46 splitting 47 SRN 1 steadv state analvsis 30 stochastic Petri net 4 tangible marking 4 timed transition 4 12 transient 39 transient analvsis 30 transition 3 unifdep 23 unifdep is 48 uniffun 23 uniffun is 48 uniform distribution 23 unifval 23 unifval is 48 useparm 19 vanishing marking 4 vharc 18 viarc 18 voarc 18 weibdep 24 weibdep is 48 weibfun 24 weibfun is 48 Weibull distribution 24 weibval 24 w
162. peibVPN2BE 1 if Tlpolicy 3 fprintf Outfile nTraffic from Best Effort to VPN 12e n expected get BE2VPN proBE2VPN_h expected get_prbBBE2 VPN prbBust prbBE2VPN 1 expected get prbNBBE2VPN 1 prbBust fprintf Outfile nProb of Traffic from Best Effort to VPN 12e n expected get_prbBE2VPN fprintf Outfile nProb of Traffic fromBest Effort to VPN at Busty 12e n prbBE2VPN h fprintf Outfile nProb of Traffic from Best Effort to VPN at Non Busty 12e n prbBE2VPN 1 sprintf sstr Ss pda modelname if fp fopen sstr w NULL perror Can not Open Data File fclose Outfile exit 1 151 for i 1 i lt 3 i switch i case 1 fprintf fp 12e t 12e n expected get prbNBEMPTY 1 prbBust expected get probBEMPTY prbBust break case 2 fprintf fp S 12e t 12e n prbVPN2BEJ prbVPN2BE h break case 3 fprintf fp 12e t 12e n prhbBE2VPN I prbBE2VPN_h break fclose fp fclose Outfile exit 2 3 Config file smod3ta cfg link type Link Type Aggregated MMPP Rate of MMPP 0 to 1 1 Rate of MMPP 1 to 0 1 tagged aggregated links Size of Buffer 224 Size of Leaky Bucket Token Pool 112 Erlang Stage 1 Leaky Bucket Token Rate 63 High Packet Arrival Rate 107 3431 Low Packet Arrival Rate 67 6569 Percent of High Priority Packet 90 Percent of Low Priority Packet 10
163. prb_head reaches EOF unexpected strtok p x skip _nplace p strtok char NULL nplace atoi p printf nplace d n nplace x read place names while feof fpRG fgets sline MAXLINE fpRG 192 if p strstr sline _places break if feof fpRG fclose fpRG fclose fpPrb LogMsg MSG_EXIT read_prb_head reaches EOF unexpected for i 0 1 lt nplace i fgets sline MAXLINE fpRG strtok sline x skip 1 74 p strtok char NULL if idx i findplace p RES_ERROR LogMsg MSG EXIT load init prob could not open rg file strepv splacelil p printf d s n i p x go to the start of markings p char NULL while feof fpRG fgets sline MAXLINE fpRG if p strstr sline _reachset break if feof fpRG fclose fpRG fclose fpPrb LogMsg MSG_EXIT read_prb_head reaches EOF unexpected skip the line w place names fgets sline MAXLINE fpRG now we are ready to read markings void next_marking int 1 char xp x end of file reached if feof fpRG fclose fpRG fclose fpPrb LogMsg MSG_EXIT next marking reaches EOF unexpected fgets sline MAXLINE fpRG strtok sline x skip the Ist token i_t for i 0 i lt nplace i p strtok char NULL if p 0 marking i 0 193 1
164. rance and behavior Widget types include buttons scrollbars menus and text windows Tk also has a general purpose drawing widget called a canvas that lets you create lighter weight items such as lines boxes and bitmaps The X window system supports a hierarchy of windows and this is reflected by the Tk commands too To an application the window hierarchy means that there is a primary window and then inside that window there can be a number of children windows The children windows can contain more windows and so on Just as a hierarchical file system has directories that are containers for files and directories a hierarchical window system uses windows as containers for other windows The hierarchical affects the naming scheme used for Tk widgets as described below and it is used to help arrange widgets on the screen Widgets are under the control of a geometry manager that controls their size and location on the screen Until a geometry manager learns about a widget it will not be mapped onto the screen and you will not see it The main trick with any geometry manager is that you use frame widgets as containers for other widgets One or more widgets are created and then arranged in a frame by a geometry manager A Tk based application has an event driven control flow just as with most window system toolkits An event is handled by 84 associating a Tcl command to that event using the bind command There are a large number of different events
165. ransition must and be defined for each transition Function probval or its more general versions illustrated in the following sections needs to be called only if the firing weight is different with the default value 1 0 coming with the definition of the immediate transition by imm The definitions in the files const h and type h are always provided with the distribution of the package Users are not encouraged to change them especially when the complete souce files are not available Changes in these files may incur inconsistency and may cause compiling failure 12 e priority The function void priority char t int prio defines the priority for Transition t to be prio By default transitions have the lowest priority 0 e policy The function void policy char t int pol defines the resampling policy for transition t to be pol when the enabled transition is disabled by the firing of a competitive transition and later becomes enabled again Three different policies are implemented PRI Preemptive Repeat Identical the interrusted job is repeated with an iden tical firing time PRD Preemptive Repeat Different the interrupted job is repeated with a re sampled random time PRR PReemptive Resume an interrupted job continues with the old remain ing firing time By default transitions have policy PRD e affected The function void affected char s char t int pol defines the effect on the firin
166. rint 4 r NULL petror popen exit 1 PE 141f amp eq printf 12f n eq fclose pp rrHsp 1 eq strepy cmdvsc run gsbvsc1 system cmdvsc if pp popen grepMTTFeg gsbvscl out awk print 4 r NULL perror popen exit 1 is S141 amp eq printf 12f n eq fclose pp frNsp 1 eq frDsp 1 eq if pp popen grep MTTReq gsbvscl out awk print 4 r NULL perror popen exit 1 fscanf pp 141 amp eq 173 printf 12f n eq fclose pp rrNsp 1 eq rrDsp 1 eq x REWARD Functions x Unweighted Outage Downtime Performance Measurement double uodpm double dt calCap if cap lt 0 99999 dt 1 else dt 0 dt x 876660 return dt int condUo calCap if cap lt 0 99999 return 1 else return 0 double timesUo 2 x Partial Outage Downtime Performance Measurement double tpodpmQ double dt calCap dt 1 cap dt x 876660 return dt double tpodpmNsp double dt calCap dt 1 capNsp dt x 8766 60 return dt double tpodpmDsp double dt calCap dt 1 capDsp dt x 8766x60 return dt double tpodpmBus double dt calCap dt 1 capBus dt x 8766 60 return dt 174 Outage Frequency Measurement double ofm x Total System Outage DPM double tsodpmQ double dt calCap if cap lt 0
167. rking but the more accurate the set of conditions is the more confidence you have on the correspondence of the reachability graph with the real system For example the following function assert assert if mark p_1 mark p 2 N return RES_ERROR return RES_NOERR will stop the execution in a marking where the sum of the number of tokens in Places p and p2 1s not N If the execution is stopped the program outputs information before exiting which is useful in debugging the CSPL file If the illegal marking is caused by an unfore seen sequence of transition firings finding that sequence using the output information is usually a fast process even in large reachability graphs of tens of thousands of markings However this type of check is limited It helps to detect the presence of illegal mark ings or illegal firing sequences but it can not detect the absence of legal markings or legal firing sequences which relates to the reachability set or graph as a whole and cannot be checked while the reachability graph is being built Practically it is important to be able to perform checks of illegality as soon as possible typically to debug a net which is supposed to be bounded but it turns out to be not The examination of the whole infinite reacha bility graph is out of the question since the program will terminate printing a message for insufficient memory 28 4 4 Functions ac_init and ac reach
168. rom an external source into tank One which sends the liquid to a processing station with rate fout gt Tin The processing station is subject to breakdowns and repairs exponentially distributed with respective rates and u During a breakdown the station is not fuelled and the liquid from the external source is immediatley redirected to the additional tank Two The external source is shut down only when tank Two is full When the processing station is repaired the external flow is immediately switched to tank One which resume his work In addition the liquid in tank Two is pumped into tank One with rate r21 If tank One is full the flow from tank two to tank One is slowed 10 15 3 Features e This is an FSPN e The flows are marking dependent e Computation of the probability to have a full tank Two 10 15 4 SPNP File splitting c This example is adapted from Discrete event simulation of fluid stochastic xPetre nets by Gianfranco Ciardo el 157 On Fill One Tout MUY Tin x ry if z lt b Tout Tin if x b ra if z lt b Start Stop y ba and myp 1 MDoun 1 i Repair xb oO son Figure 10 20 FSPN model of a dual tank Tout Tin if x b mDown r_in GEOG GGG RK ok 3 include user h define bound1 1 0 define bound2 2 0 define rin 0 08 de
169. rt specifi cation can still be given it is checked in each marking encountered during the simulation The output of SPN in this case is analogous to the one obtained from an analytic numerical solution but with confidence intervals instead of point values For FSPNs sim ulation is the only solution method implemented in SPNP 6 1 Standard discrete event simulation The following information is specified in the CSPL file normally using calls to opt or fopt e Simulation specification IOP_SIMULATION specifies if the simulation procedure will be used Default value is VAL_NO e Discrete event simulation method IOP SIM RUNMETHOD specifies the simulation method Value VAL_REPL is specified if independent replications are used and value VAL_BATCH if it is batches 31 Other values for other simulation methods are possible and will be explained in next sections e Simulation length FOP_SIM_LENGTH is the length of each simulation run in simulated time to be specified with a call to fopt in the case where batches are used it represents the length of each batch If no value is specified it is possible to use calls to at_time or cum_time in function ac_final instead 44 e Mode of data collection IOP SIM STD REPORT specifies that the results will be displayed in the out file and the call of pr_message char msg in ac_final allows to print a message in the out file IOP SIM CUMULATIVE allows the data to be collected
170. s 0 amp amp mark hsp1ss 0 amp amp mark D 0 return 1 else return 0 double times5vs10 2 164 double tsodpm double dtime dtime double mark Ds double mark D double mark hsp0s double mark hsp0 double mark FC double mark F dtime x 876660 return dtime double dtimeFC double dtimeFC dtimeFC double mark FC x 1 0 dtimeFC 876660 return dtimeFC double dtimeF double dtimeF dtimeF doublejmark F x1 0 dtimeF x 876660 return dtimeF GUARD Functions x RATE Functions double rHsp2_DQ return lambdaP lambdaT double rHsp2_hsp1 return lambdaP alpha lambdaT l double rD_hsp1 4 return deltaxc I double rD_Ds return deltax 1 c double rDs hsp20 return beta1 q double rDs_FC return betal 1 q double rHsp1_hsp1sQ return betax l r double rHsp1_hsp2 return betaxr double rHsp1_hsp0O return lambdaP lambdaT double rHsp0_F return betax 1 r 165 l double rHsp0_hsp1 return betaxr 3 double rHsp1s_hspOs return lambdaP lambdaT double rHsp0s_hsp1s return betaxr double rHspOs FO return betax l r x CARDINALITY Functions void net lx PLACE Active HSP Standby HSP 4 place hsp2 no fault no fault init hsp2 l place D fault try to detec
171. s to represent continuous quantities iSPN provides the editing environment for FSPN In FSPN the fluid places are drawn as two concentrical circles and the fluid arcs are drawn as double lined arrows to differentiate with the single circle representation of dis crete places and single lined arrow representation of discrete arcs In iSPN editing for each places and arcs there is an attribute checkbox for fluid places and fluid arcs Clicking on this attribute checkbox will change the corresponding place arc into fluid place arc and verse vesa iSPN will adjust the graphics output according to these attributes Several op tions have to be set for FSPN model Refer to Section 7 The execution of FSPN model is through simulation i e IOP_SIMULATION should be set to VAL_YES before execution The results will be displayed in the output panel after the simulation 9 5 Execution of the model The design can be executed from two places One is from the Petri net editor itself and the other is from the Run Programs page From the Petri Net Editor page 1 Click Run 2 The Run Programs page is pulled up and the current model is executed 3 If the model has been incorrectly specified a list of errors is displayed 4 If there are no errors an OK message is signalled 5 Click Mapping The CSPL source code is generated and displayed 6 To control the execution environment of SPNP click Environment 7 Click Execute to run the model 8
172. sBRepr rrfBus ratedep nspAFail frNsp nspAUp ratedep nspARepr rrNsp nspADn ratedep nspBFail frNsp nspBUp ratedep nspBRepr rrNsp nspBDn ratedep dspAFail frDsp dspAUp ratedep dspARepr rrDsp dspADn ratedep dspBFail frDsp dspBUp ratedep dspBRepr rrDsp dspBDn x ARC iarc hspFail hspUp 177 oarc hspFail hspDn iarc hspRepr hspDn oarc hspRepr hspUp larc bpFail bpUp oarc bpFail bpDn larc bpRepr bpDn oarc bpRepr bpUp iarc psfFail psfUp oarc psfFail psfDn larc psfRepr psfDn oarc psfRepr psfUp iarc busAFail busAUp oarc busAFail busADn larc busARepr busADn oarc busARepr busAUp iarc busBFail busBUp oarc busBFail busBDn iarc busBRepr busBDn oarc busBRepr busBUp iarc nspAFail nspAUp oarc nspAFail nspADn larc nspARepr nspADn oarc nspARepr nspAUp iarc nspBFail nspBUp oarc nspBFail nspBDn larc nspBRepr nspBDn oarc nspBRepr nspBUp iarc dspAFail dspAUp oarc dspAFail dspADn iarc dspARepr dspADn oarc dspARepr dspAUp iarc dspBFail dspBUp oarc dspBFail dspBDn iarc dspBRepr dspBDn oarc dspBRepr dspBUp void assert void ac_init void ac_reach void ac_final Jk double t for t 0 t lt 5000
173. se fp else nodata 1 if nodata for i 0 1 lt NMRR i prbtRT i 1 double NMRR 1 0 void options ioptIOP_PR _RGRAPH VAL_NO ioptIOP_PR MC VAL_NO ioptIOP_PR DERMC VAL_NO iopt lOP PR PROB VAL NO iopt lOP PR PROBDTMC VAL NO iopt OP PR DOT VAL NO ioptIOP_PR MERG_MARK VAL_YES iopt lOP PR FULL MARK VAL NO ioptIOP_USENAME VAL_YES ioptIOP_DEBUG VAL_NO ioptIOP_PR MARK_ORDER VAL_CANONIO ioptIOP_PR_RSET VAL_NO ioptIOP_PR MC_ORDER VAL_FROMTO NUMERICAL SOLUTION chosen ioptIOP_SENSITIVITY VAL_NO ioptIOP_MC VAL_CTMC ioptIOP_SSMETHOD VAL_GASED ioptIOP_TSMETHOD VAL_FOXUNIF ioptIOP_ITERATIONS 20000 fopt FOP_PRECISION 0 000001 fopt FOP_ABS_RET_MO0 0 000000 ioptIOP_CUMULATIVE VAL_YES ioptIOP_SSDETECT VAL_YES ioptIOP_OK_ABSMARK VAL_NO ioptIOP_OK_VANLOOP VAL_NO 10opt IOP_OK_TRANS_MO VAL_YES 10pt IOP_OK_VAN_MO VAL_YES iopt lOP ELIMINATION VAL REDONTHEFLV LoadConfig GUARD Functions int guard tRT 145 if mark pHO amp amp mark pTK return 1 else return 0 int guard tBP if mark pHO amp amp mark pTK return 0 else return 1 int guard tMBP if mark pHO amp amp mark pTK return 1 else return 0 int guard tBE_p12 return 1 int guard tBE_p3 if mark pTK mark pHO gt TIp3 th return 0 else return 1 int g
174. seriptien tt ts BM da bili ea td da ne 124 10 10 3 DEC A RE Bde ek tens ae hol nar bond 124 10 10 4 SPNP File LA c nete DS AA AAA AR 125 10 11 MMPP Model for the BUS in ATM LAN emulation 130 ORAL SOUNCEK sd dn Ane es fist er NES rave 130 10 11 2DeScMAptron s des Ab ra Aa lede Heerke Beg dee Le Bee 130 TOMS FEMMES onder dari a Aleenta SG Se al de af use 131 10 114 SPNP File LANE AC okeee L EE See eS Se 131 10 12Performance anlysis of Multi Protocol Label Switching Network 137 10 12 VSO XCSS Lanta soute reder ee A N A aed Bat hong 137 10122 Description ei sh DA R DA RS RR AES RRM MR BOR 137 LO 1246 CAVES been ie ne A DARE NEA RE Lee tee 138 LO 4A SPN model for LSN rarse od een ai a ln ee GE 138 10 125 E A RC mak Dede he git 4 dee 138 10 13Simulation example reader and writer sharing buffer 153 IO 30bSourcer Gr e Di Bte D ee A Be A A RES 153 LUS 2 Des riplion te ii awe Stee B dar Bee ta ti fis 8 153 10 13 53 Features e 2 422 pauses da ME sn ke Se EA AE di Mi Me 153 10 13 4 SPNP File readwrite c 154 10 14Hybrid System reactor temperature control system 155 VOSTA N Source sis Gas a ed ee was AS dd ee a 155 10 14 2 DeScMptron ore ha Boe tek ut reel dwiet b mes 287224 155 1014 3 Featuteszz zu ere LR See A Bons a pet Bons Sew Bed 155 10 14 4 SPNP File reactor c 156 10 15 Dual tank example y sons wie ed ja e YG ne
175. specifies whether cumulative probabilities should be computed IOP_SENSITIVITY This option specifies whether sensitivity analysis should be performed e If VAL YES is specified IOP_MC must have value VAL_CTMC and IOP_ELIMINATION must have value VAL_REDONTHEFLY IOP ITERATIONS This option specifies the maximum number of iterations allowed for the numerical solution Any nonnegative integer can be specified FOP_PRECISION This option specifies the minimum precision required from the numerical solution The numerical solution will stop either if the precision is reached or if the maximum number of iteration is reached Both the reached precision and the actual number of iterations are always output in the prb file so you can and should check how well the numerical algorithm performed 7 3 Options for simulative solution IOP_SIMULATION This option indicates whether the system is solved numerically or simulated IOP _SIM_RUNS This option specifies the number of simulator runs or batches It can either be a positive integer or zero In the latter case SPNP runs until FOP_SIM ERROR is reached 55 IOP SIM RUNMETHOD This option specifies the simulation method which will be used e VAL REPL if we are using the standard discrete vent simulation with independent replications e VAL BATCH if we are using the standard discrete vent simulation with batches and then a single run e VAL RESTART if we are using Restart
176. strchr sstr sscanf ptr 1 ed amp NER continue if strncmp sstr Traffic Interaction Policy 27 ptr strchr sstr sscanf ptr 1 Sd amp TIpolicy continue 143 if Istenemp sstr Policy III Threshold 20 ptr strchr sstr sscanf ptr 1 Sd amp TIp3_th continue l if Istrncmp sstr Fix Point Iteration File 25 ptr strehr sstr sscanf ptr 1 Ss nameFP continue if strncmp sstr Fix Point Precision 20 ptr strchr sstr sscanf ptr 1 S1 amp FPprecision continue if strncmp sstr Link Type 10 ptr strehr sstr sscanf ptr 1 Ss linktvpe continue fclose fp rateTTK x NER nodata 0 sprintf sstr Ss itp modelname if fp fopen sstr r 4 NULL for i 0 i lt NRR i if fgets sstr 100 fp nodata 1 break if xsstr xsstr n printf Error in Iteration Date n exit 1 sscanf sstr S1 my prbtRT i fclose fp else nodata 1 if nodata for 0 i lt NRR i my prbtRT i 1 double NRR 1 0 nodata 0 if fp fopen nameFP r 4 NULL 144 for i 0 i lt NMRR i if fgets sstr 100 fp nodata 1 break if xsstr xsstr n printf Error in Iteration Date n exit 1 J sscanf sstr S1 prbtRT i fclo
177. strncmp sstr Round Robin Weight 18 ptr strchr sstr sscanf ptr 1 Sd amp NRR continue if Istrncmp sstr Maximum Waiting Time 21 ptr strchr sstr sscanf ptr 1 3 ed amp NMRR continue if Istrncmp sstr Rate of MMPP 0 to 1 20 ptr strchr sstr sscanf ptr 1 SLE krateTMMPPOL continue if Istrncmp sstr Rate of MMPP 1 to 0 20 142 ptr strchr sstr sscanf ptr 1 S1 amp rateTMMPP10 continue if strncmp sstr Leaky Bucket Token Rate 24 ptr strchr sstr sscanf ptr 1 sIf amp rateTTK continue l if Istrncmp sstr High Packet Arrival Rate 24 ptr strehr sstr sscanf ptr 1 S1 amp harvrate continue if strncmp sstr Low Packet Arrival Rate 23 ptr strchr sstr sscanf ptr 1 1 amp larvrate continue if strncmp sstr Packet Leaving Rate 20 ptr strchr sstr sscanf ptr 1 1 f amp rate TTX rate TMTX rateTTX continue if Istrncmp sstr Percent of High Priority Packet 32 ptr strchr sstr sscanf ptr 1 S1 amp prbtVPN prbtVPN 100 continue if strncmp sstr Percent of Low Priority Packet 31 ptr strchr sstr sscanf ptr 1 S1f amp prbtBE prbtBE 100 continue if strncmp sstr Erlang Stage 13 ptr
178. t Packet Size 4 define PLMD 4 x Medium Packet Size 4 define PLLG 32 x Long Packet Size define cl 0 342 define c2 0 093 define c3 0 565 define rateOUT 5000 131 int K 3 double lambda 0 9 mu 1 beta 1 1 int BN 100 x Buffer Size 4 int QLEN double g0 0 01 gl 0 05 d01 0 5 d10 0 5 double a0 0 01 al 0 05 b01 0 5 b10 0 5 double m2 v2 u2 t2 double m1 vl ul tl double rateAH rateAL theta0 thetal gt x prototype guard functions int guardARV int guardARV2 int guardBST 0 int guardBMD int guardBLG x prototype rate functions double rate ARV2 double t01 double t10 void options 10pt IOP_PR_RGRAPH VAL_NO 10pt IOP_PR MC VAL_NO 10pt IOP_PR DERMC VAL_NO 10pt IOP_PR_PROB VAL_NO 10pt IOP_PR PROBDTMC VAL_NO iopt IOP_PR_DOT VAL_NO iopt IOP_PR_MERG_MARK VAL_YES 10pt IOP_PR_FULL_MARK VAL_NO ioptIOP_USENAME VAL_NO topt IOP_DEBUG VAL_NO topt IOP_PR_MARK_ORDER VAL_CANONIO 10pt IOP_PR_RSET VAL_NO topt IOP_PR_MC_ORDER VAL_FROMTO iopt IOP_SENSITIVITY VAL_NO ioptIOP_MC VAL_CTMC iopt lOP SSMETHOD VAL SSSOR ioptdOP TSMETHOD VAL FOXUNIF ioptdOP ITERATIONS 20000 fopt FOP_PRECISION le 13 fopt FOP_ABS_RET_MO 0 0 ioptIOP_CUMULATIVE VAL_YES ioptIOP_SSDETECT VAL_YES iopt lOP OK ABSMARK VAL NO ioptdOP OK VANLOOP VAL_NO ioptdOP OK TRANS MO VAL XVES ioptIOP_OK_VAN_MO VAL
179. t function f g and h e Functions void hypoval char t double va l double va 2 double va 3 double val4 void hypodep char t double vall double val2 double val3 double val4 char p void hypofun char t double f double 9 0 double h dou ble 0 26 define a transition t with 2 or 3 stages hypo exponential distribution with number of stages vall 2 or 3 and rates val2 val3 and val4 number of stages vall and rates val2 val3 and val4 times the number of tokens in place p or the marking dependent functions f g h and i Functions void erlval char t double vall double val2 void erldep char t double vall double val2 char p void erlfun char t double f double 9 0 define a transition with a firing time following an Erlang distribution with respective parameters vall and val2 vall times the number of tokens in place p and val2 times the number of tokens in place p and the marking dependent function f and g The first parameter denotes here the rate of the underlying exponential distribution and the second parameter the number of phases Even if this last parameter is actually an integer it must be given as a double Functions void parval char t double k double alpha void pardep char t double k double alpha char p void parfun char t double f double 9 0 define a transition t with a firing time following a Pareto distribution with respective
180. t is timed the stochastic behavior will not be the same unless the SRN explicitly models this flushing of tokens with an additional immediate transition and possibly some control places Some words of caution must be said on this construct First it should be used only when really needed because it may make the SRN harder to understand and it requires slightly more computation than a standard or multiple arc This is because the input and output bags for a transition in a marking are computed by evaluating the marking dependent functions for the arc multiplicities if any before firing the transition this is why the output arc from t to q will put the correct amount of tokens in q This might give rise to unintuitive or unforeseen behaviors for example in the flushing of tokens just described transition t is enabled in any marking even when place p is empty unless 1 other input arcs are defined for t 2 an enabling function is used to explicitly disable t when p is empty and possibly in other cases as well or 3 the marking dependent arc multiplicity function for the arc from p to returns a positive value when p is empty this is the most efficient solution if the goal is to enable only when there are one or more tokens to be flushed in p At times inhibitor arcs or transition priorities can specify a given behavior only through awkward subsets that only obfuscate the actual logic of model In these cases the definition of a
181. t no faul 4 place Ds x fault not covered reboot no fault place FC x reboot failed repair no faul 4 place hsp1 no fault reboot x place hspls no fault repair 4 place hspiss x no faul repair reboot place hsp0 reboot waiting for reboot place hsp0s reboot waiting for repair place F repair waiting for repair x TRANSITION 4 ratefun hsp2_D rHsp2_D ratefun hsp2_hspl1 rHsp2_hspl ratefun D_hsp1 rD_hsp1 ratefun D_Ds rD_Ds ratefun Ds_hsp2 rDs_hsp2 ratefun Ds_FC rDs_FC rateval FC_hsp2 muCr ratefun hsp1_hsp1s rHsp1 hspls ratefun hsp1_hsp2 rHspl_hsp2 ratefun hsp1_hsp0 rHsp1 hsp0 ratefun hsp0_F rHsp0F ratefun hsp0_hsp1 rHsp0_hsp1 ratefun hspl1s_hsp0s rHspls_hspOs rateval hsp1is_hsp2 muNc ratefun hsp0s_hsp1s rHsp0Os_hsp 1s ratefun hsp0s_F rHsp0s_F rateval F_hspiss muCr rateval hsplss_hsp2 muNcS x ARC 4 larc hsp2_D hsp2 oarc hsp2_D D iarc hsp2_hsp1 hsp2 oarc hsp2_hsp1 hsp1 iarc D hspl D oarc D_hsp1 hsp1 iarc D_Ds D oarc D_Ds Ds larc Ds_hsp2 Ds oarc Ds_hsp2 hsp2 larc Ds_FC Ds oarc Ds_FC FC 166 iarc FC_hsp2 FC oarc FC_hsp2 hsp2 larc hsp1_hspls hspl oarc hspl_hspls hspls larc hsp1_hsp2 hspl oarc hspl_hsp2 hsp2 larc hsp1_hsp0 hspl oarc hsp1_hsp0 hsp0 iarc hspO_F hsp0 oarc
182. tIOP_CUMULATIVE VAL YES ioptIOP_SSDETECT VAL_YES iopt lOP OK ABSMARK VAL NO ioptdOP OK VANLOOP VAL NO 10pt IOP_OK_TRANS_MO VAL S 10opt IOP_OK_VAN_MO VAL_YES iopt IOP_ELIMINATION VAL_REDONTHEELY x REWARD Functions double QL O if mark PBUF gt QLEN return 1 0 else return 0 double MLP if mark PBUF gt BN PLMD return 1 0 else return 0 j double SLP 4 if mark PBUF gt BN PLST return 1 0 else return 0 1 double LLP 0 if mark PBUF gt BN PLLG return 1 0 else return 0 GUARD Functions int guardARV int n 0 if mark PCS2 gt 0 n 1 if mark PAR mark PCS1 n lt K return 1 else return 0 int guardt2 if mark Puon 0 return 1 126 else return 0 int guardTunicast if mark Puon gt 0 return 1 else return 0 int guardSTO if mark PBUF lt BN PLST return 1 else return 0 int guardMDO if mark PBUF lt BN PLMD return 1 else return 0 J int guardLGO if mark PBUF lt BN PLLG return 1 else return 0 x RATE Functions double rateTbroad if mark Pbroad return g1 else return g0 double rateTunicast double x mark Puon al mark Puof f xaQ0 return x void net x PLACE d place PAR place PCS1 place PCS2 place PARV place PST pl
183. tatic struct initpv double prob int nToken 5 initPV 10 180 Figure 10 23 DSPN model of a PMS 181 static double pTime MAXPHASE failratel MAXPHASEJ static double reprate MAXPHASE coverage MAXPHASE static int upreg MAXPHASE downreq MAXPHASE numvp MAXPHASE static int TNUM 4 nPlace 5 nState 0 nPhase 0 ntPhase 1 static char sPlace 5 10 P_LPH P_UP P_DOWN P_SPARE P_FAIL static int UPREQ DOWNREQ static double phaseTime NUMVP FAILRATE REPRATE C void LoadP FILE xfp void data int type int xiData idData 1 double xf Data fdData char sstr 100 xptr if type fData double data else iData int data while fgets sstr 100 fp if lstrncmp sstr default 8 ptr strchr sstr if type sscanf ptr 1 31 amp fdData else sscanf ptr 1 Sd amp idData for i 0 i lt ntPhase i if type fData i fdData else iDatali idData continue if strncmp sstr end 3 break sscanf sstr Sd 421 if G gt 0 amp amp i lt ntPhase ptr strchr sstr if type sscanf ptr 1 S1f amp fDatalil else sscanf ptr 1 Sd KiDatalil j void LoadConfig char xsModelName FILE fp char sstr 100 ptr sprintf sstr Ss cfg sModelName if fp fopen sstr x NULL perror Can not Open the Config File
184. te t_ double fnum return mark B void ac_final int 1 double tp err for i 1 i lt MAX_ITERATIONS i pr value 1am_h_i lam_h_i bind 1lam_h_i lam_h_i solve INFINITY tp expected hotput pr value Throughput of t_h_o tp err fabs lam_h_i tp tp pr value Error err if err lt MAX_ERROR break 115 lam_h_i tp pr expected block handoff BH pr expected block new BN pr expected available channel ACh pr_value avg waiting time expected fnum expected ftput 10 9 Accurate Model for the BUS in ATM LAN emulation 10 9 1 Source H Sun X Zang and K S Trivedi Performance of Broadcast and Unknown Server BUS in ATM LAN Emulation Technical Report Center for Advanced Computing and Communication Duke University 1999 10 9 2 Description The net shown in Figure 10 11 represents a performance model of the Broadcast and Un known Server BUS in the ATM LAN emulator 10 9 3 Features e Markovian model e Dependent marking rates e Priorities 10 9 4 SPNP File LAN c include lt stdio h gt include user h corresponds to ACCURATE model in the papers define PLST 2 x Short Packet Size define PLMD 4 Medium Packet Size define PLLG 32 Long Packet Size define cl 0 342 define c2 0 093 define c3 0 565 116 T101 bol
185. th multiplicity k can be thought of as k arcs having the same source and destination The input output bag for a transition is the bag constituted by the input output arcs considered with their multiplicity Each place may contain any number of tokens All the tokens are indistinguishable A marking is a bag representing the configuration of tokens in the places of the Petri net It is also called the state of the Petri net Regarding the evolution of the Petri net the following terms are fundamental A tran sition is enabled if its input bag is a subbag of the current marking When a transition is enabled it can fire leading the Petri net into a possibly different marking obtained by subtracting its input bag from and adding its output bag to the current marking A firing sequence is a sequence of transition firings A marking is reachable if it is obtained by a firing sequence starting in the initial marking The reachability set graph is the set graph of all the reachable markings connected by arcs labeled with the transition firings A set S of transitions enabled in a marking m is a conflicting transition set if the contemporary firing of all the transitions of S is impossible in m or in other words if the sum of the input bags of the transitions in S is not a subbag of m 2 1 3 Stochastic Petri net The stochastic Petri net model is obtained from the Petri net model by associating a prob ability distribution function to t
186. th their extensions is distributed with the package in the directory tcltk If you can t run the application remove the directory tcltk then install it in the same path 82 You need to install in the order if you have any problems 1 Tel Home page http www sco com Technology tcl Tcl html Download the code http sunscript sun com TclTkCore index html 2 Tk Home page http www sco com Technology tcl Tcl html Download the code http sunscript sun com TclTkCore index html 3 Tix Home page http www xpi com tix Download the code http www xpi com download binaries html 4 Blt Download the code http www sco com Technology tcl Tcl html ftp ftp neosoft com pub tcl alcatel extensions 5 Expect Home page http expect nist gov Download the code http expect nist gov 6 Tcl my fancy Comprehensive interpreter for tcl tk tix blt expect commands Download the code http www nsrc nus sg STAFF rthien d bugger mps cap Type in your shell the script file script after you have modified it to correspond with the directory where you have installed the packages iSPN and SPNP 1 setenv TIX_LIBRARY dir0 dir0 directory contained the library files for tix examples opt tcltk lib tix 2 setenv ISPN2_DIRECTORY dirl dirl directory contained the ispn code 3 setenv SPNP_DIRECTORY dir2 dir2 directory contained the SPNP executable Operation in ispn file Change the first line and write the
187. the expected accumulated value for user defined functions We can also compute the time averaged expected values of functions using pr_time_avg_expected as void pr_time_avg_expected char string double func As an example consider the following double avail void ac final double time point solve 15 05 pr expected Inst Availabilitv avail pr_cum_expected Total jobs lost jobslost for time point 10 0 time point lt 100 0 time_ point 10 0 solve time point pr_time_avg_expected Interval Availabilitv avail pr_mtta Mean time to failure 33 Here the instantaneous availability and total jobs lost are computed at time point t 15 05 The for loop computes the instantaneous availability in the interval 0 t with varying from 10 to 100 with an increment of 10 pr_mtta and pr_newmtta void pr_mtta char string void pr_mtta char string The function pr_mtta and pr_newmtta computes the mean time to absorption for the SRN The functions should be used only when the underlying CTMC has ab sorbing states pr newmtta gives the same result but runs much faster pr mtta fun void pr mtta fun char string double func computes the accumulated reward up to absorption using function func to define which states are absorbing func 0 and the rewards of other states func 0 pr_cum_abs void pr_cum_abs char string double func O Func
188. tion pr_cum_abs which is similar to pr_mtta allows the user to compute the expected accumulated reward until absorption for a CTMC with absorbing states To use this function the corresponding reward rate should be specified set_prob_init void set_prob_init double func Transient analysis of the underlying CTMC depends on the initial state probability vector When the initial marking is tangible the state corresponding to this marking has the initial probability of 1 and all the other states have an initial probability of 0 If the initial marking is vanishing the initial probability vector over the states of the CTMC is automatically computed by the program The user is also allowed to define the initial probability vector over the markings of the SRN using this function At present user defined initial probability vector is allowed only over the set of tangible markings pr_value void pr value char string double expr 34 Sometimes the user may desire to print values of functions that cannot be expressed as a simple reward definition but as a function of the expected values of several re ward functions To facilitate this SPNP provides a special function called pr_value func Here expr could be any expression which evaluates to a floating point number For example if we wish to compute the ratio of two expected values expected qlength and expected tput and print the result in the output file we can specif
189. tion with importance sampling to speed up the simulation 49 Chapter 7 Available Options Tables 7 1 7 2 7 3 and 7 4 lists all options and their legal and default values in CSPL Their usage will be given in the following sections Default TOP PR RSET VAL_YES VALNO VAL TAN VAL_NO IOP_PR_RGRAPH VAL_YES VAL_NO VAL_NO TOP_PR MARK_ORDER VAL_CANONIC VAL_LEXICAL VAL MATRIX VAL CANONIC IOP PRMERG MARK VAL YES VAL NO VAL_YES IOP_PR FULL MARK VAL_YES VAL_NO VAL_NO IOP_USENAME VAL YES VALN VAL_NO IOP_PR_MC VAL_YES VAL_N VAL_NO IOP_PR DERMC VAL_YES VALN VAL_NO IOP_PR_MC_ORDER VAL FROMTO VAL TOFROM VAL _FROMTO IOP_PR_PROB VAL_YES VALN VAL_NO IOP_PR_PROBDTMC VAL_YES VALN VAL_NO IOP_PR DOT VAL_YES VALN VAL_NO Table 7 1 Available options for intermediate files IOP MC VAL_CTMC VAL DTMC VAL_CTMC IOP_SSMETHOD VAL_SSSOR VAL GASEI VAL POWER VAL_SSSOR IOP_SSDETECT VAL_YES VAL_NO VAL_YES FOP_SSPRES non negative double 0 25 IOP_TSMETHOD VAL_TSUNIF VAL_FOXUNIF VAL_FOXUNIF IOP_CUMULATIVE VAL_YES VAL_NO VAL_YES IOP_SENSITIVITY VAL_YES VAL_NO VAL_NO IOP_ITERATIONS non negative int 2000 FOP_PRECISION non negative double 0 000001 Table 7 2 Available analytic numeric solution options 50 Values IOP_SIMULATION VAL_YES VAL NO IOP_SIM_RUNS non negative int IOP_
190. tional Conference on Petri Nets and Performance Models Melbourne Australia December 1991 199 22 23 24 25 26 2T 28 29 30 31 32 N Lopez Benitez Dependability Analysis of Distributed Computing Systems Us ing Stochastic Petri Nets Eleventh IEEE Symposium on Reliable Distributed Sys tems Houston 1992 Y Ma J J Han and K S Trivedi A Channel Recovery Method in TDMA Wireless Systems Proc of 50th IEEE International Vehicular Technology Conference VTC Fall 99 Amsterdam The Netherlands Sep 1999 Y Ma J J Han and K S Trivedi A Channel Recovery Method for RF Channel Failure in Wireless Communications Systems Proc of IEEE Wireless Communi cations and Networking Conference WCNC 99 New Orleans LA Sep 1999 Y Ma C W Ro and K S Trivedi Performability Analysis of Channel Allocation with Channel Recovery Strategy in Cellular Networks To appear in Proceedings of the 7th IEEE International Conference on Universal Personal Communications ICUPC 98 Florence Italy 5 9 October 1998 M Madhukar M Leuze and L Dowdy Petri Net Model of a Dynamically Parti tioned Multiprocessor System Proceedings of the 6th Int Workshop on Petri Nets and Performance Models PNPM 95 Durham NC USA Oct 1995 C Molina N Jain and K Basu Performance Model of Cellular Data on American Systems In Proceedings of 1996 IEEE 46th Vehicular T
191. transi tions involved when printing the reachability set and graph instead of the index a small integer starting at 0 Using names generates a large rg file but it is useful when debug ging a SRN IOP PR MC This option specifies whether the mc file should be generated or not 52 IOP PR DERMC This option specifies whether the derivative with respect to each defined parmname files should be generated or not in the file me IOP PR MC ORDER This option specifies whether the transition matrix if VAL FROMTO or its transpose if VAL TOFROM should be printed in the mc file IOP PR PROB This option specifies whether the prb file is generated or not IOP PR PROBDTMC This option specifies whether the prbdtmc file is generated or not IOP_PR_DOT This option specifies whether the dot file is generated or not 7 2 Options for analytic numeric solution IOP MC This option specifies the solution approach e Using VAL_CTMC will transform the SRN into a CTMC e Using VAL_DTMC will use an alternative solution approach where the vanishing marking are not eliminated and an embedded DTMC is solved instead In this case the first index in the mc file is n if there are n vanishing markings not 0 SPNP can perform transient and sensitivity analysis only by reducing the SRN to a CTMC Hence this option should be set to VAL_CTMC when these types of analysis are needed 53
192. tsT priority t ST 20 probval tST cl imm tMD priority tMD 20 probval tMD c2 imm tLG priority t LG 20 probval tLG c3 imm tBST priority t BST 40 probval tBST 1 guard tBST guardBST imm tBMD priority tBMD 40 probval tBMD 1 guard tBMD guardBMD imm tBLG priority tBLG 40 135 probval tBLG 1 guard tBLG guardBLG imm tLST priority tLST 20 probval t LST 1 imm t LMD priority t LMD 20 probval t LMD 1 imm t LLG priority t LLG 20 probval t LLG 1 imm tEOUT priority t EOUT 20 probval t EOUT 1 rateval TOUT rateOUT ratefun TTO1 t01 ratefun TT10 t10 x ARC 4 oarc TARV PAR larc TAR PAR oarc TAR PCS iarc tOUT PCS moarce tOUT POUT 3 larc TCS POUT harc tOUT POUT oarc TARV2 PARV iarc tST PARV iarc tMD PARV iarc t LG PARV oarc tST PST oarc tMD PMD oarc tLG PLG iarc tBS PS DE iarc tLS PS Ws iarc tBMD PMD larc LMD PMD md iarc BLG P iG iarc t iLG P iG moarc tBST PBUF PLST moarc tBLG PBUF PLLG moarc tBMD PBUF PLMD iarc tEOUT PBUF moarc tEOUT PEOUT 3 larc TOUT PEOUT harc tEOUT PEOUT oarc TTO1 PAON larc TT10 PAON harc TTO1 PAON
193. uardARV2 D RV3 rateARV3 TARV3 guardARV3 7 ratefun TARV4 rateARV4 guard rateval T rateval T rateval T rateval T rateval T rateval T rateval T rateval T TARV4 guardARV4 001 d01 010 d10 01 b01 10 b10 H 01 b01 10 b10 NN 01 b01 10 b10 WW rateval T401 b01 rateval T410 b10 imm EST priority t ST 20 probval tST c1 imm EMD priority tMD 20 probval tMD c2 imm tLG priority t LG 20 probval tLG c3 imm tBST priority tBST h 40 probval tBST 1 121 guard T guardBST imm LB D priority tBMD 40 probval tBMD 1 guard tBMD guard BMD imm tBLG priority t BLG 40 probval tBLG 1 guard tBLG guardBLG imm t LST priority t LST 20 probval t LST 1 imm tL D priority t LMD 20 probval t LMD 1 imm t LLG priority t LLG 20 probval t LLG 1 imm tEOUT priority t EOUT 20 probval tEOUT 1 rateval TOUT rateOUT lx ARC oarc TARV PAR iarc TAR PAR z oarc TAR PCS iarc tOUT PCS moarc tOUT POUT 3 iarc TCS POUT harc tOUT POUT oarc TO01 PONO iarc TO10 PONO harc TO01 PONO oarc T101 PON1 larc T110 PON1
194. uardARV4 int n 0 if mark POUT gt 0 n 1 n mark PAR mark PCS if n gt 3 return 1 else return 0 int guardBST if mark PBUF lt BN PLST return 1 else return 0 int guard BMD if mark PBUF lt BN PLMD return 1 else return 0 119 int guardBLG 0 4 if mark PBUF lt BN PLLG return 1 else return 0 x RATE Functions double rate ARVO if mark PONO return g1 else return g0 double rateARV1 if mark PON1 return al else return a0 double rateARV2 if mark PON2 return al else return a0 double rateARV3 if mark PON3 return al else return a0 double rateARV4 if mark PON4 return al else return a0 j void net x PLACE 4 place PAR place PCS place POUT 120 place place place place place place place place place place place PARV PST PMD PLG PBUF PEOUT PONO PON1 PON2 PON3 PON4 x TRANSITION rateval TARV lambda guard TARV guardARV rateval TAR mu rateval TCS beta imm tOUT priority t OUT 20 probval tOUT 1 ratefun TARVO rateARVO ratefun TARV1 rateARV1 guard TARV1 guardARV1 ratefun TARV2 rate ARV2 guard ratefun T guard TARV2 g
195. uardtVPN if mark pHO lt NBUF return 1 else return 0 int guard tMWT if Imark pMTX amp amp mark pMWT return 1 else return 0 x RATE Functions double rate TARV if mark pMMPP return harvrate else return larvrate x CARDINALITY Functions int cardinality MWT 0 return mark pMWT 146 void net int 1 char rt 128 1x MMPP place pMMPP rateval TMMPP10 rateTMMPP10 rateval TMMPP 01 rate TMMPPO1 iarc TMMPP10 pMMPP oarc TMMPPO1 pMMPP harc TMMPP01 pMMPP gt ps Ix Tagged Aggregated link place pARV place pHQ place pTK place pER ratefun TARV rate_TARV rateval TTK rateTTK rateval TTX rate TTX imm tVPN guard t VPN guard VPN priority t VPN 20 probval t VPN prbtVPN imm tBE w mye if Tlpolicy lt 3 guard t BE guard tBE_p12 else guard t BE guard tBE_p3 priority t BE 20 probval t BE prbtBE imm tER priority tER 20 probval tER 1 4 oarc TARV pARV iarc tBE pARV iarc tVPN pARV oarc tVPN pHQ oarc TTK pE R miarc tER pER NER oarc tER pTK mhare TTK pTK NTK larc XI v pHO larc X M PTK Round Robin place pRR place pRC init pRC NRR place pMTX place
196. uf lt m return mark bu x mu else return m mu void net place buf rateval t rin lambda ratefun trserv rate_serv oarc trin buf mharc trin bu b larc trserv buf int assert Make sure that the number of tokens in buf does not exceed the buffer size if mark buf gt b return RES_ERROR else return RES_NOERR void ac_init fprintf stderr A model of the M M m b Queue pr netinfo void ac_reach pr rg info double qlength return mark bu double util return enabled trserv double tput return rate trserv double probrej if mark buf b return 1 0 93 else return 0 0 double probemptvO if mark bu 0 return 1 0 else return 0 0 double probhalffullO if mark bu b 2 return 1 0 else return 0 0 void ac_final double time pt x measures related to the queue if method 0 solve INFINITY pr expected Average Queue Length qlength pr expected Average Throughput tput pr expected Utilization util this case corresponds to buf having b tokens pr expected Probabil lity of rejection probrej this case corresponds to buf having zero tokens pr expected Probabil lity that queue is empty probempty x this case corresponds to buf having b 2 tokens pr_expected Probabil e
197. uously while the transitions is enabled as long as the level remains between zero and the upper bound FSPNs have the potential to facilitate the computation of two kinds of important prob lems One is the ordinary SPN with a huge amount of tokens in some places which can now be approximated by fluid places the other is for analysing hybrid systems with a con tinuous deterministic part and a discrete stochastic part which is hard to deal with by other hybrid system analyzation tools FSPN can be solved either with numeric analytic method or with simulative method At the present time only the simulative method is implemented in SPNP For further information on FSPNs see 8 14 32 Chapter 3 Getting Started With SPNP 3 1 Installation and run The package is composed of several C files The SRN to be studied must be described in a CSPL C based Stochastic Petri Net Language file which is a C file specifying the structure of the SRN and the desired outputs by means of predefined functions The CSPL file is compiled linked to the other files constituting the package usually kept compiled and run by typing make f PATH TO SPNP spnp obj Makerun SRN filename where filename is your CSPL file without the C extension and PATH TO SPNP represents the UNIX path to the package on your installation It is possible to check the CSPL file for certain errors by typing make f PATH_TO_SPNP spnp obj Makerun lint SPN filename
198. vents The discrete event simulation described above is a very powerful tool but is inefficient to examine rare events To do so we can use importance splitting techniques 34 which means defining thresholds and splitting the simulation path when the thresholds are hit The aim of these methods in this software is to compute P p gt x in 0 T the probability to have more than a given amount a tokens or fluid in a place in the time interval 0 T or P t lt min T 70 the probability that 7 the first time that p gt x is less than the simulation run T and less than 79 the return time to the initial state An advantage with respect to the discrete event simulation of the previous section is that here the measures can be computed on fluid places The usual simulation options IOP SIM RUNS and FOP SIM LENGTH are still used by the importance splitting estimation The use of importance splitting techniques is specified by the option IOP SIM RUNMETHOD Its is set to VAL_RESTART if we use RESTART estimating then P p gt x in 0 T and to VAL SPLIT if we use splitting estimating then P rr lt min T 7p For each 46 method RESTART or splitting the importance splitting procedure is called in ac_final by inserting splitting name_of_place p x Two specific options exist one for splitting IOP SPLIT LEVEL DOWN which de termines the number d of levels the path is stopped if it goes d levels down and one for RESTART
199. via files that can be declared and opened inside individual SPNP submodel input files Examples of papers using model hierarchies and fixed point iteration include 4 10 16 19 20 22 30 17 23 Chapter 2 Notation and Terminology We write predefined CSPL types constants and functions in boldface while we use italic for user defined quantities In the examples however we simply use a fixed pitch font to show actual CSPL code For readability a place p 1 or a parameter alpha ina CSPL fragment are written as p and a in the textual discussion 2 1 Petri net and stochastic Petri net 2 1 1 Bag The concept of bag will be used in the following so we describe it here For a complete definition and examples see 25 The concept of bag extends the one of set If x is an element of the set S then S U x S but there are cases where it is important to count the occurrences of x in S A bag represents this by allowing repeated occurrences of the same element or in other words by attaching a positive integer count to each element of a set So for example x x y z x y fx 2 2 1 2 Petri net A Petri net is a directed graph whose nodes are partitioned into two sets places and tran sitions Arcs can only connect a place to a transition input arcs or a transition to a place output arcs A multiplicity positive integer may be attached to each arc which is then called a multiple arc Intuitively a multiple arc wi
200. y the following pr_value Expected Response Time xpected qlength expected tput This would print the following in the output file VALUE Expected Response Time 15 7 e pr_message void pr_message char string Function pr_message allows the user to print an arbitrary message in the out file e sens void sens char parameter char 0 If IOP_SENSITIVITY has the value VAL_YES the sensitivities derivatives with respect to the model parameters will be provided for the measurements given by pr_std_average pr std cum averagel pr_expected expected pr_time_avg_expected pr_mtta pr_cum_abs 11 See example CSPL file sensi c 35 bi Figure 4 2 The SRN model Currentiv the reward functions can not be specified in terms of the defined param eters Therefore when computing the derivative of anv measurement that requires a reward function the reward accumulated in anv state is assumed constant with respect to the parameters By default the sensitivities with respect to all defined parameters will be computed By making a call to sens with a list of parameter names terminated with 0 one can define a set of enabled parameters that is a subset of all defined parameters For example sens alpha beta gamma 0 will enable sensitivity analysis for only the parameters a B and y while sens 0 will produce an empty set of

Download Pdf Manuals

image

Related Search

Related Contents

  USB2.0対応 外付け3.5インチハードディスクドライブ 取扱説明書  eMachines DUV1000 User's Manual  V81513A Ist.Mont.BMW  Soehnle Silvia  

Copyright © All rights reserved.
Failed to retrieve file