function candidates=generate_candidates(best_control, regulator_parameters)
num_of_candidates=regulator_parameters.num_of_candidates;
dim_u=size(best_control,1);
if (regulator_parameters.generate_candidates_mode=='rand')
    candidates=best_control*ones(1,num_of_candidates)+regulator_parameters.search_region*[rand(dim_u,num_of_candidates-1).*(-1).^(randi(2,dim_u,num_of_candidates-1)-1) zeros(dim_u,1)];
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
