本文整理汇总了Python中NewTraceFac.NTRC.trace方法的典型用法代码示例。如果您正苦于以下问题:Python NTRC.trace方法的具体用法?Python NTRC.trace怎么用?Python NTRC.trace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NewTraceFac.NTRC
的用法示例。
在下文中一共展示了NTRC.trace方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: starter4e
# 需要导入模块: from NewTraceFac import NTRC [as 别名]
# 或者: from NewTraceFac.NTRC import trace [as 别名]
def starter4e(env, event):
NTRC.trace(3,"4e.starter4e: before callstart at %s." % env.now)
event.start()
NTRC.trace(3,"4e.starter4e: before yieldtimeout at %s." % env.now)
yield env.timeout(3)
NTRC.trace(3,"4e.starter4e: after yieldtimeout at %s." % env.now)
event.reset()
NTRC.trace(3,"4e.starter4e: after callreset at %s." % env.now)
示例2: starter4f
# 需要导入模块: from NewTraceFac import NTRC [as 别名]
# 或者: from NewTraceFac.NTRC import trace [as 别名]
def starter4f(env, event):
NTRC.trace(3,"4f.starter4f: before callstart at %s." % env.now)
event.start()
NTRC.trace(3,"4f.starter4f: before yieldtimeout at %s." % env.now)
yield env.timeout(5)
NTRC.trace(3,"4f.starter4f: after yieldtimeout at %s." % env.now)
event.stop()
event.start()
NTRC.trace(3,"4f.starter4f: after stop/start at %s." % env.now)
示例3: starter4g
# 需要导入模块: from NewTraceFac import NTRC [as 别名]
# 或者: from NewTraceFac.NTRC import trace [as 别名]
def starter4g(env, event):
NTRC.trace(3,"4g.starter4g: before callstart at %s." % env.now)
event.start()
NTRC.trace(3,"4g.starter4g: before yieldtimeout at %s." % env.now)
yield env.timeout(5)
NTRC.trace(3,"4g.starter4g: after yieldtimeout at %s." % env.now)
event.stop()
event.stop() # can you stop a stopped timer? yes.
event.setdelay(17).start()
yield env.timeout(1)
event.reset()
yield env.timeout(1)
event.reset()
NTRC.trace(3,"4g.starter4g: after change delay and reset twice at %s." % env.now)
示例4: main
# 需要导入模块: from NewTraceFac import NTRC [as 别名]
# 或者: from NewTraceFac.NTRC import trace [as 别名]
def main():
g = CG() # One instance of the global data.
dCliDict = fndCliParse("")
# Carefully insert any new CLI values into the Global object.
fnMaybeOverride("sInstructionsFile",dCliDict,g)
# Read the file of instructions.
sFilename = g.sInstructionsFile
lCommands = fnlParseInput(sFilename)
cCommand = CCommand()
# Process the instructions one line at a time.
for sFullCmd in lCommands:
# Print something to let the user know there is progress.
print('-----------------')
NTRC.trace(0,sFullCmd.rstrip())
print('-----------------')
lResult = cCommand.doCmdLst(sFullCmd)
for sResult in lResult:
NTRC.trace(0,"stdout=|%s|" % (sResult))
print '-----------------'
stdout.flush()
示例5: starter4h
# 需要导入模块: from NewTraceFac import NTRC [as 别名]
# 或者: from NewTraceFac.NTRC import trace [as 别名]
def starter4h(env, event):
NTRC.trace(3,"4h.starter4h: before callstart at %s." % env.now)
event.start()
NTRC.trace(3,"4h.starter4h: before yieldtimeout at %s." % env.now)
yield env.timeout(23)
NTRC.trace(3,"4h.starter4h: after yieldtimeout at %s." % env.now)
event.reset()
NTRC.trace(3,"4h.starter4h: after reset at %s." % env.now)
yield event.event
NTRC.trace(3,"4h.starter4h: after yieldevent at %s." % env.now)
NTRC.trace(0,"yieldevent %s completed at %s." % (event.context,env.now))
示例6: interrupt
# 需要导入模块: from NewTraceFac import NTRC [as 别名]
# 或者: from NewTraceFac.NTRC import trace [as 别名]
def interrupt(timerobj, context):
NTRC.trace(0,"interrupt %s delay %s called from %s at %s."
% (context, timerobj.delay, timerobj, env.now))
return (timerobj, context)
示例7: callback
# 需要导入模块: from NewTraceFac import NTRC [as 别名]
# 或者: from NewTraceFac.NTRC import trace [as 别名]
def callback(timerobj, context):
NTRC.trace(0,"callback %s delay %s called from %s at %s."
% (context, timerobj.delay, timerobj, env.now))
timerobj.setevent()
return (timerobj, context)