logicAgents.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:AIclass 作者: mttk 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号