Optimal operation of a water resources system by stochastic programming