P_generation