Is it possible to export extra parameters (variables) from the inner of a fitness finction in the Parallel Genetic Algorithm in Matlab?

3 views (last 30 days)
my question is about the Parallel version of the Genetic Algorithm (GA) in Matlab ('UseParallel', 'always' in gaoptimset). I have a fitness function to evaluate that is not a function in a closed form (y=x^2+5) but a black-box where in the inner there is a clustering algorithm that runs N times. Given an individual the parallel GA gives a fitness value (scalar), and that's ok. I would like to export others model parameters (others internal variables of the fitness function ) calculated in the inner of fitness function. To be more precise I would like to get the centroids values and the "assignement matrix" of each of N runs (for each individual of the GA the clustering algorithm runs N times). I'm looking for a solution other than a "save" command in the fitness function and moreover the latter seems not working well because it will be saved only the model parameters of the last individual evaluated but not the ones of the best individual. I tried also to nest the fitness function in the main function wher I call the GA (augmenting the variable scope), but GA after the first Generation (starting to 0) seems to work with a private copy of the fitness function (that I pass as an anonymous function to the GA because I need to pass extra parameters) stored in each worker space of matlabpool. Thus with the nested solution I can memorize in a multiple scope variable only the model parameters for the generation 0. After the 0 generation of the GA the nested trick doesn't work anymore and at the and of Parallel GA optimization I get that parameters, but I would the parameters corresponding to the best individual after for example 500 generations.
I hope to be clear in the explanation of my problem. Thanks in advance for your help.
  1 Comment
Muhammad Raza
Muhammad Raza on 6 Feb 2016
Algorithm to find optimal location and size of multiple distributed generation. dg-algorithm.blogspot.com/2016/02/distributed-generation-algorithm-code.html

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!