A Grid-based Algorithm For The Solution Of Non Markovian Stochastic Petri Nets