This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Lets now run our simulation by creating a park with some food, water, and our dog."
"Let's now run our simulation by creating a park with some food, water, and our dog."
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand Down
Expand Up
@@ -235,15 +226,13 @@
"source": [
"Notice that the dog moved from location 1 to 4, over 4 steps, and ate food at location 5 in the 5th step.\n",
"\n",
"Lets continue this simulation for 5 more steps."
"Let's continue this simulation for 5 more steps."
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand All
@@ -263,15 +252,13 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Perfect! Note how the simulation stopped after the dog drank the water - exhausting all the food and water ends our simulation, as we had defined before. Lets add some more water and see if our dog can reach it."
"Perfect! Note how the simulation stopped after the dog drank the water - exhausting all the food and water ends our simulation, as we had defined before. Let's add some more water and see if our dog can reach it."
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand All
@@ -298,7 +285,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"This is how to implement an agent, its program, and environment. However, this was a very simple case. Lets 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. Let's try a 2-Dimentional environment now with multiple agents.\n",
"\n",
"\n",
"# 2D Environment #\n",
Expand Down
Expand Up
@@ -349,8 +336,8 @@
" return dead_agents or no_edibles\n",
"\n",
"class BlindDog(Agent):\n",
" location = [0,1]# change location to a 2d value\n",
" direction = Direction(\"down\")# variable to store the direction our dog is facing\n",
" location = [0,1]# change location to a 2d value\n",
" direction = Direction(\"down\")# variable to store the direction our dog is facing\n",
" \n",
" def movedown(self):\n",
" self.location[1] += 1\n",
Expand Down
Expand Up
@@ -381,15 +368,13 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Now lets test this new park with our same dog, food and water"
"Now let's test this new park with our same dog, food and water"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand Down
Expand Up
@@ -436,7 +421,7 @@
"\n",
"# PROGRAM - EnergeticBlindDog #\n",
"\n",
"Lets 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 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",
"\n",
"<table>\n",
" <tr>\n",
Expand Down
Expand Up
@@ -471,14 +456,12 @@
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"from random import choice\n",
"\n",
"turn = False# global variable to remember to turn if our dog hits the boundary\n",
"turn = False# global variable to remember to turn if our dog hits the boundary\n",
"class EnergeticBlindDog(Agent):\n",
" location = [0,1]\n",
" direction = Direction(\"down\")\n",
Expand Down
Expand Up
@@ -611,9 +594,7 @@
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand Down
Expand Up
@@ -653,15 +634,15 @@
"park.add_thing(water, [2,1])\n",
"morewater = Water()\n",
"park.add_thing(morewater, [0,2])\n",
"print('dog started at [0,0], facing down. Lets see if he found any food or water!')\n",
"print(\"dog started at [0,0], facing down. Let's see if he found any food or water!\")\n",
"park.run(20)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This is good, but it still lacks graphics. What if we wanted to visualize our park as it changed? To do that, all we have to do is make our park a subclass of <b>GraphicEnvironment</b> instead of <b>XYEnvironment</b>. Lets see how this looks."
"This is good, but it still lacks graphics. What if we wanted to visualize our park as it changed? To do that, all we have to do is make our park a subclass of <b>GraphicEnvironment</b> instead of <b>XYEnvironment</b>. Let's see how this looks."
]
},
{
Expand Down
Expand Up
@@ -739,7 +720,6 @@
"cell_type": "code",
"execution_count": 19,
"metadata": {
"collapsed": false,
"scrolled": true
},
"outputs": [
Expand Down
Expand Up
@@ -1155,7 +1135,7 @@
"morefood = Food()\n",
"park.add_thing(morewater, [2,4])\n",
"park.add_thing(morefood, [4,3])\n",
"print('dog started at [0,0], facing down. Lets see if he found any food or water!')\n",
"print(\"dog started at [0,0], facing down. Let's see if he found any food or water!\")\n",
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Add a thing to the environment, setting its location. For
convenience, if thing is an agent program we make a new agent
for it. (Shouldn't need to override this."""
for it. (Shouldn't need to override this.)"""
if not isinstance(thing, Thing):
thing = Agent(thing)
if thing in self.things:
Expand Down
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix typo for issue #664 #665
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
Uh oh!
There was an error while loading. Please reload this page.
fix typo for issue #664 #665
Filter by extension
Viewed files
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing