Use of evolutionary computation and guide curves to optimize the operating policies of a reservoir system established to supply drinking water

The objective of the present study was to develop a genetic algorithm capable of establishing optimal operating policies for monthly extractions from the three main reservoirs of the Cutzamala System, which supply drinking water to the Mexico City metropolitan area. In previous studies, annual water extraction defined with an annual Z curve in terms of the total water storage in the reservoirs on November 1 was optimized using genetic algorithms. In this study, a percentage of total annual extraction for each reservoir was also optimized, but monthly water extractions were adjusted too, when the water level fell outside the upper or lower limits of guide curves stablished for each reservoir. The capabilities of the genetic algorithms combined with a detailed simulation of reservoirs operation were used to optimize the levels of the guide curves and also to optimize the adjusted monthly programed extractions as linear functions of the difference between the actual storage level at the beginning of each month and the corresponding level of the guide curves. Therefore, 90 parameters were established: four to define the Z curve, two to establish the percentage assigned to each reservoir, 72 to establish the monthly levels of the guide curves and 12 to define the parameters of the linear functions used to adjust the monthly programed extractions when the actual water level exceeds the limits of the guide curves. For each alternative of the 90 parameters, a detailed simulation is done using the last 20 years of hydrological data on the inflow of water to the three main reservoirs, including the net contributions of five diversion dams, and the objective function sought to maximize water delivery to the treatment plant, while penalizing possible spills and deficits in the system is evaluated. The optimal policies found in this research resulted in smaller spills than those that occurred during the historical operation of the reservoir system. Therefore, the optimal monthly operating decisions required for each reservoir are provided by the genetic algorithm.


Introduction
The Cutzamala System provides 25% of the drinking water consumed in the Valley of Mexico (Mexico City and the surrounding metropolitan area). It is made up of three main reservoirs (located in the states of Mexico and Michoacán) formed by the El Bosque Dam, Valle de Bravo Dam and Villa Victoria Dam (Fig. 1). Together they can store up to 782.5 hm 3 , 642.5 hm 3 of which are considered as useful capacity. These storage reservoirs are principally fed by the Cutzamala, Zitácuaro, and Tilostoc rivers and five diversion dams: Tuxpan, Ixtapan del Oro, Colorines, Chilesdo, and El Barraje.
The Tuxpan diversion dam receives water from the tributaries of the Zitácuaro River and transfers it along an open channel to the El Bosque storage dam, which captures water from the Zitácuaro river basin as well. Some of the water from the El Bosque reservoir is taken for irrigation and the rest is sent along an open channel to the Colorines reservoir. The latter, which also receives water from the Ixtapan del Oro diversion dam, functions as a regulating reservoir by providing water through pumping plant 1 (PP1) to the Valle de Bravo reservoir. Hence, the Valle de Bravo storage dam is fed by the Tuxpan, El Bosque, Ixtapan del Oro, and Colorines dams as well as from its own basin (the Amanalco river basin). It supplies water through pumping plants PP2, PP3 and PP4 to the Los Berros water purification plant. The plant also receives water from the Villa Victoria and El Barraje storage dam along an open channel, and from the Chilesdo regulating dams through the PP6 pumping plant.
All the water in the system is processed in the Los Berros water purification plant before being sent to the Valley of Mexico through the PP5 pumping plant. The pumping system (illustrated in Fig. 1) is capable of driving up to 14.0 m 3 /s with pumping loads of up to 350 m. Overall, the water ascends more than 1100 m from the Colorines Dam, where the pumping begins, to oscillation tower 5. From this tower, the water flows by gravity to the point of entry of the Analco − San José tunnel, excavated in a high-altitude point in the mountains, then through the tunnel to the Valley of Mexico. One restriction factor of the Cutzamala System is the capacity of the Los Berros water purification plant, which is now approximately 19 m 3 /s, equivalent to 600 hm 3 per year.
Since the beginning of operations in 1982, the dams and the flow of water in the Cutzamala System have been operated empirically based on information about the historical behavior patterns of the volumes stored in the reservoirs during different periods of the annual hydrological cycle. The increase in water demand due to the growth of the Mexico City metropolitan area along with the variation in the annual pattern of rainfall in the basins of the Cutzamala System have created the need for a more sophisticated system. Consequently, it is necessary to develop tools to determine optimal policies for the operation of the dams in the system, considering the characteristics of the annual hydrological cycle as well as the necessary minimum and maximum levels of the reservoirs.
With respect to studies related to the optimal operation of reservoirs for different purposes, Gilmore (1996) conducted an exhaustive investigation of the optimization models used to support decision making for the operation of the Colorado River. The monthly optimization model that he created included the appraisal of operational flexibility to increase the generation of electricity. Butcher (1971), from the University of Texas at Austin, demonstrated how to find the optimal policy by means of stochastic dynamic programming for a reservoir with more than one function. Such policy is established in accordance with the storage volume of the reservoir in the previous month. Oliveira and Loucks (1997) focuses on the use of genetic search algorithms to derive multi-reservoir operating policies. The genetic algorithms use real-valued vectors containing information needed to define both system release and individual reservoir storage volume targets as functions of total storage in each of multiple within-year periods. One of the outstanding studies of a reservoir system in the last few decades was carried out in India by Neelakantan and Pundarikanthan (1999); the researchers arrived at optimal operating rules to meet the demand for drinking water by organizing data according to the month of the year and by utilizing Rosenbrock optimization, neural networks, and the simulation of water inflow and extraction. Sánchez and Andreu (2002) analyzed two systems of surface water resources to find the optimal scheme for expanding the hydraulic infrastructure with a methodology based on a genetic algorithm (GA). Ahmed and Sarma (2005) presented a Genetic Algorithm (GA) model for finding the optimal operating policy of a multipurpose reservoir, located on the river Pagladia, a major tributary of the river Brahmaputra. The policies derived by the GA model were compared with that of the stochastic dynamic programming (SDP) model on the basis of their performance in reservoir simulation for 20 years of historic monthly streamflow. Uhr (2006) employed stochastic dynamic programming to define policies that optimized the production of hydroelectric power and minimized costs. The model contemplates the inflow of water and the energy load. Mathur and Nikam (2009) used a Genetic Algorithm (GA) to optimize the operation of existing multipurpose reservoir in India and to derive reservoir operating rules for optimal reservoir operations. Garudkar et al. (2011) developed an optimization model for the reservoir releases based on elitist GA approach considering the heterogeneity of the command area. The developed model was applied to Waghad irrigation project in upper Godavari basin of Maharashtra, India. Cioffi and Gallerano (2012) analyzed how to optimize the output of electricity from hydroelectric dams while protecting the fish habitat. To identify the Pareto optimal set, they compared two different approaches: ε restriction methods and the non-dominated sorting GA (NSGA II). El-Hazek (2014) collected data from forty dams built in Al-Baha (Saudi Arabia) from 1975 to 2012 to achieve an optimal storage design and predict the cost of storing 1 m 3 of water. Yang et al. (2015) made comparisons of different optimization algorithms, several of them from the evolutionary computation for the multi-objective problem of hydropower reservoir operation in California, USA; they introduced the Multi-Objective Complex Evolution Global Optimization Method with Principal Component Analysis and Crowding Distance Operator method (MOSPD). The policy found by this method adapts to different runoff conditions in the year, especially in dry periods. Heydari et al. (2016) evaluated the performance of the system of six dams that form the Karun and Dez reservoirs in order to optimize the production of hydroelectric energy and the provision of water. A series of five dams have been built on the Karun River, and one more on the Dez River. One of the principal accomplishments of the research was to improve decision making about the structure of hydroelectric energy production by feeding related information into MATLAB. Adib and Samandizadeh (2016) studied the Karaj Dam, located in western Tehran, with the aim of optimizing water management. The researchers compared dynamic programming with a GA, finding reliability and resilience to be greater and vulnerability lower when using the latter.
By assessing the performance of the operating policies of a reservoir designated for the supply of drinking and irrigation water in South Africa, Ndiritu et al. (2017) achieved improvements with a nonlinear objective optimization method and statistical policy analysis of operation. Different conditions of the initial level of the dam were contemplated, and simulations were carried out with synthetic records obtained with ARMA models. Anas et al. (2019) focuses on derivation of optimum operational policies for a single purpose reservoir using Genetic Algorithm (GA) in MATLAB.
Jamali and Jamali (2019) adopted a simulation-optimization framework to formulate long-term monthly operating rules for this same system of six dams, taking three factors into account: the generation of hydroelectric power, the provision of irrigation water, and ecological flow. The simulation/optimization model of the corresponding Water Assessment and Planning System included two variables in decision making: (1) the monthly variation in the upper limit of the buffer parameter for the storage reservoirs that release water to satisfy consumer demand, and (2) the monthly policy for filling the reservoirs. Sharifi et al. (2021) employed five recently introduced robust evolutionary algorithms (EAs) of Harris hawks optimization algorithm (HHO), seagull optimization algorithm (SOA), sooty tern optimization algorithm (STOA), tunicate swarm algorithm (TSA) and moth swarm algorithm (MSA, for the first time, to optimal operation of Halilrood multi-reservoir system. This system includes three dams with parallel and series arrangements simultaneously. The results obtained with the mentioned algorithms were compared with two well-known methods of genetic algorithm (GA) and particle swarm optimization (PSO) algorithm. Yang et al. (2021) applied 12 Artificial Intelligence and Data Mining (AI&DM) with different models with different 2 Page 4 of 16 parameterizations employed to simulate the daily reservoir outflows of 33 reservoirs over the Upper Colorado Region in the USA. They conclude that the advantage of AI&DM models lies in their flexibility in incorporating different types of input data and identifying the implicit relationship between features and target variables; but a lot of trial-error experiments must be done in order to get the most suitable combination of input data structure and model parameterizations to obtain the best possible model outcomes for each reservoir system.
In contrast to previous research, the current investigation sought to optimize the operating policies of a system of three main reservoirs by using a GA designed to deliver the maximum annual extraction volume to the water treatment plant while achieving a minimum volume of deficits and spills. Firstly, based on the total volume of water storage in the main reservoirs of the system (El Bosque, Valle de Bravo and Villa Victoria) on November 1 of each year, the GA calculated the optimal total annual extraction as well as the percentage to be taken from each reservoir. Because the demand for drinking water has few variations during the year, the GA was initially developed with a uniform monthly distribution of 1/12.
In the second stage of this investigation, monthly upper and lower limit guide curves were set for the water level of the three main reservoirs. These curves are intended to avoid abruptly reaching of deficit and spill situations by programming adjustments to be made early and gradually. Adjustments were presently made each time the storage in any of the dams fell outside the upper or lower limits of such curves.
In summary, the decision variables are the coordinates that define the annual Z curve; an extraction percentage was assigned to two of the main dams (the third being decided by default to reach 100%); monthly values were set for the maximum and minimum storage levels of the three main reservoirs (the upper and lower limit guide curves, respectively), constituting 72 values and two coefficients for linear equations were used to calculate the adjustments to the monthly withdrawals when the level of a reservoir fell outside the guide curves, implying another 12 values. Hence, it was necessary to optimize a total of 90 variables related to decision making, a task carried out with a simple GA coupled to a computer program for simulating the detailed operation of the system.
The simulations were made using the historical records of the monthly inflows to the three main dams and the contribution from diversion dams during the last 20 years. The capacities of the channels, pumping plants, pipes, and the water purification plant were considered as restrictions for the movement of water through the system.

Z curve
A Z curve was employed to determine the total annual programmed withdrawals of water from the reservoirs to feed the Los Berros water purification plant. The curve was established based on the total storage of the main reservoirs of the system at the beginning of the hydrological cycle (November 1 of each year). The name of the curve derives from its typical shape (Fig. 2).

Simulation algorithm for the operation of the reservoir system
For the hydrological simulation of the entire water management system, a continuity equation was applied to each reservoir: where Vfinal k i is the volume of reservoir "i" at the end of month "k", Vinitial k i is the volume of reservoir "i" at the beginning of month "k", Vinflow k i is the volume entering reservoir "i" in month "k", Vext k i is the volume extracted from reservoir "i" in month "k", and Vevap k i is the net evaporation volume in reservoir "i" in month "k".
The simulation of the hydrological operation of the storage dam system was conducted with the following procedure: (1) The data on the characteristics of the reservoirs and the net amount of water evaporation for each month of the year are fed into the simulation program.
(2) The simulation program reads the information in regard to the monthly inflow to each of the three main reservoirs, the contribution from the diversion dams, the capacities of the channels, pumping plants, pipes, Fig. 2 Example of the shape of a Z curve and the water purification plant and the values of the 90 decision-making variables.
(3) The initial storage is defined on November 1 for the start of the simulation. (4) In accordance with the total storage on November 1 and the values of the Z curve, the annual programmed quantity of extracted water to be delivered to the Los Berros plant is found. This value is divided by 12 to calculate the total monthly extraction volume, which is multiplied by the percentage assigned to each reservoir to establish the corresponding monthly extraction volume. (1). Where appropriate deficits and spills are recorded. (10) The procedure is repeated for the following month from point 6. (11) The procedure is repeated from point 4 at the end of the year in order to begin another annual cycle.

The genetic algorithm generated optimal values for water management policies
The optimal values for each of the 90 decision variables were found with a simple GA. GAs represent one of the first computational techniques to make analogies with the processes of natural selection to ascertain the values of search variables capable of maximizing or minimizing an objective function. They are able to optimize values to achieve operating policies for a reservoir system (Goldberg 1989;Mathworks 1992;Chipperfield et al. 1994;Gestal et al. 2010). The GA presently employed is widely used for practical engineering problems.
In its typical form, a GA begins with a randomly produced population of n individuals, each consisting of a set of proposed search variables, expressed as a row of binary values in a matrix (resembling a chromosome). Each individual is tested in the objective function to evaluate its performance, and then some individuals are selected to form an intermediate population by means of random methods such as roulette, tournament, or universal stochastic. The exchange or crossover operator and the mutation operator are applied to the selected individuals to create a new population and therefore the next generation (iteration). Provided that the established number of generations (iterations) has not yet been met, the procedure is repeated in the objective function through the processes of selection, exchange and crossover to again form a new population. In case the number of iterations has reached its maximum, the individual with the best performance in the final generation represents the optimal solution and is reported as the real set of variables. The GA herein developed was applied to the simulation program for the operation of the three main dams and reservoirs of the system.

The objective function
The objective function has been formulated in the current study to maximize the delivery of water to the Los Berros plant (taking into account its maximum capacity) to meet the demands of the population, while at the same time penalizing unwanted deficit or spill conditions for the storage dams and their reservoirs. Hence, the objective function (Eq. 2) represents the amount of water supplied to the Valley of Mexico. It was optimized by maximizing the flow of water to the Los Berros water purification plant, considering as restrictions the processing capacity of the plant, the conduction capacity of channels, pipes and pumping plants, as well as the maximum and minimum volumes allowed in each of the three storage reservoirs. To decrease the possibility of unwanted events, deficit or spill events were penalized.
where Vent k is the volume delivered to the Los Berros plant in month "k", Vderr k i is the volume spilled in reservoir "i" in month "k", Vdef k i is the deficit volume in reservoir "i" in month "k", Cderr k i is the penalty coefficient for the volume spilled in reservoir "i" in month "k", and Cdef k i is the penalty coefficient for the deficit volume in reservoir "i" in month "k". The first term of the objective function represents the quantity of water arriving to the Los Berros water purification plant and the remaining two terms penalize the (2)

The genetic algorithm for determining the optimal operating policy (without guide curves)
For the optimization of the Z curve, a simple GA (Goldberg 1989;Mathworks 1992;Gestal et al. 2010) was applied to the simulation algorithm. In a preliminary analysis, the GA was applied to optimize six parameters: four correspond to the points that define the Z curve and 2 to the percentage of total extraction assigned to two of the dams. The percentage for the third dam is obtained by default, being the value needed to make the sum of the three percentages equal to 100. Based on the total volume stored in the reservoirs as of November 1 of each year, the total annual quantity of water to be extracted from the reservoirs and delivered to the Los Berros plant is programmed with the Z curve. This quantity is divided into 12 equal parts to indicate the allocations for each month of the year. Finally, the amount of water to be extracted from each dam is calculated with the assigned percentage. The steps of the optimization algorithm are illustrated in Fig. 3.

The genetic algorithm for determining the optimal operating policy (with guide curves for reservoirs)
In the second analysis, the GA was employed to calculate 90 parameters, including the six mentioned in the previous section and 84 more, related to guide curves, which help to maximize the delivery of water to the population. Of these 84 variables, 72 are needed to define the monthly values of the high and low guide curves for the three-storage reservoir (12 months × 2 guide curves × 3 reservoirs). Another 12 values are required to make adjustments when the storage in some reservoir is outside the limits of the guide curves.

Results and discussion
The computational tool presently developed was applied to the three main storage dams of the Cutzamala System to determine optimal operating policies based on the historical monthly inflow of water to the reservoirs from November 1999 to October 2018. The values resulting from the GA without guide curves (GA1) were compared to those obtained by including guide curves and the corresponding adjustment parameters (GA2). The latter adjustment parameters were used when the initial monthly level in any of the main reservoirs was outside the limits. Finally, a sensitivity analysis was conducted to create a GA (GA3) that assigns a different lower limit to the Valle de Bravo reservoir in order to avoid low levels (to accommodate recreational use).
The values of the optimal extraction policy found with GA1 (considering six parameters only) formed a Z curve (Fig. 4), which represents the total annual volume of water scheduled for delivery to the Los Berros purification plant, based on the total initial storage of the three reservoirs as of the beginning of the annual cycle (November 1). To select the values used to penalize undesired events a penalty-free operation rule is first obtained, the operation of the system is simulated, and the behavior of the variables of interest (storage, extractions and the presence of undesirable events, mainly) is analyzed, once this is done, a trail and error process of testing different penalty values is started until finding the combination that minimizes the unwanted events. The penalty coefficients obtained are shown in Table 1.
A percentage of total annual extraction was assigned to each main reservoir by GA1 (Table 2).
In the simulation of the Cutzamala System from 1999 to 2018 with GA, there was a greater amount of total deficits than spills (Table 3).
The second analysis included variables corresponding to upper and lower limit guide curves for each reservoir and each month of the year, and to the adjustments made when the initial monthly level in a reservoir fell outside the limits of the guide curves. In the latter case, the adjustments were calculated as a linear function of the difference between the initial storage level and the affected guide curve (Eqs. 3 and 4). For each reservoir and each guide curve, two parameters were defined for the linear relationship.
The Z curve obtained by using the GA2 is illustrated in Fig. 5.
A percentage of the total annual extraction was assigned to each main reservoir by GA2 (Table 4).
The upper and lower limit guide curve values optimized with GA2 (listed in Table 5) are compared to those based on the empirical practice of the historical operation of the reservoirs (Fig. 6).
The adjusting parameters were determined for Eqs. 3 and 4 to obtain optimal GA2 policy ( Table 6).
The spills and deficits caused by applying GA2 are shown in Table 7.
When simulating operational policy from 1999 to 2018 with GA2, spills only occurred at the Valle de Bravo Dam, and the total spill volume decreased from 196.05 (Table 3) to 45.94 hm 3 ( Table 7). The total deficit volume dropped from 306.89 hm 3 to zero, leading to an increase from 8436.3 to 8496.1 hm 3 in the volume supplied to the Los Berros plant.
(3) Ajusextr = a1 + a2 * difference (4) Ajusextr = a3 + a4 * difference; a3anda4 < 0 A monthly drawing of the total volume arriving to the Los Berros water purification plant is illustrated for GA2 policy in Fig. 7. As can be appreciated, in no month was the capacity of the Los Berros plant exceeded. On the other hand, the minimum utilization value of the quantity delivered was always greater than 14.5 m 3 /s. The monthly initial water storage level of each of the three reservoirs is compared between the GA2 simulation and the real historical record (Figs. 8,9 and 10). The same comparison is shown for the total monthly initial water storage level (Fig. 11). The maximum simulated levels for the El Bosque reservoir were generally lower than the historical ones (particularly from the year 2010), which facilitates transfers to it from the Tuxpan diversion dam, avoiding spills in this dam (the total historical spill in Tuxpan diversion dam was 289.6 hm 3 , mainly in years 2014, 2015 and 2018, as it is shown in Fig. 12). In the case of the Valle de Bravo and Villa Victoria reservoirs, the minimum simulated levels were lower than the historical ones. The simulated storage employed all the available useful capacity. In the Valle de Bravo reservoir (Fig. 10), the simulation reached much lower levels than the historical record.
A comparison of the total volume of water extracted from the reservoirs between the simulated GA2 policy and the actual historical record is illustrated in Fig. 13. It is remarkable that the actual historical extractions were lower than 10 m 3 /s in a dry period in 2009. Due to its recreational function, the Valle de Bravo reservoir has historically been maintained at medium to high levels ( Fig. 9), thus, the GA2 procedure was modified by setting the minimum water level for the Valle de Bravo reservoir at 170 hm 3 . The new procedure was denominated GA3.
The optimal Z curve from GA3 versus GA2 policy is shown in Fig. 14 and Table 8.
A percentage of annual total extraction was assigned to each main reservoir by GA3 (Table 9).
The parameters were determined for Eqs. 3 and 4 to obtain optimal GA3 policy ( Table 10). The optimal upper and lower limit guide curves for GA3 and GA2 policy are compared in Fig. 15.
The spills and deficits caused by applying GA3 policy are denoted in Table 11.
By reducing the useful capacity in the Valle de Bravo reservoir, the total spill amount rose from 45.94 to 170.93 hm 3 (GA2 versus GA3 policy). The deficit remained at zero for GA3.
The average monthly delivery to the Los Berros plant with GA3 policy is illustrated in Fig. 16. The minimum values are still above 14.5 m 3 /s. Figures 17, 18 and 19 illustrate the evolution of the monthly initial storage in each of the three main reservoirs, comparing GA3 and GA2 policies. With GA3, the storage in the Valle de Bravo reservoir was never less than 190 hm 3 , except for one value of 175.6 hm 3 . On the other hand, the maximum monthly storage level in the El Bosque reservoir was still lower than the historical values (particularly from 2010 onwards), which would facilitate transfers from the Tuxpan Dam, avoiding the spills in that dam. The Fig. 4 The Z curve optimized with genetic algorithm GA1 Table 1 The penalty coefficients integrated into genetic algorithm GA1 policy C r , coefficient to take into account the total annual extraction in the objective function; C derr , penalty coefficient based on the total annual spills (for all the years simulated); C def , penalty coefficient based on the total annual deficits (for all the years simulated)

GA1
El Bosque Valle de Bravo Villa Victoria     total monthly initial storage for all three main reservoirs is depicted in Fig. 20. The water delivery pattern to the Los Berros plant wasdifferent between policies GA2 and GA3 (Fig. 2, Fig. 21). Since the availability of useful storage decreased with GA3, its minimum delivery volume was lower than that found with GA2. Although more frequent peaks in delivery volume  . 6 The upper limit guide curve (UGC) and lower limit guide curve (LGC) obtained for each reservoir with genetic algorithm GA2 versus the corresponding curves based on empirically determined historical operation patterns occurred with GA3 (during times of more abundant rainfall), they did not prevent the increased spill volume. The optimal Z curves derived from GA1, GA2 and GA3 policies are compared in Fig. 22. Despite the fact that GA1 policy (without guide curves) allowed for a greater annual extraction of water, the total spill volume was larger than the obtained under GA3 and specially under GA2 policy (see Tables 3, 7, and 11). The consideration of a minimum level of storage in the Valle de Bravo reservoir of 170 hm 3 versus 50 hm 3 (GA3 vs GA2 policy) resulted in a loss of regulatory capacity, which led to lower annual extractions and a higher spill volume. Hence, the volume delivered to the Los Berros plant by GA3 was 97.8% of that supplied by GA2.
When the reservoir levels were very low on November 1, the largest difference that existed between GA2 and GA3 policy in relation to the rate of water delivery to the Los Berros plant was an approximately 0.75 m 3 /s greater quantity furnished by GA2. When the reservoirs were full, a greater delivery volume was also found with GA2 versus GA3, with a maximum difference of 0.95 m 3 /s. The average monthly rate of water flow arriving to the Los Berros plant under each of the three policies herein analyzed is depicted in Fig. 23. The frequency of the distinct monthly average rates of water flow that arrived to the Los Berros plant based on GA1, GA2, and GA3 policies is portrayed in Fig. 24. The total extraction of water from the reservoirs (to be delivered to the Los Berros water treatment plant) is compared between the historical record and the genetic algorithm GA2 simulation 2 Page 12 of 16

Conclusions
The historical management of the Cutzamala system has been made based on subjective decisions supported by the experience of the operators. In this research an operating procedure was reached that avoids subjectivity and gives precise instructions on how to operate that can be by inexperienced staff.
Simulations of the operation of the three main reservoirs of the Cutzamala System were carried out with three GAs (GA1, GA2 and GA3) based on real data on the annual hydrological cycle during the last 20 years. Such data included the quantity of direct inflow to the aforementioned reservoirs and the contributions made by its five diversion dams.
The policies of GA1 (without guide curves, six variables), GA2 (with upper and lower guide curves and GA3 (with upper and lower guide curves, with less useful capacity in the Valle de Bravo dam) were compared in relation to the objective function, which involved several factors: the annual and monthly extraction of water from each of the three main reservoirs, the annual total extraction, and the annual and monthly water spills and deficits in the system. The restriction factors includes the capacity of channeling water through canals and pipes, the pumping capacities and the capacity of the water purification plant, as well as the maximum and minimum allowable levels of the three main reservoirs.
GA1, involving six variables, was similar to the historical operation of the Cutzamala System based on empirical decision making. GA2 considered upper and lower, when guide curves. The initial monthly level of one of the reservoirs was outside the limits of the guide curves, linear equations were employed to make the adequate adjustments. Hence, the 90 search variables included in GA2 were related to the Z curve of total annual extraction, the percentages of total annual extraction from each of the three main reservoirs of the system, the upper and lower limit guide curves, and the adjustments in the extractions during the simulation in case a reservoir level was outside the limits of the guide curves.
Since the GA1 policy regulated water extraction from the three reservoirs without implementing upper and lower limit guide curves, there were numerous spills and deficits. The GA2 policy optimized the objective function, delivering a greater monthly volume of water to the purification plant (compared to GA1) without exceeding its capacity. GA2 minimized spills and deficits in the long term because it made timely adjustments to comply with the standards set by the guide curves. GA3, consisting of    the same 90 search variables as GA2, included a greater restriction since it required a higher minimum level for the Valle de Bravo reservoir to accommodate its traditional recreational use. As a consequence, the total spills suffer an important increase and the delivery of water to the treatment plant was slightly lower for GA3 than GA2. The current research allows to define an operation policy with precise instructions by using a simple genetic algorithm to reach a operation policy that optimize a complex objective function evaluated thru a detailed simulation model of a complex reservoir system. Fig. 15 The upper limit guide curve (UGC) and lower limit guide curve (LGC) for GA3 versus GA2 policy There are several benefits of applying the proposed policy GA2 compared with the historical ones; mainly: For the simulated period of 20 years the total spill volume was reduced from 52.82 to 45.94 hm 3 . In addition the spills in the diversion dam Tuxpan (Fig. 12) can be substantially The total monthly initial storage of the three main reservoirs with GA2 and GA3 policy diminished because the reduction in the maximum storages in El Bosque dam (Fig. 8) makes transfers easier from the Tuxpan to the El Bosque dam.
Applying the proposed policy the minimum release to the treatment plant is 14.5 m 3 /s over the 20 years simulated in contrast with the historical minimum of 9.5 m 3 /s (Fig. 13), there for it is avoided an important stress in the Mexico City water distribution system. The proposed function to make adjustments when the water level in any of the three storage areas goes out of the limits of the Guide curve means that these adjustments are not abrupt as shown in Fig. 13, in particular, there are no steep drops that would also negatively affect the operation of Mexico City water distribution system.
The current research established an objective function capable of managing a complex reservoir system, including timely adjustments to the levels of the reservoirs to maximize water delivery to the treatment plant and minimize spills and deficits. The subjective criteria for decision making employed to date do not allow for a precise response when the water storage of reservoirs is outside the upper or lower limits. The comprehensive policies presently proposed give concrete instructions to the operators of the reservoirs at the beginning of each month in accordance with the state of the system. Additionally, said policies replace subjective Operation decisions based on the operator's experience.
Authors' contributions All authors participated in the study design, data collection and analysis, the preparation of the manuscript, and the decision to publish.

Fig. 21
The monthly quantity of water arriving to the Los Berros plant according to genetic algorithm (GA)3 and GA2 policies Fig. 22 The optimized Z curves resulting from genetic algorithm GA1, GA2 and GA3 policies