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


Python Simulator.getLaunchedSimu方法代码示例

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


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

示例1: testStopAtStableConfig

# 需要导入模块: from simulator import Simulator [as 别名]
# 或者: from simulator.Simulator import getLaunchedSimu [as 别名]
 def testStopAtStableConfig(self):
     tau = systems.LongTransitive2
     sched = Scheduler.EDF(tau)
     simulator = Simulator.getLaunchedSimu(tau, sched)
     self.assertTrue(simulator.success())
     self.assertTrue(simulator.isStable)
     self.assertEqual(simulator.t, 46)
开发者ID:tchapeaux,项目名称:py-rt-simulator,代码行数:9,代码来源:testSimulator.py

示例2: checkResult

# 需要导入模块: from simulator import Simulator [as 别名]
# 或者: from simulator.Simulator import getLaunchedSimu [as 别名]
 def checkResult(self, tau, sched, expectedResult):
     simulator = Simulator.getLaunchedSimu(tau, sched)
     self.assertIs(simulator.success(), expectedResult)
开发者ID:tchapeaux,项目名称:py-rt-simulator,代码行数:5,代码来源:TestScheduler.py

示例3: testStopAtDeadlineMiss

# 需要导入模块: from simulator import Simulator [as 别名]
# 或者: from simulator.Simulator import getLaunchedSimu [as 别名]
 def testStopAtDeadlineMiss(self):
     tau = systems.MustIdle
     sched = Scheduler.EDF(tau)
     simulator = Simulator.getLaunchedSimu(tau, sched)
     self.assertFalse(simulator.success())
     self.assertEqual(simulator.t, 5)
开发者ID:tchapeaux,项目名称:py-rt-simulator,代码行数:8,代码来源:testSimulator.py

示例4: recognizeSchedulerName

# 需要导入模块: from simulator import Simulator [as 别名]
# 或者: from simulator.Simulator import getLaunchedSimu [as 别名]
schedClass = recognizeSchedulerName(schedName)
if schedClass == Scheduler.ExhaustiveFixedPriority:
    scheduler = schedClass(tau, nbrCPUs=1)
else:
    scheduler = schedClass(tau)

# Short circuit for arbitrary scheduler (use if you know what you're doing)
# schedule = [
#     tau.tasks[2],
#     tau.tasks[1],
#     tau.tasks[1],
#     ]
# scheduler = Scheduler.ArbitraryScheduler(tau, schedule)

try:
    simu = Simulator.getLaunchedSimu(tau, scheduler, stop=stop, verbose=False, drawing=True, stopAtDeadlineMiss=False, stopAtStableConfig=False)
    if simu.success():
        print("Success.")
    else:
        print("Failure.")
except AssertionError:
    print("Something went wrong ! Close the image preview to see the stack trace")
    raise
finally:
    outputName = simu.drawer.outputName()
    if "linux" in sys.platform:
        if ".eps" in outputName:
            subprocess.Popen(['okular', simu.drawer.outputName()])
        else:
            subprocess.Popen(['eog', simu.drawer.outputName()])
    elif "win" in sys.platform:
开发者ID:tchapeaux,项目名称:py-rt-simulator,代码行数:33,代码来源:mainSimu.py


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