On 6/8/2016 11:14 AM, Georgios Papazetis wrote:
> I use genetic algorithms application. I run a very simple kind of a
> problem in order to show a difference that occurs between the genetic
> algorithms toolbox and the form of the problem I want to set up.
>
> function [x,fval,exitflag,output,population,score] = main()
> %% This is an auto generated MATLAB file from Optimization Tool.
> nvars = 1;
> %% Start with the default options
> options = gaoptimset;
> %% Modify options setting
> options = gaoptimset(options,'Display','iter');
> options = gaoptimset(options,'Generations',61,'StallGenLimit',60);
> options = gaoptimset(options,'PopulationSize',2);
> [x,fval,exitflag,output,population,score] =
> ga(@opt,nvars,[],[],[],[],[],[],[],[],options);
>
> function [y] = opt(t) y = abs( t - 1 ) % objective fcn
> Outputs:
>
> x = 0.9603
> fval = 0.0397
> population =
> 0.9603
> 0.9603
> 0.9603
> 0.9603
> score =
> 0.0397
> 0.0397
> 0.0397
> 0.0397
> Concerning Genetic Algorithms
> --> A population of individuals is maintained within search space for a
> GA, each individual representing a possible solution to a given problem.
> Each individual is coded as a finite length vector of components, or
> variables, in terms of some alphabet, usually the binary alphabet {0,1}.
> To continue the genetic analogy these individuals are likened to
> chromosomes and the variables are analogous to genes. Thus a chromosome
> (solution) is composed of several genes (variables). A fitness score is
> assigned to each solution representing the abilities of an individual to
> `compete'. The individual with the optimal (or generally near optimal)
> fitness score is sought. The GA aims to use selective `breeding' of the
> solutions to produce `offspring' better than the parents by combining
> information from the chromosomes.
>
> Regarding the Genetic Algorithms theory (-->) I realize, in some way,
> that the optimtool('ga') isn't appropriate to this occasion.
> Is this right, or there are options which can change the toolbox so that
> can fit to my problem?
>
> Specifically I (-->) would like to create chromosome arrays that
> correspond, one by one, to the population individuals, respectively.
> Each chromosome owns its genes related to variables (unrelated to x
> variable of objective fcn).
>
> Is there any idea?
I'm sorry to say that I have no idea what you are asking.
However, ga is a very flexible solver, and I believe that most likely
you can do what you want with it. You might need a custom population, or
custom score function, but you can probably get ga to operate the way
you want. See
http://www.mathworks.com/help/gads/genetic-algorithm-options.html
and
http://www.mathworks.com/help/gads/examples/custom-data-type-optimization-using-the-genetic-algorithm.html
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
> I use genetic algorithms application. I run a very simple kind of a
> problem in order to show a difference that occurs between the genetic
> algorithms toolbox and the form of the problem I want to set up.
>
> function [x,fval,exitflag,output,population,score] = main()
> %% This is an auto generated MATLAB file from Optimization Tool.
> nvars = 1;
> %% Start with the default options
> options = gaoptimset;
> %% Modify options setting
> options = gaoptimset(options,'Display','iter');
> options = gaoptimset(options,'Generations',61,'StallGenLimit',60);
> options = gaoptimset(options,'PopulationSize',2);
> [x,fval,exitflag,output,population,score] =
> ga(@opt,nvars,[],[],[],[],[],[],[],[],options);
>
> function [y] = opt(t) y = abs( t - 1 ) % objective fcn
> Outputs:
>
> x = 0.9603
> fval = 0.0397
> population =
> 0.9603
> 0.9603
> 0.9603
> 0.9603
> score =
> 0.0397
> 0.0397
> 0.0397
> 0.0397
> Concerning Genetic Algorithms
> --> A population of individuals is maintained within search space for a
> GA, each individual representing a possible solution to a given problem.
> Each individual is coded as a finite length vector of components, or
> variables, in terms of some alphabet, usually the binary alphabet {0,1}.
> To continue the genetic analogy these individuals are likened to
> chromosomes and the variables are analogous to genes. Thus a chromosome
> (solution) is composed of several genes (variables). A fitness score is
> assigned to each solution representing the abilities of an individual to
> `compete'. The individual with the optimal (or generally near optimal)
> fitness score is sought. The GA aims to use selective `breeding' of the
> solutions to produce `offspring' better than the parents by combining
> information from the chromosomes.
>
> Regarding the Genetic Algorithms theory (-->) I realize, in some way,
> that the optimtool('ga') isn't appropriate to this occasion.
> Is this right, or there are options which can change the toolbox so that
> can fit to my problem?
>
> Specifically I (-->) would like to create chromosome arrays that
> correspond, one by one, to the population individuals, respectively.
> Each chromosome owns its genes related to variables (unrelated to x
> variable of objective fcn).
>
> Is there any idea?
I'm sorry to say that I have no idea what you are asking.
However, ga is a very flexible solver, and I believe that most likely
you can do what you want with it. You might need a custom population, or
custom score function, but you can probably get ga to operate the way
you want. See
http://www.mathworks.com/help/gads/genetic-algorithm-options.html
and
http://www.mathworks.com/help/gads/examples/custom-data-type-optimization-using-the-genetic-algorithm.html
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation