My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
function y = rastriginsfcn(x)
% Takes row inputs. If not row, will attempt to correct it.
% Syntax:
% y = rastriginsfcn(x)
% options = rastringinsfcn('init')

if strcmp(x,'init')
y.Aineq = [] ; y.bineq = [] ;
y.Aeq = [] ; y.beq = [] ;
y.LB = [-4,-4] ; y.UB = [4,4] ;
y.nonlcon = [] ;
y.options.PopInitRange = [-4, -4; 4, 4] ;
y.options.KnownMin = [0,0] ;
y.options.PopulationSize = 100 ;
y.options.Vectorized = 'on' ;
y.options.ConstrBoundary = 'absorb' ;
% y.options.InitialPopulation = rand(100,2) ;
% y.options.InitialVelocities = repmat([-1,0],100,1) ;
else
% x = reshape(x,1,[]) ;
% y = 10*size(x,2) + x*x' - 10*sum(cos(2*pi*x),2) ;

y = 10*size(x,2) + sum(x.^2,2) - 10.*sum(cos(2*pi*x),2) ;
end

Change log

r2 by sdn.chen on Apr 15, 2010   Diff
[No log message]
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 783 bytes, 24 lines
Powered by Google Project Hosting