<div align="center">
<a href="http://aima.cs.berkeley.edu/"><img src="https://raw.githubusercontent.com/aimacode/aima-python/master/images/aima_logo.png"></a><br><br>
</div>
# `aima-python` [![Build Status](https://travis-ci.org/aimacode/aima-python.svg?branch=master)](https://travis-ci.org/aimacode/aima-python) [![Binder](http://mybinder.org/badge.svg)](http://mybinder.org/repo/aimacode/aima-python)
Python code for the book *[Artificial Intelligence: A Modern Approach](http://aima.cs.berkeley.edu).* You can use this in conjunction with a course on AI, or for study on your own. We're looking for [solid contributors](https://github.com/aimacode/aima-python/blob/master/CONTRIBUTING.md) to help.
## Structure of the Project
When complete, this project will have Python implementations for all the pseudocode algorithms in the book, as well as tests and examples of use. For each major topic, such as `nlp` (natural language processing), we provide the following files:
- `nlp.py`: Implementations of all the pseudocode algorithms, and necessary support functions/classes/data.
- `tests/test_nlp.py`: A lightweight test suite, using `assert` statements, designed for use with [`py.test`](http://pytest.org/latest/), but also usable on their own.
- `nlp.ipynb`: A Jupyter (IPython) notebook that explains and gives examples of how to use the code.
- `nlp_apps.ipynb`: A Jupyter notebook that gives example applications of the code.
## Python 3.4 and up
This code requires Python 3.4 or later, and does not run in Python 2. You can [install Python](https://www.python.org/downloads) or use a browser-based Python interpreter such as [repl.it](https://repl.it/languages/python3).
You can run the code in an IDE, or from the command line with `python -i filename.py` where the `-i` option puts you in an interactive loop where you can run Python functions. All notebooks are available in a [binder environment](http://mybinder.org/repo/aimacode/aima-python). Alternatively, visit [jupyter.org](http://jupyter.org/) for instructions on setting up your own Jupyter notebook environment.
## Installation Guide
To download the repository:
`git clone https://github.com/aimacode/aima-python.git`
Then you need to install the basic dependencies to run the project on your system:
`pip install -r requirements.txt`
You also need to fetch the datasets from the [`aima-data`](https://github.com/aimacode/aima-data) repository:
```
cd aima-python
git submodule init
git submodule update
```
Wait for the datasets to download, it may take a while. Once they are downloaded, you need to install `pytest`, so that you can run the test suite:
`pip install pytest`
Then to run the tests:
`py.test`
And you are good to go!
# Index of Algorithms
Here is a table of algorithms, the figure, name of the algorithm in the book and in the repository, and the file where they are implemented in the repository. This chart was made for the third edition of the book and is being updated for the upcoming fourth edition. Empty implementations are a good place for contributors to look for an issue. The [aima-pseudocode](https://github.com/aimacode/aima-pseudocode) project describes all the algorithms from the book. An asterisk next to the file name denotes the algorithm is not fully implemented. Another great place for contributors to start is by adding tests and writing on the notebooks. You can see which algorithms have tests and notebook sections below. If the algorithm you want to work on is covered, don't worry! You can still add more tests and provide some examples of use in the notebook!
| **Figure** | **Name (in 3<sup>rd</sup> edition)** | **Name (in repository)** | **File** | **Tests** | **Notebook**
|:-------|:----------------------------------|:------------------------------|:--------------------------------|:-----|:---------|
| 2 | Random-Vacuum-Agent | `RandomVacuumAgent` | [`agents.py`][agents] | Done | Included |
| 2 | Model-Based-Vacuum-Agent | `ModelBasedVacuumAgent` | [`agents.py`][agents] | Done | Included |
| 2.1 | Environment | `Environment` | [`agents.py`][agents] | Done | Included |
| 2.1 | Agent | `Agent` | [`agents.py`][agents] | Done | Included |
| 2.3 | Table-Driven-Vacuum-Agent | `TableDrivenVacuumAgent` | [`agents.py`][agents] | Done | Included |
| 2.7 | Table-Driven-Agent | `TableDrivenAgent` | [`agents.py`][agents] | Done | Included |
| 2.8 | Reflex-Vacuum-Agent | `ReflexVacuumAgent` | [`agents.py`][agents] | Done | Included |
| 2.10 | Simple-Reflex-Agent | `SimpleReflexAgent` | [`agents.py`][agents] | Done | Included |
| 2.12 | Model-Based-Reflex-Agent | `ReflexAgentWithState` | [`agents.py`][agents] | Done | Included |
| 3 | Problem | `Problem` | [`search.py`][search] | Done | Included |
| 3 | Node | `Node` | [`search.py`][search] | Done | Included |
| 3 | Queue | `Queue` | [`utils.py`][utils] | Done | No Need |
| 3.1 | Simple-Problem-Solving-Agent | `SimpleProblemSolvingAgent` | [`search.py`][search] | Done | Included |
| 3.2 | Romania | `romania` | [`search.py`][search] | Done | Included |
| 3.7 | Tree-Search | `depth/breadth_first_tree_search` | [`search.py`][search] | Done | Included |
| 3.7 | Graph-Search | `depth/breadth_first_graph_search` | [`search.py`][search] | Done | Included |
| 3.11 | Breadth-First-Search | `breadth_first_graph_search` | [`search.py`][search] | Done | Included |
| 3.14 | Uniform-Cost-Search | `uniform_cost_search` | [`search.py`][search] | Done | Included |
| 3.17 | Depth-Limited-Search | `depth_limited_search` | [`search.py`][search] | Done | Included |
| 3.18 | Iterative-Deepening-Search | `iterative_deepening_search` | [`search.py`][search] | Done | Included |
| 3.22 | Best-First-Search | `best_first_graph_search` | [`search.py`][search] | Done | Included |
| 3.24 | A\*-Search | `astar_search` | [`search.py`][search] | Done | Included |
| 3.26 | Recursive-Best-First-Search | `recursive_best_first_search` | [`search.py`][search] | Done | Included |
| 4.2 | Hill-Climbing | `hill_climbing` | [`search.py`][search] | Done | Included |
| 4.5 | Simulated-Annealing | `simulated_annealing` | [`search.py`][search] | Done | Included |
| 4.8 | Genetic-Algorithm | `genetic_algorithm` | [`search.py`][search] | Done | Included |
| 4.11 | And-Or-Graph-Search | `and_or_graph_search` | [`search.py`][search] | Done | Included |
| 4.21 | Online-DFS-Agent | `online_dfs_agent` | [`search.py`][search] | Done | Included |
| 4.24 | LRTA\*-Agent | `LRTAStarAgent` | [`search.py`][search] | Done | Included |
| 5.3 | Minimax-Decision | `minimax_decision` | [`games.py`][games] | Done | Included |
| 5.7 | Alpha-Beta-Search | `alphabeta_search` | [`games.py`][games] | Done | Included |
| 6 | CSP
weixin_39841856
- 粉丝: 491
- 资源: 1万+
最新资源
- 基于java+springboot+vue+mysql的水果蔬菜商城 源码+数据库+论文(高分毕业设计).zip
- 基于java+springboot+vue+mysql的网上购物商城 源码+数据库+论文(高分毕业设计).zip
- 基于java+springboot+vue+mysql的校园朋友圈系统 源码+数据库+论文(高分毕业设计).zip
- 深度学习驱动的油气开发工程技术
- 基于java+springboot+vue+mysql的无可购物网站 源码+数据库+论文(高分毕业设计).zip
- sasl-0.3.1-cp37-cp37m-win-amd64.whl
- 蛇年的祝福前奏,以及JAVA贪吃蛇的一个项目讲解
- 包含fontawesome-pro依赖库的node库,版本对应v18.20.4
- 深度学习在岩土工程中应用与实践=-前沿技术与创新实践(2025)
- boost1.72+win10+vs2022+64位动态编译+debug版本
- 静态无功补偿器(SVC)仿真模型 采用静态无功补偿器(SVC)对一个500kv, 3000mva的系统进行电压调节 (1)当系统电压较低时,SVC产生无功功率(SVC电容性) (2)当系统电压较高
- 数字孪生行业发展和数字孪生发展研究报告.pdf
- Huang晶体塑性umat耦合Johnson-Cook损伤模型,实现晶体材料弹塑性损伤模拟分析
- Commander One PRO for Mac v.3.12
- 自动化码头AGV无冲突动态路径规划
- 基于simulink的三自由度汽车操纵模型,模型全套可运行 自由度:侧向-侧倾-横摆 带数据参数与详细公式文档 基于二自由度模型的成熟理论,采用SAE坐标系建立三自由度汽车操纵模型 该模型能够反映
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈