当前位置: 首页>>代码示例>>Python>>正文


Python Simulator.saveToFile方法代码示例

本文整理汇总了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()


开发者ID:andybarry,项目名称:Machine-Learning-6.867-homework,代码行数:30,代码来源:runSARSAMultiple.py

示例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 = []
开发者ID:andybarry,项目名称:Machine-Learning-6.867-homework,代码行数:32,代码来源:runSARSATest.py


注:本文中的simulator.Simulator.saveToFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。