rewritten gp mechanism with discrete generations