Genetic Algorithm options 'PopInitRange' not working
Show older comments
I am using GAOPTIMSET to establish an upper and lower bound for my initial population in a GA optimisation.
I have abbreviated my inputs as below:
InitPopRange = [0.0076 0.0030 0.0011 0.0004 0.0068 0.0004; 0.0303 0.0068 0.0149 0.0049 0.0118 0.0303];
Options = gaoptimset('PopInitRange' , InitPopRange);
The optimisation kept crashing in my fitness function just after the very first individual had been created. During debugging, I noticed that my first individual had the following values:
x = [0.2508 0.0000 0.0000 0.2132 0.0970 1.0000];
Why is it that every single value of x falls outside InitPopRange? This is what has caused my fitness function to crash.
Obviously the work-around solution for me is to create my own initial population using a random number generator and apply my own limits. I'm just curious to know why the GA has seemingly ignored my option for initial population range. Any ideas?
5 Comments
Walter Roberson
on 11 Jun 2013
Which MATLAB version are you using?
Craig Cowled
on 11 Jun 2013
Edited: Craig Cowled
on 11 Jun 2013
Matt J
on 11 Jun 2013
I noticed that my first individual had the following values:
What method did you use to observe the individuals? How do you know this individual was the "first"?
Even if you do succeed in getting the Initial Population that you want, what is to prevent the population from evolving at later iterations into a region which causes your fitness function to crash?
Because this is a Genetic Algorithm, the fitness function doesn't have to be smooth/continuous, so I think one normally defines the fitness function to return a safe value everywhere.
Craig Cowled
on 11 Jun 2013
Accepted Answer
More Answers (1)
Craig Cowled
on 12 Jun 2013
0 votes
Categories
Find more on Genetic Algorithm in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!