A Generalized Simulated Annealing Framework