A General Method for Handling Constraints in Genetic