**2.3. Optimization algorithm**

The definition of optimal control strategies in water distribution systems, where the rules evaluate the behaviour of the system and make decisions at each time-step, requiring a great computational demand. Among several available optimization methods, the Genetic Algo‐ rithm (GA) was the tool chosen for offering a great flexibility in search space, allied to the possibility of use discrete variables. Besides these advantages, the technique has an easy ma‐ nipulation, which makes its connectivity with simulation models easier.

**2.4. Prediction algorithm**

**Figure 2.** Flowchart for the developed ANN model.

The conception of an ANN in order to capture the best energy model domain from a config‐ uration model and economical simulator (CES) in a much more efficient way is based on the following remarks: first of all, a robust data base has to be developed to create the input and output data set that will be used in ANN conception and training; the data has to be ana‐ lysed to determine a structure that fits the problem and then to train and validate the ANN.

Energy Efficiency in Water Supply Systems: GA for Pump Schedule Optimization and ANN for Hybrid Energy Prediction

http://dx.doi.org/10.5772/50458

81

The model developed is composed by two modules that will work as a whole in a way the hydraulic simulation routine is called to simulate each operational alternative scenarios giv‐ en by the GA, in the search of alternatives with better performance.

**Figure 1.** Stages of the optimization model

Further a Simple Genetic Algorithm (SGA), a Hybrid Genetic Algorithm (HGA) was also de‐ veloped. This algorithm was built from a combination of a conventional GA with a method of correction of solutions and a specialized local search procedure. The goal is to find, in a faster way, feasible solutions, which are difficult to be found by traditional genetic algo‐ rithms due to the tendency that the situation has to generate a high number of impracticable hydraulic solutions.

The flowchart containing the steps of the optimization model is shown in the Figure 1.
