当前位置: 首页>>代码示例>>Python>>正文


Python Solver.set_sequence方法代码示例

本文整理汇总了Python中solver.Solver.set_sequence方法的典型用法代码示例。如果您正苦于以下问题:Python Solver.set_sequence方法的具体用法?Python Solver.set_sequence怎么用?Python Solver.set_sequence使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在solver.Solver的用法示例。


在下文中一共展示了Solver.set_sequence方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: MainWindow

# 需要导入模块: from solver import Solver [as 别名]
# 或者: from solver.Solver import set_sequence [as 别名]

#.........这里部分代码省略.........
        """
        logging.info('Data Set Number: {0}'.format(self.current_data_set))
        self.model.current_data_set = self.current_data_set
        if self.data_set_bool:
            #print('one_set')1
            if self.current_iteration == 1 and self.model.current_time == 0:
                self.model.load_data_set()
            self.solve_iteration()

            if self.current_data_set == len(self.data.data_set_list):
            #    print('finish')
                self.current_iteration = 1
                self.current_data_set = 0
                self.trial_time = 0
        else:
            while self.current_data_set < len(self.data.data_set_list):
                if self.pause_bool:
                    break
                self.model.load_data_set()
                self.solve_iteration()
            #   print(self.current_data_set)
            self.current_data_set = 0

    def solve_iteration(self):
        """
        solves one iteration
        :return:
        """
        if self.iteration_bool:
            if self.model.current_time == 0:

                if self.current_iteration == 1:
                    self.algorithms.start()
                    self.model.set_sequence(self.algorithms.solution_sequence)
                    self.solve_whole_step()
                    self.model.reset()
                    self.algorithms.next()
                    self.model.set_sequence(self.algorithms.solution_sequence)
                else:
                    self.algorithms.next()
                    self.model.set_sequence(self.algorithms.solution_sequence)
            self.solve_step()

            if self.current_iteration == self.iteration_limit:
                self.log_results()
                self.current_iteration = 1
        else:
            while self.current_iteration < self.iteration_limit:
                if self.pause_bool:
                    break

                if self.model.current_time == 0:
                    if self.current_iteration == 1:
                        self.algorithms.start()
                    else:
                        self.algorithms.next()
                    self.model.set_sequence(self.algorithms.solution_sequence)
                # next sequence
                self.solve_step()
            self.current_iteration = 1
            self.log_results()

    def solve_step(self):
        if self.step_bool:
            self.solve_one_step()
        else:
开发者ID:mparlaktuna,项目名称:capraz_sevkiyat_yazilimi,代码行数:70,代码来源:gui.py

示例2: GeneralInfo

# 需要导入模块: from solver import Solver [as 别名]
# 或者: from solver.Solver import set_sequence [as 别名]

#.........这里部分代码省略.........
            #print('one_set')1
            if self.current_iteration == 1 and self.model.current_time == 0:
                self.model.set_data(self.current_data_set)
            self.solve_iteration()

            if self.current_data_set == len(self.data.data_set_list):
            #    print('finish')
                self.current_iteration = 1
                self.current_data_set = 0
                self.trial_time = 0
        else:
            while self.current_data_set < len(self.data.data_set_list):
                if self.pause_bool:
                    break
                self.model.set_data(self.current_data_set)
                self.solve_iteration()
                self.current_data_set += 1
            #   print(self.current_data_set)
            self.current_data_set = 0

    def solve_iteration(self):
        """
        solves one iteration
        :return:
        """

        if self.iteration_bool:
            #print('one_iteration')
            if self.model.current_time == 0:

                if self.current_iteration == 1:
                    print('start')
                    self.algorithms.start()
                    self.model.set_sequence(self.algorithms.solution_sequence)
                    self.solve_whole_step()
                    self.algorithms.next()
                    self.model.set_sequence(self.algorithms.solution_sequence)
                else:
                    self.algorithms.next()
                    self.model.set_sequence(self.algorithms.solution_sequence)
                self.print_simulation_data()
            self.solve_step()

            if self.current_iteration == self.iteration_limit:
                self.current_data_set += 1
                self.current_iteration = 1
        else:
            while self.current_iteration < self.iteration_limit:
                if self.pause_bool:
                    break

                self.print_simulation_data()
                if self.model.current_time == 0:
                    if self.current_iteration == 1:
                        self.algorithms.start()
                    else:
                        self.algorithms.next_sequence()
                    self.model.set_sequence(self.algorithms.solution_sequence)
                # next sequence
                self.solve_step()
                self.current_iteration += 1
            #print(self.current_iteration)
            self.current_iteration = 1
            #print('whole_iteration')

    def solve_step(self):
开发者ID:mparlaktuna,项目名称:capraz_sevkiyat_yazilimi,代码行数:70,代码来源:general_info.py


注:本文中的solver.Solver.set_sequence方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。