Пример #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
    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