File tree Expand file tree Collapse file tree 4 files changed +8
-13
lines changed Expand file tree Collapse file tree 4 files changed +8
-13
lines changed Original file line number Diff line number Diff line change 11"""CSP (Constraint Satisfaction Problems) problems and solvers. (Chapter 6)."""
22
3- from utils import count , first , argmin_random_tie
3+ from utils import argmin_random_tie , count , first
44import search
55
66from collections import defaultdict
@@ -320,11 +320,11 @@ def tree_csp_solver(csp):
320320
321321
322322def topological_sort (xs , x ):
323- unimplemented ()
323+ raise NotImplementedError
324324
325325
326326def make_arc_consistent (Xj , Xk , csp ):
327- unimplemented ()
327+ raise NotImplementedError
328328
329329# ______________________________________________________________________________
330330# Map-Coloring Problems
Original file line number Diff line number Diff line change @@ -412,11 +412,11 @@ def decision_list_learning(examples):
412412 def find_examples (examples ):
413413 """Find a set of examples that all have the same outcome under
414414 some test. Return a tuple of the test, outcome, and examples."""
415- unimplemented ()
415+ raise NotImplementedError
416416
417417 def passes (example , test ):
418418 "Does the example pass the test?"
419- unimplemented ()
419+ raise NotImplementedError
420420
421421 def predict (example ):
422422 "Predict the outcome for the first passing test."
Original file line number Diff line number Diff line change @@ -674,11 +674,11 @@ class HybridWumpusAgent(agents.Agent):
674674 "An agent for the wumpus world that does logical inference. [Figure 7.20]" ""
675675
676676 def __init__ (self ):
677- unimplemented ()
677+ raise NotImplementedError
678678
679679
680680def plan_route (current , goals , allowed ):
681- unimplemented ()
681+ raise NotImplementedError
682682
683683# ______________________________________________________________________________
684684
@@ -844,7 +844,7 @@ def subst(s, x):
844844
845845
846846def fol_fc_ask (KB , alpha ):
847- unimplemented ()
847+ raise NotImplementedError
848848
849849
850850def standardize_variables (sentence , dic = None ):
Original file line number Diff line number Diff line change @@ -322,11 +322,6 @@ def DataFile(name, mode='r'):
322322 return AIMAFile (['aima-data' , name ], mode )
323323
324324
325- def unimplemented ():
326- "Use this as a stub for not-yet-implemented functions."
327- raise NotImplementedError
328-
329-
330325# ______________________________________________________________________________
331326# Expressions
332327
You can’t perform that action at this time.
0 commit comments