Nashpy 项目教程

Nashpy 项目教程

NashpyA python library for 2 player games.项目地址:https://gitcode.com/gh_mirrors/na/Nashpy

1. 项目的目录结构及介绍

Nashpy 是一个用于处理2人游戏的Python库。以下是项目的目录结构及其介绍:

Nashpy/
├── benchmarks/
├── docs/
├── src/
│   └── nashpy/
├── tests/
│   └── unit/
├── .gitignore
├── .readthedocs.yml
├── CHANGES.md
├── CITATION.md
├── LICENSE
├── README.md
├── paper/
│   ├── paper.bib
│   └── paper.md
├── pyproject.toml
├── pytest.ini
├── tox.ini
  • benchmarks/: 包含性能测试的文件。
  • docs/: 包含项目的文档文件。
  • src/nashpy/: 包含项目的主要源代码。
  • tests/unit/: 包含单元测试文件。
  • .gitignore: Git忽略文件。
  • .readthedocs.yml: 用于Read the Docs的配置文件。
  • CHANGES.md: 项目变更日志。
  • CITATION.md: 项目引用信息。
  • LICENSE: 项目许可证。
  • README.md: 项目介绍和使用说明。
  • paper/: 包含项目相关的论文文件。
  • pyproject.toml: 项目构建配置文件。
  • pytest.ini: Pytest配置文件。
  • tox.ini: Tox配置文件。

2. 项目的启动文件介绍

Nashpy 项目的启动文件位于 src/nashpy/ 目录下。主要的启动文件是 __init__.py,它初始化了整个库并导入了必要的模块。

# src/nashpy/__init__.py

from .game import Game
from .learning import replicator_dynamics, fictitious_play
from .algorithms import support_enumeration, vertex_enumeration, lemke_howson

__all__ = [
    'Game',
    'replicator_dynamics',
    'fictitious_play',
    'support_enumeration',
    'vertex_enumeration',
    'lemke_howson'
]

3. 项目的配置文件介绍

Nashpy 项目的配置文件主要包括 pyproject.tomltox.ini

pyproject.toml

pyproject.toml 文件用于配置项目的构建系统和其他相关设置。

[tool.poetry]
name = "nashpy"
version = "0.0.41"
description = "A Python library for 2 player games"
authors = ["Vincent Knight <vincent.knight@gmail.com>"]
license = "MIT"
readme = "README.md"
repository = "https://github.com/drvinceknight/Nashpy"
documentation = "http://nashpy.readthedocs.io/"

[tool.poetry.dependencies]
python = "^3.6"
numpy = "^1.18"
scipy = "^1.4"

[tool.poetry.dev-dependencies]
pytest = "^5.4"
tox = "^3.15"
sphinx = "^3.0"
alabaster = "^0.7"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

tox.ini

tox.ini 文件用于配置自动化测试环境。

[tox]
envlist = py36, py37, py38
skipsdist = true

[testenv]
deps =
    pytest
    numpy
    scipy
commands =
    pytest

以上是 Nashpy 项目的基本教程,涵盖了项目的目录结构、启动文件和配置文件的介绍。希望这些信息能帮助你更好地理解和使用 Nashpy 项目。

NashpyA python library for 2 player games.项目地址:https://gitcode.com/gh_mirrors/na/Nashpy

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

常拓季Jane

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值