MyGit

drvinceknight/Nashpy

Fork: 71 Star: 335 (更新于 2024-11-11 20:14:37)

license: MIT

Language: Python .

A python library for 2 player games.

最后发布版本: v0.0.41 ( 2024-03-11 00:38:57)

官方网址 GitHub网址

DOI Discord Gitter DOI

Nashpy: a python library for 2 player games.

Nashpy is:

Documentation

Full documentation is available here: http://nashpy.readthedocs.io/

Installation

$ python -m pip install nashpy

To install Nashpy on Fedora, use:

$ dnf install python3-nashpy

Usage

Create bi matrix games by passing two 2 dimensional arrays/lists:

>>> import nashpy as nash
>>> A = [[1, 2], [3, 0]]
>>> B = [[0, 2], [3, 1]]
>>> game = nash.Game(A, B)
>>> for eq in game.support_enumeration():
...     print(eq)
(array([1., 0.]), array([0., 1.]))
(array([0., 1.]), array([1., 0.]))
(array([0.5, 0.5]), array([0.5, 0.5]))
>>> game[[0, 1], [1, 0]]
array([3, 3])

Other game theoretic software

  • Gambit is a library with a python api and support for more algorithms and more than 2 player games.
  • Game theory explorer a web interface to gambit useful for teaching.
  • Axelrod a research library aimed at the study of the Iterated Prisoners dilemma

Development

Clone the repository and create a virtual environment:

$ git clone https://github.com/drvinceknight/nashpy.git
$ cd nashpy
$ python -m venv env

Activate the virtual environment and install tox:

$ source env/bin/activate
$ python -m pip install tox

Make modifications.

To run the tests:

$ python -m tox

To build the documentation. First install the software which also installs the documentation build requirements.

$ python -m pip install flit
$ python -m flit install --symlink

Then:

$ cd docs
$ make html

Full contribution documentation is available at https://nashpy.readthedocs.io/en/latest/contributing/index.html

Pull requests are welcome.

Code of conduct

In the interest of fostering an open and welcoming environment, all contributors, maintainers and users are expected to abide by the Python code of conduct: https://www.python.org/psf/codeofconduct/

最近版本更新:(数据更新于 2024-10-14 10:31:51)

2024-03-11 00:38:57 v0.0.41

2023-08-04 20:39:07 v0.0.40

2023-08-01 23:21:38 v0.0.39

2023-07-26 19:26:18 v0.0.38

2023-03-29 18:22:48 v0.0.37

2023-01-11 00:23:52 v0.0.36

2022-06-20 17:22:00 v0.0.35

2022-06-07 23:43:10 v0.0.34

2022-05-27 23:13:15 v0.0.33

2022-03-25 18:59:58 v0.0.32

主题(topics):

algorithm, computer-science, equilibria, game, mathematics, nash, python

drvinceknight/Nashpy同语言 Python最近更新仓库

2024-11-22 02:39:01 goauthentik/authentik

2024-11-22 00:03:47 comfyanonymous/ComfyUI

2024-11-21 22:06:18 rashevskyv/dbi

2024-11-21 21:09:02 xtekky/gpt4free

2024-11-21 20:03:58 ultralytics/ultralytics

2024-11-21 00:54:04 hect0x7/JMComic-Crawler-Python