本文整理汇总了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)
示例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)
示例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)
示例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: