Reproducing cosmic evolution of galaxy population from z = 4 to 0