# A Novel Method for Building Displacement Based on Multipopulation Genetic Algorithm
## 3 Introducing BDMPGA
### Objective Function and Fitness Function  
During the process of evolution, the pros and cons of the individual are evaluated by the fitness function, which is the only basis of individual selection and guides the evolution of the algorithm. Usually, the fitness function is obtained by the linear scaling of the objective function. In this study, we take the reciprocal of the objective function value as the fitness value. If an individual has a higher fitness value, then it will be more likely to be selected as the parent population for genetic manipulation.  
For different problems, objective function is defined in different ways. In the problem of building displacement, three indicators are considered to construct the objective function, namely, the number of remaining conflicts between buildings and buildings, the number of remaining conflicts between buildings and roads, and the total displacement distances of all the buildings. Then, the objective function is transformed into a fitness function by a linear transformation. If after the displacement, the smaller the number of remaining conflicts between objects and the shorter the displacement distance are, then the displacement is a successful solution. The metrics are defined in detail below:  
* Number of conflicts between buildings. For two neighboring buildings \(Bi\) and \(Bj\), \(MinDist(Bi,Bj)\) is the minimum distance between buildings \(Bi\) and \(Bj\). \(conf(Bi,Bj)\) represents a spatial conflict  
Figure 3: Diagram of the immigration operation.  
between buildings \(Bi\) and \(Bj\). If \(MinDist(Bi,Bj)\) is less than then predefined distance threshold, then \(conf(Bi,Bj)=1\); otherwise, \(conf(Bi,Bj)=0\). Thus, the number of conflicts between all buildings can be expressed as: \[Min\Big{(}F_{BB\_conf}(X)\Big{)}=\sum conf(Bi,Bj).\] (4)
* Number of conflicts between buildings and roads. For building \(Bi\) and road \(Rj\), \(MinDist(Bi,Rj)\) is the minimum distance between building \(Bi\) and road \(Rj\), and \(conf(Bi,Rj)\) represents a spatial conflict between building \(Bi\) and road \(Rj\). If \(MinDist(Bi,Rj)\) is less than then predefined distance threshold, then \(conf(Bi,Rj)=1\); otherwise, \(conf(Bi,Rj)=0\). Thus, the number of conflicts between buildings and roads can be expressed as: \[Min\Big{(}F_{BR\_conf}(X)\Big{)}=\sum conf(Bi,Rj).\] (5)
* Total displacement distances of all the buildings. This measure is used to evaluate the positional accuracy after displacement. The displacement must be within a certain range of the positional accuracy, and the smaller the total displacement distances are, the better the positional accuracy is maintained. The total displacement distances of all the buildings are calculated by summing the displacement distances in the \(X\) and \(Y\) directions of all the buildings. The expression is as follows: \[Min(F_{TotalDist}(X))=\sum\Big{(}\sqrt{dx_{i}^{2}}+\sqrt{dy_{i}^{2}}\Big{)}.\] (6) Finally, the objective function can be expressed in the following form: \[Min(F(X))=w_{BB\_conf}*F_{BB\_conf}(X)+w_{BR\_conf}*F_{BR\_conf}(X)+w_{Total Dist}*F_{TotalDist}\] (7) where \(w_{BB\_conf}+w_{BR\_conf}+w_{TotalDist}=1\), \(w_{BB\_conf}\), \(w_{BR\_conf}\), and \(w_{TotalDist}\) are weights for the number of conflicts between buildings, number of conflicts between buildings and roads and the total displacement distances of all the buildings displaced, respectively.  
After the objective function is constructed, it is transformed into a fitness function by linear transformation. The objective of optimization is to select the chromosome with the maximum fitness function value. The larger the fitness function value is, the better the chromosome and the greater the probability of being selected are.  
\[MaxFitness=\frac{1}{Min(F(X))} \tag{8}\]