* Example 5:
* The following are staochastic Petri Net 
* models of task execution graphs from 
* Veeraraghvan and Trivedi paper 
* ``Hierarchical Modeling for Reliability and Performance Measures,''
* Concurrent Computations: Algorithms, Architecture and
* Technology,
* S. K. Tewksbury, B. W. Dickson and S. C. Schwartz (eds.), 
* Plenum Press, New York, 1988.
* The two models used here are for single processor
* and three processors 

gspn proc1
* places
p1 1
p2 0
p3 0
p4 0
p5 0
p6 0
p7 0
p8 0
p9 0
p10 0
end
* timed trans
t1 ind 1
t2 ind 0.5
t3 ind 1
t4 ind 0.25
t5 ind 0.25
t6 ind 1/3
t7 ind 1/7
t8 ind 1/8
t9 ind 1
end
* immed trans
end
* input arcs
p1 t1 1
p2 t2 1
p3 t3 1
p4 t4 1
p5 t5 1
p6 t6 1
p7 t7 1
p8 t8 1
p9 t9 1
end
* output arcs
t1 p2 1
t2 p3 1
t3 p4 1
t4 p5 1
t5 p6 1
t6 p7 1
t7 p8 1
t8 p9 1
t9 p10 1
end
* inhib arcs
end

gspn proc3
* places
p1 1
p2 0
p3 0
p4 0
p5 0
p6 0
p7 0
p8 0
p9 0
p10 0
end
* timed trans
t1 ind 1
t2 ind 0.5
t3 ind 1
t4 ind 0.25
t5 ind 0.25
t6 ind 1/3
t7 ind 1/7
t8 ind 1/8
t9 ind 1
end
* immed trans
end
* input arcs
p1 t1 1
p2 t2 1
p3 t3 1
p4 t4 1
p5 t5 1
p6 t6 1
p7 t7 2
p8 t8 2
p9 t9 3
end
* output arcs
t1 p2 1
t1 p3 1
t2 p4 1
t2 p5 1
t3 p6 1
t4 p7 1
t4 p8 1
t5 p7 1
t5 p8 1
t6 p9 1
t7 p9 1
t8 p9 1
t9 p10 1
end
* inhib arcs
end

* The effect of multiple processors is to provide speedup
var speedup mean(proc1) / mean(proc3)

* But even more important, is the reduction in the probability
* to fail to complete on time. dfp (dynamic failure probability)
* is definded to be the prob that a program fails to complete
* before its deadline.
func dfp1(d) 1.0 - value(d;proc1)
func dfp3(d) 1.0 - value(d;proc3)

expr speedup

loop deadline,5,35,5
 expr dfp1(deadline), dfp3(deadline)
end

end
