Global optimization toolbox - GA solver

I used the following commands to generate random numbers in the range 0 to 5 for my input variable a and b. I also put 0 as the lower bound and 5 as upper bound in the constraints. The rest remain at default values.
a=rand*5; b=rand*5;
When I run the GA solver, I expect the value for final point should be between 0 to 5. Surprisingly, why I got the final point outside the range of 0 to 5. I got the numbers such as 9.473, -0.651 etc.
Secondly, the current iteration will always stop at the figure I provided at the generation, stopping criteria. e.g if I provide 600, the current iteration will stop at 600, I put 4000, it will stop at 4000 and so on.

Answers (1)

ga is a strictly feasible algorithm with respect to bounds and linear constraints, so if you give bounds properly, you will never get a member of a population to violate the constraints. Therefore, you did something wrong.
You don't provide the exact commands that you use, so I am going to have to guess what you did. I suppose that your problem has at least two dimensions, and that you gave the following bounds:
lb = 0;
ub = 5;
If you look at the documentation for bounds, you see that you need to give bounds as vectors:
lb = zeros(N,1);
ub = 5*ones(N,1);
Here N is the number of dimensions of your problem.
As for stopping conditions, take a look at the algorithm description.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation

Products

Asked:

on 10 Oct 2012

Community Treasure Hunt

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

Start Hunting!