I need to optimize a function $f:\mathbb{R}^n\to\mathbb{R}$ of which the explicit form missing, but I can evaluate it at any point of its domain. The only thing I know is that such function is piecewise constant. Also, the evaluation of the function is time-consuming, so is preferable that the set of points at which the function is evaluated remains relatively small.
I wanted to use some kind of direct search method, but it looks like the latter do not converge for non-differentiable function.
Is there any other method which can be used to optimize a black-box function made of step functions? Alternatively, is there any argument I can use in order to legitimate the use of a direct search algorithm although it does not converge?
Many thanks