示例#1
0
def beam_lin(count, room_time_limit, seed):
    #beam parameters:

    init_width_domain = [20]
    growf_domain = [(2, 'lin'), (4, 'lin'), (8, 'lin'), (16, 'lin')]
    heuristic_s = [heuristics.PowerHeuristic2(), heuristics.LinearHeuristic()]

    #------------------ Create Agents ------------------
    agent_list = []
    for h in heuristic_s:
        for init_width in init_width_domain:
            for growf in growf_domain:
                algorithm = AnytimeBeamSearch(init_width, growf)
                agent = TestAgent(algorithm, h)
                agent_list.append(agent)

    #---------------- Create Roomsets --------------------
    roomsets = [
        c_roomsets.easy_roomset(count, seed),
        c_roomsets.mild_roomset(count, seed),
        c_roomsets.heavy_roomset(count, seed)
    ]
    #---------------- measure --------------------
    dbs = ameasure(agent_list, roomsets, room_time_limit)
    return dbs
示例#2
0
class TheAgent(ProblemAgent):
    def __init__(self):
        self.heuristic = heuristics.PowerHeuristic2()
        self.algorithm = AnytimeBeamSearch(20, (1.3, 'exp'))

    def solve(self, problem_state, time_limit=NO_LIMIT):
        solution, _ = self.algorithm.find(problem_state, self.heuristic,
                                          time_limit)
        return solution
示例#3
0
文件: agent.py 项目: hizki/AI1
class TheAgent(ProblemAgent):
    
    def __init__(self):
        self.heuristic = heuristics.PowerHeuristic2()
        self.algorithm = AnytimeBeamSearch(20, (1.3, 'exp') )
        
    def solve(self, problem_state, time_limit = NO_LIMIT):
        solution, _ = self.algorithm.find(problem_state, self.heuristic,time_limit)
        return solution
示例#4
0
class SolveAgent(ProblemAgent):
    def __init__(self):
        self.heuristic = heuristics.PowerHeuristic2()
        self.algo = AnytimeBeamSearch(10, (1.2, "exp"))

    def getHeuristic(self):
        return self.heuristic

    def solve(self, problem_state, time_limit):
        return self.algo.find(problem_state, self.heuristic, time_limit)
示例#5
0
文件: solve_agent.py 项目: hizki/AI1
class SolveAgent(ProblemAgent):
    def __init__(self):
        self.heuristic = heuristics.PowerHeuristic2()
        self.algo = AnytimeBeamSearch(10,(1.2,"exp"))

    def getHeuristic(self):
        return self.heuristic

    def solve(self, problem_state, time_limit):
        return self.algo.find(problem_state, self.heuristic, time_limit)
示例#6
0
 def __init__(self):
     self.heuristic = heuristics.PowerHeuristic2()
     self.algo = AnytimeBeamSearch(10, (1.2, "exp"))
示例#7
0
 def __init__(self):
     self.heuristic = heuristics.PowerHeuristic2()
     self.algorithm = AnytimeBeamSearch(20, (1.3, 'exp'))
示例#8
0
文件: solve_agent.py 项目: hizki/AI1
 def __init__(self):
     self.heuristic = heuristics.PowerHeuristic2()
     self.algo = AnytimeBeamSearch(10,(1.2,"exp"))
示例#9
0
文件: agent.py 项目: hizki/AI1
 def __init__(self):
     self.heuristic = heuristics.PowerHeuristic2()
     self.algorithm = AnytimeBeamSearch(20, (1.3, 'exp') )