Computer modeling of cooperation and altruistic punishment