A stochastic cost model for the pi-calculus