function candidates=generate_candidates(best_control, regulator_parameters)
num_of_candidates=regulator_parameters.num_of_candidates;
candidates=zeros(size(best_control),num_of_candidates);
if (regulator_parameters.generate_candidates_mode=='rand')
    for i=1:num_of_candidates
        candidates=[best_control*ones(1,)+rand(size(best_control),num_of_candidates-1).*(-1).^round(rand(2,num_of_candidates-1)) best_control];
    end
else
    if (mod(num_of_candidates,2)==0)
        pom=((-((num_of_candidates-2)/2)):((num_of_candidates-2)/2))/((num_of_candidates-2)/2);
        candidates=best_control*ones(num_of_candidates-1,1)+pom'*search_region;
        candidates(num_of_candidates)=best_control+(2*rand-1)*search_region;
    else
        pom=((-((num_of_candidates-1)/2)):((num_of_candidates-1)/2))/((num_of_candidates-1)/2);
        candidates=best_control*ones(num_of_candidates,1)+pom'*search_region;
    end          
    pom1=(max(candidates)-min(candidates))/(2*num_of_candidates);
    for i=1:num_of_candidates
        if(candidates(i)<0)
            candidates(i)=abs(abs(candidates(i))-pom1);
        end
    end
end
end
