Continuous spatial public goods game with self and peer punishment based on particle swarm optimization