3.2.4. Selection of Fitness Function

In this paper, a sorting-based allocation function was used as the fitness function. The equation was as follows:

$$Fit(P) = 2 - \mathcal{Y} + \mathcal{Z}(\mathcal{Y} - 1)(P - 1)/(N - 1)$$

where *N* is the number of chromosomes in the population, *P* is the sorting number of the chromosome in the population, *Y* is the selection pressure with a value in the range of [1.0, 2.0]. When the fitness function was applied, it was necessary to calculate at first the penalty value of each chromosome in the population, incurred by the differences in the width, thickness, and hardness among adjacent slabs, as well as the TOU electricity pricing. Following this, sorting was performed according to the penalty values, and the *P* value of the corresponding chromosome was obtained. Finally, the fitness values of different chromosomes were calculated. The smaller the objective function value was, the greater the fitness of the corresponding chromosome was. In this way, the high-quality chromosomes were picked from the population.

#### 3.2.5. Genetic Operators

Genetic operators include selection operators, crossover operators, and mutation operators. In a rolling plan, each slab could only occupy one position in the sequence. In other words, no duplicate genes would appear in the same chromosome, which is different from the conventional GA. Therefore, it was necessary to improve the crossover and mutation operators. The selection operator used in the model solution method proposed in this paper was used to realize a selection operation similar to roulette according to the above-mentioned fitness function. The crossover operator was a secondary crossover operator. As illustrated in Figure 9, the crossover operator worked as follows. (1) Three contiguous genes on the chromosome were randomly selected and their positions are recorded; (2) the three genes were led to exchange positions with three corresponding genes on another chromosome without changing the original order. Finally, the mutation operator exchanged the positions of two randomly selected genes on the same chromosome, as presented in Figure 10.

˄**E**˅**\$IWHUPXWDWLRQ**

˄ ˅ **Figure 10.** Mutation operator.
