Stochastic Activity Networks