Water Resources Management 12: 185–198, 1998.
© 1998 Kluwer Academic Publishers. Printed in the Netherlands. 185
Real-Coded Genetic Algorithm for Rule-Based
Flood Control Reservoir Management
FI-JOHN CHANG1and LI CHEN2
1Department of Agriculture Engineering, National Taiwan University, Tapei, Taiwan, Republic of China
2Department of Civil Engineering, CHUNG-HUA University, Hsin-Chu, Taiwan, Republic of China
(Received: 25 February 1997; in final form: 4 November 1997)
Abstract. Genetic algorithms (GAs) have been fairly successful in a diverse range of optimization problems, providing an efficient and robust way for guiding a search even in a complex system and in the absence of domain knowledge. In this paper, two types of genetic algorithms, real-coded and binary-coded, are examined for function optimization and applied to the optimization of a flood control reservoir model. The results show that both genetic algorithms are more efficient and robust than the random search method, with the real-coded GA performing better in terms of efficiency and precision than the binary-coded GA.
Key words: binary-coded GA, flood control, fuzzy control, real-coded GA, reservoir optimization.
1. Introduction
Due to the temporal and spatial variability in rainfall and high mountains and steep channels upstream of all watersheds on Taiwan Island, water reservoirs are the most effective means for mitigating natural disasters such as flooding or drought. Operating rules for reservoir operation are intended to guide and manage such systems so that the releases made are in the best interests of the system’s objectives consistent with certain inflows and existing storage levels. For optimal control of reservoirs, prediction of the inflow hydrograph and optimization of the release must be accurate. Due to the natural uncertainties of the predicted inflow hydrograph and complexity of reservoir operating rules, reservoir operation highly depends on the experience based knowledge of operator(s), such as during an extreme hydrologic situation like flooding. Based on the fuzzy inference theory associated with the information in a weather forecast, discharge predictions and updating observations, a real-time operation of a flood control reservoir has been developed. It has shown promising results that permit treatment and extension of the experience and knowl-edge of reservoir operations in extreme flood events (Kojiri et al., 1990). However, it is like most of the fuzzy controllers which were designed based on human op-erator experience, and/or knowledge. An opop-erator often cannot tell linguistically what kind of action is taken in a particular situation; moreover, there is no reason
warm1081.tex; 4/06/1998; 8:42; p.1 INTERLINIE: pc3:warm1203: Pipsnr.: 157622 (warmkap:mathfam) v.1.15
to believe that control is optimal.
The need for solving optimization problems arises in almost every field and, in particular, is a dominant theme in water resource systems. As a consequence, many analytic and numerical optimization techniques have been developed. However there exist a great number of functions, such as discontinuous, nondifferentiable, non-convex, or multi-modal, which are beyond analytical methods and present profound difficulties for numerical techniques. Moreover, traditional optimization techniques depend highly on a deterministic relationship between the model’s pa-rameters and its performance; to date, these techniques have been unable to op-timize the performance of complex systems. Consequently, new and more robust optimization techniques which are capable of handling such problems are needed. Recently, there has been an increasing interest in a biologically motivated adap-tive system for solving optimization problems. The genetic algorithm is one of the most promising techniques in that domain and has received a great deal of attention regarding its potential for optimizing complex systems. The GA is essentially a Darwinian natural selection which combines an artificial survival of the fittest with natural genetic operators (Holland, 1975). The major differences between GA and other search methods can be summarized as follows.
1. GA works with a coding of the parameter set rather than the parameter values themselves.
2. GA searches a population of solutions instead of a single solution. 3. GA uses probabilistic transition operators and not deterministic ones. 4. GA does not require domain specific information.
In the past decade, genetic algorithms (GAs) have been applied successfully to a number of problems such as optimizing simulation models, fitting nonlinear curves to data, solving systems of nonlinear equations, and machine learning (Wright, 1991). In the water resources field, GAs have been applied to variety of problem (Wang, 1991; Simpson et al., 1994; McKinney and Lin, 1993; Oliveira and Loucks, 1997).
In this study, a real-coded genetic algorithm is investigated and utilized to op-timize the parameters in the fuzzy inference rules of a flood control reservoir. The paper is organized in the following manner: binary and real-coded genetic algorithms are described and examined in the next section; the succeeding section presents the GAs application and its results; conclusions and closing remarks are given in the final section.
2. Genetic Algorithm
The genetic algorithm is an iterative procedure maintaining a population of indi-viduals that are candidate solutions to specific domain. During each generation, the individuals in the current population are rated for their effective evaluations, and
REAL-CODED GENETIC ALGORITHM 187
Figure 1. A standard GA.
a new population of candidate solutions is formed using specific genetic operators such as reproduction, crossover, and mutation (Grefenstette, 1986). Figure 1 pro-vides a flow diagram of a GAs. The basic algorithm does step 1 to choose an initial population. Steps 2 to 5 are done to go from one generation to the next. These steps are repeated until the convergence criterion is satisfied or a predetermined number of generations is reached.
3. Binary-Coded GA
The common method of applying GAs to real-parameter problems is to encode each parameter as a bit string using a standard binary coding. Individuals A are represented as bit strings of fixed length L, i.e. A ∈ BL, where B = 0, 1. The bit strings for the parameters are concatenated together to give a single bit string (or ‘chromosome’) which represents the entire vector of parameters. If a single parameter xi has lower and upper bounds aiand bi respectively, then the standard way of binary coding xiusing n bits is to let real value ai+m(bi−ai)/2ncorrespond to the standard binary code for an integer m in the range 0≤ m < 2n. For example,
if ai = 0 and bi = 4 and n = 5, then the real value 3/8 would correspond to the
binary code 00011 [0 + 3(4–0)/25= 3/8].
A simple genetic algorithm is composed of three operators: reproduction, cross-over and mutation. The detail of the binary coded GA can be found in Goldberg (1989).
4. Real-Coded GA
A growing number of researchers in the GAs community have come to champion the large alphabet real-coded (or floating-point) genes as opposed to the small alphabet binary-coded genes. Although few theorists believe that small alphabets should be more effective than large alphabets (Antonisse, 1989; Wright, 1991), practical experience shows that real-coded genes with their large alphabet may work better in certain situations (Davis, 1991a).
According to several previous studies, real-coded GAs have advantages over binary coded GAs (Wright, 1991; Eshelman and Schaffer, 1992) and these are summarized as follows. First, real-coding of the genes eliminates concern that precision is not adequate to represent good values are representative in the search space. Whenever a parameter is binary coded, there is always the danger that the reduced level of precision does not represent parameter values that produce the best solution values. Second, for a real-coded GA, the range of a parameter does not have to be a power of two. Third, GAs operating on real-coded genes have the ability to exploit the gradualness of functions of continuous variables. Gradualness here means that small changes in the variables correspond to small changes in the function.
REAL-CODED GENETIC ALGORITHM 189
Figure 2. A flaw of real crossover where the objective value of the generated point (X1,Y2)
is worse than those of parent points.
parameters, a gene corresponds to a real number, and an allele corresponds to a real value. In the binary-coded GA, only step 5 (crossover and mutation) of Figure 1 uses the bit string representation of a chromosome. Thus, to design a real GA, we can take the methods for doing steps 1 to 4 from the corresponding methods for standard GAs. Wright (1991) has shown that binary crossover can be viewed as a real crossover operation on the vector of parameters plus perturbations of some of the parameters, and binary mutation can also be considered as a perturbation of some of the parameters. A detailed explanation of the real-coded GA can be found in Wright (1991).
A weakness with real crossover is illustrated in Figure 2. The ellipses in the figure represent contour lines of the objective function. A local minimum is at the center of the inner ellipse. Parents 1 and 2 are both relatively good points in that their function value is not too much above the local minimum. However, any child generated using crossover from these points will be much worse than either parent. There are three methods for solving this problem.
1. Wright’s linear crossover operator creates three offspring: Treating the two parents as two points, P1 and P2; one child is the midpoint of P1 and P2;
and the other two lie on a line determined by P1and P2: 1.5P1− 0.5P2 and
–0.5P1+ 1.5P2(Wright, 1991).
2. Radcliffe’s flat crossover chooses parameters for an offspring by uniformly picking parameter values between (inclusively) the two parents parameter values (Radcliffe, 1990).
3. Eshelman and Schaffer use a crossover operator that is a generalization of Radcliffe’s (1990) which they call blend crossover (BLX-α). It uniformly
Figure 3. The interval of BLX-α crossover.
picks values that lie between two points that contain the two parents, but may extend equally on either side determined by a user specified GA-parameter α (see Figure 3.) (Eshelman and Schaffer, 1992). For example, BLX-0.5 picks parameter values from points that lie on an interval that extends 0.5I on either side of the interval I between the parents. BLX-0.0, on the other hand, is equivalent to Radcliffe’s flat crossover.
4.1. APPLICATION TO A MATHEMATICAL EXAMPLE
A simple example is chosen to demonstrate the use of the algorithms for function optimization. For evaluating the efficiency and robustness of the GAs, their per-formance is also compared with the results obtained from a random search for the same function. The random search method is a common used method, consequently its result is used only as a base for the purpose of comparison. The function was first designed by DeJong (1975) and shown as follows.
minimize F1= f (x1, x2, x3)=
X3
i=1x
2
i, (1)
where –5.12≤ xi≤ 5.12, i = 1,2,3. The function has a zero minimum at (0,0,0). The following operator values of GAs are used: population size = 100, crossover probability = 0.9 and mutation rate = 0.01. For the binary-coded GA, string length = 10 is used to represent each variable. For the real-coded GA, BLX-0.5 is used to make a crossover.
The function (Equation (1)) is executed with different values of x1and x2 for
one hundred times in each generation, and ten generations are performed. Conse-quently, there are 1000 function evaluations. To evaluate the efficiency and robust-ness, the full search procedure of each method is executed 100 times. The average of the best-so-far objective function values versus the number of evaluations is shown as Figure 4 and Table I.
Apparently, the performance of real-coded GA is better than that of the other two methods. The results also show that the real-coded GA converges quickly and reaches an optimal point, where the average objective value is close to the
theoret-REAL-CODED
GENETIC
ALGORITHM
191
Table I. Results of the simple function optimization using the real-coded, binary-coded genetic algorithms and random search Methods Statistics Number of evaluations
100 200 300 400 500 600 700 800 900 1000 Real- Mean 0.452 0.087 0.031 0.012 0.003 0.000 0.000 0.000 0.000 0.000 coded Std. dev. 0.366 0.116 0.069 0.083 0.013 0.003 0.000 0.000 0.000 0.000 Binary Mean 1.595 1.073 0.736 0.531 0.416 0.358 0.312 0.266 0.233 0.200 coded Std. dev. 1.140 0.777 0.510 0.387 0.306 0.288 0.250 0.222 0.198 0.155 Random Mean 1.920 1.055 0.886 0.661 0.627 0.512 0.441 0.419 0.396 0.394 search Std. dev. 1.225 0.660 0.562 0.461 0.405 0.338 0.243 0.239 0.228 0.229 warm1081.tex; 4/06/1998; 8:42; p.7
Figure 4. 100-Run average of the best-so-far objective function values versus number of
ob-jective function evaluations. Optimization of a 3-variable simple function using the real-coded, binary-coded GAs and random search.
Figure 5. Components of a typical expert system.
ical minimum point, i.e. zero. The optimal value is obtained after six generations (after 600 evaluations).
4.2. APPLICATION TO OPERATING A FLOOD CONTROL RESERVOIR
The above algorithms were then applied to select good parameters for operation of a simplified flood control reservoir. The reservoir information was first proposed by Kojiri and Ikebuchi (1988) and was used to develop an expert reservoir operation (Kojiri et al., 1988). The total capacity of the reservoir is 10× 106m3, and the design flood of release discharge is 2800 CMS. The basic functions of the flood control expert system are illustrated in Figure 5, and the system is implemented on a PC running Microsoft Windows 3.1 as shown in Figure 6. The inference engine
REAL-CODED GENETIC ALGORITHM 193
Figure 6. The main window of the fuzzy expert system.
is made by fuzzy logic which includes four basic flood control rules. Each rule contains one parameter to determine the magnitude of water release. The GAs is used to select these four parameters so that the reservoir can best achieve its designated goal. The rules are described as follows:
1. If inflow is large and storage is high, then release water (R1t) = a× inflow.
2. If inflow is small and storage is high, then release water (R2t) = b× inflow.
3. If inflow is large and storage is low, then release water (R3t) = c× inflow.
4. If inflow is small and storage is low, then release water (R4t) = d× inflow.
To execute the reservoir release under the linguistic rules, the inference engine has to decide the weights (Wi) of these four fuzzy inference rules according to their membership functions which are relative to the observed magnitudes of current inflow and storage values. Four simple linear membership functions are designated to indicate the quantitative meaning of large inflow, small inflow, high storage, and low storage, respectively, and shown in Figure 7. The weights Wi, release water Rt and reservoir storage St are computed as follows.
Wi = min (USi, UI i), ∀i = 1, 2, 3, 4
Rt = P4 i=1(Wi×Rit) P4 i=1Wi warm1081.tex; 4/06/1998; 8:42; p.9
Figure 7. The membership functions of fuzzy inference.
St+1= St+ (It− Rt)× 3600
Where USi is the membership value corresponding to high or low storage and UI i is the membership value corresponding to large or small inflow for ith inference rule, respectively. It is the inflow at time t, and the unit of time t is hour.
The main purpose of the reservoir is to reduce the outflow during the peak time and at the end of the flood to return the storage close to its initial value to reserve storage for the next flood coming. To achieve this goal, the objective function for the flood control reservoir is formulated as follows.
Maximize 3600(Ip − Rp) − |S0 − Sn| (2) where Ip = peak inflow Rp = peak release S0 = initial storage Sn = final storage
The value 3600 is to make consistent the flow and storage unit.
The computational process is to search for the best parameter of a, b, c, d in the fuzzy inference rules so that the maximum value for the objective can be obtained. Using more training data in the optimization process might provide a more reasonable and robust expert system for guiding flood control operation in
REAL-CODED GENETIC ALGORITHM 195
Figure 8. 100-Run average of the best-so-far objective function values versus number of
ob-jective function evaluations. Optimization of 4 parameters in the fuzzy expert system using the real-coded, binary-coded GAs and random search.
Figure 9. The storage variation of the flood control reservoir.
the future. However, for this example the system parameters were calibrated on the basis of one known flood event only.
The real-coded GA and binary-coded GA, were used to estimate the four pa-rameters. For the purpose of evaluating the efficiency and robustness of these methods, the search process was designed as follows.
• The population size was set to 100, and ten generations were performed for the GA methods.
• The above process is executed 100 times.
The 100 times average of the best-so-far objective function values versus the num-ber of evaluations is shown in Figure 8 and Table II. The real-coded GA obtained better results than the binary-coded GA, in terms of higher mean objective function values and smaller standard deviation. Table III shows the best parameter values of best performance using the real-coded and binary-coded genetic algorithms. Figure 9 shows the final best release discharge sequences and Figure 10 presents the final best storage sequences for each method.
FI-JOHN
CHANG
AND
Table II. Results of the parameters optimization in fuzzy expert system using the real-coded, binary-coded genetic algorithms and random search
Methods Statistics Number of evaluations (× 105)
100 200 300 400 500 600 700 800 900 1000 Real- Mean 5.743 13.413 17.699 19.949 22.840 25.503 28.008 30.322 31.552 31.748 coded Std. dev. 6.291 5.014 2.892 1.763 0.960 0.894 0.701 0.631 0.511 0.412 Binary Mean –2.554 –1.714 6.727 9.808 14.120 17.691 21.180 23.441 24.413 25.872 coded Std. dev. 7.051 5.591 3.147 2.357 1.183 0.954 0.893 0.802 0.755 0.684 Random Mean –5.651 –0.112 4.390 6.894 8.071 12.872 14.751 15.732 16.430 16.526 search Std. dev. 7.369 5.920 3.658 2.891 1.401 1.285 1.148 1.099 0.928 0.864 warm1081.tex; 4/06/1998; 8:42;
REAL-CODED GENETIC ALGORITHM 197 Table III. Best parameter values of best performance for the reservoir
operating using the real-coded, binary-coded genetic algorithms and random search
Parameters Random Binary-coded Real-coded Parameters search genetic algorithm genetic algorithm
a 0.05253 0.04286 0.0344
b 2.35093 2.15263 2.0848
c 0.61941 0.58749 0.54101
d 1.0736 1.22107 1.37099
Object valuesa 3906292 4573264 5144698
aObject values for Equation (2).
Figure 10. The inflow and outflow hydrograph of the flood control reservoir.
5. Conclusions
Genetic Algorithms (GAs) have received considerable attention for their potential as optimization techniques for complex systems. In this study, two types of GAs, real-coded and binary coded, are presented and investigated for function optimiza-tion and model parameter estimaoptimiza-tion. To evaluate the stability and robustness of the search methods, one hundred runs in each generation and ten generations are performed in both cases. The full search procedure of each method is executed 100 times, and the average of the best-so-far objective values are recorded. For the function optimization the methods searched for the values of three random variables that would minimize the function (Equation (1)). The result shows that the real-coded GA converges quickly and reaches an optimal points, where the objective value is close the theoretical minimum point. For the flood control reser-voir, four parameters of fuzzy inference control rules, which are used to determine the magnitude of water release, were estimated so that the release maximized the objective function for a specified inflow and initial storage level. The real-coded GA obtains superior results than the binary-coded GA, in terms of high mean
objective function values and smaller standard deviation. The study shows that the GA is a very promising technique for parameter estimation in the water resource management models, while the real-coded GA is better than the binary coded GA in three respects: precision, efficiency and flexibility.
References
Antonisses, H. J.: 1989, A new interpretation of schema notation that overturns the binary encoding constraint, Proc. Third. International Conference on Genetic Algorithms, Morgan Kaufmann, San Mateo, CA, pp. 86–91.
Davis, T. E.: 1991b, Toward an extrapolation of the simulated annealing convergence theory onto the simple genetic algorithm, Ph. D. Thesis, University of Florida.
Davis, L.: 1991a, Hybridization and numerical representation, in L. Davis (ed.), The Handbook of
Genetic Algorithms, Van Nostrand Reinhold, New York, pp. 61–71.
DeJong, K. A.: 1975, Analysis of the behavior of a class of genetic adaptive Systems, Ph. D. Dis-sertation, Department of Computer and Communications Sciences, University of Michigan, Ann Arbor, MI.
Eshelman, Larry J. and Schaffer, J. David: 1992, Real-coded genetic algorithms and interval-schemata, Proc. Fifth International Conference on Genetic Algorithms, Morgan Kaufmann, San Mateo, CA, pp. 187–202.
Goldberg, D. E.: 1985, Optimal initial population size for binary-coded genetic algorithms, TCGA
Report No. 85001, University of Alabama, Tuscaloosa.
Goldberg, D. E.: 1989, Genetic Algorithms in Search, Optimization and Machine Learning, Addison-Wesley, Reading, MA.
Grefenstette, John J.: 1986, Optimization of control parameters for genetic algorithms IEEE Trans.
System, Man, Cybernet., SMC16(1) 122–128.
Holland, J. H.: 1975, Adaptation in Natural and Artificial Systems, The University of Michigan Press, Ann Arbor, MI.
Kojiri, T. and Ikebuchi, S.: 1988, Real-time operation of dam reservoir by using fuzzy inference theory, 6th Congress Asian and Pacific Regional Division International Association for Hydraulic
Research, Kyoto, Japan, 20–22 July, pp. 437–445.
McKinney, D. C. and M.-D. Lin: 1994, Groundwater optimization using genetic algorithms, Water
Resour. Res. 30(6), 1897.
Nix, A. and Vose, M. D.: 1991, Modeling genetic algorithm with Markov chains, Ann. Math. Artificial
Intell.
Oliveira, R. and Loucks, D. P.: 1997, Operating rules for multireservoir systems, Water Resour. Res. 33(4), 839.
Radcliffe, N. J.: 1990, Genetic neural networks on MIMD computers, Ph. D., Dissertation, Dept. of Theoretical Physics, University of Edinburgh, Edinburgh, U.K.
Simpson, A. R., Dandy, G. C. and Murphy, L. J.: 1994, Genetic algorithms compared with other techniques for pipe optimization, J. Water Resour. Plann. Manage. 120(4).
Wang, Q. J.: 1991, The genetic algorithm and its application to calibrating conceptual rainfall-runoff models, Water Resour. Res. 27(9), 2467.
Wright, A.: 1991, Genetic algorithms for real parameter optimization, in: G. J. E. Rawlins, (ed.),