GA: How to create chromosomes with n genes evaluated with a fitness function measunring m parameters for each one?

3 views (last 30 days)
Hi! I am working for the first time with MATLAB and I have some problems.
In particular I need to use the global optimization toolbox for an assembly line balancing problem to solve with GA.
Each chromosome of the population that I need to create is made up of a feasibile assembly solution for my product (so if I have 7 tasks I can have a population like this: 1 2 3 4 5 6 7; 2 5 3 4 1 6 7;...)
My fitness function has to measure 5 parameters of each solution, that is to say: number of workstations needed, number of changes in assembly directions and so on. Each of these is then normalized to be evaluated by a weighted sum in this form:
F=-0.4*x(1)-0.1*x(2)-0.2*x(3)-0.1*x(4)-0.2*x(5);
My question is: How, using the toolbox, can I create a population whose chromosomes are made up of n tasks and then evaluated with the fitness function that has to measure these 5 parameters?
Thank tou in advance for your help!
  1 Comment
Vigneshwar Pesaru
Vigneshwar Pesaru on 11 Apr 2017
Dear Michela Dalle Mura,
I think,you better write your code,for creating initial solutions i.e population generation by using functions such randperm() etc.
And,now after generating initial population you can call the optimiztion tool box for fitness function evaluation.
Thank you!!!

Sign in to comment.

Answers (1)

Alan Weiss
Alan Weiss on 23 Jul 2015
It sounds to me as if you have an integer optimization problem. It sounds like each population member should be a permutation of the numbers 1 through 7.
Probably your best choice would be to use intlinprog rather than ga for this problem. I suggest that you examine the Sudoku example to see how you can represent a permutation as a binary array with summation constraints.
If you really insist on using genetic algorithms, though, consult the mixed-integer optimization documentation. But I believe that you would be doing yourself a disservice to do so.
Alan Weiss
MATLAB mathematical toolbox documentation

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!