Source code for the simulation from ref. Burtsev M., Turchin P. Evolution of cooperative strategies from first principles // Nature. 2006. № 440. С. 1041–1044.