Options for ga() with only integer variables

Hello to everyone,
I want to run a ga() with just integer variables.
The boundary conditions that I set for myself are: number of variables is 5, lb is 1 and the ub is 4. So there are 1024 possible combinations. My number of generations will be 7 with a Population of 30.
I am using gacreationuniform, crossoverlaplace and mutationpower. Also, I will try several Crossover fractions.
When I run with this set of parameters and with an crossover fraction of 0.2, I will "only" get 132 unique individuals.
Does any one have an idea to set better parameters for the ga()?
Thank you very much and greetings,
Jonas

댓글 수: 2

With that few possible options, why not just evaluate the objective at every valid combination, and take the best?
Jonas
Jonas 2022년 8월 31일
My simulation time is several hours. Also I want to have an methodical approach.

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2022년 9월 1일

1 개 추천

Suppose you had a surface that had a large bowl, but also had a narrow deeper pit. Any given initial population might happen to all be in the catch-basin for the large bowl. Optimization on that bowl might only require examining 1/8th or so of the possibilities to find the minima of the bowl.
Is cross-over and mutation guaranteed to find the narrow deep pit? No -- at least not unless you run a large population for a lot of iterations. The catch-basin for the narrow deep pit might only cover (for example) 1/256 th of the possibilities.

댓글 수: 2

Hi @Jonas,
I think this is scenario of a large bowl with a narrow pit. The deepest pit lies at .
x = linspace(1, 7, 60001);
y = exp(-(exp(- abs((x - 4)/0.8))/0.04).^2) - exp(-(x.^4 - 16*x.^2 + 5*x).^2);
plot(x, y), grid on, xlabel('x'), ylabel('y')
fun = @(x) exp(-(exp(- abs((x - 4)/0.8))/0.04).^2) - exp(-(x.^4 - 16*x.^2 + 5*x).^2);
lb = 1;
ub = 7;
options = optimoptions('ga', 'PopulationSize', 30, 'MaxGenerations', 7);
x = ga(fun, 1, [], [], [], [], lb, ub, [], options)
Optimization terminated: maximum number of generations exceeded.
x = 3.8839
Imagine something like
A B C
* * *
** ** * *
******** ********** * *
* **
+
D E
if you start anywhere in the range A to B, you are going to end up either at D or in the shallow bowl.
If you start in B to C you may end up at the true minima at E (but in some cases you would end up near D anyhow even if you started in B to C range.)

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

제품

릴리스

R2018b

태그

질문:

2022년 8월 31일

댓글:

2022년 9월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by