def __init__(self, fn='logicBasedSearch', prob='LogicSearchProblem'):
# Warning: some advanced Python magic is employed below to find the right functions and problems
# Get the search function from the name and heuristic
if fn not in dir(pacard):
raise AttributeError, fn + ' is not a search function in pacard.py.'
func = getattr(pacard, fn)
self.searchFunction = func
# Get the search problem type from the name
if prob not in globals().keys() or not prob.endswith('Problem'):
raise AttributeError, prob + ' is not a search problem type in logicAgents.py.'
self.searchType = globals()[prob]
print('[PacardAgent] using problem type ' + prob)
评论列表
文章目录