Optimization Tool, genetic algorithm

4 次查看(过去 30 天)
I'm using the optimization tool. I have a very elaborate ga that works just fine with code. Unfortunately, I cannot just run it and let it solve all in one sitting because of the length of run time. So I am trying to figure out how to use the optimization tool so that I can pause and resume the problem. For example, see code below. My setup function defines x2 and x3 that need to be passed in to the fitness function each time it runs. The tool just has a space for fitness function, I can run setupfunction first. But if I do this, then I can't get x2 and x3 in to mainfunction for it to run.
setupfunction
[x,fval]=ga(@(x1)mainfunction(x1,x2,x3),nval)

回答(1 个)

Alan Weiss
Alan Weiss 2016-8-23
Sorry, Scott, your question is not clear to me. There are several things I do not understand:
  1. Do you need to use the GUI? You say that "... ga ... works just fine with code." Does this mean that you can do what you want at the command line, but things are unsatisfactory using the GUI? If so, why do you want to use the GUI? If not, then what is the problem at the command line?
  2. I do not understand why or how you want to pass in x2 and x3 that vary over the course of the optimization.
  3. Do you need to save partial results to a file? To something else?
In short, I do not understand your question. Sorry.
Alan Weiss
MATLAB mathematical toolbox documentation

类别

Help CenterFile Exchange 中查找有关 Genetic Algorithm 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by