Adaptive Optimization Algorithm for Resetting Techniques in Obstacle-ridden Environments