Genetic Algorithms-Saving and using objective function values in later iterations
显示 更早的评论
Hi,
I want to solve an optimization problem and everything run perfect within MATLAB when using Genetic Algorithms commands.
In order me to reduce the time for the solving the optimization problem (with use og genetic algorithms) I want the solver to store and use the objective function values for specific values of the design variables, so in the new populations of i-th iteration, of possible solutions, the value of the objective function that already calculated with iteartion i-1 for design variables with similar value NOT to be calculated again but use the value as calculated in the previous iterations.
For example in a problem with one design variable X and oblective function F(X)
if in the first iteration in the genetic algorithms the algorithm will calculate that for X=2 then F(2)=105
then in the second iteartion of the genetic algorithm if the population will consist of X=2 the GA not to calculate the onjective finction again but use the value F(2)=105 as previously calculated (for not spending time for calculate the F(X) value.
Do you know how I can model it?
Thank you,
Constantine
回答(1 个)
Ameer Hamza
2020-6-12
编辑:Ameer Hamza
2020-6-12
0 个投票
3 个评论
Constantine Michailides
2020-6-12
Ameer Hamza
2020-6-12
memorize() does not affect or care about the internal working of the objective function. It just creates a wrapper around your objective function and sees if it can use a cached result, or it needs to pass it to the objective function. memorize() object work, just like your original function. Therefore, if your objective function works correctly with GA, then memorize will work fine too.
Constantine Michailides
2020-6-12
类别
在 帮助中心 和 File Exchange 中查找有关 Genetic Algorithm 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!