Thanks to visit codestin.com
Credit goes to github.com

Skip to content

search.py #467 #469

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 610 commits into from
May 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
610 commits
Select commit Hold shift + click to select a range
af0351e
Remove unused import.
darius Apr 16, 2016
8f58668
Style: delete excess parentheses. In some of these cases you need to …
darius Apr 16, 2016
7776583
Remove unnecessary list coercions.
darius Apr 17, 2016
3c2639a
Use dict comprehensions now that we can.
darius Apr 17, 2016
677274b
Fix bug: used Py2 syntax for except.
darius Apr 17, 2016
083f8b2
Remove unimplemented(): it's not worth it without *-imports.
darius Apr 17, 2016
28b485b
Remove unused imports.
darius Apr 17, 2016
ac49792
Fix bugs in diff() and simp(). Add a smoke test.
darius Apr 17, 2016
2ab564b
Fix typos in comments.
darius Apr 17, 2016
19ca12f
Formatting: remove tabs.
darius Apr 17, 2016
b9c2433
Fix some pyflakes complaints.
darius Apr 17, 2016
2458724
Fix: there is no utils.caller anymore.
darius Apr 17, 2016
c4565b9
Missing imports.
darius Apr 17, 2016
a828fe0
Typo in comment.
darius Apr 17, 2016
08b6aea
Typo in comment.
darius Apr 17, 2016
194a2f1
Style: address pep8 warnings.
darius Apr 17, 2016
6525e23
Removed unnecessary list coercions around map (#228)
reachtarunhere Apr 18, 2016
8bcc7b0
Notebook for MDPs (#229)
reachtarunhere Apr 19, 2016
5089669
Start of CYK parser. The grammar still needs to be updated accordingly.
darius Apr 27, 2016
a70ff51
README: GSoC applications over.
norvig Apr 28, 2016
ab868f5
README: Fix link
norvig Apr 28, 2016
da8b17e
removes pseudo-codes which are deleted from 3rd edition
SnShine May 22, 2016
464ca5d
Update Depth Limited Search from 2nd to 3rd ed
reachtarunhere May 22, 2016
2f84be4
planning.py (#232)
Chipe1 May 22, 2016
887bd6c
Better Tests for depth_limited_search to make build pass
reachtarunhere May 24, 2016
7ce9a2a
text edits to search.ipynb (#236)
go-bears May 27, 2016
319ff52
Added Index Notebook for Binder
reachtarunhere May 27, 2016
3bd230a
Added Info and Binder Badge
reachtarunhere May 27, 2016
b73ef7f
Re writes badges in html to open links in new tab
SnShine May 27, 2016
3a0bc75
Removed refrence to depreacated utils * imports
reachtarunhere May 27, 2016
1b4e2d7
Add version of search.ipynb for 4th edition.
norvig May 29, 2016
bc45dd1
uncommented itertools to show the chessboard and renamed the notebook
SnShine May 29, 2016
644ffbc
adds 4th edition search notebook
SnShine May 29, 2016
5a4b8bd
Updating README's Index of Code to reflect actual implementation stat…
May 30, 2016
edac048
Merge branch 'master' of https://github.com/aimacode/aima-python
reachtarunhere May 31, 2016
e2645fb
Added Example and Applet for Value Iteration
reachtarunhere Jun 1, 2016
2c4f28a
updates aima-data submodule to add sgb-words to data
SnShine Jun 1, 2016
0081c5f
Merge branch 'master' of https://github.com/aimacode/aima-python
SnShine Jun 1, 2016
dcdeb25
reverts last commit which is breaking the build because of the change…
SnShine Jun 1, 2016
0852e9e
updates submodule - adds sgb-words to aima-data
SnShine Jun 7, 2016
ad73cdb
cleans games notebook and interactive TTT, notebooks imports like 'fr…
SnShine Jun 7, 2016
d0e53a8
Review & Graph Coloring
reachtarunhere Jun 8, 2016
fe0a6ed
Helper Functions & Backtracking Search
reachtarunhere Jun 8, 2016
7404dc3
Visualization Applet for Graph Coloring
reachtarunhere Jun 8, 2016
f00a658
Added networkx in requirements.txt. It is now only used for notebook …
reachtarunhere Jun 8, 2016
45f4432
Removed France Refrence & More general function for converting to instru
reachtarunhere Jun 10, 2016
728f1b4
Display Values in Visualization & Changed to Step Function Pattern
reachtarunhere Jun 12, 2016
79392c4
NQueens Applet
reachtarunhere Jun 12, 2016
9c11d9f
Same Size for Both Boards
reachtarunhere Jun 12, 2016
030c27f
used sgb-words from aimadata rather than downloading a local copy
SnShine Jun 13, 2016
cd24621
adds skeletal romania map in search notebook
SnShine Jun 13, 2016
d7bcf3a
adds node labels, edge labels to romania_map
SnShine Jun 14, 2016
a3bdaf6
adds visualisation for breadth_first_tree_search on romania map in no…
SnShine Jun 14, 2016
355924c
adds interactive visual for breadth first search
SnShine Jun 14, 2016
54e4693
adds visuals for uniform cost search and A-star search
SnShine Jun 14, 2016
8623520
Added Visualize and Time Delay to Applets
reachtarunhere Jun 14, 2016
303c127
Trait Error Fix for older versions of ipywidgets (#241)
reachtarunhere Jun 14, 2016
7bdeb78
adds legend to the plot and shows final path after completing search
SnShine Jun 15, 2016
5480fda
users can specify starting and goal cities in search notebook
SnShine Jun 17, 2016
c541d31
users can select searching algorithm to search on romania map
SnShine Jun 19, 2016
ba9dc72
Implemented Passive ADP Agent
reachtarunhere Jun 19, 2016
671fc20
Remove redundant initialization
reachtarunhere Jun 20, 2016
2c458ae
Style: address pep8 warnings.
reachtarunhere Jun 20, 2016
0dbb1f6
Style: address pep8 warnings in main code.
reachtarunhere Jun 20, 2016
08c86c8
adds intro and removes views' output in search notebook
SnShine Jun 21, 2016
7832f97
Introduce NQueens & Clear Outputs
reachtarunhere Jun 22, 2016
2352626
Explain backtracking_search parameters
reachtarunhere Jun 22, 2016
af47548
Fixed Typo in Docstring
reachtarunhere Jun 29, 2016
dfa50c2
Added Tests for enumerate_joint
reachtarunhere Jun 29, 2016
b86d845
Tests for Bayesnode.sample
reachtarunhere Jun 29, 2016
6a28b53
Added PassiveADPAgent to Index
reachtarunhere Jun 29, 2016
d25b37a
Introduction & Examples for ProbDist
reachtarunhere Jun 30, 2016
e6100d4
Explained JointProbDist
reachtarunhere Jun 30, 2016
d81be44
Added __repr__ to ProbDist
reachtarunhere Jun 30, 2016
671dea6
Added section for inference by full joint distributions
reachtarunhere Jun 30, 2016
7bb9bf1
removes unnecessary definitions/examples from search notebook
SnShine Jul 1, 2016
6f8ed98
Fix Description mismatch with code.
reachtarunhere Jul 1, 2016
65f50c7
commits after running all visualisations
SnShine Jul 1, 2016
5c0f23c
Merge branch 'master' of https://github.com/aimacode/aima-python
SnShine Jul 1, 2016
5bdcfb3
Added section on Bayesian Networks
reachtarunhere Jul 1, 2016
a121360
BayesNet Enumeration
reachtarunhere Jul 6, 2016
915d55f
Added Section on Variable Elimination
reachtarunhere Jul 7, 2016
551ce42
adds intro section to learning notebook
SnShine Jul 9, 2016
f6ec5e0
Experimental new version of probability.ipynb
norvig Jul 10, 2016
195e388
gets latest updates (adds MNIST data) from aima-data submodule
SnShine Jul 12, 2016
cb0895a
Added Section on Approximate Inference
reachtarunhere Jul 13, 2016
935822e
adds method to load MNIST data in learning notebook
SnShine Jul 13, 2016
51f39e5
adds visualisations of MNIST handwritten digits
SnShine Jul 13, 2016
6eeea3f
adds visuals og average images from MNIST dataset
SnShine Jul 15, 2016
6404d1d
removes checking truth value of an array with more than one element
SnShine Jul 15, 2016
0ab31ba
runs check_example only if values are provided while initialising Dat…
SnShine Jul 15, 2016
f7bd052
adds method to calculate manhattan (L1) distance
SnShine Jul 15, 2016
8a9b361
impleemnts kNN classifier of learning module on MNIST data
SnShine Jul 15, 2016
4e4f310
implements faster kNN in NumPy in learning notebook
SnShine Jul 16, 2016
bf6af62
adds aima3e image to readme (#245)
SnShine Jul 16, 2016
d952574
adds aima logo as repo's logo and links to aima berkely website
SnShine Jul 16, 2016
9f49ade
Update README.md
norvig Jul 26, 2016
cc95bd3
Rename Probability-4e.ipynb to probability-4e.ipynb
norvig Jul 31, 2016
5c730de
Update probability-4e.ipynb
norvig Jul 31, 2016
fdac4c1
modifies gramatical errors in learning notebook
SnShine Aug 2, 2016
b771b97
adds contents table in learning notebook
SnShine Aug 2, 2016
bbe9f3d
Updated normalize to support dict
reachtarunhere Aug 6, 2016
35b787c
Shorthand for True False
reachtarunhere Aug 6, 2016
c631aa0
updates contents table and modifies notebook accordingly
SnShine Aug 11, 2016
2701794
Edited a link in CONTRIBUTING.md (#249)
Aug 25, 2016
8ec6012
adds SVM classifier on MNIST in SkLearn
SnShine Aug 29, 2016
5574d77
Added Default Parameter to Support Smoothing (#246)
reachtarunhere Sep 7, 2016
61ef267
Planning (#253)
opensourceware Sep 7, 2016
04c7d51
Implementing HITS algorithm (#244)
Sep 7, 2016
5fd9c6a
Added test in test_planning.py (#261)
Sep 14, 2016
62f2fc0
Added implementation of Three Block Tower (#263)
Sep 22, 2016
4c9ef4e
Added implementation of the cake problem, tests for cake and three to…
opensourceware Sep 27, 2016
9f7f4df
Adding HITS algorithm to completed table (#277)
Jan 16, 2017
0e46096
Import turn_heading from grids.py since it is used in agents.py (#281)
orsenthil Jan 23, 2017
123571e
Used learning_rate in gradient update for w (#284)
TheSPARTA Mar 1, 2017
fc73e8f
Update README.md
norvig Mar 2, 2017
1ff1072
Update README.md
norvig Mar 2, 2017
53ca003
added six to pip installs (#297)
reachtarunhere Mar 2, 2017
fc287e2
Typo in bold formatting. (#298)
sampadsaha5 Mar 2, 2017
493fd13
Fixed genetic_algorithm() population iterator (#296)
yrevar Mar 2, 2017
9054eef
ModelBasedReflexAgent should have model. Code updated (#300)
Agnishom Mar 3, 2017
a6e3192
Commenting Fixes (#294)
antmarakis Mar 3, 2017
93e7fdc
Corrects a typo in tests/test_games.py (#278)
jacobkjoseph Mar 3, 2017
38e3001
GraphPlan Algorithm (#274)
opensourceware Mar 3, 2017
e8a5e07
Fixed Bug #295 (#301)
vidursatija Mar 3, 2017
be8543f
Correct a typo in usage (#279)
HedgehogInDaFog Mar 3, 2017
e59faf6
Fixed typo in comments (#302)
doctorBeast Mar 3, 2017
82d78c6
Fixes typos in the search.ipynb (#307)
chinmayapancholi13 Mar 4, 2017
1356ab9
Modern String Formatting in Code (#292)
sampadsaha5 Mar 4, 2017
ce7aa26
Add new tests (#314)
antmarakis Mar 5, 2017
ee5068e
Image Mistake Fix (#311)
antmarakis Mar 5, 2017
ca893d7
Fix __call__ command for Graph class (#306)
lucasmoura Mar 5, 2017
c9eab0f
Add tests to CSP class (#299)
lucasmoura Mar 5, 2017
0ff4b6e
Change Link's Style (#271)
Z-Fikar Mar 5, 2017
413139d
Update CONTRIBUTING.md
norvig Mar 5, 2017
bd6ec0d
Update README.md
norvig Mar 5, 2017
48f079e
Update CONTRIBUTING.md
norvig Mar 5, 2017
efb3324
Stop using statistics.mode.
norvig Mar 6, 2017
af98080
minor edits in agents (#327)
kaivalyar Mar 7, 2017
651416e
Update learning.py
norvig Mar 7, 2017
b2458ca
Update utils.py
norvig Mar 7, 2017
94e63cd
changed mean boolean error (#325)
Chipe1 Mar 7, 2017
69d93e6
Update agents.py (#322)
articuno12 Mar 7, 2017
9689bbe
Fixed knn_plot (#317)
Chipe1 Mar 7, 2017
e76b886
Update Comments in learning.py + PluralityLearner Update (#315)
antmarakis Mar 7, 2017
43fced5
Fix flake8 for test files (#303)
lucasmoura Mar 7, 2017
7c5f283
Add test to csp.py (#326)
lucasmoura Mar 7, 2017
556120d
Update utils.py
norvig Mar 7, 2017
ceb9874
Update Learning Notebook (#329)
antmarakis Mar 7, 2017
14bf5e4
corrected return value for simulated-annealing (#369)
kaivalyar Mar 18, 2017
bddd1cf
Update weighted_sample_with_replacement() in utils.py (#366)
sofmonk Mar 18, 2017
b70a2f5
Fix: typo in Search notebook (#365)
adityasiwan Mar 18, 2017
8a735bd
changed unify_var() (#344)
Chipe1 Mar 18, 2017
a17cc77
corrected typo and added color green (#364)
kaivalyar Mar 18, 2017
1ef9a84
Make build break for flake8 errors on tests dir (#363)
lucasmoura Mar 18, 2017
facee1f
corrected equivalence operator to <=> from ==> (#361)
kaivalyar Mar 18, 2017
4ae32d8
Update grid.ipynb (#358)
antmarakis Mar 18, 2017
f51888a
Renamed grid.py Function (#356)
antmarakis Mar 18, 2017
c5c964e
Update search.ipynb (#359)
ed-word Mar 18, 2017
d941781
Update comments and cleanup (#354)
VladKha Mar 18, 2017
35ef22c
Updated text.py Notebook (#352)
antmarakis Mar 18, 2017
b4e6843
Converted fig_5_2 Image (#353)
antmarakis Mar 18, 2017
cf30580
Corrected Direction arithmetic in agents.py (#348)
kaivalyar Mar 18, 2017
70f0abd
Completed BlindDog agent examples (#350)
kaivalyar Mar 18, 2017
8e0bfd3
Updated test_text.py (#349)
antmarakis Mar 18, 2017
c7a0d6d
Adding missing docstring in utils.py (#342)
articuno12 Mar 18, 2017
ca02738
"epoches" to "epochs" (#336)
antmarakis Mar 18, 2017
3f5f856
Added Hamming Distance (#340)
antmarakis Mar 18, 2017
3129917
Update load_MNIST on learning.ipynb (#339)
lucasmoura Mar 18, 2017
1b82e4d
Added DataSet Functions (#333)
antmarakis Mar 18, 2017
bf15924
Add more tests to csp.py (#328)
lucasmoura Mar 18, 2017
5316898
Fixed a bug in Decision Tree Learner (#334)
TheSPARTA Mar 18, 2017
706838b
Removed flake8 test for pytest directory (#386)
Chipe1 Mar 21, 2017
c8115ce
edits in search.py (#384)
kaivalyar Mar 22, 2017
6a1b84b
Upadte search.py (#389)
BesanHalwa Mar 22, 2017
9f1b1ee
Update learning.py (#388)
BesanHalwa Mar 22, 2017
4548aae
Updated docstring for ModelBasedReflexAgentProgram in agent.py (#391)
articuno12 Mar 22, 2017
4bac571
Added testcase for ReflexVacuumAgent and ModelBasedVacuumAgent (#394)
articuno12 Mar 22, 2017
c38675a
Add Perceptron to Notebook (#387)
antmarakis Mar 22, 2017
2922ab6
Games notebook updates (#383)
kaivalyar Mar 22, 2017
2b07ba9
Fixed bugs in games.py (#380)
kaivalyar Mar 22, 2017
efa5628
Update test_learning.py (#376)
antmarakis Mar 22, 2017
581fa6b
added double_tennis_problem to planning.py; and minor pep8 edits (#373)
sofmonk Mar 22, 2017
64bb564
Fix gradient descent for LinearLearning (#414)
lucasmoura Mar 25, 2017
313fee0
Bug Fixes for LinearLearner (#408)
antmarakis Mar 25, 2017
eca3b2a
Fix NgramTextModel bug (#412)
lucasmoura Mar 25, 2017
4f1b182
Add NgramCharModel to text.py (#413)
lucasmoura Mar 25, 2017
10c82c6
Add DataSet Tutorial (#411)
antmarakis Mar 25, 2017
df9d7d5
added fol_fc_ask to logic.py ; update README.md (#415)
sofmonk Mar 25, 2017
f624415
Use lru_cache decorator on memoize function (#406)
lucasmoura Mar 25, 2017
444ac26
Bug Fixing in DataSet + Test Updates (#410)
antmarakis Mar 25, 2017
c8e22e6
Fixed Notebook Typos (#397)
antmarakis Mar 25, 2017
cb7a0b1
Implemented Topological Sort (#401)
antmarakis Mar 25, 2017
034d279
Fix flake8 for main files (#399)
lucasmoura Mar 25, 2017
52eb90e
Added ShiftDecoder to notebook (#463)
Chipe1 Apr 6, 2017
0c66b8f
Update grid.ipynb (#459)
antmarakis Apr 6, 2017
8d45324
Implemented PermutationDecoder (#456)
Chipe1 Apr 6, 2017
cf743b6
Record necessary dependency for test (#476)
TheCDC Apr 6, 2017
1c181dc
Changes for python3 string formating (#471)
Chipe1 Apr 6, 2017
bce7ced
Distance Functions (Euclidean+ Notebook) (#460)
antmarakis Apr 6, 2017
5ecee13
Update logic.py fix minor typos (#474)
ltfschoen Apr 6, 2017
28c4948
Fix learning tests (#484)
lucasmoura Apr 7, 2017
6178784
Temporarily remove flake8 tests (#487)
Chipe1 Apr 12, 2017
99d4cc3
Implementation: Multi-Class Backpropagation (#486)
antmarakis Apr 12, 2017
f9f6ecf
Changes to hashable dict (#482)
Chipe1 Apr 12, 2017
b0b1d6f
Update test_learning.py (#483)
antmarakis Apr 12, 2017
ab6669c
Add tests to NgramCharModel (#485)
lucasmoura Apr 12, 2017
dc8989f
Replaces max/min with argmax/argmin (#481)
Chipe1 Apr 12, 2017
60a4285
update test_utils.py (#466)
sofmonk Apr 12, 2017
5b5d4df
test cases for logic.py (#451)
Chipe1 Apr 12, 2017
4c2918c
Changed normalize() (#439)
Chipe1 Apr 12, 2017
1d278f6
Fix errors in HITS() (#440)
Chipe1 Apr 12, 2017
e3ce769
Allow tests to run without IPython. Closes #226.
darius Apr 12, 2017
34409d9
Expand count tests (#494)
antmarakis Apr 13, 2017
fb503e6
Use mock to remove network requirement from tests (#495)
lucasmoura Apr 13, 2017
17fac54
Learning: Grade Learner (#496)
antmarakis Apr 14, 2017
c0c97bf
Implementation of GA in notebook search.ipyinb (#489)
BesanHalwa Apr 14, 2017
4edce2a
Update text.py (#492)
antmarakis Apr 14, 2017
1cd6428
Update search.py (#480)
BesanHalwa Apr 14, 2017
38a3844
Fix incorrect abbreviation from PDLL to PDDL (Planning Domain Definit…
ltfschoen Apr 14, 2017
a77b947
Implementation: Genetic Algorithm (Fixing Build) (#501)
antmarakis Apr 17, 2017
5ea1fb6
Notebook: Genetic Algorithms (#503)
antmarakis Apr 17, 2017
b009d1f
Planning implementations - 11.1 and 11.5 (#505)
kaivalyar Apr 17, 2017
0879c4b
Learning: Grading Learners (#499)
antmarakis Apr 17, 2017
8ca5ab1
Update intro.ipynb fixing single minor typo (#470)
ltfschoen Apr 17, 2017
28d7996
Changes to planning.py (#452)
Chipe1 Apr 17, 2017
6b64e77
Tests: RL.py (#450)
antmarakis Apr 17, 2017
d3155eb
Update test_grid.py (#448)
antmarakis Apr 17, 2017
2c29a90
Fixed mistake in HITS and add test to NLP (#441)
Chipe1 Apr 17, 2017
4d9bea0
Moved asserts from main code to unit tests (#396)
kaivalyar Apr 17, 2017
80dbdf8
added another test for air_cargo_problem (#465)
sofmonk Apr 17, 2017
085f10e
Add new tests to test_csp.py (#447)
lucasmoura Apr 17, 2017
072f685
Typo: 'logic_test.py' -> 'test_logic.py' in README.md fixed (#425) (…
arahman010 Apr 17, 2017
e9c2d07
Updated implementation of FIFOQueue (#403)
articuno12 Apr 17, 2017
856e8d9
Implementation: Continuous Naive Bayes (#435)
antmarakis Apr 17, 2017
cd08bec
Notebook + Implementation: Perceptron (#512)
antmarakis May 24, 2017
e6d5fcf
Intersection query for relevant_pages (#509)
Chipe1 May 24, 2017
4caca95
Fix flake8 warnings (#508)
Chipe1 May 24, 2017
ff8fc03
Added PermutationDecoder to notebook (#507)
Chipe1 May 24, 2017
7de2967
Planning notebook (#506)
kaivalyar May 24, 2017
7bebc1b
Implementation: Transition Model for MDP (#445)
antmarakis May 24, 2017
db049ce
RL Fixes (Fixing Build) (#519)
antmarakis May 28, 2017
86a1908
Notebook: Naive Bayes (#510)
antmarakis May 28, 2017
dfe938f
Implementation: Tree CSP Solver (#434)
antmarakis May 28, 2017
b96f01b
Update csp.ipynb (#433)
antmarakis May 28, 2017
3e57e00
Refactor backpropagation (#437)
lucasmoura May 28, 2017
c25fc70
Removed errors to make the build pass (#418)
articuno12 May 28, 2017
416c152
changed cross validation wrapper (#346)
Allen-Hao-Huang May 28, 2017
d3fe49b
Update README.md
norvig May 29, 2017
01e4450
Show outputs (#521)
antmarakis May 29, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[flake8]
max-line-length = 100
ignore = E121,E123,E126,E221,E222,E225,E226,E242,E701,E702,E704,E731,W503,F405,F841
exclude = tests
72 changes: 72 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask instance folder
instance/

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# IPython Notebook
.ipynb_checkpoints

# pyenv
.python-version

# dotenv
.env
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "aima-data"]
path = aima-data
url = https://github.com/aimacode/aima-data.git
24 changes: 24 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
language:
- python

python:
- "3.4"

before_install:
- git submodule update --remote

install:
- pip install six
- pip install flake8
- pip install jupyter
- pip install -r requirements.txt

script:
- py.test
- python -m doctest -v *.py

after_success:
- flake8 --max-line-length 100 --ignore=E121,E123,E126,E221,E222,E225,E226,E242,E701,E702,E704,E731,W503 .

notifications:
email: false
116 changes: 116 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
How to Contribute to aima-python
==========================

Thanks for considering contributing to `aima-python`! Whether you are an aspiring [Google Summer of Code](https://summerofcode.withgoogle.com/organizations/5663121491361792/) student, or an independent contributor, here is a guide to how you can help:

## Read the Code and Start on an Issue

- First, read and understand the code to get a feel for the extent and the style.
- Look at the [issues](https://github.com/aimacode/aima-python/issues) and pick one to work on.
- One of the issues is that some algorithms are missing from the [list of algorithms](https://github.com/aimacode/aima-python/blob/master/README.md#index-of-algorithms).

## Port to Python 3; Pythonic Idioms; py.test

- Check for common problems in [porting to Python 3](http://python3porting.com/problems.html), such as: `print` is now a function; `range` and `map` and other functions no longer produce `list`s; objects of different types can no longer be compared with `<`; strings are now Unicode; it would be nice to move `%` string formating to `.format`; there is a new `next` function for generators; integer division now returns a float; we can now use set literals.
- Replace old Lisp-based idioms with proper Python idioms. For example, we have many functions that were taken directly from Common Lisp, such as the `every` function: `every(callable, items)` returns true if every element of `items` is callable. This is good Lisp style, but good Python style would be to use `all` and a generator expression: `all(callable(f) for f in items)`. Eventually, fix all calls to these legacy Lisp functions and then remove the functions.
- Add more tests in `_test.py` files. Strive for terseness; it is ok to group multiple asserts into one `def test_something():` function. Move most tests to `_test.py`, but it is fine to have a single `doctest` example in the docstring of a function in the `.py` file, if the purpose of the doctest is to explain how to use the function, rather than test the implementation.

## New and Improved Algorithms

- Implement functions that were in the third edition of the book but were not yet implemented in the code. Check the [list of pseudocode algorithms (pdf)](https://github.com/aimacode/pseudocode/blob/master/aima3e-algorithms.pdf) to see what's missing.
- As we finish chapters for the new fourth edition, we will share the new pseudocode in the [`aima-pseudocode`](https://github.com/aimacode/aima-pseudocode) repository, and describe what changes are necessary.
We hope to have a `algorithm-name.md` file for each algorithm, eventually; it would be great if contributors could add some for the existing algorithms.
- Give examples of how to use the code in the `.ipynb` file.

We still support a legacy branch, `aima3python2` (for the third edition of the textbook and for Python 2 code).

# Style Guide

There are a few style rules that are unique to this project:

- The first rule is that the code should correspond directly to the pseudocode in the book. When possible this will be almost one-to-one, just allowing for the syntactic differences between Python and pseudocode, and for different library functions.
- Don't make a function more complicated than the pseudocode in the book, even if the complication would add a nice feature, or give an efficiency gain. Instead, remain faithful to the pseudocode, and if you must, add a new function (not in the book) with the added feature.
- I use functional programming (functions with no side effects) in many cases, but not exclusively (sometimes classes and/or functions with side effects are used). Let the book's pseudocode be the guide.

Beyond the above rules, we use [Pep 8](https://www.python.org/dev/peps/pep-0008), with a few minor exceptions:

- I have set `--max-line-length 100`, not 79.
- You don't need two spaces after a sentence-ending period.
- Strunk and White is [not a good guide for English](http://chronicle.com/article/50-Years-of-Stupid-Grammar/25497).
- I prefer more concise docstrings; I don't follow [Pep 257](https://www.python.org/dev/peps/pep-0257/). In most cases,
a one-line docstring suffices. It is rarely necessary to list what each argument does; the name of the argument usually is enough.
- Not all constants have to be UPPERCASE.
- At some point I may add [Pep 484](https://www.python.org/dev/peps/pep-0484/) type annotations, but I think I'll hold off for now;
I want to get more experience with them, and some people may still be in Python 3.4.


Contributing a Patch
====================

1. Submit an issue describing your proposed change to the repo in question (or work on an existing issue).
1. The repo owner will respond to your issue promptly.
1. Fork the desired repo, develop and test your code changes.
1. Submit a pull request.

Reporting Issues
================

- Under which versions of Python does this happen?

- Is anybody working on this?

Patch Rules
===========

- Ensure that the patch is python 3.4 compliant.

- Include tests if your patch is supposed to solve a bug, and explain
clearly under which circumstances the bug happens. Make sure the test fails
without your patch.

- Follow the style guidelines described above.

Running the Test-Suite
=====================

The minimal requirement for running the testsuite is ``py.test``. You can
install it with::

pip install pytest

Clone this repository::

git clone https://github.com/aimacode/aima-python.git

Fetch the aima-data submodule::

cd aima-python
git submodule init
git submodule update

Then you can run the testsuite with::

py.test

# Choice of Programming Languages

Are we right to concentrate on Java and Python versions of the code? I think so; both languages are popular; Java is
fast enough for our purposes, and has reasonable type declarations (but can be verbose); Python is popular and has a very direct mapping to the pseudocode in the book (but lacks type declarations and can be slow). The [TIOBE Index](http://www.tiobe.com/tiobe_index) says the top seven most popular languages, in order, are:

Java, C, C++, C#, Python, PHP, Javascript

So it might be reasonable to also support C++/C# at some point in the future. It might also be reasonable to support a language that combines the terse readability of Python with the type safety and speed of Java; perhaps Go or Julia. I see no reason to support PHP. Javascript is the language of the browser; it would be nice to have code that runs in the browser without need for any downloads; this would be in Javascript or a variant such as Typescript.

There is also a `aima-lisp` project; in 1995 when we wrote the first edition of the book, Lisp was the right choice, but today it is less popular (currently #31 on the TIOBE index).

What languages are instructors recommending for their AI class? To get an approximate idea, I gave the query <tt>[\[norvig russell "Modern Approach"\]](https://www.google.com/webhp#q=russell%20norvig%20%22modern%20approach%22%20java)</tt> along with the names of various languages and looked at the estimated counts of results on
various dates. However, I don't have much confidence in these figures...

|Language |2004 |2005 |2007 |2010 |2016 |
|-------- |----: |----: |----: |----: |----: |
|[none](http://www.google.com/search?q=norvig+russell+%22Modern+Approach%22)|8,080|20,100|75,200|150,000|132,000|
|[java](http://www.google.com/search?q=java+norvig+russell+%22Modern+Approach%22)|1,990|4,930|44,200|37,000|50,000|
|[c++](http://www.google.com/search?q=c%2B%2B+norvig+russell+%22Modern+Approach%22)|875|1,820|35,300|105,000|35,000|
|[lisp](http://www.google.com/search?q=lisp+norvig+russell+%22Modern+Approach%22)|844|974|30,100|19,000|14,000|
|[prolog](http://www.google.com/search?q=prolog+norvig+russell+%22Modern+Approach%22)|789|2,010|23,200|17,000|16,000|
|[python](http://www.google.com/search?q=python+norvig+russell+%22Modern+Approach%22)|785|1,240|18,400|11,000|12,000|
9 changes: 9 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
The MIT License (MIT)

Copyright (c) 2016 aima-python contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Loading