コード例 #1
0
def getIDSData(goal):
    res = iterativeDeepeningSearch(startState,actionsF,takeActionF, lambda (s): s==goal, 20)
    depth = len(res) - 1 # not counting start state..
    nodes = getNodeCount()
    branchf = ebf(nodes, depth)
    
    return depth, nodes, branchf
コード例 #2
0
def getIDSData(goal):
    res = iterativeDeepeningSearch(startState, actionsF, takeActionF, lambda
                                   (s): s == goal, 20)
    depth = len(res) - 1  # not counting start state..
    nodes = getNodeCount()
    branchf = ebf(nodes, depth)

    return depth, nodes, branchf
コード例 #3
0
def getRBFSData(goal, hfunc):
    def goalTest(state):
        return state == goal
    
    def takeAction(state, action):
        return takeActionF(state, action), 1
    
    res = RBFS(startState, actionsF, takeAction, goalTest, hfunc)
    depth = len(res[0]) - 1 # not counting start state..
    nodes = getNCount()
    branchf = ebf(nodes, depth)
    
    return depth, nodes, branchf
コード例 #4
0
def getRBFSData(goal, hfunc):
    def goalTest(state):
        return state == goal

    def takeAction(state, action):
        return takeActionF(state, action), 1

    res = RBFS(startState, actionsF, takeAction, goalTest, hfunc)
    depth = len(res[0]) - 1  # not counting start state..
    nodes = getNCount()
    branchf = ebf(nodes, depth)

    return depth, nodes, branchf