本文整理汇总了Python中simulator.Simulator.saveToFile方法的典型用法代码示例。如果您正苦于以下问题:Python Simulator.saveToFile方法的具体用法?Python Simulator.saveToFile怎么用?Python Simulator.saveToFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类simulator.Simulator
的用法示例。
在下文中一共展示了Simulator.saveToFile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: range
# 需要导入模块: from simulator import Simulator [as 别名]
# 或者: from simulator.Simulator import saveToFile [as 别名]
if runSim:
print "WARNING!!!!"
print "running simulation, break now to avoid overwriting files!!!!"
simList = []
for runNum in range(1,numRuns+1):
filename = filenameBase + str(runNum)
if runSim:
sim = Simulator(autoInitialize=False, verbose=False)
sim.options = copy.deepcopy(options)
sim.initialize()
sim.run(launchApp=False)
sim.saveToFile(filename)
else:
sim = Simulator.loadFromFile(filename)
simList.append(sim)
# om.removeFromObjectModel(om.findObjectByName("world"))
# om.removeFromObjectModel(om.findObjectByName("robot"))
# simList[0].initialize()
if not runSim:
sim = simList[0]
sim.setupPlayback()
示例2: Simulator
# 需要导入模块: from simulator import Simulator [as 别名]
# 或者: from simulator.Simulator import saveToFile [as 别名]
# # setup the training time
options["runTime"]["supervisedTrainingTime"] = 10
options["runTime"]["learningRandomTime"] = 20
options["runTime"]["learningEvalTime"] = 10
options["runTime"]["defaultControllerTime"] = 10
sim = Simulator(autoInitialize=False, verbose=False)
sim.options = copy.deepcopy(options)
sim.initialize()
sim.run(launchApp=False)
# save it to a file
sim.saveToFile("test")
sim.setupPlayback()
# Testing
#
#
#
# # sim2 = Simulator(autoInitialize=False, verbose=False)
# # sim2.options = sim.options
# # sim2.options['SARSA']['useQLearningUpdate'] = False
# #
# # sim2.initialize()
# # sim2.run()
#
#
# simList = []