本文整理汇总了Python中driver.Driver.drive方法的典型用法代码示例。如果您正苦于以下问题:Python Driver.drive方法的具体用法?Python Driver.drive怎么用?Python Driver.drive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类driver.Driver
的用法示例。
在下文中一共展示了Driver.drive方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: drive
# 需要导入模块: from driver import Driver [as 别名]
# 或者: from driver.Driver import drive [as 别名]
def drive(self):
random_seed = 0
results = []
for i in xrange(self.num_sims):
print("Initializing simulation run %d." % i)
driver = Driver(vis=False)
results.append(driver.drive(max_iterations=1000,
random_seed=random_seed,
initial_pop=50))
random_seed += 1
return results
示例2: drive
# 需要导入模块: from driver import Driver [as 别名]
# 或者: from driver.Driver import drive [as 别名]
def drive(self, initial_pop=50):
random_seed = 0
results = []
print('-'*50)
print('---> Initializing batch for initial_pop %d.', initial_pop)
for i in xrange(self.num_sims):
print('---> Initializing simulation run %d for initial pop %d.' % (i, initial_pop))
driver = Driver(vis=False)
result = driver.drive(max_iterations=1500,
random_seed=random_seed,
initial_pop=initial_pop)
results.append(result)
random_seed += 2
return results