{"id":20631059,"url":"https://github.com/gfarrell/eye-for-an-eye","last_synced_at":"2026-04-17T16:02:27.232Z","repository":{"id":142037726,"uuid":"234437133","full_name":"gfarrell/eye-for-an-eye","owner":"gfarrell","description":"Evolutionary prisoner's dilemma simulator","archived":false,"fork":false,"pushed_at":"2020-06-15T12:35:57.000Z","size":53,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-17T07:09:19.033Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gfarrell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-17T00:17:32.000Z","updated_at":"2024-10-18T15:32:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"23f0c626-f106-4ebd-9857-e6b007ad0a07","html_url":"https://github.com/gfarrell/eye-for-an-eye","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfarrell%2Feye-for-an-eye","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfarrell%2Feye-for-an-eye/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfarrell%2Feye-for-an-eye/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfarrell%2Feye-for-an-eye/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gfarrell","download_url":"https://codeload.github.com/gfarrell/eye-for-an-eye/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242588424,"owners_count":20154203,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T14:10:43.091Z","updated_at":"2026-04-17T16:02:22.176Z","avatar_url":"https://github.com/gfarrell.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# An Eye for an Eye\n\nEvolution simulator for the prisoner's dilemma.\n\n## Purpose\n\nThe point of this project is to simulate scenarios in which `Agent`s\nplay out the prisoner's dilemma but with a conception of memory (so\nthey respond to what their counteragents last did to them). In order\nto test the \"fitness\" of various strategies, the simulator also has\nan appreciation of reproduction, such that `Agent`s achieving certain\nscores will be able to reproduce.\n\nThe basic idea is that an `Agent` has two possible actions, `Cooperate`\nand `Defect`. In the simulation, there is a `RewardsVector` which will\nconfigure the calculation for what happens in the following scenarios,\nfor two `Agent`s `A` and `B`:\n\n* `A` cooperates, `B` cooperates;\n* `A` cooperates, `B` defects;\n* `A` defects, `B` cooperates;\n* `A` defects, `B` defects.\n\nThese outcomes will have different weightings, which will be used on\neach round to calculate the `Agent`'s score, and therefore give it a\nprobability of reproducing.\n\nThe simplest behaviour is a \"tit-for-tat\" algorithm (or \"an eye for an\neye\"), in which the `Agent` will, by default, cooperate, but if the\ncounteragent defects, then it will defect in retaliation.\n\n## Nuances in the simulation\n\n### Imperfect world\n\nNo natural `Agent` is perfect, so the world will introduce a \"fuck-up\nfactor\" or \"mistake factor\". This will be the probability of an `Agent`\nwhich, intending to do one action, does the opposite.\n\n### Beg forgiveness\n\n`Agent`s can also have a tolerance of defections in their counteragents,\nby adjusting the `generosity` factor, which is the likelihood that\nan `Agent` will cooperate even in the face of a defection from the\ncounteragent.\n\n### El vivo vive del bobo\n\nSome people might believe that by being selfish, one can get ahead, and\ntherefore one should defect more often in the hope that some sucker\ncooperates anyway. The `selfishness` factor of an `Agent` is the\npropensity to defect no matter what.\n\n### Fitness inheritance\n\nIn this model, children inherit scores from their parents, to mimic how\nadvantage and disadvantage can be inherited in the real world.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgfarrell%2Feye-for-an-eye","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgfarrell%2Feye-for-an-eye","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgfarrell%2Feye-for-an-eye/lists"}