本文整理汇总了Python中simulator.Simulator.schedule方法的典型用法代码示例。如果您正苦于以下问题:Python Simulator.schedule方法的具体用法?Python Simulator.schedule怎么用?Python Simulator.schedule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类simulator.Simulator
的用法示例。
在下文中一共展示了Simulator.schedule方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: from simulator import Simulator [as 别名]
# 或者: from simulator.Simulator import schedule [as 别名]
def run(self):
s = Simulator(self.maxID)
for p in self.p_list:
#p.printProcess()
p.setInQueueTime(0)
self.process_queue.appendProcess(p.burst_time, p)
if self.queueType == "PWA":
p.currentAgingSeq = random.getrandbits(128)
s.schedule( 0 + 3 * p.burst_time, self.eAging, p, p.currentAgingSeq , s)
print "time 0ms: Simulator started for %s [Q" % self.queueType,
sys.stdout.write('')
self.printQueue()
print "]"
next_burst_time, next_process = self.process_queue.nextProcess()
self.waitTimeSum += next_process.setOutQueueTime(0)
self.waitTimeNum += 1
s.schedule(self.t_cs, self.eContentSwitch, next_process, next_burst_time, s)
s.run()
示例2: Simulator
# 需要导入模块: from simulator import Simulator [as 别名]
# 或者: from simulator.Simulator import schedule [as 别名]
"""
@author : Rajan Khullar
@created : 01/08/16
@updated : 01/08/16
"""
from simulator import Simulator
sim = Simulator(2)
sim.load('processes.csv')
sim.schedule()
for event in sim.events:
print(event)