Skip to content
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

Fix typos for Wupus agent (#999) #5

Merged
merged 1 commit into from Dec 23, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions logic.py
Expand Up @@ -35,7 +35,7 @@
removeall, unique, first, argmax, probability,
isnumber, issequence, Expr, expr, subexpressions
)
import agents
from agents import Agent, Glitter, Bump, Stench, Breeze, Scream
from search import astar_search, PlanRoute

import itertools
Expand Down Expand Up @@ -851,7 +851,7 @@ def __init__(self,dimrow):
wumpus_at_least = list()
for x in range(1, dimrow+1):
for y in range(1, dimrow + 1):
wumps_at_least.append(wumpus(x, y))
wumpus_at_least.append(wumpus(x, y))

self.tell(new_disjunction(wumpus_at_least))

Expand Down Expand Up @@ -913,7 +913,7 @@ def make_percept_sentence(self, percept, time):
self.tell(percept_scream(time))

## Things not perceived
for i in len(range(flags)):
for i in range(len(flags)):
if flags[i] == 0:
if i == 0:
self.tell(~percept_glitter(time))
Expand Down Expand Up @@ -1037,16 +1037,16 @@ def __eq__(self, other):
# ______________________________________________________________________________


class HybridWumpusAgent(agents.Agent):
class HybridWumpusAgent(Agent):
"""An agent for the wumpus world that does logical inference. [Figure 7.20]"""

def __init__(self):
super().__init__()
self.dimrow = 4
def __init__(self,dimentions):
self.dimrow = dimentions
self.kb = WumpusKB(self.dimrow)
self.t = 0
self.plan = list()
self.current_position = WumpusPosition(1, 1, 'UP')
super().__init__(self.execute)


def execute(self, percept):
Expand Down