%% CERAF initialization    

%% control parameters for CERAF strategy:
% deact_rate control the speed of incresing of radioactive zone size
deact_rate = 0.995;
% after this number of generation new local extreme is marked, if no better solution is found
% if you don't want to use CERAF strategy, choose high value of this parameter
quiet_generation=100000;
%initial radius of radioactive zone as a percentage of domain size
radius_rate = 0.25; 
%% other options
%if you want to save extremes, set following parameter to 1 and define runi
%variable in the configfile of your function; otherwise set 0
save_extremes = 0;
% choose if you want to display resunts during optimization
cerafdisplayconf = 0; %set 1 for on and 0 for off
%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

if cerafdisplayconf 
    display( ' ' );
    display(sprintf( 'CERAF cofiguration:' ));
    display(sprintf( '   deact_rate = %g', deact_rate ));
    display(sprintf( '   quiet_generation = %g', quiet_generation ));
    display(sprintf( '   radius_rate = %g', radius_rate ));
    display( ' ' );
end

ExtremeSize = 100;

n_extreme=0;
killed=0;
monsters=0;

Eloc=zeros(ExtremeSize,Dim);
Eval=zeros(ExtremeSize,1);
Erad=zeros(ExtremeSize,Dim);

lastbtg = 999999999999;

lastchange=0;

new_ceraf=1;

if save_extremes == 1
    Efile = sprintf( '%s_%03d_extremes.out', Name, runi);
end

%% author: Anicka Kucerova, Czech Technical University in Prague
%% version 0.0.5
%% 24 Mar 2009