An Optimization and Adjustment Method of Pile Orientation for a Pile-Supported Wharf Based on a Genetic Algorithm

The pile-supported wharf is widely used in port wharf design due to its excellent adaptability. However, it may intersect in space because a large number of batter piles are used. In the design process of the pile-supported wharfs, pile orientation adjustment is an essential process to avoid pile intersection. The arrangement of pile orientation in a structural section often takes several days manually. Sometimes, designers cannot avoid pile intersections after many attempts. At present, the software can only check pile intersections, but it cannot optimize pile orientations. Considering the priority order of adjusting the pile slope, the rotation angle, and avoiding a pile intersection, the objective function for optimization is designed, and the pile orientation is optimized and adjusted by a genetic algorithm. Then the performance of the algorithm is analyzed. Finally, the algorithm is applied to two practical cases of pile-supported wharfs. One case involves the designers who failed to arrange the pile orientation. Moreover, satisfactory results of pile orientations are obtained in a few minutes. Therefore, the proposed method greatly improves labor efficiency.


Introduction
e pile-supported wharf has advantages, such as less wave re ection, light structure, and strong adaptability. is deep foundation structure is especially suitable for soft soil foundations such as deep silt layers [1][2][3][4]. erefore, this wharf structure has been widely used. In the past three decades, a large number of pile-supported wharfs have been built in China [5]. With the exhaustion of excellent port resources, the conditions for ports to be built will worsen in the future. ese structural characteristics of pile-supported wharfs make them more useful for wharf construction in the future. e pile-supported wharf is characterized by a large number of piles. e amount of piles in a single structural segment of a typical 50000-ton pile-supported wharf is 50 or 60, and the whole wharf usually has hundreds or even thousands of piles. e pile group e ect is formed by numerous pile foundations. erefore, the design parameters of the pile group need to be optimized in order to save cost and achieve optimal working performance. At present, most of the research on pile group optimization focuses on vertical pile groups [6][7][8][9][10][11][12]. However, to bear horizontal loads, such as uid loads, wave loads, and wind load sand ship impact loads [13,14], batter piles are widely used in pile-supported wharf to ensure su cient lateral bearing capacity. With the development of larger ships, pile-supported wharfs are subjected to a greater number of lateral loads, and thus, more batter piles are needed. At present, the optimization of pile groups involving batter piles focuses on their bearing capacity and di erential settlement [15][16][17][18][19]. In addition, pile foundations may intersect spatially, resulting in failure of construction. erefore, the layout of the pile foundation must be optimized. In the design process of pilesupported wharf structures, the pile intersection check is an essential process. Many methods can be used to check pile intersections, but they only focus on whether piles intersect in space [20][21][22][23]. Adjusting piles to avoid pile intersections still needs to be handled manually. In the face of hundreds or even thousands of piles, it usually takes considerable time to nd all the intersected piles and adjust them. Sometimes, even after many attempts, the appropriate pile orientation arrangement cannot be obtained.
Due to this situation, considering the priority of adjusting the slope, and the rotation angle, as well as avoiding pile intersections, the optimization algorithm for pile orientation adjustment is constructed based on a genetic algorithm, and the performance of the algorithm is analyzed. e algorithm is used to adjust the pile orientation in two practical cases, and the pile orientation can be welloptimized.
2. An Analysis of Algorithm Difficulties and a Genetic Algorithm

An Analysis of Algorithm Di culties.
ere are two main di culties in realizing the automatic adjustment of pile orientations. First, the orientations of the two piles are likely to be interdependent variables when their orientations are adjusted. For the two piles shown in Figure 1, the rotation angle and slope of one pile are the variables that need to be determined when adjusting the pile orientations, but these two variables a ect the adjustment of the rotation angle and the slope of the other pile at the same time and vice versa. erefore, it is di cult to optimize pile orientations with conventional optimization algorithms. Second, the slope and rotation angle of the pile have di erent e ects on the internal force of bents. Generally, the slope of the pile has a greater impact on the internal force of bents. erefore, the adjustment of the rotation angle is usually selected rst, followed by the adjustment of the pile slope. In other words, there is a priority between the adjustment of the rotation angle and the slope. Considering these di culties, the genetic algorithm is used to realize the automation adjustment of pile orientations under the priority of adjusting the rotation angle.
In principle, many methods can satisfy the optimization requirements of this study [24][25][26][27][28][29]. Considering that many studies use the GA algorithm to optimize piles, the GA method is rst used to implement the automatic optimization and adjustment of pile orientation for pile-supported wharfs. e practical results show that the GA algorithm can successfully complete the optimization of a structural segment in a few minutes, which fully meets the requirements. It is of little importance to further improve the computational e ciency.

Genetic Algorithm.
In essence, a genetic algorithm is a set of methods to solve the optimal value of functions. It is a model to simulate the natural selection and genetic mechanism of Darwin's biological evolution theory. Genetic algorithms can be applied to many objective optimization problems that are not suitable for conventional algorithms. It is widely used in many elds, such as machine learning, intelligent control, image processing, and pattern recognition. For example, when solving the minimum value of functions, the speci c procedure of the genetic algorithm is as follows [30].
First, an initial population for the algorithm is randomly generated. Each individual in the population is the potential solution of the problem. On the basis of the initial population, a series of new populations are generated. When a new population is generated, the following steps will be performed: (1) We calculate the corresponding objective function value of each individual (i.e., potential solution) in the current population. (2) We scale the value of the original objective function to make it into a more useable value range, as the score of each individual. (3) We select some individuals with low scores from the current population as parental individuals. (4) Some parental individuals with the lowest score are selected as "elite" individuals and copied directly into the next generation population. (5) We use the remaining parental individuals to generate o spring individuals, including mutation (directly introducing a certain random change to a parental individual to become a new individual) and hybridization (using a part of two parental individuals to form a new individual). (6) We repeat steps 1-5 and check the stop condition.
When certain conditions are met, the algorithm stops running, and the individual with the lowest score from the last generation population is selected as the nal solution. When one of the following conditions is met, the algorithm stops running, the set maximum genetic generation is reached, the objective function value meets the requirements, and the change in the optimal value of the objective function between two generations is less than the set value. e owchart of the GA method in this paper is presented in Figure 2.

Term and Parameter De nitions.
Describing the process of intersection checking and adjusting pile orientation as an optimized objective function is the core problem to realize pile orientation optimization. e coordinate system used in this paper is shown in Figure 3. It is the right-hand Cartesian coordinate system. e rotation angle refers to the angle between the projection of the pile in the x-y plane and the positive direction of the x-axis, with counterclockwise as positive. e negative direction of the y-axis is the sea side, and the positive direction of the y-axis is the land side.
All piles are divided into movable piles and xed piles. e movable pile can adjust the rotation angle and the slope of the pile, but the plane coordinates of the pile top are xed. e amount of movable piles is denoted as N v . e plane position, the rotation angle, and the slope of the xed pile are xed, and the movable pile tries to avoid intersecting with it during the optimization process. e amount of xed piles is denoted as N f . e symbol tol is used to represent the minimum allowable distance. If the minimum distance between the axes of two piles is not less than this distance, the two piles are not considered to have intersected. e preferred slope of the movable pile is determined by the results of the bent stress calculation. e stress of the bents is a ected by the slope of the pile. erefore, in the optimization process, the slope of the movable pile should be as close as possible to the preferred slope. e preferred slope is represented by the symbols slp 0 i , and the subscript i represents the preferred slope of the ith movable pile. e initial rotation angle of the movable pile gives the approximate direction of the pile, and the value is limited to four cases: 0°, 90°, 180°, and 270°. For batter piles along the cross section direction, the initial rotation angle is 90°or 270°. For longitudinal coupled batter piles, the initial angle is 0°or 180°. e rotation angle of the pile on the plane also a ects the stress of the bent. erefore, in principle, in the process of adjusting the pile orientation, the rotation angle of the movable pile should also be as close to the initial rotation angle as possible. e initial rotation angle is represented by the symbol agl 0 i , and the subscript i represents the initial rotation angle of the ith movable pile.
For the purpose of avoiding pile intersection, the larger the slope value is, the less likely the pile intersection will occur; however, from the perspective of structural stress, Advances in Civil Engineering the smaller the slope is, the greater the batter pile can play a role. Since it is obtained from the stress calculated for the bent, the preferred slope is generally the lower bound of the slope. However, to ensure that the preferred slope can be selected by individuals randomly generated by the algorithm, generally speaking, the lower bound of the slope can be taken as the preferred slope minus of 0.5. e upper bound of the slope is usually 15. ere is no essential di erence between the batter pile with 15 : 1 and the vertical pile in engineering. Generally, the rotation angle can fully meet the requirements of the di erence between it, and the initial rotation angle is within 30°clockwise or counterclockwise. Of course, it can also take the initial rotation angle as the center and 30°on both sides as the value range. However, this is not the usual way. e reason is that, to improve the structural segment for a better stress state along the direction of the wharf front, it is usually designed to ensure that the batter pile of a structural segment rotates both clockwise and counterclockwise. If the initial angle is centered and both sides can be rotated, the algorithm is likely to rotate the batter pile of a structural segment in the same direction. en, the slope does not have to be adjusted. If piles in a structural segment turn clockwise and counterclockwise, there must be two piles with opposite tips. e slope will almost certainly have to be adjusted to avoid pile intersection. However, when the slope is changed, the objective function increases even more. erefore, to avoid adjusting the slope, the algorithm is more likely to rotate the pile in the same direction.
To check whether two piles intersect, it is necessary to calculate the minimum distance between any two space segments with nite length and determine whether they intersect according to the speci ed minimum allowable distance.
is function is referred to as the intersection check function. e form of the intersection check function is as follows: where p 1 and p 2 are the position information vectors of two piles, and tol is the minimum allowable distance. If two piles intersect, C 1; otherwise, C 0. e details of this function are described in the next section.

e Check Function for Pile
Intersection. e input parameters of the check function for pile intersection include information of two piles, i.e., the plane position of the pile top, the elevation of the pile top and the bottom, the rotation angle, and the slope, as well as the minimal allowable distance. To reduce the matrix operation as much as possible, the check of whether piles are intersected or not is implemented in several steps ( Figure 4). It is assumed that the line segments of the two piles are P 1 P 2 and Q 1 Q 2 , where P 1 and Q 1 are pile tops. e straight lines on which the two piles are located are l P and l Q , respectively. e pile radii are r P and r Q , and the projection lengths of the two piles on the horizontal plane are L P and L Q , respectively.
(1) First, the straight-line distance |P 1 Q 1 | between two pile tops is calculated. If the distance |P 1 Q 1 | is greater than the sum of the lengths of the two piles projected on the plane, L P and L Q , their radius, r P and r Q , and the minimal allowable distance tol, they must not be intersected. It is estimated that this situation should account for approximately half of the total amount of checks. (2) If the rst step fails, the second step is calculated in three cases. Case 1: One of the piles is vertical (if both piles are vertical, they will be ltered out in the rst step). It is assumed that P 1 P 2 is a vertical pile. en, an intersection point P is calculated. It is between the common perpendicular line of straight lines l P and l Q and the straight line l Q . If point P is within the line segment Q 1 Q 2 , the distance between point P and the projection point of the vertical pile on the plane is calculated. Otherwise, the distances from Q 1 and Q 2 to l 1 are compared, and the closer pile is chosen (it is assumed that the vertical pile is in nitely long, since one pile is not allowed to drill under the other pile in practical engineering). Case 2: Two batter piles are parallel. A plane is constructed by taking the straight-line direction of the pile as normal.
en, the intersection points between the plane and the two piles are found, and the distance between the two intersection points is calculated. Case 3: e two batter piles are not parallel. is situation is complicated. To calculate the distance of two spatial line segments, the common perpendicular line of the straight lines l P and l Q should be found rst. en, the intersections of the common perpendicular line and the straight lines l P and l Q are calculated. e intersections are A and B, respectively. ere will be three scenarios: (a) both intersections are within the corresponding line segment of the piles. In this case, the distance |AB| is  calculated. (b) Only one point is within the line segment of the pile. We suppose A is on the corresponding line segment P 1 P 2 , and the endpoint of another pile closest to B is C. en, the distance from point C to line l 1 is calculated. (c) A and B are not on the line segments of corresponding piles. e distances between the endpoints of the two piles are calculated, and the smallest distance is chosen.

Objective Function
. p i is used to represent the vector containing the information of the ith pile. e movable pile information includes the plane position of the pile top, the elevation of the pile top and bottom, the pile radius, the preferred slope, the initial rotation angle, ranges of the slope, and the rotation angle. e xed pile information includes the plane position of the pile top, the elevation of the pile top and bottom, the pile radius, the slope, and the rotation angle. When i ≤ N y , p i represents the movable pile, and when i > N y , p i represents the xed pile. e variables to be optimized include the slope and the rotation angle of the movable piles. e symbols slp i and agl i are used to represent the slope and the rotation angle of the ith movable pile, respectively. When there are N y movable piles and N f xed piles, the objective function of the pile orientation is de ned as follows:

Advances in Civil Engineering
S � w c N c + w s D s + w a D a . (2) In equation (2), S is the objective function value of the current state, and N c is the amount of pile intersections, which is calculated according to equation (3) as follows: D s is the slope change, which is calculated according to equation (4) as follows: D a is the rotation angle change, calculated according to equation (5) as follows: w c w c , w s , and w a in equation (2) are three weight values, which are used to determine the priority of events that should be avoided in the process of pile orientation adjustment. e greater weight value corresponds to the event that should be avoided more. ere are three events involved in the objective function: one is the N c pile intersection, the slope change amount D s , and the rotation angle change amount D a . In the three events, pile intersection should be avoided first, and pile slope adjustment should be avoided second. erefore, w c should be the largest, w s the second largest, and w a the smallest. How should these three weights be taken? First, from the construction of the function, it does not matter what the values of the three weights are, what matters is the ratio of them. If the value increase of the objective function caused by the 1°rotation angle adjustment of each pile does not exceed that caused by one pile intersection, the algorithm will choose to change the rotation angle instead of one pile intersection. Second, the proportion of the three weights is related to the amount of movable piles. e differences among the three weights increase with the increase in the amount of movable piles. e more movable piles there are, the greater the value increase of the objective function caused by adjusting the pile orientation. We further analyze this later.

Parameter Setting for the Algorithm.
e operation of the genetic algorithm needs to set some parameters. e mutation probability of the population between two generations is 0.15. If this number is too large, the objective function value will be unstable, and if it is too small, the population will be too stable. is number is currently an empirical value. e mutation methods include uniform mutation and adaptive mutation. e uniform mutation is performed in two steps. In the first step, the algorithm selects some values from an individual for mutation. For example, three components of a 1 × 7 vector might be chosen for variation. e second step is to randomly change the number used for variation within the value boundary according to the mutation probability. Adaptive mutation is selected in this study. A variation direction is generated using the previous generation objective function. If the previous generation let the objective function value decrease, it follows this direction. Otherwise, it follows the opposite direction. A mutation step length is generated if the constraints are satisfied. en, the step length is multiplied by the direction to obtain a vector, which is added to the original vector to generate the mutation individual. e constraint condition is the value range of the specified slope and the rotation angle. e stop condition is set to reach the maximum genetic generation, or the variation in the optimal value of the objective function between two generations is less than 1 × 10 −5 .
To facilitate construction, after the optimization is finished, the final value is rounded according to a certain modulus. For example, the rotation angle is rounded by 0.5°, and the slope is rounded by 0.25. After rounding, another checking calculation for pile intersection is conducted. If there is no pile intersection, the rounding is successful, and the rounded value is returned. Otherwise, the original value directly obtained by the algorithm is returned, in which case the value is a fragmentary number.

Algorithm Performance Analysis
Because the initial population generated by the genetic algorithm is random, the optimal solution given by the algorithm is slightly different each time. e final result is also affected by the population number to some extent. Of course, if the computation time can be tolerated, it is better to generate larger populations. To study the influence of the initial population on the result of the optimal solution, virtual cases with a total of 61 piles and 20 movable piles were constructed. Initial populations are randomly generated for 10 times, and the population number is 200. After 20 generations, the optimization results were compared ( Figure 5). It can be seen that the average value of the objective function changes greatly. Although there are differences in the optimal value obtained each time, it is relatively small. Except for a few times, the slope of the optimal solution changes a little in most cases ( Figure 6). For the movable pile with the largest slope change, the optimized minimum slope is 4.0 and the maximum slope is 7.5. e ten optimized rotation angles differ considerably, with a maximum difference of 26.5 o (Figure 7). However, these are within the allowable range of the design.
To analyze the influence of the population size on the optimal solution, virtual cases are constructed, with a total of 76 piles. e amounts of movable piles are 10, 20, 30, and 40 and represented as N v . e population is 5, 10, 15, and 20 times that of the movable pile. To reduce the influence of the randomly generated initial population, the population is randomly generated three times in each case, and the final objective function takes the average of the three optimizations. e optimal value of the objective function is shown in Figure 8. e optimal value of the objective function basically decreases with the increasing population. If the population is more than 10 times the movable pile amount, the optimal value of the objective function changes slightly. When the population size is 15-20 times the movable pile amount, the optimal value of the objective function is basically unchanged.
To study the in uence of genetic generations on the optimization results, virtual cases are constructed, with 76 piles and 10, 20, 30, and 40 movable piles. e population size is 10 times that of movable piles, and the genetic generations are 2, 5, 8, and 15 times those of movable piles. To reduce the in uence of the randomly generated initial population, the population is randomly generated three times in each case, and the nal objective function takes the average of the three optimizations. e optimal value of the objective function is shown in Figure 9. It can be seen that the optimal value of the objective function decreases with the increase in genetic generations. When the genetic generation is 8 times the movable pile amount, the change in the optimal value of the objective function is very small. A similar conclusion can be obtained by keeping 20 movable piles unchanged and changing the total amount of piles ( Figure 10).
According to the de nition of equation (2), the objective function is the sum of the three parts. e rst part is the   Advances in Civil Engineering count of the pile intersection check, which is directly proportional to the product of the amount of movable piles and the total amount of piles. erefore, when the total amount of piles is constant, the computational complexity of the rst part relative to the amount of movable piles is O(n). e second and the third parts are O(n) as seen directly from equations (4) and (5). erefore, when the total amount of piles remains constant, the computational complexity of the algorithm is O(n) relative to the amount of movable piles, and the running time of the algorithm should be linear with the amount of movable piles. For the total amount of piles, the computation complexity of the rst part is O(n), and the second and third parts are not directly related to the total amount of piles. erefore, when the amount of movable piles is constant, the running time of the algorithm should be linear with the total amount of piles.
If the population is M and the genetic generation is P, the genetic algorithm needs to complete M × P computations of the objective function. e computational complexity of the algorithm relative to the population and the genetic generation is O(n). erefore, theoretically, the running time of the algorithm is linear with the amount of populations and genetic generations.
Based on 20 movable piles, 76 total piles, 100 populations, and 100 genetic generations, pile orientation optimization simulations are carried out by changing one parameter individually each time, and the relationship between the computation consumption time and the total pile amount, movable pile amount, populations, and genetic generations is statistically analyzed, as shown in Figure 11.
is result is consistent with the conclusion of the previous analysis. Of course, this time is not entirely the running time of the genetic algorithm, including the time of preprocessing and postprocessing. However, the time of this part is basically xed. erefore, it does not a ect the law of computational complexity. e con guration of the running computer is as follows: Intel (R) core (TM) i7-10510U CPU@1.80 GHz and 2.30 GHz processor, 16.0 GB RAM, and 64 bit Windows 10 professional operating system.
To study the values of the three weight coe cients, it is necessary to know the average slope change and the rotation angle change in the actual optimization process. A large amount of data has been accumulated in the research process of previous problems. Actual optimization data of 15 times with 20∼40 movable piles are randomly selected as samples. It can be concluded that the average change in the slope of the movable pile is 0.32, and the average change in the rotation angle is 12.6°. If there are N v movable piles, the sum of slope changes is approximately 0.32N v and the sum of rotation angle changes is approximately 12.6N v . Based on this result, to give priority to the rotation angle change over the slope change, the ratio w s /w a should not be less than 12.6/0.32 ≈ 40. For pile intersections, because any pile intersection is not allowed, the increase in the objective function caused by any pile intersection should be greater than the sum of it caused by the slope change and the rotation angle change that may occur. erefore, the weight w c of the pile intersection should not be less than 2 × 12.6 N v 25.2 N v . In conclusion, for the N v movable piles, if w a 1, w s shall not be less than 40 and w c shall not be less than 25.2 N v . Otherwise the objective function may fail. rough practice, for approximately 100 movable piles, the recommended values of w c , w s , and w a can be 1000, 4, and 0.001, respectively.

Case 1.
is case is a general wharf project in the Guangli port area of Dongying Port. e wharf is a 10000ton pile-supported beam slab structure. e top elevation of the wharf is 5.5 m, and the water depth of the front is −10.0 m. e front and rear bearing platform is adopted. e   Advances in Civil Engineering bent spacing of the front bearing platform is 7 m, and PHC piles with a diameter of 0.8 m are used. e bent spacing of the rear bearing platform is 4.0 m and 3.5 m, and the PHC piles with a diameter of 0.8 m and cast-in-place piles with a diameter of 1.0 m are adopted. e project belongs to the type that front and rear bents do not correspond to. For example, with the 14th structural segment of the project, a row of piles on the land side of the front bearing platform must be arranged, which are circled in Figure 12.
e preferred slope for this row of piles is 3 : 1. Because the bent spacing at the junction of structural segments is small and it is difficult to arrange piles, a bent on the leftmost side of structural segment 15 is also added. In addition, since the arrangement of the bent of the front and the rear bearing platform in this example does not correspond, each pile must be considered. erefore, the workload of pile orientation adjustment is very large.
Using the genetic algorithm established above, a population of 100 is generated. After approximately 105 generations of inheritance, the program gives appropriate pile layout suggestions (Figure 13). e pile orientations recommended by the program are shown in Figure 13. When comparing Figures 12 and 13, it can be seen that the pile on the rightmost side of the 14th structural segment in Figure 12 is a vertical pile. e initial pile layout is manually designed and the bent spacing at the junction of structural segments is small. Under the condition that the pile layout work is very cumbersome, it is difficult for the designer to find an appropriate pile orientation for this pile. erefore, a vertical pile is simply used. However, the adjustment algorithm for pile orientations finds appropriate orientations for all piles.

Case 2.
is case is the auxiliary working ship berth of an LNG wharf in the south port area of Tianjin Port. e wharf top elevation is 6.0 m, and the water depth of the front is −7.0 m. e form of the front bearing platform and the approaching bridge is adopted. e bent spacing of the front bearing platform is 7.3 m, and prestressed concrete hollow square piles with a diameter of 650 mm × 650 mm are adopted. In this case, a large number of piles need to be arranged. From the cross section, the two opposite batter piles circled in Figure 14 need to be arranged. According to the stress calculation of the bents, the preferred slope of the two batter piles is 4 : 1. In addition, from the plane, it is also necessary to arrange longitudinal coupling batter piles ( Figure 15). erefore, it is difficult to arrange piles.

Conclusions
To solve the pile intersection problem caused by a large number of batter piles in pile-supported wharfs and optimized pile orientations, the optimization objective function is designed considering the priority order of slope adjustment, rotation angle adjustment, and avoiding pile intersection. Based on a genetic algorithm, the automatic adjustment of pile orientations is realized, and the performance of the algorithm is analyzed and discussed. e optimization results of the genetic algorithm established in this study are a ected by the initial population to some extent. erefore, the pile layout suggestions given by the algorithm are slightly di erent each time. However, it generally meets the basic requirement of avoiding pile intersections.
To obtain more ideal optimization results, the population should increase with the amount of movable piles. e ratio of the population to the amount of movable piles is ideal when it is 10-20. A larger ratio can approach the optimal solution with greater probability, but it can also increase the running time.
e three weight values of the objective function themselves are not important, but their proportion is important.
eir proportion is related to the amount of movable piles. e di erence between them increases with the increase in the amount of movable piles. e running time of the algorithm is linear with the amount of movable piles, the total amount of piles, the population amount, and the genetic generation.
It is used in pile orientation adjustments of two actual cases to obtain satisfactory pile orientation results in a few minutes, and in one of the cases, the appropriate pile orientation arrangement cannot be obtained after many attempts.  Advances in Civil Engineering 11

Nomenclature
S: e objective function of pile orientations w c , w s , w a : e weight values of pile intersections, slope change, and rotation angle change, respectively N c : e amount of pile intersections D s : e slope change D a : e rotation angle change r P , r Q : Pile radii L P , L Q : e projection length of two piles on the horizontal plane.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest.