Newer
Older
"# AGENT #\n",
"\n",
"An agent, as defined in 2.1 is anything that can perceive its <b>environment</b> through sensors, and act upon that environment through actuators based on its <b>agent program</b>. This can be a dog, robot, or even you. As long as you can perceive the environment and act on it, you are an agent. This notebook will explain how to implement a simple agent, create an environment, and create a program that helps the agent act on the environment based on its percepts.\n",
"\n",
"Before moving on, review the <b>Agent</b> and <b>Environment</b> classes in [<b>agents.py</b>](https://github.com/aimacode/aima-python/blob/master/agents.py).\n",
"\n",
"Let's begin by importing all the functions from the agents.py module and creating our first agent - a blind dog."
]
},
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Can't find a valid program for BlindDog, falling back to default.\n"
]
}
],
"source": [
"from agents import *\n",
"\n",
"class BlindDog(Agent):\n",
" def eat(self, thing):\n",
" print(\"Dog: Ate food at {}.\".format(self.location))\n",
" \n",
" def drink(self, thing):\n",
" print(\"Dog: Drank water at {}.\".format( self.location))\n",
"\n",
"dog = BlindDog()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"What we have just done is create a dog who can only feel what's in his location (since he's blind), and can eat or drink. Let's see if he's alive..."
"execution_count": 2,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"True\n"
]
}
],
"source": [
"print(dog.alive)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
"This is our dog. How cool is he? Well, he's hungry and needs to go search for food. For him to do this, we need to give him a program. But before that, let's create a park for our dog to play in."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# ENVIRONMENT #\n",
"\n",
"A park is an example of an environment because our dog can perceive and act upon it. The <b>Environment</b> class in agents.py is an abstract class, so we will have to create our own subclass from it before we can use it. The abstract class must contain the following methods:\n",
"\n",
"<li><b>percept(self, agent)</b> - returns what the agent perceives</li>\n",
"<li><b>execute_action(self, agent, action)</b> - changes the state of the environment based on what the agent does.</li>"
]
},
{
"cell_type": "code",
"execution_count": 3,
"outputs": [],
"source": [
"class Food(Thing):\n",
" pass\n",
"\n",
"class Water(Thing):\n",
" pass\n",
"\n",
"class Park(Environment):\n",
" def percept(self, agent):\n",
" '''prints & return a list of things that are in our agent's location'''\n",
" things = self.list_things_at(agent.location)\n",
" return things\n",
" \n",
" def execute_action(self, agent, action):\n",
" '''changes the state of the environment based on what the agent does.'''\n",
" if action == \"move down\":\n",
" print('{} decided to {} at location: {}'.format(str(agent)[1:-1], action, agent.location))\n",
" agent.movedown()\n",
" elif action == \"eat\":\n",
" items = self.list_things_at(agent.location, tclass=Food)\n",
" if len(items) != 0:\n",
" if agent.eat(items[0]): #Have the dog eat the first item\n",
" print('{} ate {} at location: {}'\n",
" .format(str(agent)[1:-1], str(items[0])[1:-1], agent.location))\n",
" self.delete_thing(items[0]) #Delete it from the Park after.\n",
" elif action == \"drink\":\n",
" items = self.list_things_at(agent.location, tclass=Water)\n",
" if len(items) != 0:\n",
" if agent.drink(items[0]): #Have the dog drink the first item\n",
" print('{} drank {} at location: {}'\n",
" .format(str(agent)[1:-1], str(items[0])[1:-1], agent.location))\n",
" self.delete_thing(items[0]) #Delete it from the Park after.\n",
" def is_done(self):\n",
" '''By default, we're done when we can't find a live agent, \n",
" but to prevent killing our cute dog, we will stop before itself - when there is no more food or water'''\n",
" no_edibles = not any(isinstance(thing, Food) or isinstance(thing, Water) for thing in self.things)\n",
" dead_agents = not any(agent.is_alive() for agent in self.agents)\n",
" return dead_agents or no_edibles\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
},
"source": [
"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",
"<table>\n",
" <tr>\n",
" <td><b>Percept:</b> </td>\n",
" <td>Feel Food </td>\n",
" <td>Feel Water</td>\n",
" <td>Feel Nothing</td>\n",
" </tr>\n",
" <tr>\n",
" <td><b>Action:</b> </td>\n",
" <td>eat</td>\n",
" <td>drink</td>\n",
" </tr>\n",
" \n",
"</table>\n"
]
},
{
"cell_type": "code",
"class BlindDog(Agent):\n",
" location = 1\n",
" \n",
" def movedown(self):\n",
" self.location += 1\n",
" \n",
" def eat(self, thing):\n",
" '''returns True upon success or 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",
" if isinstance(thing, Water):\n",
" return True\n",
" return False\n",
" \n",
"def program(percepts):\n",
" '''Returns an action based on it's percepts'''\n",
" for p in percepts:\n",
" if isinstance(p, Food):\n",
" return 'eat'\n",
" elif isinstance(p, Water):\n",
" return 'drink'\n",
" return 'move down'"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's now run our simulation by creating a park with some food, water, and our dog."
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"BlindDog decided to move down at location: 1\n",
"BlindDog decided to move down at location: 2\n",
"BlindDog decided to move down at location: 3\n",
"BlindDog decided to move down at location: 4\n",
"BlindDog ate Food at location: 5\n"
]
}
],
"source": [
"park = Park()\n",
"dog = BlindDog(program)\n",
"dogfood = Food()\n",
"water = Water()\n",
"park.add_thing(dogfood, 5)\n",
"park.add_thing(water, 7)\n",
"\n",
"park.run(5)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"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",
"Let's continue this simulation for 5 more steps."
]
},
{
"cell_type": "code",
"execution_count": 6,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"BlindDog decided to move down at location: 5\n",
"BlindDog decided to move down at location: 6\n",
"BlindDog drank Water at location: 7\n"
]
}
],
"source": [
"park.run(5)"
]
},
{
"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. Let's add some more water and see if our dog can reach it."
]
},
{
"cell_type": "code",
"execution_count": 7,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"BlindDog decided to move down at location: 7\n",
"BlindDog decided to move down at location: 8\n",
"BlindDog decided to move down at location: 9\n",
"BlindDog decided to move down at location: 10\n",
"BlindDog decided to move down at location: 11\n",
"BlindDog decided to move down at location: 12\n",
"BlindDog decided to move down at location: 13\n",
"BlindDog decided to move down at location: 14\n",
"BlindDog drank Water at location: 15\n"
]
}
],
"source": [
"park.add_thing(water, 15)\n",
"park.run(10)"
]
},
{
"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",
"\n",
"\n",
"# 2D Environment #\n",
"To make our Park 2D, we will need to make it a subclass of <b>XYEnvironment</b> instead of Environment. Please note that our park is indexed in the 4th quadrant of the X-Y plane.\n",
"\n",
"We will also eventually add a person to pet the dog."
"source": [
"class Park2D(XYEnvironment):\n",
" def percept(self, agent):\n",
" '''prints & return a list of things that are in our agent's location'''\n",
" things = self.list_things_at(agent.location)\n",
" return things\n",
" \n",
" def execute_action(self, agent, action):\n",
" '''changes the state of the environment based on what the agent does.'''\n",
" if action == \"move down\":\n",
" print('{} decided to {} at location: {}'.format(str(agent)[1:-1], action, agent.location))\n",
" agent.movedown()\n",
" elif action == \"eat\":\n",
" items = self.list_things_at(agent.location, tclass=Food)\n",
" if len(items) != 0:\n",
" if agent.eat(items[0]): #Have the dog eat the first item\n",
" print('{} ate {} at location: {}'\n",
" .format(str(agent)[1:-1], str(items[0])[1:-1], agent.location))\n",
" self.delete_thing(items[0]) #Delete it from the Park after.\n",
" elif action == \"drink\":\n",
" items = self.list_things_at(agent.location, tclass=Water)\n",
" if len(items) != 0:\n",
" if agent.drink(items[0]): #Have the dog drink the first item\n",
" print('{} drank {} at location: {}'\n",
" .format(str(agent)[1:-1], str(items[0])[1:-1], agent.location))\n",
" self.delete_thing(items[0]) #Delete it from the Park after.\n",
" \n",
" def is_done(self):\n",
" '''By default, we're done when we can't find a live agent, \n",
" but to prevent killing our cute dog, we will stop before itself - when there is no more food or water'''\n",
" no_edibles = not any(isinstance(thing, Food) or isinstance(thing, Water) for thing in self.things)\n",
" dead_agents = not any(agent.is_alive() for agent in self.agents)\n",
" 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",
" \n",
" def movedown(self):\n",
" self.location[1] += 1\n",
" \n",
" def eat(self, thing):\n",
" '''returns True upon success or 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",
" if isinstance(thing, Water):\n",
" return True\n",
" return False\n",
" \n",
"def program(percepts):\n",
" '''Returns an action based on it's percepts'''\n",
" for p in percepts:\n",
" if isinstance(p, Food):\n",
" return 'eat'\n",
" elif isinstance(p, Water):\n",
" return 'drink'\n",
" return 'move down'"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now let's test this new park with our same dog, food and water"
]
},
{
"cell_type": "code",
"execution_count": 9,
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"BlindDog decided to move down at location: [0, 1]\n",
"BlindDog decided to move down at location: [0, 2]\n",
"BlindDog decided to move down at location: [0, 3]\n",
"BlindDog decided to move down at location: [0, 4]\n",
"BlindDog ate Food at location: [0, 5]\n",
"BlindDog decided to move down at location: [0, 5]\n",
"BlindDog decided to move down at location: [0, 6]\n",
"BlindDog drank Water at location: [0, 7]\n",
"BlindDog decided to move down at location: [0, 7]\n",
"BlindDog decided to move down at location: [0, 8]\n",
"BlindDog decided to move down at location: [0, 9]\n",
"BlindDog decided to move down at location: [0, 10]\n",
"BlindDog decided to move down at location: [0, 11]\n",
"BlindDog decided to move down at location: [0, 12]\n",
"BlindDog decided to move down at location: [0, 13]\n",
"BlindDog decided to move down at location: [0, 14]\n",
"BlindDog drank Water at location: [0, 15]\n"
]
}
],
"source": [
"park = Park2D(5,20) # park width is set to 5, and height to 20\n",
"dog = BlindDog(program)\n",
"dogfood = Food()\n",
"water = Water()\n",
"park.add_thing(dog, [0,1])\n",
"park.add_thing(dogfood, [0,5])\n",
"park.add_thing(water, [0,7])\n",
"morewater = Water()\n",
"park.add_thing(morewater, [0,15])\n",
"park.run(20)"
]
},
{
"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",
"\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",
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
"\n",
"<table>\n",
" <tr>\n",
" <td><b>Percept:</b> </td>\n",
" <td>Feel Food </td>\n",
" <td>Feel Water</td>\n",
" <td>Feel Nothing</td>\n",
" </tr>\n",
" <tr>\n",
" <td><b>Action:</b> </td>\n",
" <td>eat</td>\n",
" <td>drink</td>\n",
" <td>\n",
" <table>\n",
" <tr>\n",
" <td><b>Remember being at Edge : </b></td>\n",
" <td>At Edge</td>\n",
" <td>Not at Edge</td>\n",
" </tr>\n",
" <tr>\n",
" <td><b>Action : </b></td>\n",
" <td>Turn Left / Turn Right <br> ( 50% - 50% chance )</td>\n",
" <td>Turn Left / Turn Right / Move Forward <br> ( 25% - 25% - 50% chance )</td>\n",
" </tr>\n",
" </table>\n",
" </td>\n",
" </tr>\n",
" \n",
"</table>"
]
},
{
"cell_type": "code",
"execution_count": 10,
"outputs": [],
"source": [
"from random import choice\n",
"\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",
" \n",
" def moveforward(self, success=True):\n",
" '''moveforward possible only if success (ie valid destination location)'''\n",
" global turn\n",
" if not success:\n",
" turn = True # if edge has been reached, remember to turn\n",
" return\n",
" if self.direction.direction == Direction.R:\n",
" self.location[0] += 1\n",
" elif self.direction.direction == Direction.L:\n",
" self.location[0] -= 1\n",
" elif self.direction.direction == Direction.D:\n",
" self.location[1] += 1\n",
" elif self.direction.direction == Direction.U:\n",
" self.location[1] -= 1\n",
" \n",
" def turn(self, d):\n",
" self.direction = self.direction + d\n",
" \n",
" def eat(self, thing):\n",
" '''returns True upon success or 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",
" if isinstance(thing, Water):\n",
" return True\n",
" return False\n",
" \n",
"def program(percepts):\n",
" '''Returns an action based on it's percepts'''\n",
" global turn\n",
" for p in percepts: # first eat or drink - you're a dog!\n",
" if isinstance(p, Food):\n",
" return 'eat'\n",
" elif isinstance(p, Water):\n",
" return 'drink'\n",
" if turn: # then recall if you were at an edge and had to turn\n",
" turn = False\n",
" choice = random.choice((1,2));\n",
" else:\n",
" choice = random.choice((1,2,3,4)) # 1-right, 2-left, others-forward\n",
" if choice == 1:\n",
" return 'turnright'\n",
" elif choice == 2:\n",
" return 'turnleft'\n",
" else:\n",
" return 'moveforward'\n",
" "
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We also need to modify our park accordingly, in order to be able to handle all the new actions our dog wishes to execute. Additionally, we'll need to prevent our dog from moving to locations beyond our park boundary - it just isn't safe for blind dogs to be outside the park by themselves."
]
},
{
"cell_type": "code",
"execution_count": 11,
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
"outputs": [],
"source": [
"class Park2D(XYEnvironment):\n",
" def percept(self, agent):\n",
" '''prints & return a list of things that are in our agent's location'''\n",
" things = self.list_things_at(agent.location)\n",
" return things\n",
" \n",
" def execute_action(self, agent, action):\n",
" '''changes the state of the environment based on what the agent does.'''\n",
" if action == 'turnright':\n",
" print('{} decided to {} at location: {}'.format(str(agent)[1:-1], action, agent.location))\n",
" agent.turn(Direction.R)\n",
" elif action == 'turnleft':\n",
" print('{} decided to {} at location: {}'.format(str(agent)[1:-1], action, agent.location))\n",
" agent.turn(Direction.L)\n",
" elif action == 'moveforward':\n",
" loc = copy.deepcopy(agent.location) # find out the target location\n",
" if agent.direction.direction == Direction.R:\n",
" loc[0] += 1\n",
" elif agent.direction.direction == Direction.L:\n",
" loc[0] -= 1\n",
" elif agent.direction.direction == Direction.D:\n",
" loc[1] += 1\n",
" elif agent.direction.direction == Direction.U:\n",
" loc[1] -= 1\n",
" if self.is_inbounds(loc):# move only if the target is a valid location\n",
" print('{} decided to move {}wards at location: {}'.format(str(agent)[1:-1], agent.direction.direction, agent.location))\n",
" agent.moveforward()\n",
" else:\n",
" print('{} decided to move {}wards at location: {}, but couldn\\'t'.format(str(agent)[1:-1], agent.direction.direction, agent.location))\n",
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
" agent.moveforward(False)\n",
" elif action == \"eat\":\n",
" items = self.list_things_at(agent.location, tclass=Food)\n",
" if len(items) != 0:\n",
" if agent.eat(items[0]):\n",
" print('{} ate {} at location: {}'\n",
" .format(str(agent)[1:-1], str(items[0])[1:-1], agent.location))\n",
" self.delete_thing(items[0])\n",
" elif action == \"drink\":\n",
" items = self.list_things_at(agent.location, tclass=Water)\n",
" if len(items) != 0:\n",
" if agent.drink(items[0]):\n",
" print('{} drank {} at location: {}'\n",
" .format(str(agent)[1:-1], str(items[0])[1:-1], agent.location))\n",
" self.delete_thing(items[0])\n",
" \n",
" def is_done(self):\n",
" '''By default, we're done when we can't find a live agent, \n",
" but to prevent killing our cute dog, we will stop before itself - when there is no more food or water'''\n",
" no_edibles = not any(isinstance(thing, Food) or isinstance(thing, Water) for thing in self.things)\n",
" dead_agents = not any(agent.is_alive() for agent in self.agents)\n",
" return dead_agents or no_edibles\n"
]
},
{
"cell_type": "code",
"execution_count": 12,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"dog started at [0,0], facing down. Let's see if he found any food or water!\n",
"EnergeticBlindDog decided to turnright at location: [0, 0]\n",
"EnergeticBlindDog decided to move leftwards at location: [0, 0], but couldn't\n",
"EnergeticBlindDog decided to turnright at location: [0, 0]\n",
"EnergeticBlindDog decided to turnright at location: [0, 0]\n",
"EnergeticBlindDog decided to turnleft at location: [0, 0]\n",
"EnergeticBlindDog decided to move upwards at location: [0, 0], but couldn't\n",
"EnergeticBlindDog decided to turnleft at location: [0, 0]\n",
"EnergeticBlindDog decided to turnleft at location: [0, 0]\n",
"EnergeticBlindDog decided to turnleft at location: [0, 0]\n",
"EnergeticBlindDog decided to turnright at location: [0, 0]\n",
"EnergeticBlindDog decided to turnright at location: [0, 0]\n",
"EnergeticBlindDog decided to turnleft at location: [0, 0]\n",
"EnergeticBlindDog decided to turnleft at location: [0, 0]\n",
"EnergeticBlindDog decided to move rightwards at location: [0, 0]\n",
"EnergeticBlindDog decided to turnleft at location: [1, 0]\n",
"EnergeticBlindDog decided to turnleft at location: [1, 0]\n",
"EnergeticBlindDog decided to turnleft at location: [1, 0]\n",
"EnergeticBlindDog decided to move downwards at location: [1, 0]\n",
"EnergeticBlindDog decided to move downwards at location: [1, 1]\n",
"EnergeticBlindDog ate Food at location: [1, 2]\n"
]
}
],
"source": [
"park = Park2D(3,3)\n",
"dog = EnergeticBlindDog(program)\n",
"dogfood = Food()\n",
"water = Water()\n",
"park.add_thing(dog, [0,0])\n",
"park.add_thing(dogfood, [1,2])\n",
"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. 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>. Let's see how this looks."
]
},
{
"cell_type": "code",
"execution_count": 13,
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
"outputs": [],
"source": [
"class GraphicPark(GraphicEnvironment):\n",
" def percept(self, agent):\n",
" '''prints & return a list of things that are in our agent's location'''\n",
" things = self.list_things_at(agent.location)\n",
" return things\n",
" \n",
" def execute_action(self, agent, action):\n",
" '''changes the state of the environment based on what the agent does.'''\n",
" if action == 'turnright':\n",
" print('{} decided to {} at location: {}'.format(str(agent)[1:-1], action, agent.location))\n",
" agent.turn(Direction.R)\n",
" elif action == 'turnleft':\n",
" print('{} decided to {} at location: {}'.format(str(agent)[1:-1], action, agent.location))\n",
" agent.turn(Direction.L)\n",
" elif action == 'moveforward':\n",
" loc = copy.deepcopy(agent.location) # find out the target location\n",
" if agent.direction.direction == Direction.R:\n",
" loc[0] += 1\n",
" elif agent.direction.direction == Direction.L:\n",
" loc[0] -= 1\n",
" elif agent.direction.direction == Direction.D:\n",
" loc[1] += 1\n",
" elif agent.direction.direction == Direction.U:\n",
" loc[1] -= 1\n",
" if self.is_inbounds(loc):# move only if the target is a valid location\n",
" print('{} decided to move {}wards at location: {}'.format(str(agent)[1:-1], agent.direction.direction, agent.location))\n",
" agent.moveforward()\n",
" else:\n",
" print('{} decided to move {}wards at location: {}, but couldn\\'t'.format(str(agent)[1:-1], agent.direction.direction, agent.location))\n",
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
" agent.moveforward(False)\n",
" elif action == \"eat\":\n",
" items = self.list_things_at(agent.location, tclass=Food)\n",
" if len(items) != 0:\n",
" if agent.eat(items[0]):\n",
" print('{} ate {} at location: {}'\n",
" .format(str(agent)[1:-1], str(items[0])[1:-1], agent.location))\n",
" self.delete_thing(items[0])\n",
" elif action == \"drink\":\n",
" items = self.list_things_at(agent.location, tclass=Water)\n",
" if len(items) != 0:\n",
" if agent.drink(items[0]):\n",
" print('{} drank {} at location: {}'\n",
" .format(str(agent)[1:-1], str(items[0])[1:-1], agent.location))\n",
" self.delete_thing(items[0])\n",
" \n",
" def is_done(self):\n",
" '''By default, we're done when we can't find a live agent, \n",
" but to prevent killing our cute dog, we will stop before itself - when there is no more food or water'''\n",
" no_edibles = not any(isinstance(thing, Food) or isinstance(thing, Water) for thing in self.things)\n",
" dead_agents = not any(agent.is_alive() for agent in self.agents)\n",
" return dead_agents or no_edibles\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"That is the only change we make. The rest of our code stays the same. There is a slight difference in usage though. Every time we create a GraphicPark, we need to define the colors of all the things we plan to put into the park. The colors are defined in typical [<b>RGB digital 8-bit format</b>](https://en.wikipedia.org/wiki/RGB_color_model#Numeric_representations), common across the web."
]
},
{
"cell_type": "code",
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"dog started at [0,0], facing down. Let's see if he found any food or water!\n"
]
},
{
"data": {
"text/html": [
"<style type=\"text/css\">table.blockgrid {border: none;} .blockgrid tr {border: none;} .blockgrid td {padding: 0px;} #blocks434ae471-141f-40bc-a895-4e2a34039a82 td {border: 1px solid white;}</style><table id=\"blocks434ae471-141f-40bc-a895-4e2a34039a82\" class=\"blockgrid\"><tbody><tr><td title=\"Index: [0, 0] Color: (200, 0, 0)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 0, 0);\"></td><td title=\"Index: [0, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [1, 0] Color: (0, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(0, 200, 200);\"></td><td title=\"Index: [1, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [2, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 1] Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td><td title=\"Index: [2, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [3, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 4] Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td></tr><tr><td title=\"Index: [4, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 2] Color: (0, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(0, 200, 200);\"></td><td title=\"Index: [4, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr></tbody></table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"EnergeticBlindDog decided to move downwards at location: [0, 0]\n"
]
},
{
"data": {
"text/html": [],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<style type=\"text/css\">table.blockgrid {border: none;} .blockgrid tr {border: none;} .blockgrid td {padding: 0px;} #blocks1262f8b9-5a91-41f4-b222-50ceeadbf943 td {border: 1px solid white;}</style><table id=\"blocks1262f8b9-5a91-41f4-b222-50ceeadbf943\" class=\"blockgrid\"><tbody><tr><td title=\"Index: [0, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [1, 0] Color: (0, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(0, 200, 200);\"></td><td title=\"Index: [1, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [2, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 1] Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td><td title=\"Index: [2, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [3, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 4] Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td></tr><tr><td title=\"Index: [4, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 2] Color: (0, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(0, 200, 200);\"></td><td title=\"Index: [4, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr></tbody></table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"EnergeticBlindDog drank Water at location: [0, 1]\n"
]
},
{
"data": {
"text/html": [],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<style type=\"text/css\">table.blockgrid {border: none;} .blockgrid tr {border: none;} .blockgrid td {padding: 0px;} #blocks07e62bbe-2c97-47b0-8fd8-c932320cb3bb td {border: 1px solid white;}</style><table id=\"blocks07e62bbe-2c97-47b0-8fd8-c932320cb3bb\" class=\"blockgrid\"><tbody><tr><td title=\"Index: [0, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [1, 0] Color: (200, 0, 0)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 0, 0);\"></td><td title=\"Index: [1, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [2, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 1] Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td><td title=\"Index: [2, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [3, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 4] Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td></tr><tr><td title=\"Index: [4, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 2] Color: (0, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(0, 200, 200);\"></td><td title=\"Index: [4, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr></tbody></table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"EnergeticBlindDog decided to move downwards at location: [0, 1]\n"
{
"data": {
"text/html": [],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<style type=\"text/css\">table.blockgrid {border: none;} .blockgrid tr {border: none;} .blockgrid td {padding: 0px;} #blocks174aebda-4b1d-41a7-bef4-d8eb82fc9cc9 td {border: 1px solid white;}</style><table id=\"blocks174aebda-4b1d-41a7-bef4-d8eb82fc9cc9\" class=\"blockgrid\"><tbody><tr><td title=\"Index: [0, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [1, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [2, 0] Color: (200, 0, 0)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 0, 0);\"></td><td title=\"Index: [2, 1] Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td><td title=\"Index: [2, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [3, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 4] Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td></tr><tr><td title=\"Index: [4, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 2] Color: (0, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(0, 200, 200);\"></td><td title=\"Index: [4, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr></tbody></table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"EnergeticBlindDog decided to move downwards at location: [0, 2]\n"
{
"data": {
"text/html": [],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<style type=\"text/css\">table.blockgrid {border: none;} .blockgrid tr {border: none;} .blockgrid td {padding: 0px;} #blocks4ee95b3d-163d-4bef-ac4e-413154bc4f2a td {border: 1px solid white;}</style><table id=\"blocks4ee95b3d-163d-4bef-ac4e-413154bc4f2a\" class=\"blockgrid\"><tbody><tr><td title=\"Index: [0, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [1, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [2, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 1] Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td><td title=\"Index: [2, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [3, 0] Color: (200, 0, 0)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 0, 0);\"></td><td title=\"Index: [3, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 4] Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td></tr><tr><td title=\"Index: [4, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 2] Color: (0, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(0, 200, 200);\"></td><td title=\"Index: [4, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr></tbody></table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"EnergeticBlindDog decided to move downwards at location: [0, 3]\n"
{
"data": {
"text/html": [],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<style type=\"text/css\">table.blockgrid {border: none;} .blockgrid tr {border: none;} .blockgrid td {padding: 0px;} #blocks907a1b83-0512-4208-a60b-7eacf452185b td {border: 1px solid white;}</style><table id=\"blocks907a1b83-0512-4208-a60b-7eacf452185b\" class=\"blockgrid\"><tbody><tr><td title=\"Index: [0, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [1, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [2, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 1] Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td><td title=\"Index: [2, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [3, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 4] Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td></tr><tr><td title=\"Index: [4, 0] Color: (200, 0, 0)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 0, 0);\"></td><td title=\"Index: [4, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 2] Color: (0, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(0, 200, 200);\"></td><td title=\"Index: [4, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr></tbody></table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"EnergeticBlindDog decided to turnleft at location: [0, 4]\n"
{
"data": {
"text/html": [],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<style type=\"text/css\">table.blockgrid {border: none;} .blockgrid tr {border: none;} .blockgrid td {padding: 0px;} #blocks22486510-92f9-42d8-8674-247e0dd84d88 td {border: 1px solid white;}</style><table id=\"blocks22486510-92f9-42d8-8674-247e0dd84d88\" class=\"blockgrid\"><tbody><tr><td title=\"Index: [0, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [1, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [2, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 1] Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td><td title=\"Index: [2, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [3, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 4] Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td></tr><tr><td title=\"Index: [4, 0] Color: (200, 0, 0)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 0, 0);\"></td><td title=\"Index: [4, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 2] Color: (0, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(0, 200, 200);\"></td><td title=\"Index: [4, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr></tbody></table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"EnergeticBlindDog decided to turnright at location: [0, 4]\n"
{
"data": {
"text/html": [],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<style type=\"text/css\">table.blockgrid {border: none;} .blockgrid tr {border: none;} .blockgrid td {padding: 0px;} #blocks8faf8892-32b6-40ae-b9fa-697ac25d719b td {border: 1px solid white;}</style><table id=\"blocks8faf8892-32b6-40ae-b9fa-697ac25d719b\" class=\"blockgrid\"><tbody><tr><td title=\"Index: [0, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [1, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [2, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 1] Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td><td title=\"Index: [2, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [3, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 4] Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td></tr><tr><td title=\"Index: [4, 0] Color: (200, 0, 0)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 0, 0);\"></td><td title=\"Index: [4, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 2] Color: (0, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(0, 200, 200);\"></td><td title=\"Index: [4, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr></tbody></table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"EnergeticBlindDog decided to move downwards at location: [0, 4], but couldn't\n"
{
"data": {
"text/html": [],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<style type=\"text/css\">table.blockgrid {border: none;} .blockgrid tr {border: none;} .blockgrid td {padding: 0px;} #blocks9c00982c-cfca-4540-95c8-65fe1ee24385 td {border: 1px solid white;}</style><table id=\"blocks9c00982c-cfca-4540-95c8-65fe1ee24385\" class=\"blockgrid\"><tbody><tr><td title=\"Index: [0, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [1, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [2, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 1] Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td><td title=\"Index: [2, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [3, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 4] Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td></tr><tr><td title=\"Index: [4, 0] Color: (200, 0, 0)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 0, 0);\"></td><td title=\"Index: [4, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 2] Color: (0, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(0, 200, 200);\"></td><td title=\"Index: [4, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr></tbody></table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"EnergeticBlindDog decided to turnright at location: [0, 4]\n"
{
"data": {
"text/html": [],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<style type=\"text/css\">table.blockgrid {border: none;} .blockgrid tr {border: none;} .blockgrid td {padding: 0px;} #blocks825fa77d-919f-476b-a894-98a254a6bd07 td {border: 1px solid white;}</style><table id=\"blocks825fa77d-919f-476b-a894-98a254a6bd07\" class=\"blockgrid\"><tbody><tr><td title=\"Index: [0, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [1, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [2, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 1] Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td><td title=\"Index: [2, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [3, 0] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 2] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 4] Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td></tr><tr><td title=\"Index: [4, 0] Color: (200, 0, 0)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 0, 0);\"></td><td title=\"Index: [4, 1] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 2] Color: (0, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(0, 200, 200);\"></td><td title=\"Index: [4, 3] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 4] Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr></tbody></table>"