Skip to content

Commit bef727a

Browse files
authored
Merge pull request #5 from aimacode/master
Fix typos for Wupus agent (aimacode#999)
2 parents 972cff6 + fb9b85a commit bef727a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

logic.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
removeall, unique, first, argmax, probability,
3636
isnumber, issequence, Expr, expr, subexpressions
3737
)
38-
import agents
38+
from agents import Agent, Glitter, Bump, Stench, Breeze, Scream
3939
from search import astar_search, PlanRoute
4040

4141
import itertools
@@ -851,7 +851,7 @@ def __init__(self,dimrow):
851851
wumpus_at_least = list()
852852
for x in range(1, dimrow+1):
853853
for y in range(1, dimrow + 1):
854-
wumps_at_least.append(wumpus(x, y))
854+
wumpus_at_least.append(wumpus(x, y))
855855

856856
self.tell(new_disjunction(wumpus_at_least))
857857

@@ -913,7 +913,7 @@ def make_percept_sentence(self, percept, time):
913913
self.tell(percept_scream(time))
914914

915915
## Things not perceived
916-
for i in len(range(flags)):
916+
for i in range(len(flags)):
917917
if flags[i] == 0:
918918
if i == 0:
919919
self.tell(~percept_glitter(time))
@@ -1037,16 +1037,16 @@ def __eq__(self, other):
10371037
# ______________________________________________________________________________
10381038

10391039

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

1043-
def __init__(self):
1044-
super().__init__()
1045-
self.dimrow = 4
1043+
def __init__(self,dimentions):
1044+
self.dimrow = dimentions
10461045
self.kb = WumpusKB(self.dimrow)
10471046
self.t = 0
10481047
self.plan = list()
10491048
self.current_position = WumpusPosition(1, 1, 'UP')
1049+
super().__init__(self.execute)
10501050

10511051

10521052
def execute(self, percept):

0 commit comments

Comments
 (0)