genetic algorithm - reg
4 visualizaciones (últimos 30 días)
Kallam Haranadha Reddy el 11 de Dic. de 2018
I want to use genetic algorithm for inventory classification. Number of variables is 6. All the variables must lie between 0 and 1. If we add first 4 variables, the sum must be 1. Also 5 th variable must be greater than 6 th variable. My doubt is whether the Fitness function should return a single scalar value or the fitness function should return all the fitness values of the population. I think the GA can be solved using the toolbox of GA in MATLAB. I tried to run GA in optimtool toolbox. The population size is 50. The fitness function is InvGAClassifyFitnessFunc(Position, classGA1,ClassDM!) where Position is the chromosome with the above properties. I have written the inequalities as Aineq=[0,0,0,0,-1,1] Bineq=0;
Aeq as [1,1,1,1,0,0] and Beq as ;
lb as [0,0,0,0,0,0] and ub as [1,1,1,1,1,1];
creation function as constraint-dependent. Population type is double.Scaling function as Rank. Selection function as 'Roulette'.Mutation function as 'Adaptive feasible'. Crossover function as 'Constraint dependent'. All other options as default.
When i ran this problem in MATLAB it is giving error " Not enough input arguments".
Please guide me.
Walter Roberson el 11 de Dic. de 2018
Your fitness function will be passed a single population member in the form of a vector . It should return aa scalar . ga will call it as many times as needed to pass in all the population members .
Your fitness function appears to require 3 inputs needing classGA1 and ClassDM1 as the second and third parameters . ga only passes a single parameter to the fitness function . You probably need to paramaterize the fitness function
ff = @(Position) InvGAClassifyFitnessFunc(Position, classGA1, ClassDM1 )
and then pass ff as the fitness function .