In this paper, a new methodology is developed for optimization of water and waste load allocation in reservoir–river systems considering the existing uncertainties in reservoir inflow, waste loads and water demands. A stochastic dynamic programming (SDP) model is used to optimize reservoir operation considering the inflow uncertainty, and another model called PSO-SA is developed and linked with the SDP model for optimizing water and waste load allocation in downstream river. In the PSO-SA model, a particle swarm optimization technique with a dynamic penalty function for handling the constraints is used to optimize water and waste load allocation policies. Also, a simulated annealing technique is utilized for determining the upper and lower bounds of constraints and objective function considering the existing uncertainties. As the proposed water and waste load allocation model has a considerable run-time, some powerful soft computing techniques, namely, Regression tree Induction (named M5P), fuzzy K-nearest neighbor, Bayesian network, support vector regression and an adaptive neuro-fuzzy inference system, are trained and validated using the results of the proposed methodology to develop real-time water and waste load allocation rules. To examine the efficiency and applicability of the methodology, it is applied to the Dez reservoir–river system in the south-western part of Iran.