Skip to content

Commit ecf9a2f

Browse files
committed
Merge pull request aimacode#59 from SnShine/changeReadme
modifications in README.md on format of tables
2 parents 2d98898 + a19fdf1 commit ecf9a2f

File tree

1 file changed

+15
-19
lines changed

1 file changed

+15
-19
lines changed

README.md

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# `aima-python`: Structure of the Project
22

3-
Python code for the book *Artificial Intelligence: A Modern Approach.*
3+
Python code for the book *Artificial Intelligence: A Modern Approach.*
44
When complete, this project will cover all the major topics in the book, for each topic, such as `logic`, we will have the following [Python 3.5](https://www.python.org/downloads/release/python-350/) files in the main branch:
55

6-
- `logic.py`: Implementations of all the pseudocode algorithms in the book.
6+
- `logic.py`: Implementations of all the pseudocode algorithms in the book.
77
- `logic_test.py`: A lightweight test suite, using `assert` statements, designed for use with `py.test`.
88
- `logic.ipynb`: A Jupyter notebook, with examples of usage. Does a `from logic import *` to get the code.
9-
9+
1010
Until we get there, we will support a legacy branch, `aima3python2` (for the third edition of the textbook and for Python 2 code). To prepare code for the new master branch, the following two steps should be taken
1111

1212
## Port to Python 3; Pythonic Idioms; py.test
@@ -29,11 +29,11 @@ There are a few style rules that are unique to this project:
2929

3030
- 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.
3131
- 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.
32-
- 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.
32+
- 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.
3333

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

36-
- I'm not too worried about an occasional line longer than 79 characters.
36+
- I'm not too worried about an occasional line longer than 79 characters.
3737
- You don't need two spaces after a sentence-ending period.
3838
- Strunk and White is [not a good guide for English](http://chronicle.com/article/50-Years-of-Stupid-Grammar/25497).
3939
- I prefer more concise docstrings; I don't follow [Pep 257](https://www.python.org/dev/peps/pep-0257/).
@@ -42,31 +42,27 @@ Beyond the above rules, we use [Pep 8](https://www.python.org/dev/peps/pep-0008)
4242
parameter name is already suggestive of the name of a type, such as `url` below, then i don't think the type annotation is useful.
4343
Return type annotations, such as `-> None` below, can be very useful.
4444

45-
def retry(url: Url) -> None:
45+
def retry(url: Url) -> None:
4646

4747
# Choice of Programming Languages
4848

4949
Are we right to concentrate on Java and Python versions of the code? I think so; both languages are popular; Java is
5050
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 (ut lacks type declarations and can be solw). The [TIOBE Index](http://www.tiobe.com/tiobe_index) says the top five most popular languages are:
5151

5252
Java, C, C++, C#, Python
53-
53+
5454
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. And finally, Javascript is the language of the browser; it would be nice to have code that runs in the browser, in Javascript or a variant such as Typescript.
5555

5656
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.
5757

5858
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
5959
various dates. However, I don't have much confidence in these figures...
6060

61-
<p>
62-
<table border=1>
63-
<tr><th>Language<th>2004<th>2005<th>2007<th>2010<th>2016
64-
<tr><td> <a href="http://www.google.com/search?q=norvig+russell+%22Modern+Approach%22"> <i>none</i></a><td align=right> 8,080<td align=right>20,100<td align=right>75,200<td align=right>150,000<td align=right>132,000
65-
<tr><td> <a href="http://www.google.com/search?q=java+norvig+russell+%22Modern+Approach%22">java </a><td align=right> 1,990<td align=right>4,930<td align=right>44,200<td align=right>37,000<td align=right>50,000
66-
<tr><td> <a href="http://www.google.com/search?q=c%2B%2B+norvig+russell+%22Modern+Approach%22">c++ </a><td align=right> 875<td align=right>1,820<td align=right>35,300<td align=right>105,000<td align=right>35,000
67-
<tr><td> <a href="http://www.google.com/search?q=lisp+norvig+russell+%22Modern+Approach%22">lisp </a><td align=right> 844<td align=right>974<td align=right>30,100<td align=right>19,000<td align=right>14,000
68-
<tr><td> <a href="http://www.google.com/search?q=prolog+norvig+russell+%22Modern+Approach%22">prolog </a><td align=right> 789<td align=right>2,010<td align=right>23,200<td align=right>17,000<td align=right>16,000
69-
<tr><td> <a href="http://www.google.com/search?q=python+norvig+russell+%22Modern+Approach%22">python </a><td align=right> 785<td align=right>1,240<td align=right>18,400<td align=right>11,000<td align=right>12,000
70-
71-
</table>
72-
61+
|Language |2004 |2005 |2007 |2010 |2016 |
62+
|-------- |----: |----: |----: |----: |----: |
63+
|[none](http://www.google.com/search?q=norvig+russell+%22Modern+Approach%22)|8,080|20,100|75,200|150,000|132,000|
64+
|[java](http://www.google.com/search?q=java+norvig+russell+%22Modern+Approach%22)|1,990|4,930|44,200|37,000|50,000|
65+
|[c++](http://www.google.com/search?q=c%2B%2B+norvig+russell+%22Modern+Approach%22)|875|1,820|35,300|105,000|35,000|
66+
|[lisp](http://www.google.com/search?q=lisp+norvig+russell+%22Modern+Approach%22)|844|974|30,100|19,000|14,000|
67+
|[prolog](http://www.google.com/search?q=prolog+norvig+russell+%22Modern+Approach%22)|789|2,010|23,200|17,000|16,000|
68+
|[python](http://www.google.com/search?q=python+norvig+russell+%22Modern+Approach%22)|785|1,240|18,400|11,000|12,000|

0 commit comments

Comments
 (0)