genetic-algorithm

Optimization of FIS membership functions, via GA

一曲冷凌霜 提交于 2019-12-25 17:46:48
问题 i am trying to optimize my FIS with the help of a GA, with matlab optimization toolbox. The code looks like this: function errorr=fun3_2(x) Name='eleni'; Type='mamdani'; NumInputs='8'; NumOutputs='1'; % NumRules='80'; AndMethod='min'; OrMethod='max'; ImpMethod='min'; AggMethod='max'; DefuzzMethod='centroid'; a=newfis('eleni'); %INPUTS_______________input 1____________ a.input(1).name='ARIAS'; a.input(1).range=[0 1]; a.input(1).mf(1).name='1'; a.input(1).mf(1).type='trimf'; a.input(1).mf(1)

Can the genetic-algorithm in Matlab pass a second return value from the fitness-function to the constraints?

不问归期 提交于 2019-12-25 04:29:11
问题 I am simulating a batch evaporator in Matlab. The genetic algorithm varies several starting variables x (such as size, max. mass of working fluid, the overall number of evaporators used ...) and the goal is to maximize the efficiency. So my function evaporator(x) returns the negative efficiency which is minimized by the algorithm. Besides the efficiency, there are several other values calculated. One is the duration of the simulated cycle (NOT the runtime of the calculation itself!). As a

Writing a compare function for a structure for qsort?

半世苍凉 提交于 2019-12-24 03:46:07
问题 I'm having trouble writing a compare function for qsort function in C. This is what I currently have: int cmpfunc(const void *a, const void *b) { return (*(Individual*)a->fitness - *(Individual*)b->fitness); } I know how the compare function works but I don't understand how to reference an integer value within my structure called Individual . Here is the structure of the Individual. typedef struct { PPM_IMAGE image; double fitness; } Individual; I want to compare the fitness values within the

How can I create a list with random numbers in different ranges for deap package in python

删除回忆录丶 提交于 2019-12-24 03:25:11
问题 I am using DEAP package in Python to write a program for optimization with evolutionary algorithm specifically with Genetic. I need to create chromosomes by using list type in python. This chromosome should have five float genes (alleles) in different ranges. My main problem is to create such a chromosome. However, it would be better if I could use tools.initRepeat function of deap package for this. For the cases in which all the genes are in the same range we could use the following code:

What does crossover index of 0.25 means in Genetic algorithm for real encoding?

爷,独闯天下 提交于 2019-12-24 01:44:27
问题 I am familiar with crossover and mutation indexes in binary representation but in real encoding, I came across with several articles in which crossover index and mutation index are used as parameter values. For example, we have population size of 300 and 30 decision variables then what does crossover index = 0.25 means? Also confused about the mutation index of 100+current generation number . 回答1: Crossover index A number of real-coded crossover operators have been developed that create two

Needs help for Genetic Algorithm Single-Point Crossover Mechanism in Java

假如想象 提交于 2019-12-24 01:24:40
问题 I have been implementing a simple genetic algorithm(GA) using Java. The steps of my GA are basically binary encoding, tournament selection, single-point crossover, and bit-wise mutation. Each individual of the population is represented by a class consisting of binary genes and a fitness value. public class Individual { int gene[]; int fitness; public Individual(int n){ this.gene = new int[n]; } } The codes below does not include the bit-wise mutation part as I have been facing problem at the

Constraints on parameters using differential evolution in python

ⅰ亾dé卋堺 提交于 2019-12-23 23:11:11
问题 I am trying to use differential evolution to optimize availability based on cost. However, I have three unknown parameters (a, b, c) here and I can define the range using bounds. However, I want to define additional constraint as a+b+c <= 10000. I am using python to do this and I tried to use an option "args" within differential evolution but it did not work. Any information will be appreciated. 回答1: Here is a hack. I used the last example from the documentation and constrained the sum(x) > 4

Building ranking with genetic algorithm,

元气小坏坏 提交于 2019-12-23 17:15:08
问题 Question after BIG edition : I need to built a ranking using genetic algorithm, I have data like this : P(a>b)=0.9 P(b>c)=0.7 P(c>d)=0.8 P(b>d)=0.3 now, lets interpret a,b,c,d as names of football teams, and P(x>y) is probability that x wins with y . We want to build ranking of teams, we lack some observations P(a>d) , P(a>c) are missing due to lack of matches between a vs d and a vs c. Goal is to find ordering of team names, which the best describes current situation in that four team league

Optimizing K-means clustering using Genetic Algorithm

六眼飞鱼酱① 提交于 2019-12-23 05:40:29
问题 I have the following dataset (obtained here): ----------item survivalpoints weight 1 pocketknife 10 1 2 beans 20 5 3 potatoes 15 10 4 unions 2 1 5 sleeping bag 30 7 6 rope 10 5 7 compass 30 1 I can cluster this dataset into three clusters with kmeans() using a binary string as my initial choice of centers. For eg: ## 1 represents the initial centers chromosome = c(1,1,1,0,0,0,0) ## exclude first column (kmeans only support continous data) cl <- kmeans(dataset[, -1], dataset[chromosome == 1,

Rank Selection in GA?

我们两清 提交于 2019-12-22 09:57:02
问题 I have implemented Roulette wheel selection in GA . TotalFitness=sum(Fitness); ProbSelection=zeros(PopLength,1); CumProb=zeros(PopLength,1); for i=1:PopLength ProbSelection(i)=Fitness(i)/TotalFitness; if i==1 CumProb(i)=ProbSelection(i); else CumProb(i)=CumProb(i-1)+ProbSelection(i); end end SelectInd=rand(PopLength,1); for i=1:PopLength flag=0; for j=1:PopLength if(CumProb(j)<SelectInd(i) && CumProb(j+1)>=SelectInd(i)) SelectedPop(i,1:IndLength)=CurrentPop(j+1,1:IndLength); flag=1; break;