Borrar filtros
Borrar filtros

Optimization results when run GA with mixed integer

2 visualizaciones (últimos 30 días)
Paranee Sawad
Paranee Sawad el 3 de Abr. de 2019
Dear all,
I have run ga in matlab with setting one of my four variables to be an integer then i found every time i run i will receive totally different value of an interger variable.
options = optimoptions('ga','FitnessScalingFcn',{@fitscalingrank }, ...
'PopInitRange',[LB ; UB],...
'StallGenL',10,...
'Generations',100, ...
'PopulationSize',25,...
'EliteCount',1, ...
'CrossoverFraction',0.6,...
'UseParallel','always',...
'MigrationInterval',10,...
'MigrationFraction',0.1,...
'MigrationDirection','both', ...
'plotFcn',@gaplotbestf);
%Setup for use of the function ga for continuous variables
%[X fval exitflag output population scores] = ga(FitnessFunction,nvars,[],[],[],[],LB,UB,[],options);
%Setup for use of function ga for integer variables
[X, fval, exitflag, output, population, scores] = ga(FitnessFunction,nvars,[],[],[],[],LB,UB,[],[1],options);
for example: first time
X =
10.0000 0.6548 0.0150 0.0200
fval =
5.3928
exitflag =
0
second time
X =
5.0000 0.6520 0.0150 0.0200
fval =
5.3929
exitflag =
0
As you can see the first value is quite different from 10 to 5 so i really have no idea which one i should choose even i run it many times or may be i have set something wrong please kindly help me
Thank you.

Respuestas (0)

Categorías

Más información sobre Solver Outputs and Iterative Display en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by