[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
problem with ga function variable bounds
From: |
George Kousiouris |
Subject: |
problem with ga function variable bounds |
Date: |
Mon, 18 May 2009 13:46:12 +0300 |
User-agent: |
Thunderbird 2.0.0.21 (Windows/20090302) |
Hi,
I am using ga package version 0.9.4. I am trying to launch the genetic
algorithm with lower and upper bounds for the variables but this does
not seem to work. It seems that the values are inside the interval
[0,1]. So I took the values from this interval and normalized them in
order to fall inside the intervals I wanted. But while it was working
well for 30-40 generations, then values over 1 or negative appeared.
Does anyone have any idea why this is happening? I also tried
PopInitRange which again worked for a while and then it gave values
outside the interval. I guess this option may refer only to the initial
population range.
Snippet from my code:
% Fitness function
fitnessFunction = @script2;
% Number of Variables
nvars = 19;
% Linear inequality constraints
Aineq = [];
Bineq = [];
% Linear equality constraints
Aeq = [];
Beq = [];
% Bounds
lb = [3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1];
ub = [10 13 13 13 13 13 13 13 13 13 13 8 8 8 8 8 8 8 8];
% Nonlinear constraints
nonlconFunction = [];
%options = gaoptimset;
% Modify some parameters
options = gaoptimset('Generations' ,3,'PopulationSize',20);
%NORMALIZATION GIA TA YPOLOIPA DIASTHMATA
%options = gaoptimset(options,'StallTimeLimit' ,Inf);
%options = gaoptimset(options,'Display' ,'off');
% Run GA
[X,FVAL,REASON,OUTPUT,POPULATION,SCORES] =
ga(fitnessFunction,nvars,Aineq,Bineq,Aeq,Beq,lb,ub,nonlconFunction,options)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- problem with ga function variable bounds,
George Kousiouris <=