Disclosure of the invention
The invention aims to provide an amphibious vehicle layout optimization method based on a self-adaptive elite genetic algorithm.
The purpose of the invention is realized as follows:
(1) acquiring the size of the amphibious vehicle and the layout space;
(2) defining layout constraint conditions of the amphibious vehicle;
(3) determining a layout objective function of the amphibious vehicle;
(4) setting initial parameters of the adaptive elite genetic algorithm;
(5) randomly generating a first-generation amphibious vehicle arrangement population code;
(6) resolving the fitness of the current individual, and storing the optimal individual as an elite individual;
(7) judging whether the maximum iteration number is reached or the average fitness reaches an expected value, if so, turning to the step (11), otherwise, turning to the step (8);
(8) the difference between all the individuals and the worst individual fitness is used as the new fitness of all the individuals;
(9) genetic selection, crossing and variation are carried out to generate a new generation of population;
(10) replacing the worst individuals of the new generation of population with elite individuals, and turning to the step (6);
(11) decoding the optimal individuals in the population of the last generation to obtain the optimal sequence of vehicle arrangement;
(12) determining the arrangement position of the amphibious vehicle by using a lowest horizontal line positioning algorithm;
(13) and finishing the arrangement of the amphibious vehicle.
The invention has the advantages that: first, the conventional genetic algorithm has a long calculation time and a slow convergence rate, and may cause degeneration in an iterative process, i.e., the average fitness of children is lower than that of parents. The introduction of the elite strategy by the adaptive elite genetic algorithm improves the above problems. For a population of size n, the best shown individuals (elite individuals) were kept prior to the selection procedure. After each genetic manipulation is completed, the worst individual is replaced with the current elite individual. Ensures that the best individuals in each generation directly enter the next generation and are not affected by genetic manipulation. The elite strategy can accelerate the convergence speed of the genetic algorithm and weaken the population degradation phenomenon in the iterative process. Secondly, in the traditional genetic algorithm, excellent individuals are selected according to the fitness, and with the increase of the number of iterations, the individual fitness difference is small, so that the advantages of the excellent individuals are reduced, and finally the excellent degree of the solution is reduced. In order to solve the above problem, before the selection operation, the original fitness is replaced by the difference value between the fitness of all individuals and the minimum fitness. For each generation of population, the basis of selection operation is the current new environment, and the situation that the competitive power of excellent individuals is weakened after multiple iterations is effectively avoided. The traditional adaptive genetic algorithm is to change the cross probability and the variation, so that the algorithm is more adaptive to the current living environment. The adaptive strategy is to adaptively change the probability of each individual being selected, namely, adjust the living environment to be more suitable for the survival of excellent individuals, thereby improving the competitiveness of the excellent individuals. Compared with the traditional adaptive genetic algorithm, the provided adaptive genetic algorithm has simple operation process, does not need to solve complex functions, and can obviously reduce the calculated amount, thereby improving the calculation efficiency of the algorithm. The invention verifies the effectiveness of the adaptive elite genetic arrangement optimization algorithm through simulation experiments.
(V) detailed description of the preferred embodiments
The invention is described in detail below with reference to the attached drawing figures:
as shown in FIG. 1, the invention discloses an amphibious vehicle layout optimization method based on a self-adaptive elite genetic algorithm. The implementation of the invention comprises the following steps:
(1) acquiring the size of the amphibious vehicle and the layout space;
the size of the related amphibious vehicle and the layout space is as follows: the rectangular arrangement space of the vehicle cabin is P, the length is L, the width is W, and n vehicles { P }existiI 1.. n }, and the length and width are liAnd wiIn the plan view of the vehicle cabin deck, the lower left corner is defined as the origin O (0,0), the upper left corner is defined as (0, L), the lower right corner is defined as (W, 0), and the rectangular vehicle PiThe top left corner vertex of (x)i1,yi1) Then P isiThe coordinate of the lower right corner is
(2) Defining layout constraint conditions of the amphibious vehicle;
the constraints involved are: two vehicles PiAnd Pj(i ≠ j) does not overlap, vehicles cannot be placed outside the arrangement space, and the height and the width of the vehicles are larger than 0, and each vehicleThere will be a maximum number limit, numrIs the number of r-th kind of vehicles arranged, NrIs the maximum number of the r-th vehicle, the constraint is as follows:
(3) determining a layout objective function of the amphibious vehicle;
the objective function involved is that the vehicle cabin deck is least unused, i.e. the sum of the layout areas occupied by the vehicle is maximum, expressed as:
(4) setting initial parameters of the adaptive elite genetic algorithm;
the initial parameters involved were: the iteration times are 100 times, the population size is 100, the cross probability is 0.9, and the variation probability is 0.15;
(5) randomly generating a first-generation amphibious vehicle arrangement population code;
the population generation involved is: the initial population is generated by using individuals corresponding to chromosomes formed by random numbers to form the initial population, the amphibious vehicle arrangement problem can be converted into a vehicle parking sequence combination optimization problem, a decimal vehicle number is selected as a coding mode, for example, the coding sequence is {1,5,2, 6,3,4}, and the vehicle is represented to park according to the sequence of numbers 1,5,2,6,3, 4;
(6) resolving the fitness of the current individual, and storing the optimal individual as an elite individual;
the involved fitness is as follows: selecting the unused rate of the deck as a fitness function;
(7) judging whether the maximum iteration number is reached or the average fitness reaches an expected value, if so, turning to the step (11), otherwise, turning to the step (8);
(8) the difference between all the individuals and the worst individual fitness is used as the new fitness of all the individuals;
(9) genetic selection, crossing and variation are carried out to generate a new generation of population;
the related selection operation adopts a roulette selection method to select individuals from parents to perform genetic operation and enter the next generation, the number of amphibious vehicles is n, and the fitness of the ith vehicle is fiThen the probability P that this vehicle is selectediComprises the following steps:
the related interleaving operation adopts a sequential interleaving method to avoid the encoding repetition, and the interleaving process of two parents is assumed as follows:
first, randomly selecting a crossover on the first parent chromosome,
secondly, the same genes on the second parent chromosome as the first chromosome are removed, and the remaining genes are arranged according to the original sequence,
thirdly, splicing the rest part of the second father chromosome and the cross part of the first father chromosome into a son chromosome according to the original sequence,
finally, a second daughter chromosome was obtained in the same manner;
the mutation operations involved are: for random chromosomes, randomly selecting two different genes on the chromosome for exchange;
(10) replacing the worst individuals of the new generation of population with elite individuals, and turning to the step (6);
(11) decoding the optimal individuals in the population of the last generation to obtain the optimal sequence of vehicle arrangement;
(12) determining the arrangement position of the amphibious vehicle by using a lowest horizontal line positioning algorithm;
(13) and finishing the arrangement of the amphibious vehicle.
Take a wasp-level amphibious aggressor ship in the United states as an example. The deck arrangement space has a length of 100 meters and a width of 20 meters. The vehicles participating in the arrangement are of four types, namely A type, B type, C type and D type, and the expansion size after considering the distance between the vehicles is as follows: the A type has the length of 6.40m and the width of 2.50m, the B type has the length of 11.00m and the width of 3.00m, the C type has the length of 9.77m and the width of 3.66m, and the D type has the length of 5.00m and the width of 4.00 m. The maximum arrangement number of the four types of vehicles is set to be 80, and the vehicles are numbered in sequence, namely A is 1-80, B is 81-160, C is 161-240, and D is 241-320.
Comparing the simulation results of the traditional genetic algorithm, the simulated annealing algorithm and the self-adaptive elite genetic algorithm. Initial parameters of two genetic algorithms are set: the iteration times are 100 times, the population size is 100, the cross probability is 0.9, and the variation probability is 0.15. Setting initial parameters of a simulated annealing algorithm: the initial temperature is 2000 ℃, the end temperature is 1 ℃, the iteration times at each temperature are 1000 times, and the temperature reduction coefficient is 0.95.
Amphibious vehicle layouts of a traditional genetic algorithm, a simulated annealing algorithm and an adaptive elite genetic algorithm are shown in fig. 2-4, respectively. The three optimization algorithms all realize automatic arrangement of the amphibious vehicle to obtain respective optimal arrangement results. A long and narrow unused deck space appears in both the middle of fig. 2 and the right side of fig. 3. Fig. 4 does not show significant unused space.
The fitness curves of the conventional genetic algorithm, the simulated annealing algorithm and the adaptive elite genetic algorithm are shown in fig. 5-7. In fig. 5-7, the fitness curve of the conventional genetic algorithm starts to decline slowly after the 10 th generation, and the fitness does not change significantly after the 10 th generation. The simulated annealing algorithm gave a better solution at the 75 th generation outer loop. The adaptive elite genetic algorithm has unobvious adaptability change after the 20 th generation, and the adaptability is slowly reduced. Theoretically, the larger the number of iterations, the better the algorithm results, but the more computation is increased. Compared with the two genetic algorithms, the simulated annealing algorithm has the advantages of higher non-utilization rate of the deck, poorer arrangement result and longest calculation time. One of the disadvantages of the simulated annealing algorithm is that the initial parameter setting is complex, and the problem solving is influenced. The two genetic algorithms can obtain better optimization performance than the simulated annealing algorithm by setting initial parameters for the first time.
The deck utilization rates of the traditional genetic algorithm, the simulated annealing algorithm and the adaptive elite genetic algorithm are 95.90%, 95.28% and 97.44% respectively, the calculation time is 140.07s, 295.29s and 136.5s respectively, and the numbers of amphibious vehicles of the type A, the type B, the type C and the type D are (56,21,7,4), (61,18,9,1) and (15,18,20,20) respectively. The deck utilization rate of the adaptive elite genetic algorithm is improved by 1.61 percent compared with that of the traditional genetic algorithm and is improved by 2.27 percent compared with that of the simulated degradation algorithm. The optimization time of the adaptive elite genetic algorithm is the shortest compared with the other two optimization algorithms. The number of vehicles in the arrangement of the three algorithms is 88, 89 and 73, respectively. The number of listings for the adaptive elite genetic algorithm is minimal because the optimization goal is to minimize the unused deck rate, rather than maximizing the number of listings. The arrangement quantity of each vehicle of the self-adaptive elite genetic algorithm is relatively close, and the actual loading requirement can be met. The arrangement quantity distribution of other two optimization algorithms is uneven and mainly focuses on the A-type vehicle, and the two optimization results are not in accordance with the actual requirements.
In conclusion, the adaptive elite genetic algorithm adopts the elite strategy to store the optimal individual of each generation, and replaces the worst individual in the population after genetic operation, so that the optimal individual can not be damaged. Meanwhile, a self-adaptive selection strategy is adopted, and the adaptability of the population is changed along with the change of the environment by making a difference with the lowest adaptability in the population, so that the adaptability of the population is improved, individuals with smaller adaptability difference are distinguished in the selection process, and the excellent degree of the solution can be improved.