Beispiel #1
0
    def test_best_plan(self):
        grid = Grid()
        grid.init_generate_grid()

        grid.show_detail()
        result = grid.swap_by_strategy(StrategyType.HIGH_ORDER_FIRST)

        if len(result) == 0:
            log.error('no swap')
        for i in result:
            log.info('swap %s' % i)
Beispiel #2
0
    def test_swap(self):
        grid = Grid()
        grid.init_generate_grid()

        grid.simple_show()
        result = grid.swap_by_strategy(StrategyType.HIGH_ORDER_FIRST)

        if len(result) == 0:
            log.warning('no swap')
            return
        for i in result:
            log.info('swap %s' % i)
        grid.swap_and_eliminate(result)

        grid.show()