Skip to content

Commit

Permalink
Merge pull request aimacode#124 from reachtarunhere/online2
Browse files Browse the repository at this point in the history
Renamed run to __call__ for Online DFS Agent
  • Loading branch information
norvig committed Mar 11, 2016
2 parents fcead67 + f633d0c commit e807618
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions search.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,10 +419,7 @@ def __init__(self, problem):
self.unbacktracked = defaultdict(list)
self.result = {}

def update_state(self, percept):
raise NotImplementedError

def run(self, percept):
def __call__(self, percept):
current_state = self.update_state(percept)
if self.problem.goal_test(current_state):
self.a = None
Expand All @@ -449,6 +446,8 @@ def run(self, percept):
self.s = current_state
return self.a

def update_state(self, percept):
raise NotImplementedError

def lrta_star_agent(s1):
"[Fig. 4.24]"
Expand Down

0 comments on commit e807618

Please sign in to comment.