function.
2.1 enter optimtool ('ga ') in the command line window to open the graphical interface of the optimization tool
2.2 InFitness FunctionFunction Area input function handle @ rastriginsfcn
2.3 InNumberOf variables: 2 independent variables
2.4 click "start" to start algorithm running
When the algorithm is runningCurrentIterationThe number of current iterations is displayed. You can use the pause and stop buttons to pause or
Stop an algorithm. After the algorithm is completedRun SolverAn
. Population =NewIndividual[populationsize]; //Create Each individual in turn for(intIndividualcount = 0; Individualcount ) { //Create An individual, initializing it chromosome to the given//lengthIndividual individual =Newindividual (chromosomelength); //Add individual to population This. population[individualcount] =individual; } } /*** Get individuals from the population * *@returnindividuals individuals in population*/ Publicindividual[] Getindividual
representing the starting search point. In this case, the size of the population is 4, that is, the group consists of 4 individuals, each of which can be produced by a random method.such as: 011101,101011,011100,111001(3) Fitness juice calculation in the genetic algorithm, the size of individual adaptability is used to evaluate the degree of each individual, thus determining the size of its genetic opportunity. In this case, the objective function
Genetic algorithm optimization function y=10*sin (5*x) +7*abs (x-5) +10, this function image is:Here's a look at the code:(1) First look at the main functionfunction main () clear;clc;% population size popsize=100;% binary encoded length chromlength=10;% crossover probability pc = 0.6;% mutation probability pm = 0.001;% initial population pop = Initpop ( Popsize,chromlength); For i = 1:100 % Calculation of fitness value (function value) ObjValue
Therefore, we need a pbest to record the optimal solution of the individual search, and use gbest to record the optimal solution that the whole group searched for in one iteration. The update formula for velocity and particle position is as follows:
V[i] = w * V[i] + C1 * RAND () * (Pbest[i]-present[i]) + C2 * RAND () * (Gbest-present[i])
Present[i]=present[i]+v[i]
Where V[i] represents the speed of the particle I, w represents the inertia weight, C1 and C2 represent the learning parameters, Ra
Story Introduction: Zhou Meng (Jiang yiyan ornaments) is a university principal Zhou Deming (Chen Dao Ming ornaments). She met Li ran, a provincial newspaper reporter from the romantic news, at a friend's party) they love each other at first sight. Zhou Deming, who has been alone, is unwilling to let his daughter fall in love too early due to segu's prejudice, but his attitude changes after being severely i
another scene
When I went down the hill, I was drowned by the 100,000 mountains. I don't know where I came from.
It's almost time for Datang township. Several children and I "Hello !"
In Datang Township, leishan County, this is the place where leishan falls. The postcard sent here.
There is a skirt seedling in the village.
When I came out, I went down along the clear river. Many children were soaked in the river, so envy me!
Lunch in leishan County at noon
Flower scissors
Time Limit: 1000/1000 MS (Java/others) memory limit: 32768/32768 K (Java/Others)Total submission (s): 2814 accepted submission (s): 1881 Problem description: a fabric with some patterns in it, and a small decoration that can be directly used. There are also some patterns in it. For the given flower cloth and small ornaments, how many small ornaments can be cut out from the flower cloth as m
The purpose of decoration is to add ornaments to the original objects so that the objects can present different characteristics. Of course, in the class design, the decoration mode is used to add new features and behaviors to the class. The structure is as follows:
** |  ̄ |* | Component | * | ----------------------- |* | Operation () |* | ________________ |* △ |* |* |  ̄ |* |  ̄ | ◇-Component ------ |* | Concreatecomponent | decorator |* | -------------
Flower scissors
Time Limit: 1000/1000 MS (Java/others) memory limit: 32768/32768 K (Java/Others)Total submission (s): 6221 accepted submission (s): 4131Problem description: a fabric with some patterns in it, and a small decoration that can be directly used. There are also some patterns in it. For the given flower cloth and small ornaments, how many small ornaments can be cut out from the flower cloth as muc
Flower scissorsTime Limit: 1000/1000 MS (Java/others) memory limit: 32768/32768 K (Java/Others)Total submission (s): 2457 accepted submission (s): 1635Problem description: a fabric with some patterns in it, and a small decoration that can be directly used. There are also some patterns in it. For the given flower cloth and small ornaments, how many small ornaments can be cut out from the flower cloth as much
DescriptionJoi has n a pendant on the phone, numbered 1 ... N. Joi can put some of them on the phone.Joi's ornaments are somewhat different-some of them have hooks that can hang other pendants. Each pendant is either hung directly on the phone or hung on the hook of the other pendant. There are up to 1 hooks hanging directly on the phone.In addition, each pendant has a joy value to be obtained during installation, expressed as an integer. If Joi hates
Programme I
Programme II
Hair: Shallow Careless
Coat: library (powder)
Under Install: Small ran
Coat: Small oven
Socks: Teddy Footprint (Brown)
Shoes: Honey Pulp (Magic Pavilion Extraction, can be changed with the property ornaments)
Headdress: Butterfly knot headdress (powder)
Neck ornaments: Star Wish necklace
Hand Ornaments: Flower knot + black
.
Seventh Step: The implementation of the "jewelry → user-defined" command, as shown in Figure 08, the user-defined ornaments We have just saved are loaded into the screen, and the size and position of the two ornaments are adjusted to make the "RIP" effect more realistic, the ornaments can be rotated lightly, and the effect can be seen in Figure
variety of inquiries outside the chain of tools. There is a good query tool in the Firefox browser. Of course, these things are reference things, these things we should use to do the digging tool, because we are mining peer site, we dug out are the weight is relatively high. You can make good use of the Peer Web site outside the chain of resources, you use it again.
The next summary of mining Peer Web site outside the chain of resources is how to do, first of all, we are searching the industry
Search [fitness 99 network] for 15 years experience as a fitness instructor on the home treadmill recommendation website .. Best for the most affordable treadmill search [fitness 99 network]
The effect of familiarization with anaerobic activities is the weight of muscle strength refining. Many people may have doubts when talking about muscle importance. That's be
Genetic algorithm is an evolutionary algorithm for data optimization by simulating biological evolution. The main process is the initial population generation, selection, crossover, mutation, cyclic iteration, until the optimal solution appears. This program consists of two main classes, population classes and individual classes. Define the evolutionary strategy interface and compute the adaptive policy interface. The evolutionary strategy interface implements three behaviors, crossover, mutatio
Particle swarm optimization algorithm for solving function extremumInitializes a particle population randomly distributed in the solution space. Each iteration then updates the position of each particle according to the historical optimal position of each particle and the optimal position of the particle swarm until the requirement is met.Clc;clear all;tic;% Program Run timinge0=0.001;% allowable Errormaxnum= -;% Particle maximum iteration countnarvs=1;the number of arguments for the% target fun
classifiers, the fitness function used is usually useful to the classifier identification rate, However, there are many cases of cross-validation using the wrong case. As mentioned earlier, only training data can be used for model construction, so only the training data identification rate can be used in fitness function. The EA is the method used by the training process to adjust the model's best paramete
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.