本文整理汇总了Python中executor.Executor.step方法的典型用法代码示例。如果您正苦于以下问题:Python Executor.step方法的具体用法?Python Executor.step怎么用?Python Executor.step使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类executor.Executor
的用法示例。
在下文中一共展示了Executor.step方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: stats_run
# 需要导入模块: from executor import Executor [as 别名]
# 或者: from executor.Executor import step [as 别名]
def stats_run(n_steps=0):
e = Executor(endo())
#e.debug = True
start = clock()
try:
for i in xrange(2*10**9):
if i > 0 and i%1000 == 0:
print i, int(i/(clock()-start+1e-6)),'steps/s'
e.step()
n_steps -= 1
if n_steps == 0: break
except FinishException:
print 'execution finished'
finally:
print e.iteration, 'iterations'
print len(e.rna), 'rna produced'
print 'it took', clock()-start
print int(e.iteration/(clock()-start+1e-6)), 'iterations/s'
print 'pattern freqs', e.pattern_freqs
print 'template freqs', e.template_freqs
print 'codon len freqs', e.codon_len_freqs
示例2: main
# 需要导入模块: from executor import Executor [as 别名]
# 或者: from executor.Executor import step [as 别名]
def main():
parser = argparse.ArgumentParser(description='Produce RNA from DNA')
parser.add_argument('--trace', action='store_true')
parser.add_argument('--pause', action='store_true')
parser.add_argument('prefix_filename')
args = parser.parse_args()
prefix_filename = args.prefix_filename
prefix = open(prefix_filename+'.dna').read().strip()
assert all(c in 'ICFP' for c in prefix)
e = Executor(prefix+endo())
e.debug = args.trace or args.pause
start = clock()
#for r in e.obtain_rna():
# print>>rna, r
try:
while True:
e.step()
if args.pause:
print 'press enter',
raw_input()
except FinishException:
pass
rna_file = open(prefix_filename+'.rna', 'w')
for r in e.rna:
print>>rna_file, r
print 'it took', clock()-start
print int(e.iteration/(clock()-start+1e-6)), 'iterations/s'
rna_file.close()
示例3: generate_trace
# 需要导入模块: from executor import Executor [as 别名]
# 或者: from executor.Executor import step [as 别名]
def generate_trace(n_steps=10):
e = Executor(endo())
e.debug = True
for i in range(n_steps):
e.step()