This paper deals with the single machine scheduling problem with earliness and tardiness penalties, considering distinct time windows and sequence-dependent setup time. Due to the complexity of this problem, an adaptive genetic algorithm is proposed for solving it. Many search operators are used to explore the solution space where the choice probability for each operator depends on the success in a previous search. The initial population is generated by applying GRASP to five dispatch rules. For each individual generated, a polynomial time algorithm is used to determine the initial optimal processing date for each job. During the evaluation process, the best individuals produced by each crossover operator, in each generation undergo refinement in order to improve quality of individuals. Computational results show the effectiveness of the proposed algorithm.