function candidates=generate_candidates(best_control, search_region, num_of_candidates)
kladne=1;
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          
if (kladne)
    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
