Deterministic and stochastic Petri nets