Thread Subject: GA outputs

Subject: GA outputs

From: Dave Brackett

Date: 21 Aug, 2008 20:43:02

Message: 1 of 2

Does anyone know how I can pass variables back from a
genetic algorithm (GA) optimisation function to the m file
that initiated the GA?

I am using anonymous functions to pass variables to the GA,
but cannot work out how to get variables back from the GA.
It appears that the only allowable outputs are
[x,fval,exitflag,output,population,scores].

One way could be to write each variable to file and then
read them back from that file, but that is very
inefficient. I am trying to avoid using global variables as
I run into problems with these when running the GA in
parallel using the parallel computing toolbox.

Hopefully someone can point me in the right direction.
Thanks!


Subject: GA outputs

From: Dave Brackett

Date: 26 Aug, 2008 13:27:01

Message: 2 of 2

"Dave Brackett" <davebrackett@hotmail.com> wrote in message
<g8kk0m$fa6$1@fred.mathworks.com>...
> Does anyone know how I can pass variables back from a
> genetic algorithm (GA) optimisation function to the m
file
> that initiated the GA?
>
> I am using anonymous functions to pass variables to the
GA,
> but cannot work out how to get variables back from the
GA.
> It appears that the only allowable outputs are
> [x,fval,exitflag,output,population,scores].
>
> One way could be to write each variable to file and then
> read them back from that file, but that is very
> inefficient. I am trying to avoid using global variables
as
> I run into problems with these when running the GA in
> parallel using the parallel computing toolbox.
>
> Hopefully someone can point me in the right direction.
> Thanks!
>
>

I have found a workaround for this by recalculating based
on the GA output x. This only adds minor overhead as it is
recalculated only once at the very end of the optimisation
run. This then eliminates the need to pass any other
outputs from the GA to the initiating function.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
genetic algorithm Dave Brackett 21 Aug, 2008 16:45:06
output Dave Brackett 21 Aug, 2008 16:45:06
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com