Added GenerationMax terminate condition