• No results found

CHAPTER 3: MODEL IMPROVEMENT AND METHODOLOGY

3.5 Model Optimization

3.5.1 Applied Optimization Algorithms

3.5.1.4 Water cycle algorithm

The water cycle algorithm (WCA) mimics the flow of rivers and streams toward the sea and derived by the observation of the water cycle process. Let us assume that there are some rain or precipitation phenomena. An initial population of design variables (i.e., population of streams) is randomly generated after raining process. The best individual (i.e., the best stream), classified in terms of having the minimum cost function (for minimization problem), is chosen as the sea.

Then, a number of good streams (i.e., cost function values close to the current best record) are chosen as rivers, while the other streams flow to the rivers and sea. In an N-dimensional optimization problem, a stream is an array of 1×N. This array is defined as follows: optimization algorithm, an initial population representing a matrix of streams of size Npop ×N is generated. Hence, the matrix of the initial population, which is generated randomly, is given as (rows and column are the number of population and the number of design variables, respectively):

1

where Npop and N are the total number of population and the number of design variables, respectively. Each of the decision variable values (x1, x2, . . . , xN) can be represented as

At the first step, Npop streams are created. A number of Nsr from the best individuals (minimum values) is selected as a sea and rivers. The stream, which has the minimum value among others, is considered as the sea. In fact, Nsr is the summation of the number of rivers (which is defined by the user) and a single sea (see Equation (3.40)). The rest of the population (i.e., streams flow to the rivers or may directly flow to the sea) is

Equation (3.42) shows the population of streams, which flow to the rivers or sea.

Indeed, Equation (3.42) is part of Equation (3.38) (i.e., total individual in population):

1 1 1 1

Depending on flow magnitude, each river absorbs water from streams. The amount of water entering a river and/or the sea, hence, varies from stream to stream. In addition, rivers flow to the sea which is the most downhill location. The designated streams for each river and sea are calculated using the following Equation (Eskandar et al., 2012):

1 1, 2,3,..., streams end up in the sea that corresponds to the current best solution.

Let us assume that there are Npop streams of which Nsr-1 are selected as rivers and one is selected as the sea. Figure 3.3a shows the schematic view of a stream flowing toward a specific river along their connecting line.

Figure 3.4: a) Schematic description of the stream's flow to a specific river; b) Schematic of the WCA optimization process

For the exploitation phase in the WCA, new positions for streams and rivers have been suggested as follows (Eskandar et al., 2012):

1 ( )

t t t t

Stream Stream Sea Stream

X Xrand C  XX (3.45)

1 ( )

t t t t

Stream Stream River Stream

X Xrand C  XX (3.46)

1 ( )

t t t t

River River Sea River

X Xrand C  XX (3.47)

where 1 < C < 2 and the best value for C may be chosen as 2 and rand is a uniformly distributed random number between zero and one. Equations (3.45) and (3.46) are for streams, which flow to the sea and their corresponding rivers, respectively. Notations having vector sign correspond to vector values, otherwise the rest of notations and

parameters are considered as scalar values. If the solution given by a stream is better than its connecting river, the positions of river and stream are exchanged (i.e., the stream becomes a river, and the river becomes a stream). A similar exchange can be performed for a river and the sea.

The evaporation process operator also is introduced to avoid premature (immature) convergence to local optima (exploitation phase) (Eskandar et al., 2012). Basically, evaporation causes sea water to evaporate as rivers/streams flow to the sea. This leads to new precipitations. Therefore, we have to check if the river/stream is close enough to the sea to make the evaporation process occur. For that purpose, the following criterion is utilized for evaporation condition: applied and new streams are formed in the different locations (similar to mutation in the GAs). Hence, in the new generated sub-population, the best stream will act as a new river and other streams move toward their new river. This condition will also apply for streams that directly flow to the sea.

Indeed, the evaporation operator is responsible for the exploration phase in the WCA. The following Equation is used to specify the new locations of the newly formed streams: where LB and UB are lower and upper bounds defined by the given problem,

respectively. Similarly, the best newly formed stream is considered as a river flowing to the sea. The rest of new streams are assumed to flow into the rivers or may directly flow into the sea.

A large value for dmax prevents extra searches, and small values encourage the search intensity near the sea. Therefore, dmax controls the search intensity near the sea (i.e., best-obtained solution). The value of dmax adaptively decreases as follows:

1 max respectively. The white (empty) shapes denote the new positions taken by streams and rivers. Table 3.5 shows the pseudo-code and step by step processes of the WCA in detail.

Table 3.5: Pseudo-code of the WCA

Set user parameter of the WCA: Npop, Nsr, dmax, and Max_Iteration

Determine the number of streams, which flow to the rivers and sea using Eqs. (3.40) and (3.41)

Randomly create initial population of streams between LB and UB (Eq. (3.42)) Define the intensity of flow for rivers and sea by Eqs. (3.43) and (3.44)

% Main loop of WCA

while (t ≤ Max_Iteration) or (any stopping condition) for i = 1 : Population size (Npop)

Stream directly flows to the sea using Eq. (3.45)

Calculate the objective function of the generated stream if Objective (New_Stream) < Objective (Sea)

Sea = New_Stream end if

Stream flows to its corresponding river using Eq. (3.46) Calculate the objective function of the generated stream if Objective (New_Stream) < Objective (River)

River flows to the sea using Eq. (3.47)

Calculate the objective function of the generated river if Objective (New_River) < Objective (Sea)

New streams and a river are created using Eq. (3.48)

end if end for

% Evaporation Condition for streams who directly flow to the sea for i = 1 : NS1

if norm (Sea - Stream) < dmax

New streams are created using Eq. (3.48) end if

end for

Reduce the dmax using Eq. (3.49) end while

Postprocess results and visualization