How can I terminate the ga (genetic aclgorithm) optimizer based on elapsed cpu time?
1 次查看(过去 30 天)
显示 更早的评论
The ga optimizer (genetic algorithm) can be given various stopping criteria: number of (stalled) iterations, wall clock (stalled) time. However, on a computer where other processes are also taking cpu time, the wall clock is not a dependable measure of elapsed computation time. This makes some computations hard to reproduce. I would assume that it in principle the cpu time of the Matlab process is a better measure in that case.
So, Is it possible to use elapsed cpu time as a stopping criterion for the ga optimizer? I assumed that one would be able to define one's own stopping criteria, but from the documentation it is not clear to me which option I should use, or whether my assumption is correct.
0 个评论
采纳的回答
Alan Weiss
2017-12-4
编辑:Alan Weiss
2017-12-4
You can define you own stopping criteria by using an output function. Be careful, using cputime can give you strange results when computing in parallel. You will see in that linked discussion that ga used to use cputime for monitoring the time spent in an optimization, but this was changed in R2015b to use tic/toc because of the oddities when computing in parallel.
Alan Weiss
MATLAB mathematical toolbox documentation
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Genetic Algorithm 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!