{"id":20620562,"url":"https://github.com/blacklight/nash","last_synced_at":"2026-04-16T16:40:53.477Z","repository":{"id":1157627,"uuid":"1045097","full_name":"blacklight/nash","owner":"blacklight","description":"A tiny software that simulates the behaviour of a population in an environment in which each individual can adopt between two strategies (cooperating or being in competition)","archived":false,"fork":false,"pushed_at":"2010-11-02T15:54:51.000Z","size":92,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-06T20:16:35.992Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blacklight.png","metadata":{"files":{"readme":"README","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}},"created_at":"2010-11-02T15:53:29.000Z","updated_at":"2014-04-15T13:45:33.000Z","dependencies_parsed_at":"2022-08-16T12:20:28.989Z","dependency_job_id":null,"html_url":"https://github.com/blacklight/nash","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/blacklight/nash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blacklight%2Fnash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blacklight%2Fnash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blacklight%2Fnash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blacklight%2Fnash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blacklight","download_url":"https://codeload.github.com/blacklight/nash/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blacklight%2Fnash/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31895646,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T11:36:10.202Z","status":"ssl_error","status_checked_at":"2026-04-16T11:36:09.652Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-16T12:14:52.423Z","updated_at":"2026-04-16T16:40:53.459Z","avatar_url":"https://github.com/blacklight.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"This is a small software that simulates the behaviour of a set of individuals\nplaced (for sake of simplicity) over a matrix where each individual can choose\nbetween two strategies:\n\n- Being cooperative with the other individuals\n- Being in competition with the other individuals\n\nFrom a certain starting point, in which each individuals has its own strategy\nindependantly from the one chosen by the others, the algorithm goes on, and a\ncertain individual x changes its strategy if there is a neighbour having a\ndifferent strategy and a higher \"gain\" value (i.e. that strategy takes more\nbenefit). The algorithm is repeated as long as an equilibrium point is reached\n(Nash's equilibrium) in which no individual will change its strategy anymore as\nno change is convenient anymore. This balance point won't be always reached\nanyway, and the algorithm recognizes a scenario that has no Nash's equilibrium\npoint when a loop occurs (i.e. when it takes in exam a configuration that was\nalready met).\n\nUsage of the program: compile simply issuing `make', then start it with\n./nash \u003cenvironment_file\u003e \u003ccoop_coop_gain\u003e \u003ccoop_comp_gain\u003e \u003ccomp_coop_gain\u003e \u003ccomp_comp_gain\u003e\n\nwhere\n\n- environment_file is a file containing the starting configuration of the\nenvironment (an example is included in the file `environment'). In this file the\ncollaborating individuals are marked by a dot `.', and the ones in competition\nare marked by a `X'. Starting from here you can easily create your environment\nfile;\n\n- coop_coop_gain: Score gained when the individual x cooperates and its neighbour\ncooperates as well;\n\n- coop_comp_gain: Score gained when the individual x cooperates and its neighbour\nis in competition;\n\n- comp_coop_gain: Score gained when the individual x is in competition and its\nneighbour cooperates;\n\n- comp_comp_gain: Score gained when both the individual x and its neighbour are\nin competition.\n\nAn example is the problem of the two prisoners:\n\n- When A doesn't confess and B doesn't confess too, they both get 8 years of\nprison (coop_coop_gain = -8);\n\n- When A doesn't confess and B confesses, A gets 20 years of prison and B is\nfree (coop_comp_gain = -20);\n\n- When A confesses and B doesn't, A is free and B gets 20 years of prison\n(comp_coop_gain = 0);\n\n- When both A and B confess, they both get 14 years of prison (comp_comp_gain =\n-14).\n\nFor running a simulation of the two prisoners' problem over the example\nenvironment just type\n\n./nash environment -8 -20 0 -14\n\nHave fun.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblacklight%2Fnash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblacklight%2Fnash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblacklight%2Fnash/lists"}