【文件属性】:
文件名称:Nashpy:用于在两个玩家游戏中计算Nash平衡的库
文件大小:81KB
文件格式:ZIP
更新时间:2021-01-31 16:39:33
game python computer-science algorithm mathematics
Nashpy:一个用于计算2个玩家战略游戏均衡性的python库。
该库在2个玩家游戏中实现了纳什均衡的以下算法:
支持列举
最佳响应多面体顶点枚举
Lemke Howson算法
Nashpy具有一组简单的Python依赖关系:它仅需要numpy和scipy因此可以直接在所有操作系统上安装。
安装
通过设计,Nashpy易于安装:最简单的安装方法是从pypi:
$ python -m pip install nashpy
用法
通过传递两个二维数组/列表来创建双向矩阵游戏:
>> > 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. ]
【文件预览】:
Nashpy-master
----setup.py(587B)
----.gitignore(96B)
----readthedocs.yml(403B)
----requirements.txt(28B)
----src()
--------nashpy()
----CITATION.md(637B)
----LICENSE(1KB)
----doctests.py(650B)
----.github()
--------workflows()
----README.md(2KB)
----tests()
--------unit()
----environment.yml(143B)
----CHANGES.md(1KB)
----paper.bib(2KB)
----docs()
--------Makefile(606B)
--------index.rst(727B)
--------conf.py(5KB)
--------_static()
--------reference()
--------how-to()
--------tutorial()
--------discussion()
----paper.md(5KB)