[![Coverage
Status](https://coveralls.io/repos/github/drvinceknight/Nashpy/badge.svg?branch=master)](https://coveralls.io/github/drvinceknight/Nashpy?branch=master)
[![Build
Status](https://travis-ci.org/drvinceknight/Nashpy.svg?branch=master)](https://travis-ci.org/drvinceknight/Nashpy)
[![Build
status](https://ci.appveyor.com/api/projects/status/fj864wcbfpqfy6po?svg=true)](https://ci.appveyor.com/project/drvinceknight/nashpy)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.596758.svg)](https://doi.org/10.5281/zenodo.596758)
[![Join the chat at
https://gitter.im/Nashpy/Lobby](https://badges.gitter.im/Nashpy/Lobby.svg)](https://gitter.im/Nashpy/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![DOI](http://joss.theoj.org/papers/10.21105/joss.00904/status.svg)](https://doi.org/10.21105/joss.00904)
# Nash: a python library for the computation of equilibria of 2 player strategic games.
This library implements the following algorithms for Nash equilibria on 2 player
games:
- Support enumeration
- Best response polytope vertex enumeration
- Lemke Howson algorithm
**Nashpy** has a simple set of Python dependencies: it only requires `numpy`
and `scipy` so is straightforward to install on all operating systems.
## Installation
**By design Nashpy** is easy to install: the easiest way to install is from
pypi:
```bash
$ pip install nashpy
```
## Usage
Create bi matrix games by passing two 2 dimensional arrays/lists:
```python
>>> 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])
```
## Documentation
Full documentation is available here: http://nashpy.readthedocs.io/
## Other game theoretic software
- [Gambit](http://www.gambit-project.org/) is a library with a python api and
support for more algorithms and more than 2 player games.
- [Game theory explorer](http://gte.csc.liv.ac.uk/index/) a web interface to
gambit useful for teaching.
- [Axelrod](http://axelrod.readthedocs.io/en/stable/) a research library aimed
at the study of the Iterated Prisoners dilemma
## Development
To install a development version of this library:
```
$ python setup.py develop
```
To run the full test suite (install `pytest`: `pip install pytest`) and run:
```
$ pytest .
```
All contributions are welcome, although this is meant to be a simple library,
for more detailed game theoretic contribution please see
[gambit](https://github.com/gambitproject/gambit).
## 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/
没有合适的资源?快使用搜索试试~ 我知道了~
Python-Nash一个用于计算2人策略游戏的平衡的python库
共66个文件
py:27个
rst:24个
yml:4个
需积分: 45 18 下载量 19 浏览量
2019-08-10
03:41:16
上传
评论 1
收藏 78KB ZIP 举报
温馨提示
Nash 一个用于计算2人策略游戏的平衡的python库
资源推荐
资源详情
资源评论
收起资源包目录
Python-Nash一个用于计算2人策略游戏的平衡的python库.zip (66个子文件)
drvinceknight-Nashpy-cdb482e
readthedocs.yml 33B
paper.bib 2KB
CITATION.md 637B
CHANGES.md 1KB
doctests.py 591B
src
nashpy
integer_pivoting
__init__.py 32B
integer_pivoting.py 2KB
algorithms
support_enumeration.py 5KB
__init__.py 0B
lemke_howson.py 3KB
vertex_enumeration.py 1KB
learning
__init__.py 0B
fictitious_play.py 1KB
__init__.py 53B
game.py 5KB
polytope
polytope.py 2KB
__init__.py 24B
version.py 23B
requirements.txt 28B
.travis.yml 1KB
LICENSE 1KB
environment.yml 356B
paper.md 5KB
setup.py 587B
README.md 3KB
docs
reference
source
nashpy.learning.rst 262B
nashpy.rst 373B
nashpy.algorithms.rst 676B
lemke-howson.rst 7KB
bibliography.rst 2KB
degenerate-games.rst 3KB
index.rst 212B
vertex-enumeration.rst 4KB
fictitious-play.rst 3KB
support-enumeration.rst 2KB
how-to
create-a-game.rst 1017B
install-nashpy.rst 343B
calculate-utilities.rst 839B
use-fictitious-play.rst 2KB
solve-with-vertex-enumeration.rst 588B
index.rst 257B
solve-with-support-enumeration.rst 593B
solve-with-lemke-howson.rst 1KB
discussion
other-python-game-theory-libraries.rst 975B
john-nash.rst 613B
gambit.rst 2KB
index.rst 126B
conf.py 5KB
index.rst 727B
Makefile 606B
tutorial
index.rst 7KB
_static
learning
divergent_example
main.svg 34KB
main.py 843B
convergent_example
main.svg 38KB
main.py 867B
appveyor.yml 656B
tests
unit
test_support_enumeration.py 12KB
test_lemke_howson.py 3KB
test_integer_pivoting.py 4KB
__init__.py 0B
test_vertex_enumeration.py 2KB
test_polytope.py 7KB
test_fictitious_play.py 3KB
test_version.py 201B
test_game.py 16KB
.gitignore 83B
共 66 条
- 1
资源评论
weixin_39840387
- 粉丝: 784
- 资源: 3万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功