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


Python Problem.simulate方法代码示例

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


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

示例1: simulate

# 需要导入模块: from problem import Problem [as 别名]
# 或者: from problem.Problem import simulate [as 别名]
 def simulate(self, current_time, simulation_time, sample_time):
     horizon_time = self.options['horizon_time']
     if self.init_time is None:
         rel_current_time = np.round(current_time-self.start_time, 6) % self.knot_time
     else:
         rel_current_time = self.init_time
     if horizon_time - rel_current_time < simulation_time:
         simulation_time = horizon_time - rel_current_time
     self.compute_partial_objective(current_time, simulation_time)
     Problem.simulate(self, current_time, simulation_time, sample_time)
开发者ID:meco-group,项目名称:omg-tools,代码行数:12,代码来源:point2point.py

示例2: simulate

# 需要导入模块: from problem import Problem [as 别名]
# 或者: from problem.Problem import simulate [as 别名]
    def simulate(self, current_time, simulation_time, sample_time):
        # save global path and frame border
        # store trajectories
        if not hasattr(self, 'frame_storage'):
            self.frame_storage = []
            self.global_path_storage = []
        if simulation_time == np.inf:
            # using simulator.run_once()
            simulation_time = sum(self.motion_times)
        repeat = int(simulation_time/sample_time)
        # copy frames, to avoid problems when removing elements from self.frames
        frames_to_save = self.frames[:]
        for k in range(repeat):
            self._add_to_memory(self.frame_storage, frames_to_save)
        self._add_to_memory(self.global_path_storage, self.global_path, repeat)

        # simulate the multiframe problem
        Problem.simulate(self, current_time, simulation_time, sample_time)
开发者ID:meco-group,项目名称:omg-tools,代码行数:20,代码来源:schedulerproblem.py


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