Job Recruitment Website - Ranking of immigration countries - Help ~ Who can help me translate English?

Help ~ Who can help me translate English?

genetic algorithm

The object of genetic algorithm decides which individuals should live, which should reproduce and which should die. It also records statistics and determines how long evolution should last. Generally, genetic algorithm has no obvious stopping ping criterion. You must tell the algorithm when to stop. Usually, the number of generations is used as a stopping measure, but if you like, you can use the goodness of the best solution, population convergence or any problem-specific criteria.

The library contains four styles of genetic algorithms. The first is the standard simple genetic algorithm, which is described by Goldberg in his book. The algorithm uses non-overlapping population and optional elite strategy. Each generation of algorithms will produce a brand-new individual population. The second is a steady-state genetic algorithm using overlapping populations. In this variant, you can specify how many people should be replaced by each generation. The third variation is incremental genetic algorithm, in which each generation consists of only one or two children. Incremental genetic algorithm allows customized replacement methods to define how the new generation should integrate into the population. Therefore, for example, a newly generated offspring can replace its parent, the random individual in the population, or the most similar individual. The fourth is the' Germany-America' genetic algorithm. The algorithm uses steady-state algorithm to evolve multiple populations in parallel. Each generation of algorithms migrates some individuals in each population to another population.

In addition to the basic built-in types, GA lib also defines the components needed to derive its own genetic algorithm class. These examples include some such derivatives, including (654 38+0) a genetic algorithm that uses multiple populations and "migrates" between populations on multiple CPUs, and (2) a genetic algorithm that performs "deterministic crowding" to keep different species in the evolution process.

The basic genetic algorithm class contains operators and data common to most genetic algorithms. When you derive your own genetic algorithm, you can use these member data and functions to track statistics and monitor performance.

Genetic algorithm includes statistical data, replacement strategy and parameters of running algorithm. Population object is the container of genome, which also contains some statistics and selection and scaling operators. A typical genetic algorithm will run forever. The library has built-in functions that specify when the algorithm terminates. These include termination on generation (in this case, you can specify the specific algebra that the algorithm should run) and termination on convergence (in this case, you can specify the value to which the optimal score of the generation should converge). You can customize the stop function to use your own stop criteria.

The number of function evaluations is a good way to compare different genetic algorithms with various other search methods. GA lib genetic algorithm tracks the number of genome evaluation and population evaluation.

Definition representation

Use a data structure that is appropriate for your problem. If you are optimizing a numeric function, use real numbers in your genome. If the solution to your problem can be expressed by some imaginary numbers and some integer values, define a genome with these characteristics.

Defining an appropriate representation is part of the art of using genetic algorithms (at this point, it is still an art, not a science). Use the simplest but complete expression. Your representation should be able to represent any solution to your problem, but if possible, you should design it so that it does not represent an infeasible solution to your problem. Remember, if the genome can represent an infeasible solution, then the objective function must be designed to give partial trust to the infeasible.

The representation should not contain other information except the information needed to represent the solution of the problem. Although it may be advantageous to use a representation containing "extra" genetic material, unless it is properly implemented (consistent with the objective function and fully considering the type and characteristics of the search space), it will often increase the size of the search space, thus hindering the performance of genetic algorithms.

There are countless possible forms of expression. You can choose a representation of pure numbers, such as an array of real numbers. These can be realized as real numbers, or as a series of bits mapped to real numbers (note that for most problems, using real numbers directly is far better than binary to decimal representation, especially when you use reasonable crossover operators). Your question may depend on the order of the items, in which case an order-based representation (list or array) may be more appropriate. In many cases, you must choose an operator that maintains sequence integrity; The intersection must generate a reordered list without copying any elements in the list. Other problems are suitable for tree structure. Here, you may want to express the solution explicitly as a tree and perform genetic operations directly on the tree. Or, many people encode trees into arrays or parseable strings, and then manipulate the strings. Some problems include the mixing of continuous and discrete elements. In this case, you may need to create a new structure to store the mixed information. In these cases, you must define genetic operators that conform to the solution structure. For example, a solution with both integer and floating-point parts may use a crossover, which crosses the integer part with the integer part and the floating-point part with the floating-point part, but never mixes the floating-point part with the integer part.

No matter which representation you choose, be sure to choose the operator that is suitable for your representative representation.

Genome operator

Each genome has three main operators: initialization, mutation and crossover. Using these operators, you can favor an initial population, define a mutation or crossover specific to your problem representation, or evolve a partial genetic algorithm as your population evolves. GA lib comes with these predefined operators for each genome type, but you can customize any of them.

The initialization operator determines how to initialize the genome. When you initialize a population or genetic algorithm, it is called. This operator does not actually create a new genome, but "fills" the genome with original genetic material, and all solutions will evolve from the original genetic material. The population object has its own initialization operator. By default, this is just the initialization operator that calls the genome in the population, but you can customize it to do anything you want.

The mutation operator defines the mutation process of each genome. For different data types, mutation means different things. For example, a variant of a typical binary string genome flips the bits in the string with a given probability. On the other hand, the typical variogram of a tree will exchange subtrees with a given probability. Generally speaking, you should define a mutation that can both explore and exploit; Mutation should be able to introduce new genetic material and change existing material. You may want to define multiple types of variation for a problem.

The crossover operator defines the process of generating offspring from two parent genomes. Like mutation operators, crossover is specific to data types. However, unlike mutation, crossover involves multiple genomes. In GA lib, each genome "knows" its preferred mating method (default hybridization method), but it cannot hybridize by itself. Each genetic algorithm "knows" how to get the default crossover method from its genome, and then uses this method to mate. With this model, it is possible to derive new classes of genetic algorithms that use different default mating methods from those defined for genomes.

Each of these methods can be customized so that it is not only specific to the data type, but also specific to the problem type. This is a way to put the "intelligence" of a specific problem into genetic algorithm (I won't discuss whether this is a good thing) ...)

In addition to the three main operators, each genome must also contain an objective function and possibly a comparator. The objective function is used to evaluate the genome. Comparators (often called "distance functions") are used to determine the differences between one genome and another. Every genetic algorithm requires defining an objective function-this is how the genetic algorithm determines which individuals are better than others. Some genetic algorithms need a comparator.

The library has some basic data types built in, but if you already have an array or list object, you can quickly build a genome by inheriting your object and genome object multiple times. Then, you can directly use Arthur as the new object in the GA lib genetic algorithm object.

Generally speaking, genetic algorithm does not need to know the content of the data structure it operates on. Libraries reflect this universality. You can use genetic algorithms to mix and match genome types. Genetic algorithms know how to clone genomes to create populations, initialize genomes to start running, cross genomes to produce offspring, and mutate genomes. All these operations are performed through genome member functions.

Population object

Population object is the container of genome. Each population object has its own initializer (which is called only for each individual in the population by default) and evaluator (which is called only for each individual in the population by default). It also records the best value, average value, deviation and so on of the population. Diversity can also be recorded, but because diversity calculation usually requires a lot of extra calculation, diversity is not recorded by default.

The selection method is also defined in the population object. Genetic algorithm uses this method to choose which individuals should mate.

Each fill object has a scaling scheme object associated with it. The scaling scheme object converts the objective score of each genome into an appropriate ss score for selection by genetic algorithm A.. It also caches fitness information for later use in the selection scheme.

Objective function and fitness scale

Genetic algorithms are usually more attractive than gradient search methods because they do not need complex differential equations or smooth search space. Genetic algorithm only needs a single index to measure how good an individual is compared with other individuals. The objective function provides this measure; Given a single solution to a problem, how good is it?

It is important to pay attention to the difference between health and objective scores. The objective score is the value returned by your objective function; This is the original performance evaluation of a genome. On the other hand, fitness score is the level of possible transformation used by genetic algorithm to determine the fitness of individuals for mating. Adaptive scores are usually obtained by linear scaling of the original objective scores (but you can define any desired mapping or not transform at all). For example, if you use Arthur's linear scale, then the adaptive score is obtained from the objective score by using the adaptive proportional scale technique described in Goldberg's book. Genetic algorithm uses fitness score instead of objective score to make selection.

You can use an individual-based evaluation function (defined by you) or a group-based evaluator (also defined by you) to evaluate individuals in a group. If you use individual-based goals, then functions are assigned to each genome. The group-based objective function can use the individual objective function, or it can set the individual score by itself.