Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Generation Information from Genetic Algorithm
Replies: 6   Last Post: May 14, 2013 9:26 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Alan Weiss

Posts: 1,259
Registered: 11/27/08
Re: Generation Information from Genetic Algorithm
Posted: May 13, 2013 8:32 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 5/13/2013 12:10 AM, Maninder wrote:
> Hi Alan,
> I have some similar doubts and would appreciate if you could give some
> suggestions
>
> I am using Genetic Algorithm for optimization of a computationally
> expensive fitness function which also has constraints . I am right now
> imposing constraints in the form of penalty in to the objective
> function since constraint violation can only be calculated at the end
> of the function evaluation. I wanted to use nonlcon rather to satisfy
> the constraints.
>
> But my problem is that the fitness function evaluation is expensive
> and I cant afford to do it again for checking of constraint violation.
> I have seen some nested function formulations where using output
> function I can accumulate all the individual variable values for every
> generation.
>
> As per what I was thinking, would it be possible to have sort of a
> matrix in which I can store all the individual values at the beginning
> of a generation update that matrix while my fitness evaluations and
> when I call nonlcon for constraint evaluation, then to look up that
> updated matrix for constraint violation. While I am trying to
> implement this, I have some doubts.
>
> 1) I remember reading in some forum that outputfcn for Genetic algo
> can be called either at the beginning of a generation or at the end.
> By default, it is at the end. I wont be able to execute my method if
> it calls at the end. Sadly I am not able to find how to call the
> outputfcn at the beginning rather than the end of a generation.
>
> 2) Since my fitness function is computationally expensive, I am using
> Parallel evaluations. So Would it be possible to implement the above
> mentioned idea while using parallel option in matlab or it would
> create some difficulties??


Perhaps what you are looking for is explained in some recent documentation:
http://www.mathworks.com/help/optim/ug/writing-constraints.html#btfdwb7

As for your particular tentative approaches, you have to be careful
calling parfor with data files, you might have to use spmd commands or
some other parallel construct. Sorry, I am not an expert on parallel
computation in MATLAB.

Good luck,

Alan Weiss
MATLAB mathematical toolbox documentation



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.