CN112036567B - Genetic programming method, apparatus and computer readable medium - Google Patents

Genetic programming method, apparatus and computer readable medium Download PDF

Info

Publication number
CN112036567B
CN112036567B CN202010987598.3A CN202010987598A CN112036567B CN 112036567 B CN112036567 B CN 112036567B CN 202010987598 A CN202010987598 A CN 202010987598A CN 112036567 B CN112036567 B CN 112036567B
Authority
CN
China
Prior art keywords
individuals
preset
child
evaluation
module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010987598.3A
Other languages
Chinese (zh)
Other versions
CN112036567A (en
Inventor
张虎
刘同林
曾奕博
张恒哲
周爱民
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Electromechanical Engineering Research Institute
Original Assignee
Beijing Electromechanical Engineering Research Institute
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Electromechanical Engineering Research Institute filed Critical Beijing Electromechanical Engineering Research Institute
Priority to CN202010987598.3A priority Critical patent/CN112036567B/en
Publication of CN112036567A publication Critical patent/CN112036567A/en
Application granted granted Critical
Publication of CN112036567B publication Critical patent/CN112036567B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/12Computing arrangements based on biological models using genetic models
    • G06N3/126Evolutionary algorithms, e.g. genetic algorithms or genetic programming

Abstract

The present invention provides a genetic programming method, apparatus, and computer readable medium, the method comprising: acquiring a first preset number of first individuals, and evaluating all the first individuals by utilizing an fitness evaluation rule to obtain the fitness of each first individual; determining a first preset number of offspring individuals according to the first individuals and the genetic algorithm; evaluating all offspring individuals; if the number of the offspring individuals subjected to evaluation reaches a first preset threshold value, determining that the offspring individuals are target offspring individuals; screening a second individual according to the fitness to determine the second individual as a first individual; if the total number of the individuals which are completely evaluated is smaller than a second preset threshold value, determining a third individual and a child individual which are not completely evaluated as child individuals according to the first individual and the genetic algorithm, and performing evaluation on the child individuals; and if the total of the individuals which have completed the evaluation is not smaller than a second preset threshold value, outputting the child individuals with the highest fitness. The scheme can improve the optimization efficiency of individuals.

Description

Genetic programming method, apparatus and computer readable medium
Technical Field
The present invention relates to the field of computer technology, and in particular, to genetic programming methods, apparatus, and computer readable media.
Background
Genetic algorithms are a class of robust search algorithms that can be used for complex system optimization calculations, originating from computer simulation studies conducted on biological systems. The result of the new generation of individuals is superior to that of the father through the operations of copying, crossing, mutation and the like, and the optimal result is gradually obtained through continuous iteration. And then is widely applied to solving the problems of nonlinear optimization, image processing, automatic control, production scheduling and the like.
The efficiency refers to the capability of the system to reach a specified use target under specified conditions, the efficiency evaluation takes a certain complex system as a research object, comprehensively considers various related factors, and finally obtains the conclusive evaluation of the efficiency index of the complex system when executing a certain task through calculation. In the prior art, the problem of efficiency optimization is usually solved by using a genetic algorithm, but the traditional parallel genetic programming method needs to wait for the execution of the individual with the longest evaluation time to finish when evaluating the efficiency, so that a large amount of processor resources are in an idle state, thereby affecting the overall performance of the system, and being unfavorable for improving the optimization efficiency of the individual.
Disclosure of Invention
The invention provides a genetic programming method, a genetic programming device and a computer readable medium, which can improve the optimization efficiency of individuals.
In a first aspect, embodiments of the present invention provide a genetic programming method comprising:
acquiring a first preset number of first individuals, wherein the first preset number is not less than two;
inputting preset sample data into each first individual, and evaluating all the first individuals by using a preset fitness evaluation rule to obtain the fitness of each first individual;
determining a first preset number of offspring individuals according to the first individuals and a preset genetic algorithm;
evaluating all the child individuals by using the fitness evaluation rule, and determining whether the number of the child individuals which are evaluated reaches a preset first preset threshold value;
if the number of the child individuals which are evaluated reaches the first preset threshold value, determining the child individuals as target child individuals, wherein the first preset threshold value is smaller than the first preset number;
screening out a first preset number of second individuals from all the first individuals and all the target offspring individuals according to the sequence of the fitness from high to low, and determining the second individuals as the first individuals;
if the total number of individuals who have completed the evaluation is smaller than the second preset threshold, performing the following operations: determining a second preset number of third individuals according to the first individuals and the genetic algorithm, determining the third individuals and the child individuals which are not evaluated as the child individuals, and performing the evaluation on all the child individuals by using the fitness evaluation rule, wherein the second preset number is equal to the first preset threshold;
And if the total of the individuals which have completed the evaluation is not less than a second preset threshold value, outputting the child individuals with the highest fitness.
Optionally, the evaluating all the child individuals by using the fitness evaluation rule, and determining whether the number of child individuals that complete the evaluation reaches a preset first preset threshold includes:
evaluating all of the child individuals in a parallel manner using the fitness evaluation rules;
and polling all the child individuals in a polling mode, and determining whether the number of the child individuals which complete evaluation reaches a preset first preset threshold value.
Optionally, the fitness evaluation rule is determined by the following formula:
wherein F is used for representing the fitness value of an individual, n is used for representing the number of the sample data, y is used for representing a preset first evaluation value,for characterising the sampleThe present data is inputted to the second evaluation value obtained after each of the first individuals.
Optionally, the determining a first preset number of offspring individuals according to the first individual and a preset genetic algorithm includes:
determining at least two parent individuals from the first individuals according to a preset tournament algorithm;
And calculating at least two parent individuals according to the genetic algorithm, and determining a first preset number of offspring individuals.
Optionally, the second preset number is determined by the following formula:
S i =min(S i-1 ,E-E i-1 -T i-1 )
wherein S is i For characterizing said second preset number, S, when said genetic algorithm is executed the ith time i-1 For characterizing the number of individuals who have completed the evaluation the i-1 st time the genetic algorithm is performed, E for characterizing the second preset threshold, E i-1 For characterizing the total number of individuals who have completed the assessment in i-1 execution of the genetic algorithm, T i-1 And the number of individuals which are not evaluated in the process of carrying out the genetic algorithm for the ith-1 time is characterized, wherein i is an integer greater than or equal to 2.
In a second aspect, embodiments of the present invention also provide a genetic programming apparatus, including: the device comprises an acquisition module, an evaluation module, a generation module of filial generation, a judgment module and a determination module;
the acquisition module is used for acquiring a first preset number of first individuals, wherein the first preset number is not less than two;
the evaluation module is used for inputting preset sample data into each first individual acquired by the acquisition module, and evaluating all the first individuals by utilizing a preset fitness evaluation rule so as to obtain the fitness of each first individual;
The offspring generation module is used for determining a first preset number of offspring individuals according to the first individuals and a preset genetic algorithm which are evaluated by the evaluation module;
the evaluation module is further used for evaluating all the child individuals determined by the child generation module by utilizing the fitness evaluation rule;
the judging module is used for determining whether the number of the child individuals which are evaluated by the evaluating module reaches a preset first preset threshold value;
the determining module is configured to determine that the number of child individuals that have completed the evaluation reaches the first preset threshold, determine the child individuals as target child individuals, screen out a first preset number of second individuals from all the first individuals and all the target child individuals according to a sequence of from high to low fitness, and determine the second individuals as first individuals, where the first preset threshold is smaller than the first preset number;
the judging module is further used for judging whether the total number of the individuals which are evaluated by the evaluating module is smaller than a second preset threshold value;
the offspring generating module is further configured to determine, when the judging module determines that the total number of individuals that have completed the evaluation is smaller than a second preset threshold, a second preset number of third individuals according to the first individuals and the genetic algorithm determined by the determining module, where the second preset number is equal to the first preset threshold;
The determining module is further configured to determine the third individual determined by the child generating module and the child individual that is not yet evaluated in the evaluating module as the child individual, and output the child individual with the highest fitness when the total of the individuals that have been evaluated are not less than a second preset threshold.
Alternatively, the process may be carried out in a single-stage,
the evaluation module is further used for evaluating all the child individuals by utilizing the fitness evaluation rule in a parallel mode;
the judging module is further used for polling all the child individuals in a polling mode and determining whether the number of the child individuals which are evaluated reaches a preset first preset threshold value.
Optionally, the offspring generating module is further configured to determine at least two parent individuals from the first individuals according to a preset tournament algorithm, calculate at least two parent individuals according to the genetic algorithm, and determine a first preset number of offspring individuals.
In a third aspect, embodiments of the present invention further provide a genetic programming apparatus, including: at least one memory and at least one processor;
the at least one memory for storing a machine readable program;
The at least one processor is configured to invoke the machine readable program to perform the genetic programming method provided by the first aspect or any possible implementation of the first aspect.
In a fourth aspect, the present invention also provides a computer readable medium having stored thereon computer instructions which, when executed by a processor, cause the processor to perform the genetic programming method provided by the above first aspect or any of the possible implementations of the first aspect.
The genetic programming method, the genetic programming device and the genetic programming computer readable medium provided by the embodiment of the invention are used for carrying out iteration on the individuals subjected to the efficiency evaluation through a genetic algorithm to generate child individuals, and evaluating the child individuals by adopting a fitness evaluation rule to determine the child individuals with highest fitness. When the number of the offspring individuals which are subjected to evaluation reaches a certain number, generating offspring individuals through a genetic algorithm, evaluating the offspring individuals and the offspring individuals which are not subjected to evaluation by adopting an fitness evaluation rule, waiting for the number of the offspring individuals which are subjected to evaluation to reach a certain number again, and stopping the whole process until the total number of the individuals which are subjected to evaluation reaches a preset number. Therefore, the genetic programming method adopts an asynchronous parallel algorithm, so that the process can execute the next operation without waiting for the longest time-consuming individual to finish evaluation, thereby fully utilizing the multi-core resources of the computer, realizing the efficient operation of genetic programming and improving the optimization efficiency of the individual.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a genetic programming method provided by an embodiment of the present invention;
FIG. 2 is a flow chart of another genetic programming method provided by an embodiment of the present invention;
FIG. 3 is a schematic diagram of an apparatus in which a genetic programming apparatus according to an embodiment of the present invention is located;
FIG. 4 is a schematic diagram of a genetic programming apparatus according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments, and all other embodiments obtained by those skilled in the art without making any inventive effort based on the embodiments of the present invention are within the scope of protection of the present invention.
As shown in fig. 1, one embodiment of the present invention provides a genetic programming method, which may include the steps of:
step 101: acquiring a first preset number of first individuals, wherein the first preset number is not less than two;
step 102: inputting preset sample data into each first individual, and evaluating all the first individuals by utilizing a preset fitness evaluation rule to obtain the fitness of each first individual;
step 103: determining a first preset number of offspring individuals according to the first individuals and a preset genetic algorithm;
step 104: evaluating all the child individuals by using an fitness evaluation rule, and determining whether the number of the child individuals which are evaluated reaches a preset first preset threshold value;
step 105: if the number of the offspring individuals subjected to evaluation reaches a first preset threshold value, determining the offspring individuals as target offspring individuals, wherein the first preset threshold value is smaller than the first preset number;
step 106: screening out a first preset number of second individuals from all the first individuals and all the target offspring individuals according to the sequence of the fitness from high to low, and determining the second individuals as the first individuals;
Step 107: if the total number of individuals who have completed the evaluation is smaller than the second preset threshold, performing the following operations: determining a second preset number of third individuals according to the first individuals and the genetic algorithm, determining the third individuals and the offspring individuals which are not evaluated as offspring individuals, and executing step 104, wherein the second preset number is equal to the first preset threshold;
step 108: and if the total of the individuals which have completed the evaluation is not less than a second preset threshold value, outputting the child individuals with the highest fitness.
In the embodiment of the invention, the method iterates the individuals subjected to the efficacy evaluation through a genetic algorithm to generate offspring individuals, and the offspring individuals are evaluated by adopting the fitness evaluation rule to determine the offspring individuals with the highest fitness. When the number of the offspring individuals which are subjected to evaluation reaches a certain number, generating offspring individuals through a genetic algorithm, evaluating the offspring individuals and the offspring individuals which are not subjected to evaluation by adopting an fitness evaluation rule, waiting for the number of the offspring individuals which are subjected to evaluation to reach a certain number again, and stopping the whole process until the total number of the individuals which are subjected to evaluation reaches a preset number. Therefore, the genetic programming method adopts an asynchronous parallel algorithm, so that the process can execute the next operation without waiting for the longest time-consuming individual to finish evaluation, thereby fully utilizing the multi-core resources of the computer, realizing the efficient operation of genetic programming and improving the optimization efficiency of the individual.
In the embodiment of the invention, a first preset number of first individuals is obtained, and the first preset number is the population scale. The population size is too small, which leads to insufficient precision and unstable solution, and too large population size leads to increased operation time and reduced optimization efficiency, so that in order to ensure the precision and optimization efficiency of the genetic algorithm, the population size is generally 100-1000, for example, 100 first individuals are obtained.
In the embodiment of the invention, the selection probability of the individual can be obtained according to the fitness calculation of the individual, the preset genetic algorithm can iteratively generate the child individual according to the selection probability of the individual, the deterministic rule is replaced by the probabilistic transmission rule, and the global optimal solution of the optimization problem can be obtained. And the optimization result of the genetic algorithm is irrelevant to the initial condition, the algorithm is independent of a solving domain, and the method is applicable to complex solving optimization problems with a large number of control variables.
In an embodiment of the present invention, the individual may be a tree-shaped evaluation function for efficacy evaluation. The tree-shaped evaluation function can be directly used for carrying out selection operation, crossover operation and mutation operation by utilizing a genetic algorithm, an individual does not need to be encoded in advance, and decoding is not needed when an optimal solution is obtained, so that the optimization speed based on the genetic programming method is further increased, and the optimization efficiency of the individual is improved.
In the embodiment of the invention, when the number of the child individuals which finish evaluation reaches the first preset threshold, the child individuals are determined to be target child individuals, and the first preset threshold is smaller than the first preset number, so that asynchronous parallelization is realized. If the first preset threshold is equal to the first preset number, the evaluation process is parallel processing, and the subsequent operation can be executed after waiting for the longest-time individual to complete the evaluation. By adopting asynchronous parallelism, after a certain number of offspring individuals are evaluated, subsequent operations can be immediately executed, so that the multi-core resources of the computer are fully utilized, the efficient operation of genetic programming is realized, and the individual optimization efficiency is improved.
In the embodiment of the invention, asynchronous parallelism is adopted, after a certain number of child individuals are evaluated, if the total number of individuals which have been evaluated is smaller than a second preset threshold value, a genetic algorithm is continuously utilized to determine a second preset number of third individuals (newly generated child individuals), and the evaluation is continuously carried out according to the third individuals and the child individuals which have not been evaluated, which are determined to be child individuals. And outputting the child individuals with the highest fitness until the total number of the individuals which have been evaluated is equal to or greater than a second preset threshold value, wherein the obtained child individuals have the characteristics of high accuracy, strong interpretability, no need of repeatedly adjusting parameters and the like when being used for performing efficacy evaluation, and are suitable for any scene of efficacy evaluation. Meanwhile, when the total number of the individuals who have completed the evaluation is smaller than a second preset threshold value, the executed cyclic operations are asynchronous and parallel and are independent of each other, so that the time is effectively saved, and the individual optimization efficiency is improved.
In the embodiment of the invention, the first preset number of second individuals are screened out from all the first individuals and all the target offspring individuals according to the sequence of the fitness from high to low, namely, the population scale of all the first individuals is ensured to be consistent with that of all the second individuals, so that population expansion can be prevented and the optimization efficiency is reduced due to the reduction of the operation efficiency in the iterative process according to a genetic algorithm; and population shrinkage can be prevented, and even iteration cannot be continued, so that the accuracy of the optimal solution is affected. Meanwhile, the fitness is used for representing the goodness of the individuals, the second individuals are screened according to the sequence from high to low of the fitness, the fitness results of the second individuals are guaranteed to be more superior than those of the first individuals, the optimal results are obtained gradually through continuous iteration, the optimization precision of the genetic programming method is guaranteed, and the reliability of the genetic programming method is improved.
Optionally, in the genetic programming method shown in fig. 1, step 104 evaluates all child individuals using the fitness evaluation rule, and determining whether the number of child individuals that complete the evaluation reaches a preset first preset threshold value includes:
evaluating all child individuals in a parallel manner by utilizing fitness evaluation rules;
All child individuals are polled in a polling manner, and whether the number of child individuals who complete evaluation reaches a preset first preset threshold is determined.
In the embodiment of the invention, all the offspring individuals obtained by adopting the genetic algorithm for the first time are evaluated in a parallel mode, so that the waiting time of evaluating single offspring individuals can be reduced, a plurality of offspring individuals can be evaluated at the same time, and the processor resource can be fully utilized under the multi-core condition, thereby accelerating the evaluation process, further saving the running time of the genetic programming method and improving the optimization efficiency.
For example, as described in the previous examples, the first preset threshold is 10 and less than the first preset number 100. And putting 100 child individuals into a thread pool with the number of processors being 10 for evaluation, processing 10 processors in parallel, then polling the 100 child individuals for evaluation in a polling mode, and terminating polling when the number of child individuals for which the evaluation is completed is 10. The 10 child individuals that completed the assessment are determined to be target child individuals, and the 10 child individuals are deleted on line Cheng Chizhong, leaving only the remaining 90 child individuals that did not complete the assessment in the thread pool.
Optionally, in the genetic programming method shown in fig. 1, the fitness evaluation rule in step 104 is determined by the following formula:
Wherein F is used for representing the fitness value of an individual, n is used for representing the number of sample data, y is used for representing a preset first evaluation value,for characterizing a second evaluation value obtained after the sample data is input into each of the first individuals.
In the embodiment of the invention, the second evaluation value can be obtained by inputting the sample data into the individual, wherein the second evaluation value is the efficacy evaluation value obtained by adopting the individual, and the preset first evaluation value is the actual evaluation value obtained by performing efficacy evaluation on the sample data. The fitness value of the individual can be determined by the sum of squares of the differences between the first and second evaluation values of the plurality of sample data, wherein an individual with a greater fitness value is more likely to remain in the population iteration, i.e., the individual is a better individual.
For example, performance evaluation was performed on 10 light integrated weapons, and the sample data was 12 pieces of combat index data for each light integrated weapon. In the fitness evaluation rule, F is a fitness value of the individual a in performing the performance evaluation for the light integrated weapon, n is 10, y is a true performance evaluation value of each light integrated weapon (a true performance evaluation value obtained according to the existing method), Efficacy assessment under a individual for each light integrated weapon.
Optionally, in the genetic programming method shown in fig. 1, step 103 determines a first preset number of child individuals according to the first individual and a preset genetic algorithm, including:
determining at least two parent individuals from the first individuals according to a preset tournament algorithm;
and calculating at least two parent individuals according to a genetic algorithm, and determining a first preset number of child individuals.
In the embodiment of the invention, a plurality of pairs of father individuals are determined in a first individual according to a preset tournament algorithm, wherein the individuals in the first individual can be selected as father for a plurality of times, each pair of father individuals generates child individuals according to a crossover algorithm and a mutation algorithm in a genetic algorithm, wherein the crossover algorithm can be single-point crossover, and the mutation algorithm can be single-point mutation. In addition, the selection, crossing and mutation processes of the first individual (i.e. population) are mutually independent processes for the individuals in the first individual, and the parts can be processed in parallel, so that the iteration of the genetic algorithm can be further accelerated, the running time of the whole process is saved, and the optimization efficiency is improved.
For example, as described in the previous example, the first preset number is 100, 50 pairs of parent individuals are selected from the first individuals according to the tournament algorithm, wherein b individuals in the first individuals are selected as parents for a plurality of times, each pair of parent individuals generates 2 child individuals according to the single-point crossover algorithm and the single-point mutation algorithm in the genetic algorithm, wherein the crossover probability is 90%, the mutation probability is 1%, and thus the 50 pairs of parent individuals finally obtain 100 child individuals according to the genetic algorithm.
Optionally, in the genetic programming method shown in fig. 1, the second preset number in step 107 is determined by the following formula:
S i =min(S i-1 ,E-E i-1 -T i-1 )
wherein S is i For characterizing a second preset number, S, of ith execution of the genetic algorithm i-1 For characterizing the number of individuals who have completed the evaluation when the genetic algorithm is executed the i-1 st time, E for characterizing a second preset threshold, E i-1 For characterising the total number of individuals for which an assessment has been made in an i-1 execution of the genetic algorithm, T i-1 And the number of individuals which are not evaluated in the process of carrying out the genetic algorithm for the ith-1 time is characterized, wherein i is an integer greater than or equal to 2.
In the embodiment of the invention, the number of the generated offspring individuals when the genetic algorithm is executed for the ith time can be determined through the formula, and the iteration times can be indirectly determined according to the total number of the individuals (the second preset threshold value) which are preset and have been evaluated. Therefore, the accuracy of the optimized result of the genetic programming method is ensured by the formula.
For example, as described in the previous examples, the second preset threshold E is 5000. At the time of execution of the genetic algorithm 2 nd time, S 1 Number of individuals to complete evaluation at 1 st execution of the genetic algorithm 10, E 1 To complete the evaluation of the total number of individuals 10, T in one execution of the genetic algorithm 1 Number of individuals not evaluated at the time of execution of the genetic algorithm 1 st 90, S 2 =min (10,5000-10-90) =10. At the time of the 3 rd execution of the genetic algorithm, S 2 10, E 2 To complete the evaluation in the previous two executions of the genetic algorithm, total number of individuals 20, T 1 The number of individuals not evaluated at the time of execution of the genetic algorithm at the 2 nd time 90.S is S 2 =min (10,5000-20-90) =10. At the final stage of the genetic programming method, execution is performed at 492S in genetic algorithm 491 10, E 491 To complete the evaluation of the total number of individuals 4910, T in the first 491 execution of the genetic algorithm 491 Number of individuals not evaluated at the time of execution of the genetic algorithm for 491 90, S 492 =min(10,5000-4910-90)=0。
In order to more clearly illustrate the technical solution and advantages of the present invention, as shown in fig. 2, the following details of the genetic programming method provided in the embodiment of the present invention specifically include:
step 201: a first preset number of first individuals is obtained.
Specifically, the first preset number is not less than two, for example, as described in the previous examples, the first preset number is 100, and the individual may be a tree-shaped evaluation function for performance evaluation.
Step 202: and evaluating all the first individuals according to preset sample data and preset fitness evaluation rules.
Specifically, the preset sample data is input into each first individual, and all the first individuals are evaluated by using a preset fitness evaluation rule to obtain fitness of each first individual, wherein the fitness evaluation rule is determined by the following formula:
wherein F is used for representing the fitness value of an individual, n is used for representing the number of sample data, y is used for representing a preset first evaluation value,for characterizing a second evaluation value obtained after the sample data is input into each of the first individuals.
Step 203: and determining offspring individuals according to the first individual and a preset genetic algorithm.
Specifically, according to a preset tournament algorithm, determining at least two parent individuals from a first individual; and calculating at least two parent individuals according to a crossover algorithm and a mutation algorithm in the genetic algorithm, and determining a first preset number of offspring individuals.
For example, as described in the previous examples, when a preset genetic algorithm is adopted for the first time, 100 child individuals are determined from 100 first individuals.
Step 204: and evaluating all the child individuals, and determining that the number of the child individuals which complete the evaluation reaches a preset first preset threshold value.
Specifically, all offspring individuals are evaluated in a parallel manner by using the fitness evaluation rule; all child individuals are polled in a polling mode, and whether the number of child individuals which complete evaluation reaches a preset first preset threshold value is determined, wherein the first preset threshold value is smaller than the first preset number.
For example, as described in the previous examples, the first preset threshold is 10. Step 205 is performed when the number of child individuals for which evaluation is completed is determined to be 10 by a polling method by evaluating 100 child individuals in parallel when the genetic algorithm is performed the ith time (i is less than 492 and is an integer). At the final stage of the genetic programming method, the ith execution of the genetic algorithm (i is not less than 492 and is an integer) is performed on T i-1 The number of child individuals is evaluated in a parallel manner, and when it is determined that the number of child individuals for which evaluation is completed is 10 by a polling manner, step 205 is performed.
Step 205: and screening out the first preset number of second individuals according to the order of the fitness from high to low.
Specifically, if the number of child individuals who have completed the evaluation reaches a first preset threshold, the child individuals are determined as target child individuals, and among all the first individuals and all the target child individuals, a first preset number of second individuals are selected in the order of the fitness from high to low, and the second individuals are determined as the first individuals.
For example, as described in the previous example, the genetic algorithm is performed the i-th time, and when the number of child individuals who have completed the evaluation reaches 10, 100 individuals obtained by performing the genetic algorithm the 10 child individuals who have completed the evaluation and the i-1 th time are selected in order of fitness from high to low and determined as the first individual.
Step 206: it is determined whether the total number of individuals for which the evaluation has been completed is smaller than a second preset threshold, if so, step 207 is performed, otherwise step 208 is performed.
For example, as described in the previous examples, it is determined whether the total number of individuals for whom the evaluation has been completed is less than 5000.
Step 207: determining a second preset number of third individuals based on the first individuals and the genetic algorithm, and determining the third individuals and the offspring individuals not having been evaluated as offspring individuals, and performing step 204.
Specifically, the second preset number is determined by the following formula:
S i =min(S i-1 ,E-E i-1 -T i-1 )
wherein S is i For characterizing a second preset number, S, of ith execution of the genetic algorithm i-1 For characterizing the number of individuals who have completed the evaluation when the genetic algorithm is executed the i-1 st time, E for characterizing a second preset threshold, E i-1 For characterising the total number of individuals for which an assessment has been made in an i-1 execution of the genetic algorithm, T i-1 The method comprises the steps of (1) characterizing the number of individuals not subjected to evaluation when a genetic algorithm is executed for the i-1 th time, wherein i is an integer greater than or equal to 2;
determining at least two parent individuals from the first individuals according to a preset tournament algorithm; and calculating at least two parent individuals according to a crossover algorithm and a mutation algorithm in the genetic algorithm, and determining a second preset number of offspring individuals.
For example, as described in the previous examples, when a genetic algorithm is performed the ith time (i is less than 492 and is an integer), 10 child individuals are determined according to the formula. At the final stage of the genetic programming method, when the genetic algorithm is executed at the ith time (i is not less than 492 and is an integer), 0 child individuals are determined according to the formula, i.e. new child individuals are not generated any more, and T is started i-1 The individual child individuals are evaluated in a parallel manner until it is determined that the total number of individuals for which the evaluation has been completed is equal to or greater than 5000.
Step 208: and outputting the offspring individuals with the highest fitness.
Specifically, the child individuals having the highest fitness among the second individuals are determined in the order of the fitness from high to low and output.
For example, as described in the previous example, among 100 child individuals determined by the last execution of the genetic algorithm, the child individual having the highest fitness among the 100 individuals is determined in the order of the fitness from high to low and output.
As shown in fig. 3 and 4, the embodiment of the present invention provides a genetic programming apparatus. The apparatus embodiments may be implemented by software, or may be implemented by hardware or a combination of hardware and software. In terms of hardware, as shown in fig. 3, a hardware structure diagram of a device where a genetic programming apparatus provided in an embodiment of the present invention is located is shown, where in addition to a processor, a memory, a network interface, and a nonvolatile memory shown in fig. 3, the device where the apparatus is located may generally include other hardware, such as a forwarding chip responsible for processing a packet, and so on. Taking a software implementation as an example, as shown in fig. 4, as a device in a logic sense, the device is formed by reading corresponding computer program instructions in the nonvolatile memory into the memory by the CPU of the device where the device is located. The genetic programming apparatus provided in this embodiment includes: an acquisition module 401, an evaluation module 402, a generation module 403, a judgment module 404 and a determination module 405;
An obtaining module 401, configured to obtain a first preset number of first individuals, where the first preset number is not less than two;
the evaluation module 402 is configured to input preset sample data into each first individual acquired by the acquisition module 401, and evaluate all the first individuals by using a preset fitness evaluation rule to obtain fitness of each first individual;
a child generation module 403, configured to determine a first preset number of child individuals according to the first individual and a preset genetic algorithm after being evaluated by the evaluation module 402;
the evaluation module 402 is further configured to evaluate all child individuals determined by the child generation module 403 using the fitness evaluation rule;
a judging module 404, configured to determine whether the number of child individuals that the evaluating module 402 completes the evaluation reaches a preset first preset threshold;
a determining module 405, configured to determine, when the number of child individuals that have completed the evaluation determined by the determining module 404 reaches a first preset threshold, determine the child individuals as target child individuals, screen out a first preset number of second individuals from all the first individuals and all the target child individuals according to a sequence of from high to low fitness, and determine the second individuals as first individuals, where the first preset threshold is smaller than the first preset number;
The judging module 404 is further configured to judge whether the total number of individuals that the evaluating module 402 has completed evaluating is less than a second preset threshold;
the offspring generating module 403 is further configured to determine, when the judging module 402 determines that the total number of individuals that have completed the evaluation is less than a second preset threshold, a second preset number of third individuals according to the first individuals and the genetic algorithm determined by the determining module 405, where the second preset number is equal to the first preset threshold;
the determining module 405 is further configured to determine the third individual determined by the child generating module 403 and the child individual that has not completed the evaluation in the evaluating module 402 as child individuals, and output the child individual with the highest fitness when the total of the individuals that have completed the evaluation is not less than a second preset threshold.
In one embodiment of the invention, the evaluation module 402 is further configured to evaluate all child individuals in a parallel manner using fitness evaluation rules;
the determining module 404 is further configured to poll all child individuals in a polling manner, and determine whether the number of child individuals that have completed the evaluation reaches a preset first preset threshold.
In one embodiment of the invention, the fitness evaluation rules utilized by the evaluation module 402 are determined by the following formula:
Wherein F is used for representing the fitness value of an individual, n is used for representing the number of sample data, y is used for representing a preset first evaluation value,for characterizing a second evaluation value obtained after the sample data is input into each of the first individuals.
In one embodiment of the present invention, the child generation module 403 is further configured to determine at least two parent individuals from the first individuals according to a preset tournament algorithm, and calculate the at least two parent individuals according to a genetic algorithm to determine a first preset number of child individuals.
In one embodiment of the invention, the second predetermined number determined by the child generation module 403 is determined by the following formula:
S i =min(S i-1 ,E-E i-1 -T i-1 )
wherein S is i For characterizing a second preset number, S, of ith execution of the genetic algorithm i-1 For characterizing the number of individuals who have completed the evaluation when the genetic algorithm is executed the i-1 st time, E for characterizing a second preset threshold, E i-1 For characterising the total number of individuals for which an assessment has been made in an i-1 execution of the genetic algorithm, T i-1 And the number of individuals which are not evaluated in the process of carrying out the genetic algorithm for the ith-1 time is characterized, wherein i is an integer greater than or equal to 2.
It will be appreciated that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the genetic programming apparatus. In other embodiments of the invention, the genetic programming apparatus may include more or less components than illustrated, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The content of information interaction and execution process between the modules in the device is based on the same conception as the embodiment of the method of the present invention, and specific content can be referred to the description in the embodiment of the method of the present invention, which is not repeated here.
The embodiment of the invention also provides a genetic programming device, which comprises: at least one memory area and at least one processor;
the at least one memory for storing a machine readable program;
the at least one processor is configured to invoke the machine-readable program to perform the genetic programming method of any of the embodiments of the present invention.
Embodiments of the present invention also provide a computer readable medium having stored thereon computer instructions which, when executed by a processor, cause the processor to perform the genetic programming method of any of the embodiments of the present invention.
Specifically, a system or apparatus provided with a storage medium on which a software program code realizing the functions of any of the above embodiments is stored, and a computer (or CPU or MPU) of the system or apparatus may be caused to read out and execute the program code stored in the storage medium.
In this case, the program code itself read from the storage medium may realize the functions of any of the above-described embodiments, and thus the program code and the storage medium storing the program code form part of the present invention.
Examples of the storage medium for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (e.g., CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), a magnetic tape, a nonvolatile memory card, and a ROM. Alternatively, the program code may be downloaded from a server computer by a communication network.
Further, it should be apparent that the functions of any of the above-described embodiments may be implemented not only by executing the program code read out by the computer, but also by causing an operating system or the like operating on the computer to perform part or all of the actual operations based on the instructions of the program code.
Further, it is understood that the program code read out by the storage medium is written into a memory provided in an expansion board inserted into a computer or into a memory provided in an expansion module connected to the computer, and then a CPU or the like mounted on the expansion board or the expansion module is caused to perform part and all of actual operations based on instructions of the program code, thereby realizing the functions of any of the above embodiments.
It is noted that relational terms such as first and second, and the like, are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the statement "comprises one" does not exclude that an additional identical element is present in a process, method, article or apparatus that comprises the element.
Those of ordinary skill in the art will appreciate that: all or part of the steps for implementing the above method embodiments may be implemented by hardware related to program instructions, and the foregoing program may be stored in a computer readable storage medium, where the program, when executed, performs steps including the above method embodiments; and the aforementioned storage medium includes: various media in which program code may be stored, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the foregoing description is only illustrative of the preferred embodiments of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims (8)

1. A method of genetic programming comprising:
performing efficiency evaluation on a specified number of light integrated weapons, wherein the sample data are 12 combat index data of each light integrated weapon;
acquiring a first preset number of first individuals, wherein the first preset number is not less than two;
inputting preset sample data into each first individual, and evaluating all the first individuals by using a preset fitness evaluation rule to obtain the fitness of each first individual;
determining a first preset number of offspring individuals according to the first individuals and a preset genetic algorithm;
evaluating all the child individuals by using the fitness evaluation rule, and determining whether the number of the child individuals which are evaluated reaches a preset first preset threshold value;
If the number of the child individuals which are evaluated reaches the first preset threshold value, determining the child individuals as target child individuals, wherein the first preset threshold value is smaller than the first preset number;
screening out a first preset number of second individuals from all the first individuals and all the target offspring individuals according to the sequence of the fitness from high to low, and determining the second individuals as the first individuals;
if the total number of individuals who have completed the evaluation is smaller than the second preset threshold, performing the following operations: determining a second preset number of third individuals according to the first individuals and the genetic algorithm, determining the third individuals and the child individuals which are not evaluated as the child individuals, and performing the evaluation on all the child individuals by using the fitness evaluation rule, wherein the second preset number is equal to the first preset threshold;
if the total of the individuals which have completed the evaluation is not smaller than a second preset threshold value, outputting a child individual with the highest fitness;
the step of evaluating all the child individuals by using the fitness evaluation rule, and determining whether the number of the child individuals who complete the evaluation reaches a preset first preset threshold value comprises the following steps:
Evaluating all of the child individuals in a parallel manner using the fitness evaluation rules;
and polling all the child individuals in a polling mode, and determining whether the number of the child individuals which complete evaluation reaches a preset first preset threshold value.
2. The method of claim 1, wherein the fitness evaluation rule is determined by the following formula:
wherein F is used for representing the fitness value of an individual, n is used for representing the number of the sample data, y is used for representing a preset first evaluation value,for characterizing a second evaluation value obtained after the sample data is input into each of the first individuals.
3. The method of claim 1, wherein the determining a first predetermined number of offspring individuals based on the first individual and a predetermined genetic algorithm comprises:
determining at least two parent individuals from the first individuals according to a preset tournament algorithm;
and calculating at least two parent individuals according to the genetic algorithm, and determining a first preset number of offspring individuals.
4. The method of claim 1, wherein the second predetermined number is determined by the following formula:
S i =min(S i-1 ,E-E i-1 -T i-1 )
Wherein S is i For characterizing said second preset number, S, when said genetic algorithm is executed the ith time i-1 For characterizing the number of individuals who have completed the evaluation the i-1 st time the genetic algorithm is performed, E for characterizing the second preset threshold, E i-1 For characterizing the total number of individuals who have completed the assessment in i-1 execution of the genetic algorithm, T i-1 And the number of individuals which are not evaluated in the process of carrying out the genetic algorithm for the ith-1 time is characterized, wherein i is an integer greater than or equal to 2.
5. The genetic programming device is characterized in that performance evaluation is carried out on a specified number of light integrated weapons, and sample data are 12 combat index data of each light integrated weapon; comprising the following steps: the device comprises an acquisition module, an evaluation module, a generation module of filial generation, a judgment module and a determination module;
the acquisition module is used for acquiring a first preset number of first individuals, wherein the first preset number is not less than two;
the evaluation module is used for inputting preset sample data into each first individual acquired by the acquisition module, and evaluating all the first individuals by utilizing a preset fitness evaluation rule so as to obtain the fitness of each first individual;
The offspring generation module is used for determining a first preset number of offspring individuals according to the first individuals and a preset genetic algorithm which are evaluated by the evaluation module;
the evaluation module is further used for evaluating all the child individuals determined by the child generation module by utilizing the fitness evaluation rule;
the judging module is used for determining whether the number of the child individuals which are evaluated by the evaluating module reaches a preset first preset threshold value;
the determining module is configured to determine that the number of child individuals that have completed the evaluation reaches the first preset threshold, determine the child individuals as target child individuals, screen out a first preset number of second individuals from all the first individuals and all the target child individuals according to a sequence of from high to low fitness, and determine the second individuals as first individuals, where the first preset threshold is smaller than the first preset number;
the judging module is further used for judging whether the total number of the individuals which are evaluated by the evaluating module is smaller than a second preset threshold value;
the offspring generating module is further configured to determine, when the judging module determines that the total number of individuals that have completed the evaluation is smaller than a second preset threshold, a second preset number of third individuals according to the first individuals and the genetic algorithm determined by the determining module, where the second preset number is equal to the first preset threshold;
The determining module is further configured to determine the third individual determined by the child generating module and the child individual that is not yet evaluated in the evaluating module as the child individual, and output the child individual with the highest fitness when the total of the individuals that have been evaluated are not less than a second preset threshold;
the evaluation module is further used for evaluating all the child individuals by utilizing the fitness evaluation rule in a parallel mode;
the judging module is further used for polling all the child individuals in a polling mode and determining whether the number of the child individuals which are evaluated reaches a preset first preset threshold value.
6. The apparatus of claim 5, wherein the device comprises a plurality of sensors,
the offspring generation module is further configured to determine at least two parent individuals from the first individuals according to a preset tournament algorithm, calculate at least two parent individuals according to the genetic algorithm, and determine a first preset number of offspring individuals.
7. A genetic programming apparatus comprising: at least one memory and at least one processor;
the at least one memory for storing a machine readable program;
The at least one processor being configured to invoke the machine readable program to perform the method of any of claims 1 to 4.
8. A computer readable medium having stored thereon computer instructions which, when executed by a processor, cause the processor to perform the method of any of claims 1 to 4.
CN202010987598.3A 2020-09-18 2020-09-18 Genetic programming method, apparatus and computer readable medium Active CN112036567B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010987598.3A CN112036567B (en) 2020-09-18 2020-09-18 Genetic programming method, apparatus and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010987598.3A CN112036567B (en) 2020-09-18 2020-09-18 Genetic programming method, apparatus and computer readable medium

Publications (2)

Publication Number Publication Date
CN112036567A CN112036567A (en) 2020-12-04
CN112036567B true CN112036567B (en) 2023-10-31

Family

ID=73574975

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010987598.3A Active CN112036567B (en) 2020-09-18 2020-09-18 Genetic programming method, apparatus and computer readable medium

Country Status (1)

Country Link
CN (1) CN112036567B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112580217A (en) * 2020-12-25 2021-03-30 北京机电工程研究所 Communication system structure parameterization modeling method based on complex network

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1450493A (en) * 2003-04-25 2003-10-22 北京工业大学 Nerve network system for realizing genetic algorithm
CN103440377A (en) * 2013-08-27 2013-12-11 北京航空航天大学 Aircraft aerodynamic configuration optimum design method based on improved parallel DE algorithm
CN106909986A (en) * 2017-01-18 2017-06-30 李红旮 A kind of soil re-development plan method of use ant colony multiple target layout optimization model
CN107240100A (en) * 2017-04-06 2017-10-10 上海斐讯数据通信技术有限公司 A kind of image partition method and system based on genetic algorithm
CN110807525A (en) * 2019-10-29 2020-02-18 中国民航大学 Neural network flight guarantee service time estimation method based on improved genetic algorithm
CN111046018A (en) * 2019-11-06 2020-04-21 华北电力科学研究院有限责任公司 Multi-objective optimization-based power generation equipment operation condition library construction method and device
CN111123869A (en) * 2019-12-24 2020-05-08 北京理工大学 Flexible job shop scheduling method and device based on worker operation experience
CN111160773A (en) * 2019-12-30 2020-05-15 深圳市赛维网络科技有限公司 Process scheduling method, device, equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8577816B2 (en) * 2009-12-29 2013-11-05 International Business Machines Corporation Optimized seeding of evolutionary algorithm based simulations
US9311597B2 (en) * 2013-03-12 2016-04-12 International Business Machines Corporation Early generation of individuals to accelerate genetic algorithms

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1450493A (en) * 2003-04-25 2003-10-22 北京工业大学 Nerve network system for realizing genetic algorithm
CN103440377A (en) * 2013-08-27 2013-12-11 北京航空航天大学 Aircraft aerodynamic configuration optimum design method based on improved parallel DE algorithm
CN106909986A (en) * 2017-01-18 2017-06-30 李红旮 A kind of soil re-development plan method of use ant colony multiple target layout optimization model
CN107240100A (en) * 2017-04-06 2017-10-10 上海斐讯数据通信技术有限公司 A kind of image partition method and system based on genetic algorithm
CN110807525A (en) * 2019-10-29 2020-02-18 中国民航大学 Neural network flight guarantee service time estimation method based on improved genetic algorithm
CN111046018A (en) * 2019-11-06 2020-04-21 华北电力科学研究院有限责任公司 Multi-objective optimization-based power generation equipment operation condition library construction method and device
CN111123869A (en) * 2019-12-24 2020-05-08 北京理工大学 Flexible job shop scheduling method and device based on worker operation experience
CN111160773A (en) * 2019-12-30 2020-05-15 深圳市赛维网络科技有限公司 Process scheduling method, device, equipment and storage medium

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
A Pseudo-Parallel Genetic Algorithm Integrating Simulated Annealing for Stochastic Location-Inventory-Routing Problem with Consideration of Returns in E-Commerce;Bailing Liu等;《Discrete Dynamics in Nature and Society》;第2015卷;第1-16页 *
一种改进的异步并行遗传算法在物流配送路径的研究;张翰;《中国优秀硕士学位论文全文数据库 信息科技辑》(第9期);第I140-24页 *
基于Hadoop求解大规模VRPTW问题的并行遗传算法;臧永森;《中国优秀硕士学位论文全文数据库 信息科技辑》(第4期);第I140-56页 *
并行化遗传算法研究综述;冯智莉等;《计算机应用与软件》;第35卷(第11期);第1-8页 *

Also Published As

Publication number Publication date
CN112036567A (en) 2020-12-04

Similar Documents

Publication Publication Date Title
KR102061987B1 (en) Risk Assessment Method and System
US8577816B2 (en) Optimized seeding of evolutionary algorithm based simulations
CN109242105B (en) Code optimization method, device, equipment and medium
De Leoni et al. Data-aware process mining: discovering decisions in processes using alignments
CN108491302B (en) Method for detecting spark cluster node state
CN111881289B (en) Training method of classification model, and detection method and device of data risk class
CN110727506B (en) SPARK parameter automatic tuning method based on cost model
CN113703775A (en) Compiling method, device, equipment and storage medium
US9176732B2 (en) Method and apparatus for minimum cost cycle removal from a directed graph
CN114556360A (en) Generating training data for machine learning models
CN112036567B (en) Genetic programming method, apparatus and computer readable medium
CN113052577A (en) Method and system for estimating category of virtual address of block chain digital currency
CN114662602A (en) Outlier detection method and device, electronic equipment and storage medium
JP2019159836A (en) Learning program, learning method and learning device
CN115344805A (en) Material auditing method, computing equipment and storage medium
WO2017039684A1 (en) Classifier
CN111950579A (en) Training method and training device for classification model
CN111784246B (en) Logistics path estimation method
CN113810333B (en) Flow detection method and system based on semi-supervised spectral clustering and integrated SVM
König et al. Critically Assessing the State of the Art in CPU-based Local Robustness Verification
CN114493279A (en) Workflow task prediction method and device, storage medium and electronic equipment
CN113827980A (en) Loss user prediction method and device and computer readable storage medium
Borkar et al. Comparative study of supervised learning algorithms for fake news classification
CN113128217B (en) Public opinion disposition decision-making method based on network twinning space
CN115037648B (en) Intelligent contract test case generation method and system based on data flow reduction

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant