Bat algorithm for constrained optimization tasks