* Example 3:
* The following is a simple example of a task graph with a cycle.
* A GSPN model is used. The CTMC generated is not irreducible
* Hence a transient analysis is carried out

* Using the following line makes sharpe print more internal info
verbose on

bind
p 0.9
end

gspn cycle
* places
p1 1
p2 0
p3 0
p4 0
pt4 0
p5 0
pfin 0
end
* timed trans
t1 ind 1
t2 ind 0.5
t3 ind 1
t4 ind 0.25
t5 ind 0.25
end
* immed trans
ti1 ind p
ti2 ind 1.0 - p
end
* input arcs
p1 t1 1
p2 t2 1
p3 t3 1
p4 t4 1
pt4 ti1 1
pt4 ti2 1
p5 t5 2
end
* output arcs
t1 p2 1
t1 p3 1
t2 p5 1
t3 p4 1
t4 pt4 1
ti1 p3 1
ti2 p5 1
t5 pfin 1
end
* inhib arcs
end


* The distribution of time to reach absorption
cdf(cycle)
expr 1.0 - value(25;cycle)
* Mean time to completion
expr mean(cycle)
* Expected number of tokens at time 25 in model cycle in place pfin
expr etokt(25;cycle,pfin)
end



