Skip to content

Commit

Permalink
Changes in texts (#959)
Browse files Browse the repository at this point in the history
Added a few new sentences, modified the sentence structure at a few places, and corrected some grammatical errors.
  • Loading branch information
mkhalid1 authored and norvig committed Sep 19, 2018
1 parent 3a83335 commit 62f7d67
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions agents.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
},
"source": [
"# PROGRAM - BlindDog #\n",
"Now that we have a <b>Park</b> Class, we need to implement a <b>program</b> module for our dog. A program controls how the dog acts upon it's environment. Our program will be very simple, and is shown in the table below.\n",
"Now that we have a <b>Park</b> Class, we need to implement a <b>program</b> module for our dog. A program controls how the dog acts in it's environment; it will be very simple, and it's functionality is illustrated in the table below.\n",
"<table>\n",
" <tr>\n",
" <td><b>Percept:</b> </td>\n",
Expand Down Expand Up @@ -167,13 +167,13 @@
" self.location += 1\n",
" \n",
" def eat(self, thing):\n",
" '''returns True upon success or False otherwise'''\n",
" '''returns True for success and False otherwise'''\n",
" if isinstance(thing, Food):\n",
" return True\n",
" return False\n",
" \n",
" def drink(self, thing):\n",
" ''' returns True upon success or False otherwise'''\n",
" ''' returns True for success and False otherwise'''\n",
" if isinstance(thing, Water):\n",
" return True\n",
" return False\n",
Expand Down Expand Up @@ -289,7 +289,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"This is how to implement an agent, its program, and environment. However, this was a very simple case. Let's try a 2-Dimentional environment now with multiple agents.\n",
"This is how to implement an agent, its program, and environment. However, this was a very simple case. Lets now try a 2-Dimensional environment with multiple agents.\n",
"\n",
"\n",
"# 2D Environment #\n",
Expand Down Expand Up @@ -347,13 +347,13 @@
" self.location[1] += 1\n",
" \n",
" def eat(self, thing):\n",
" '''returns True upon success or False otherwise'''\n",
" '''returns True for success and False otherwise'''\n",
" if isinstance(thing, Food):\n",
" return True\n",
" return False\n",
" \n",
" def drink(self, thing):\n",
" ''' returns True upon success or False otherwise'''\n",
" ''' returns True for success and False otherwise'''\n",
" if isinstance(thing, Water):\n",
" return True\n",
" return False\n",
Expand Down Expand Up @@ -421,11 +421,11 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"This works, but our blind dog doesn't make any use of the 2 dimensional space available to him. Let's make our dog more energetic so that he turns and moves forward, instead of always moving down. We'll also need to make appropriate changes to our environment to be able to handle this extra motion.\n",
"This works, but our blind dog doesn't make any use of the 2 dimensional space available to him. Lets make our dog more energetic so that instead of always moving down, he turns and moves forward as well. To be able to handle this extra motion, we'll need to make appropriate changes to our environment.\n",
"\n",
"# PROGRAM - EnergeticBlindDog #\n",
"\n",
"Let's make our dog turn or move forwards at random - except when he's at the edge of our park - in which case we make him change his direction explicitly by turning to avoid trying to leave the park. Our dog is blind, however, so he wouldn't know which way to turn - he'd just have to try arbitrarily.\n",
"Let's make our dog turn or move forward at random - except when he's at the edge of our park - in which case we make him change his direction explicitly by turning to avoid trying to leave the park. Our dog is blind, however, so he wouldn't know which way to turn - he'd just have to try arbitrarily.\n",
"\n",
"<table>\n",
" <tr>\n",
Expand Down Expand Up @@ -491,13 +491,13 @@
" self.direction = self.direction + d\n",
" \n",
" def eat(self, thing):\n",
" '''returns True upon success or False otherwise'''\n",
" '''returns True for success and False otherwise'''\n",
" if isinstance(thing, Food):\n",
" return True\n",
" return False\n",
" \n",
" def drink(self, thing):\n",
" ''' returns True upon success or False otherwise'''\n",
" ''' returns True f success and False otherwise'''\n",
" if isinstance(thing, Water):\n",
" return True\n",
" return False\n",
Expand Down

0 comments on commit 62f7d67

Please sign in to comment.