joint optimization in genetic algorithm

I'm trying to use ga for optimizing 3 parameters simultaneously. I have to create a chromosome that consist of 3 section, first for the first parameters, second for second & third for third. My chromosome consist of 96 gene, 40 genes for the first parametrs, 40 genes for the second & 16 for the third. So create & cross over & mutate functions must work on each of these three section separately. Is my assumption true? & I don't know how to change my these 3 function so the ga converge.

Answers (1)

Are you using ga from Global Optimization Toolbox? Or do you have a different genetic algorithm solver?
For Global Optimization Toolbox, your control variables (the things that ga alters to look for an optimum) must all be in one row vector. For example, if x has 40 components, y has 45 components, and z has 18 components, then you can write the indices of the components as
ix = 1:40;
iy = 41:85;
iz = 86:103;
Then if sol is your solution vector,
x = sol(ix);
y = sol(iy);
z = sol(iz);
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation

2 Comments

Thanks Alan, I use ga from Global Optimization Toolbox:
options=gaoptimset('PlotFcns',{@gaplotbestf},'PopulationType','custom','TolFun',1e-4,'CreationFcn',@mycreate,'CrossoverFcn',@mycross,'MutationFcn',@mymutate,'PopulationSize',2*nvar);
[x,fval,reason,output]=ga(FitnessFCN,nvar,[],[],[],[],[],[],[],options);
Yes, I know what you said, but I don't know how GA will build three sections, because I know that when I specify nvar=103, create, mutate & other functions will work on a whole vector consisting 103 element that is the solution, but now how these function split this vector into 3 section & these functions works on each section separately to offspring & crossover & etc on each area. For example indices 1:45 consist of integers in range [2,120]( I have 45 numbers in this range) & indices 80:96 consist of range [1:16]. In this example the contents of these section are different.
You can read about the mutation and crossover functions here. Basically, mutation functions work on one component at a time, so I don't think it should matter to you exactly which component is selected. Crossover functions work on a pair of parents, but separate their influence by component, so they don't mix up unlike components.
In other words, both mutation and crossover work differently on what you call the different sections.
For a general overview, see How the Genetic Algorithm Works.
Alan Weiss
MATLAB mathematical toolbox documentation

Sign in to comment.

Categories

Asked:

liz
on 2 Aug 2016

Commented:

on 2 Aug 2016

Community Treasure Hunt

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

Start Hunting!