Optimizing complex systems by means of adaptively controlled random search