A flexible and generic approach to dynamic stochastic modelling of supply chains