PHPackages                             hopeseekr/prisoners-dilemma - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. hopeseekr/prisoners-dilemma

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

hopeseekr/prisoners-dilemma
===========================

v2.0.0(1y ago)79[8 issues](https://github.com/hopeseekr/PrisonersDilemma/issues)[1 PRs](https://github.com/hopeseekr/PrisonersDilemma/pulls)MITPHPPHP ^8.2

Since Jun 30Pushed 1y ago1 watchersCompare

[ Source](https://github.com/hopeseekr/PrisonersDilemma)[ Packagist](https://packagist.org/packages/hopeseekr/prisoners-dilemma)[ Docs](https://github.com/hopeseekr/PrisonersDilemma/)[ RSS](/packages/hopeseekr-prisoners-dilemma/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (11)Versions (4)Used By (0)

Prisoner's Dilemma Project
==========================

[](#prisoners-dilemma-project)

[![TravisCI](https://camo.githubusercontent.com/1030838c7a4f28e08a464b91d41ef4735eb9a4eb92f91c5f2738a21d5defc2e7/68747470733a2f2f7472617669732d63692e6f72672f70687065787065727473696e632f736b656c65746f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/phpexpertsinc/skeleton)[![Maintainability](https://camo.githubusercontent.com/142187f7729230f9815c0d203ef47598bec18bf64dad7e9f953e8e5b0dd7f273/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f33323261346333383265356562663161356430362f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/hopeseekr/PrisonersDilemma/maintainability)[![Test Coverage](https://camo.githubusercontent.com/54eaa7442ea0c2dc73862c27f6b580f29fbb89ce7c13b63004ade8fccb029a37/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f35303363626130633533656232363263393437612f746573745f636f766572616765)](https://codeclimate.com/github/phpexpertsinc/SimpleDTO/test_coverage)

The Prisoner's Dilemma Project is meant to see if evolutionary pressures alone are enough to arrive at an optimal solution to this age old philosophical thought experiment.

It uses the [**PHP Evolver genetic algorithm framework**](https://github.com/PHPExpertsInc/php-evolver).

Installation
------------

[](#installation)

Via Composer

```
composer create-project hopeseekr/prisoners-dilemma
```

Usage
-----

[](#usage)

```
# Play the classic Prisoner's Dilemma yourself against a completely irrational opponent.
./dilemma play

# Run the Genetic Algorithm to see how Nature would evolve a strategy, assuming everyone is *purely* rational.
./dilemma evolve:classic
```

[![image](https://user-images.githubusercontent.com/1125541/86166578-9f82ae80-bada-11ea-8ee6-ef70d5fc8f1f.png)](https://user-images.githubusercontent.com/1125541/86166578-9f82ae80-bada-11ea-8ee6-ef70d5fc8f1f.png)

Testing
-------

[](#testing)

*No tests have been created. I'm very open to contributions.*

```
phpunit --testdox
```

Contributors
============

[](#contributors)

[Theodore R. Smith](https://www.phpexperts.pro/%5D)
GPG Fingerprint: 4BF8 2613 1C34 87AC D28F 2AD8 EB24 A91D D612 5690
CEO: PHP Experts, Inc.

License
-------

[](#license)

MIT license. Please see the [license file](LICENSE) for more information.

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~546 days

Total

4

Last Release

556d ago

Major Versions

v0.5 → v1.0.02020-07-01

v1.0.0 → v2.0.02024-12-25

PHP version history (2 changes)v0.2PHP ^7.4

v2.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/3f3a2dd16766f6b03c330e65aaca9dfb97f1bbbb41c5e2af5681f58f670b7917?d=identicon)[hopeseekr](/maintainers/hopeseekr)

---

Top Contributors

[![hopeseekr](https://avatars.githubusercontent.com/u/1125541?v=4)](https://github.com/hopeseekr "hopeseekr (15 commits)")

---

Tags

machine learninggenetic algorithmthought experiment

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/hopeseekr-prisoners-dilemma/health.svg)

```
[![Health](https://phpackages.com/badges/hopeseekr-prisoners-dilemma/health.svg)](https://phpackages.com/packages/hopeseekr-prisoners-dilemma)
```

###  Alternatives

[rubix/ml

A high-level machine learning and deep learning library for the PHP language.

2.2k1.5M28](/packages/rubix-ml)[nlp-tools/nlp-tools

NlpTools is a set of php 5.3+ classes for beginner to semi advanced natural language processing work.

775672.1k5](/packages/nlp-tools-nlp-tools)[codewithkyrian/transformers

State-of-the-art Machine Learning for PHP. Run Transformers in PHP

758267.3k9](/packages/codewithkyrian-transformers)[php-ai/php-ml

PHP-ML - Machine Learning library for PHP

1061.9M13](/packages/php-ai-php-ml)[davmixcool/php-sentiment-analyzer

PHP Sentiment Analyzer is a lexicon and rule-based sentiment analysis tool that is used to understand sentiments in a sentence using VADER (Valence Aware Dictionary and sentiment Reasoner).

136173.7k1](/packages/davmixcool-php-sentiment-analyzer)[niiknow/bayes

a machine learning lib

7056.3k](/packages/niiknow-bayes)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
