コード例 #1
0
        def BeamSolve(beam_width):
            algorithm = beam_search.BeamSearch(beam_width, max_depth)
            heuristic = heuristics.PowerHeuristic()
            agent = measure_agent.MeasureAgent(algorithm, heuristic)

            def solution_len(*args, **kwrds):
                solution = agent.solve(*args, **kwrds)
                if solution is None: solution = []
                return [len(solution)]

            return solution_len
コード例 #2
0
ファイル: beam_width_research.py プロジェクト: hizki/AI1
    def rumBeamWithWidth(self, beam_width, series_limit):
        ''' beam_width => solved_percent
        '''
        #trace
        delta = time.clock() - self.run_start_time
        self.run_start_time = time.clock()
        print 'rumBeamWithWidth: %d  [delta=%03f sec] ' % (beam_width,
                                                           float(delta))

        #mss
        max_depth = self.max_depth
        algorithm = beam_search.BeamSearch(beam_width, max_depth)
        heuristic = heuristics.PowerHeuristic()
        agent = measure_agent.MeasureAgent(algorithm, heuristic)
        table = self.runSeries(agent, self.rooms, series_limit)
        return table
コード例 #3
0
 def Beam(beam_width):
     algorithm = beam_search.BeamSearch(beam_width, max_depth)
     heuristic = heuristics.PowerHeuristic()
     agent = measure_agent.MeasureAgent(algorithm, heuristic)
     return agent