Game hero outgoing recommendation method and system based on multi-objective optimization
Technical Field
The invention relates to the technical field of mobile phone games and optimization algorithms, in particular to a game hero export recommendation method and system based on multi-objective optimization.
background
The dota hand game is always favored by the majority of game players. For example, the game playing method is mainly competitive competition, such as the dota-like hand game, Rong Yao of Wang Dynasty, which is released from the next American studio of Tengxin flags. In the game, 53 kinds of three-level equipment (top-level equipment) are shared, the attributes of the equipment are different, and the appearances of game heros with different attributes in the game are also different. In the game, 6 kinds of accessories can be purchased by each hero, and all accessories are matched in 22, 957 and 480 kinds. At present, the in-game system provides 3-out-of-package recommendations for each game hero, but the three out-of-package recommendations cannot meet the requirements of players for different game lineups.
Disclosure of Invention
The invention aims to provide a game hero export recommendation method and system based on multi-objective optimization, so that the attack capability and defense capability of the game hero are maximized.
in order to achieve the purpose, the invention provides the following scheme:
A game hero outgoing recommendation method based on multi-objective optimization comprises the following steps:
Acquiring a game hero attribute table and an equipment attribute table; the game hero attribute table and the equipment attribute table are in table forms; the first column of the game hero attribute table is a game hero category, the second column of the game hero attribute table is a physical attack value of the game hero, the third column of the game hero attribute table is a legal attack value of the game hero, the fourth column of the game hero attribute table is a physical defense value of the game hero, and the fifth column of the game hero attribute table is a legal defense value of the game hero; the first column of the equipment attribute table is an equipment number, the second column of the equipment attribute table is an equipment name, the third column of the equipment attribute table is a physical attack value of the equipment, the fourth column of the equipment attribute table is a legal attack value of the equipment, the fifth column of the equipment attribute table is a physical defense value of the equipment, and the sixth column of the equipment attribute table is a legal defense value of the equipment;
Generating an iterative population according to the game hero attribute table and the equipment attribute table; the iteration population comprises M individuals representing the game hero loading recommendation scheme, and the game heros represented by all the individuals are in the same category; each individual comprises 6 sets of equipment which are different from each other, and the structural form of each individual is an array form of 6 rows and 5 columns; wherein one row of the individual represents the number and attributes of one piece of equipment, each row of the individual comprises 5 elements, namely an equipment number, a physical attack value of the equipment, a legal attack value of the equipment, a physical defense value of the equipment and a legal defense value of the equipment;
Calculating the fitness value of each individual in the iterative population according to the constructed multi-target fitness function, and recording the current iteration times; the multi-target fitness function is used for calculating the sum of an attack value and a defense value of the hero of the game;
judging whether the current iteration number is smaller than a preset iteration total number or not to obtain a first judgment result;
if the first judgment result shows that the current iteration times are not less than the preset iteration total number, determining the individual with the largest fitness value as the loading recommendation scheme of the hero game;
If the first judgment result shows that the current iteration times are smaller than the preset iteration total number, adding 1 to the current iteration times, then carrying out cross variation operation on individuals in the iteration population corresponding to the current iteration times to generate new individuals, and calculating the fitness value of each new individual according to the multi-target fitness function; the total number of the new individuals is M;
And adding all the new individuals into the iteration population corresponding to the current iteration times to update the iteration population, sequencing the individuals in the updated iteration population according to the fitness value of each individual in the updated iteration population, selecting the first M individuals as the iteration population of the next generation, then returning to the step of calculating the fitness value of each individual in the iteration population according to the established multi-target fitness function, and recording the current iteration times.
optionally, the game hero shipment recommendation method further includes:
Reserving an iteration population corresponding to the current iteration times which is not less than the preset iteration total;
Calculating a first target value and a second target value of each individual in the retained iteration population; the first target value is an attack value of game hero, and the second target value is a defense value of game hero;
Calculating a third target value of each individual in the retained iteration population; the third target value is a ratio of the first target value to the second target value;
and taking the third target value of each individual as a sorting standard, and sorting the retained individuals in the iterative population in a descending order.
Optionally, the calculation formula of the first target value isthe second target value is calculated by the formulaXmIt means that the m-th individual is,i represents the number of rows of the mth individual; w is a1、w2、w3、w4The physical attack value, the legal attack value, the physical defense value, and the legal defense value of the hero game represented by the mth individual are shown.
optionally, the multi-objective fitness function is F (X)m)=f1(Xm)+f2(Xm)。
Optionally, the generating an iterative population according to the game hero attribute table and the equipment attribute table specifically includes:
And generating an individual by adopting a coding mode according to the game hero attribute table and the equipment attribute table, and randomly initializing to obtain an iterative population comprising M individuals.
optionally, the adding all the new individuals into the iteration population corresponding to the current iteration number to update the iteration population, ranking the individuals in the updated iteration population according to the fitness value of each individual in the updated iteration population, and selecting the first M individuals as the iteration population of the next generation specifically includes:
adding all the new individuals into the iteration population corresponding to the current iteration times to obtain an updated iteration population; the number of updated iteration population is 2M;
According to the fitness value of each individual in the updated iteration population, adopting a Pareto domination algorithm to conduct domination selection on the individuals in the updated iteration population;
And sequencing the individuals subjected to domination selection, and selecting the first M individuals as the iteration population of the next generation.
A game hero outgoing recommendation system based on multi-objective optimization comprises:
the information acquisition module is used for acquiring a game hero attribute table and an equipment attribute table; the game hero attribute table and the equipment attribute table are in table forms; the first column of the game hero attribute table is a game hero category, the second column of the game hero attribute table is a physical attack value of the game hero, the third column of the game hero attribute table is a legal attack value of the game hero, the fourth column of the game hero attribute table is a physical defense value of the game hero, and the fifth column of the game hero attribute table is a legal defense value of the game hero; the first column of the equipment attribute table is an equipment number, the second column of the equipment attribute table is an equipment name, the third column of the equipment attribute table is a physical attack value of the equipment, the fourth column of the equipment attribute table is a legal attack value of the equipment, the fifth column of the equipment attribute table is a physical defense value of the equipment, and the sixth column of the equipment attribute table is a legal defense value of the equipment;
the iterative population generating module is used for generating an iterative population according to the game hero attribute table and the equipment attribute table; the iteration population comprises M individuals representing the game hero loading recommendation scheme, and the game heros represented by all the individuals are in the same category; each individual comprises 6 sets of equipment which are different from each other, and the structural form of each individual is an array form of 6 rows and 5 columns; wherein one row of the individual represents the number and attributes of one piece of equipment, each row of the individual comprises 5 elements, namely an equipment number, a physical attack value of the equipment, a legal attack value of the equipment, a physical defense value of the equipment and a legal defense value of the equipment;
the fitness value calculation module is used for calculating the fitness value of each individual in the iterative population according to the constructed multi-target fitness function and recording the current iteration times; the multi-target fitness function is used for calculating the sum of an attack value and a defense value of the hero of the game;
The judging module is used for judging whether the current iteration times are smaller than the preset iteration total number or not to obtain a first judging result;
the game hero outgoing recommendation scheme determining module is used for determining the individual with the largest fitness value as the outgoing recommendation scheme of the game hero when the first judgment result shows that the current iteration times are not less than the preset iteration total number;
The cross variation operation module is used for adding 1 to the current iteration times when the first judgment result shows that the current iteration times are smaller than the preset iteration total number, then carrying out cross variation operation on individuals in the iteration population corresponding to the current iteration times to generate new individuals, and calculating the fitness value of each new individual according to the multi-target fitness function; the total number of the new individuals is M;
and the iteration population updating module is used for adding all the new individuals into the iteration population corresponding to the current iteration times to update the iteration population, sequencing the individuals in the updated iteration population according to the fitness value of each individual in the updated iteration population, selecting the first M individuals as the iteration population of the next generation, and then returning to the fitness value calculating module.
optionally, the game hero shipment recommendation system further includes:
The reservation module is used for reserving the iteration population corresponding to the current iteration times which are not less than the preset iteration total number;
The first target value and second target value calculation module is used for calculating a first target value and a second target value of each individual in the reserved iteration population; the first target value is an attack value of game hero, and the second target value is a defense value of game hero;
the third target value calculation module is used for calculating a third target value of each individual in the reserved iteration population; the third target value is a ratio of the first target value to the second target value;
And the descending order arrangement module is used for taking the third target value of each individual as an ordering standard and arranging the retained individuals in the iteration population in a descending order.
optionally, the iterative population generation module specifically includes:
and the iteration population generating unit is used for generating an individual according to the game hero attribute table and the equipment attribute table by adopting a coding mode and randomly initializing to obtain an iteration population comprising M individuals.
optionally, the iterative population updating module specifically includes:
the updating unit is used for adding all the new individuals into the iteration population corresponding to the current iteration times to obtain an updated iteration population; the number of updated iteration population is 2M;
The domination selection unit is used for carrying out domination selection on the individuals in the updated iteration population by adopting a Pareto domination algorithm according to the fitness value of each individual in the updated iteration population;
And the individual selection unit is used for sequencing the individuals subjected to domination selection, selecting the first M individuals as the iteration population of the next generation, and jumping to the fitness value calculation module.
according to the specific embodiment provided by the invention, the invention discloses the following technical effects:
The invention provides a game hero export recommendation method and system based on multi-objective optimization.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings without inventive exercise.
FIG. 1 is a schematic flow chart of a game hero export recommendation method based on multi-objective optimization according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of a game hero export recommendation system based on multi-objective optimization according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart of a game hero export recommendation method of Wang Rong Yao based on multi-objective optimization according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of an embodiment of the present invention;
FIG. 5 is a schematic diagram of the crossover operation of the genetic algorithm according to an embodiment of the present invention;
FIG. 6 is a diagram illustrating a genetic algorithm variant operation according to an embodiment of the present invention.
Detailed Description
the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
the invention aims to provide a game hero export recommendation method and system based on multi-objective optimization, so that the attack capability and defense capability of the game hero are maximized.
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
Example one
as shown in fig. 1, the method for recommending game hero shipment based on multi-objective optimization according to the present embodiment includes the following steps.
step 101: acquiring a game hero attribute table and an equipment attribute table; the game hero attribute table and the equipment attribute table are in table forms; the first column of the game hero attribute table is a game hero category, the second column of the game hero attribute table is a physical attack value of the game hero, the third column of the game hero attribute table is a legal attack value of the game hero, the fourth column of the game hero attribute table is a physical defense value of the game hero, and the fifth column of the game hero attribute table is a legal defense value of the game hero; the equipment attribute table comprises an equipment attribute table, an equipment protection table and an equipment protection table, wherein the first column of the equipment attribute table is an equipment number, the second column of the equipment attribute table is an equipment name, the third column of the equipment attribute table is a physical attack value of the equipment, the fourth column of the equipment attribute table is a legal attack value of the equipment, the fifth column of the equipment attribute table is a physical protection value of the equipment, and the sixth column of the equipment attribute table is a legal protection value of the equipment.
the specific process of step 101 is: at present, 93 game heroes and 53 three-level equipment (top-level equipment) are arranged in a game, and in order to fully exert the maximum performance of each equipment, the embodiment only reserves 4 attributes of the game heroes and the equipment, namely physical attack, legal attack, physical defense and legal defense. The remaining attributes of the equipment are converted into physical attack, legal attack, physical defense and legal defense, the converted equipment attributes are shown in table 1, and the game hero attributes are shown in table 2.
TABLE 1 converted Equipment Attribute
TABLE 2 Game hero Attribute
step 102: generating an iterative population according to the game hero attribute table and the equipment attribute table; the iteration population comprises M individuals representing the game hero loading recommendation scheme, and the game heros represented by all the individuals are in the same category; each individual comprises 6 sets of equipment which are different from each other, and the structural form of each individual is an array form of 6 rows and 5 columns; wherein, a row of the individual represents the number and the attribute of one equipment, and each row of the individual comprises 5 elements which are respectively the equipment number, the physical attack value of the equipment, the legal attack value of the equipment, the physical defense value of the equipment and the legal defense value of the equipment.
Step 102 specifically includes:
And generating an individual by adopting a coding mode according to the game hero attribute table and the equipment attribute table, and then performing random initialization to obtain an iterative population comprising M individuals.
Each game hero can purchase 6 pieces of equipment within the game, and since the active or passive skills of the equipment are unique, it is wasteful to have the same equipment appear multiple times. Therefore, the length 6 symbol code is adopted in this embodiment, 53 equipment numbers are already provided in table 1, a valid code is a non-repeated number combination numbered from 1 to 53, such as 2-17-18-44-36-45 (the loading recommendation is resistant boot, shadow axe, army breaking, ice mark holding, anti-injury stabbing nail, and sagger's shelter) is a valid code, and 2-2-2-2 (the loading recommendation is resistant boot, and resistant boot) is an invalid code. The structure form of one individual body adopts a 6 x 5 two-dimensional array form, and isXmRepresents the m-th individual; wherein, Xmthe first column of (A) represents the equipment number, and the remaining columns represent the physical attack, legal attack, physical defense, legal defense values in Table 1, namely XmEach row of (a) is a detail of the equipment.
And then, randomly initializing to generate an iterative population with the population size of M by using the individual coding mode.
step 103: calculating the fitness value of each individual in the iterative population according to the constructed multi-target fitness function, and recording the current iteration times; the multi-target fitness function is used for calculating the sum of the attack value and the defense value of the hero of the game.
The game hero in the game can select different equipment according to own square and friend square array capacity, and the attack value of the game hero is considered from two aspects, and the defense value of the game hero is considered from two aspects. The invention maximizes the attack value and defense value of the hero game through a multi-objective optimization algorithm.
Step 104: judging whether the current iteration number is smaller than a preset iteration total number or not to obtain a first judgment result; if the first judgment result indicates that the current iteration number is not less than the preset iteration total number, executing step 105; if the first determination result indicates that the current iteration number is smaller than the preset iteration total number, step 106 is executed.
step 105: and determining the individual with the maximum fitness value as the output recommendation scheme of the hero game.
Step 106: adding 1 to the current iteration times, then carrying out cross variation operation on individuals in the iteration population corresponding to the current iteration times to generate new individuals, and calculating the fitness value of each new individual according to the multi-target fitness function; the total number of new individuals is M.
step 107: adding all the new individuals into the iteration population corresponding to the current iteration times to update the iteration population, sequencing the individuals in the updated iteration population according to the fitness value of each individual in the updated iteration population, selecting the first M individuals as the iteration population of the next generation, and then returning to the step 103.
Step 107 specifically includes:
Adding all the new individuals into the iteration population corresponding to the current iteration times to obtain an updated iteration population; the number of updated iteration populations is 2M.
And carrying out domination selection on the individuals in the updated iteration population by adopting a Pareto domination algorithm according to the fitness value of each individual in the updated iteration population.
And (4) sorting the individuals subjected to domination selection, selecting the first M individuals as the iteration population of the next generation, and then returning to the step 103.
in order to make the shipment characteristics recommended by the embodiment more clear, the embodiment reprocesses the iterative population with the size of M individuals after the evolution is finished on the basis of combining the characteristics of the game hero attribute and the equipment attribute, so as to provide a shipment recommendation scheme of more game heros for the player.
the game hero outgoing recommending method further comprises the following steps:
and reserving the iteration population corresponding to the current iteration times which is not less than the preset iteration total.
Calculating a first target value and a second target value of each individual in the retained iteration population; the first target value is an attack value of the game hero, and the second target value is a defense value of the game hero. The first target value is calculated by the formulaThe second target value is calculated by the formulaXmit means that the m-th individual is,i represents the number of rows of the mth individual; w is a1、w2、w3、w4The physical attack value, the legal attack value, the physical defense value, and the legal defense value of the hero game represented by the mth individual are shown.
calculating a third target value of each individual in the retained iteration population; the third target value is a ratio of the first target value to the second target value. Wherein, the larger the ratio is, the higher the attack property is, and the smaller the ratio is, the better the defense property is.
and (4) with the third target value of each individual as a sorting standard, sorting the individuals in the reserved iteration population in a descending order, and enabling the player to freely select the loading and unloading equipment of the game hero according to the individuals sorted in the descending order.
The multi-objective fitness function of step 103 is F (X)m)=f1(Xm)+f2(Xm)。
example two
As shown in fig. 2, the embodiment provides a game hero outgoing recommendation system based on multi-objective optimization, which includes:
an information obtaining module 201, configured to obtain a game hero attribute table and an equipment attribute table; the game hero attribute table and the equipment attribute table are in table forms; the first column of the game hero attribute table is a game hero category, the second column of the game hero attribute table is a physical attack value of the game hero, the third column of the game hero attribute table is a legal attack value of the game hero, the fourth column of the game hero attribute table is a physical defense value of the game hero, and the fifth column of the game hero attribute table is a legal defense value of the game hero; the equipment attribute table comprises an equipment attribute table, an equipment protection table and an equipment protection table, wherein the first column of the equipment attribute table is an equipment number, the second column of the equipment attribute table is an equipment name, the third column of the equipment attribute table is a physical attack value of the equipment, the fourth column of the equipment attribute table is a legal attack value of the equipment, the fifth column of the equipment attribute table is a physical protection value of the equipment, and the sixth column of the equipment attribute table is a legal protection value of the equipment.
An iterative population generating module 202, configured to generate an iterative population according to the game hero attribute table and the equipment attribute table; the iteration population comprises M individuals representing the game hero loading recommendation scheme, and the game heros represented by all the individuals are in the same category; each individual comprises 6 sets of equipment which are different from each other, and the structural form of each individual is an array form of 6 rows and 5 columns; wherein, a row of the individual represents the number and the attribute of one equipment, and each row of the individual comprises 5 elements which are respectively the equipment number, the physical attack value of the equipment, the legal attack value of the equipment, the physical defense value of the equipment and the legal defense value of the equipment.
The fitness value calculating module 203 is used for calculating the fitness value of each individual in the iterative population according to the constructed multi-target fitness function and recording the current iteration times; the multi-target fitness function is used for calculating the sum of the attack value and the defense value of the hero of the game.
The determining module 204 is configured to determine whether the current iteration number is smaller than a preset iteration total number, so as to obtain a first determination result.
and the game hero outgoing recommendation scheme determining module 205 is configured to determine, when the first determination result indicates that the current iteration number is not less than the preset iteration total number, the individual with the largest fitness value as the outgoing recommendation scheme of the game hero.
A cross variation operation module 206, configured to, when the first determination result indicates that the current iteration number is smaller than the preset iteration total number, add 1 to the current iteration number, then perform cross variation operation on individuals in an iteration population corresponding to the current iteration number to generate new individuals, and calculate a fitness value of each new individual according to the multi-target fitness function; the total number of new individuals is M.
An iteration population updating module 207, configured to add all the new individuals to the iteration population corresponding to the current iteration number to update the iteration population, rank the individuals in the updated iteration population according to the fitness value of each individual in the updated iteration population, select the first M individuals as the iteration population of the next generation, and then return to the fitness value calculating module 203.
In order to make the shipment characteristics recommended by this embodiment more clear, this embodiment reprocesses the iterative population with the size of M individuals after the evolution is finished, so as to provide more shipment selection schemes for the player, on the basis of combining the characteristics of the game hero attribute and the equipment attribute, so the game hero shipment recommendation system provided by this embodiment further includes:
And the reservation module is used for reserving the iteration population corresponding to the current iteration times which is not less than the preset iteration total number.
the first target value and second target value calculation module is used for calculating a first target value and a second target value of each individual in the reserved iteration population; the first target value is an attack value of the game hero, and the second target value is a defense value of the game hero.
the third target value calculation module is used for calculating a third target value of each individual in the reserved iteration population; the third target value is a ratio of the first target value to the second target value. A larger ratio indicates a higher attack property, and a smaller ratio indicates a better defense property.
and the descending order arrangement module is used for taking the third target value of each individual as an ordering standard and arranging the retained individuals in the iteration population in a descending order.
Wherein the first target value is calculated by the formulaThe second target value is calculated by the formulaXmit means that the m-th individual is,i represents the number of rows of the mth individual; w is a1、w2、w3、w4the physical attack value, the legal attack value, the physical defense value, and the legal defense value of the hero game represented by the mth individual are shown.
The multi-target fitness function in the fitness value calculation module 203 is F (X)m)=f1(Xm)+f2(Xm)。
The iterative population generation module 201 specifically includes:
and the iteration population generating unit is used for generating an individual according to the game hero attribute table and the equipment attribute table by adopting a coding mode and randomly initializing to obtain an iteration population comprising M individuals.
The iterative population updating module 207 specifically includes:
The updating unit is used for adding all the new individuals into the iteration population corresponding to the current iteration times to obtain an updated iteration population; the number of updated iteration populations is 2M.
And the domination selection unit is used for carrying out domination selection on the individuals in the updated iteration population by adopting a Pareto domination algorithm according to the fitness value of each individual in the updated iteration population.
and the individual selection unit is used for sequencing the individuals subjected to domination selection, selecting the first M individuals as the iteration population of the next generation, and skipping to the fitness value calculation module 203.
EXAMPLE III
As shown in fig. 3, the method for recommending hero play of game "royal glory" based on multi-objective optimization in this embodiment includes the following steps:
step 1, hero and equipment attributes are converted; the conversion process is the same as step 101 in the first embodiment, and the description is not repeated here.
step 2, randomly initializing a population; according to the uniqueness of 6 pieces of equipment purchased by each hero in the game of Wang Rong and the active or passive skills of each equipment, the effective code of one individual is a non-repeated symbol code with the length of 6, and in consideration of the equipment properties, the embodiment adopts the code form in the step 102 of the embodiment and randomly generates 100 symbol codes with the length of 6 and the range of 1-53 to obtain the initial population. For example, in the initial population, if the individual 1 is 1-45-34-25-50-3, the individual 2 is 3-43-51-40-4-37, the individual 99 is 49-34-45-6-39-5, and the individual 100 is 23-43-50-3-53-5, the corresponding solution structure is shown in FIG. 4.
step 3, generating offspring through crossing and mutation; and performing cross variation operation on the individuals in the initial population by adopting a genetic algorithm to generate M new individuals.
in the initial population, the shipment recommendation schemes represented by individuals 1, 2, 99, and 100 are (1) book-virtual unable cane-greedy fright boots of foot-virtuous persons who have a chance on the mercy-cool-the boots of (2) cool boots-extreme cold storm-wing-secret method boots-bloody magic anger of the redemption, (99) book-virtuous persons who have a chance on the fun-virtuous persons, -sheltering of high-speed boots-overlord step boots-the overlord reassorter repacking-quick combat boots, and (100) fiery person who have a chance on the mercy-cool boots-rushing chap-quick combat boots. If the currently selected game hero is the french hero, the attribute of the game hero is W ═ 0.1,0.8,0.05, 0.05. And (4) substituting the individuals into the constructed multi-target fitness function to calculate the fitness value (target value) of each individual. Fitness values calculated for individual 1, individual 2, individual 99, and individual 100 were (1.019, 0.207), (0.463, 0.262), (0.57, 0.26), and (0.324, 0.25), respectively. Next, randomly selecting two individuals in the initial population to perform crossover and mutation on the individuals until 100 new individuals are generated, and calculating the fitness value of the new individuals.
the crossover operation is an operation of interleaving or exchanging data of two individuals at one or more positions, and the mutation operation is to randomly select a certain row of data of the individuals and replace the certain row of data in the table 1.
Assuming that the individual 1 and the individual 99 are selected as parent individuals, and a single-point crossing method is adopted, the crossing result is shown in fig. 5.
In this embodiment, in a natural situation, an individual has a certain probability of mutation, and the rule is to randomly select a certain position and replace the data that does not appear in the original individual in table 1; if the filial generation of the cross generates the repeated equipment numbers, the individual has certain variation, and the operation process is shown in fig. 6.
In the crossing and mutation, both the crossing position and the mutation position are randomly generated, the crossing probability is 100%, and the mutation probability is 5%.
Step 4, merging the populations and calculating the fitness value of the individual; and adding the new individuals into the initial population to obtain a combined population, wherein the number of the individuals of the combined population is 200.
Step 5, sorting by a Pareto algorithm, wherein the individuals sorted to the top 100 are used as the initial population of the next generation; after the cross mutation operation, two excellent individuals have a great probability of generating two excellent new individuals. The mutation operation aims to make the individual jump out of local optimality. The new individuals may be worse than the parents, the new individuals are brought into a constructed multi-target fitness function, fitness values of the new individuals are calculated and then added into the initial population, non-excellent individuals are discarded after Pareto dominates selection sorting, only the first 100 excellent individuals are reserved as the initial population of the next generation, and the initial population of the last generation is output through repeated iteration.
step 6, judging whether a termination condition is met; the termination condition is whether the current iteration number is a preset iteration total number. If yes, executing step 7, otherwise, returning to step 3.
step 7, calculating a ratio and sequencing; in the final output initial population, a first target value f of each individual is calculated1and the second purposescalar value f2Then, a first target value f is calculated for each individual1and a second target value f2The larger the ratio is, the higher the attack ability of the outbound recommendation scheme is, and the smaller the ratio is, the stronger the defense ability of the outbound recommendation scheme is.
and 8, ending. Table 3 is part of the data of the optimized legal hero shipment recommendation of this example.
Table 3: french hero shipment recommendation
The invention can recommend more loading selection schemes for the player on the basis of combining the characteristics of the hero attribute and the equipment attribute of the game.
the embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. For the system disclosed by the embodiment, the description is relatively simple because the system corresponds to the method disclosed by the embodiment, and the relevant points can be referred to the method part for description.
The principles and embodiments of the present invention have been described herein using specific examples, which are provided only to help understand the method and the core concept of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, the specific embodiments and the application range may be changed. In view of the above, the present disclosure should not be construed as limiting the invention.