genetic-algorithm

How to solve linear equations using a genetic algorithm?

冷暖自知 提交于 2019-12-11 04:51:33
问题 I want to solve a system of n linear equations containing n variables using a genetic algorithm. I am having difficulty in defining the crossover operation as the solution may consist of floating point values. How do I proceed? It seems possible, but this is my first encounter with genetic algorithms. Suppose we have to solve x + 2y = 1 2x + 8y = 3 The answer would be x = 1/2 and y = 1/4. How do we model the problem? Update : see if you could decipher anything from the paper http://www

How to add elimination mechanism in Python genetic algorithm based on DEAP

99封情书 提交于 2019-12-11 02:42:06
问题 Here is my question. I'm dealing with one optimization problem using DEAP. For now, I use toolbox.register("select", tools.selNSGA2) to select some fittest indivual to survive. But I want to add some threshold by user-defined function. Can the algorithm achieve two step of selection? Select several individuals by the tournament or selNSGA2 method Eliminate several individuals by pre-defined thresholds. 回答1: This should work. def myselect(pop, k, check): return [ind for in in tools.selNSGA2

Can you please provide some topic ideas related to AI to be used in a project? [closed]

只愿长相守 提交于 2019-12-10 21:04:58
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I need topic ideas related to AI on which I will base my thesis. I am mostly interested in Genetic Algorithm and Neural Networks

Genetic Algorithm roulette wheel selection

烂漫一生 提交于 2019-12-10 17:46:00
问题 I am having issues understanding the algorithm. Here is the most popular one seen online for all members of population sum += fitness of this individual end for for all members of population probability = sum of probabilities + (fitness / sum) sum of probabilities += probability end for loop until new population is full do this twice number = Random between 0 and 1 for all members of population if number > probability but less than next probability then you have been selected end for end

Incorrect results with genetic algorithm image evolution

拟墨画扇 提交于 2019-12-10 17:26:03
问题 I'm attempting to implement a program originally created by Roger Alsing. I've done quite a bit of research on what other people have implemented. I decided to write my program in python, and use basic triangles as the shapes. When I run the program, it does not show improvement after more generations (The triangles tend to just disappear). I'm assuming something is wrong with my mutate function. Can anyone tell me why its producing less than satisfactory results? My code: import random

What's a sensible way to represent a binary genome for a genetic algorithm?

浪子不回头ぞ 提交于 2019-12-10 15:28:10
问题 My previous question belied my inexperience and was based on an assumption. Now I am much wiser. (Put 1s and 0s in a string? Pah! I laugh at the suggestion!) My question is then, how should I encode my genomes ? On paper, they look like this: 01010011010110010 17 bits that encode (in some cases singly and in some cases as groups) the parameters to be tested. The requirements are: Needs to be scalable. There might be 17 at the moment, but this could grow/shrink as options are added, removed or

find minimum of math function with genetic algorithm in matlab

牧云@^-^@ 提交于 2019-12-08 13:17:02
问题 I want to find the minimum value of function with genetic algorithm in matlab( I know matlab have toolbox for GA but I want achive it programmically ). I have four m-file, Itterate 50 time,and in every loop step save best and mean of fitness, but when I run this code code not return me lower value in best and average , this is no normal. where is my problem? my math function is find minmun of f(x)= -|x*sin(sqrt(|x|))| main.m global population; global fitness; global popsize; format bank;

c++ Genetic Algorithm Mutation error

最后都变了- 提交于 2019-12-08 05:44:02
问题 I Have a problem with the mutation function within my genetic Algorithm. I can't quite see what I am doing wrong either. I've looked at this code for a while and I think the logic is correct, it's just not producing the results i want. The problem When i output the Binary array located in the Child Struct, If mutation has occured on any of the bits, then a random number will be changed, and not the one that should be. for example 0000000 is the binary string mutation has occured on the second

Accessing ArrayList<ArrayList<SomeObject>> elements

£可爱£侵袭症+ 提交于 2019-12-08 03:57:52
问题 I have an ArrayList of ArrayList s where i need to find a simple way of accessing the elements, to make it easier to understand i have drawn my goal of what i want to achieve: As seen on the image above the main ArrayList consists of m ArrayList , where i wish to get an element by using a get method which goes from 0 to N elements, where N is the total elements of ArrayList1 and ArrayList2 . More ArrayList's may occur. I can of course iterate through the elements by using two for-loops, which

Genetic Algorithm in Java problems

非 Y 不嫁゛ 提交于 2019-12-07 20:36:51
问题 I am having trouble creating a Genetic Algorithm in java. I am competing in an online GA contest. I am trying to save the best result each time back into index 0, but it just becomes a reference to the original index. Meaning when I evolve the rest of the indexes, if it evolves the best members original index I lose it. I have tried shimming it with a getClone method that converts the objects data to and int array and creates a new object from it. Individual class: class Individual { public