本文整理汇总了Python中Engine.Engine.from_file方法的典型用法代码示例。如果您正苦于以下问题:Python Engine.from_file方法的具体用法?Python Engine.from_file怎么用?Python Engine.from_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Engine.Engine
的用法示例。
在下文中一共展示了Engine.from_file方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: simTurnTime
# 需要导入模块: from Engine import Engine [as 别名]
# 或者: from Engine.Engine import from_file [as 别名]
errors = 3, 15, 85,
def simTurnTime(error, mass, engine, turn_time, error_rate=0, error_time=0):
pid = PID3(0.05, 0.0, 0.2, 0, 1, 0.1)
hsc = HSC(engine, pid, mass, turn_time, tune_pid)
if error_rate > 0:
if error_time > 0:
return hsc.simulate_random_speed(error, error_rate, error_time, clampL(error * 2, 60))
return hsc.simulate_linear_speed(error, error_rate, clampL(error * 2, 60))
return hsc.simulate_constant_speed(error, clampL(error * 2, 60))
def simAngle(eng, mass, TT, error_rate, error_time, errors):
if error_rate > 0:
Sandbox.analyze_results(1, 1, *[simTurnTime(0, mass, eng, tt, error_rate, error_time) for tt in TT])
else:
cols = len(errors)
for c, error in enumerate(errors):
Sandbox.analyze_results(cols, c + 1, *[simTurnTime(error, mass, eng, tt) for tt in TT])
fig = plt.gcf()
fig.canvas.set_window_title(datetime.strftime(datetime.now(), '%H:%M:%S'))
plt_show_maxed()
wheesly = Engine.from_file(datafile('Squad/Parts/Engine/jetEngines/jetEngineBasic.cfg'))
LV_T30 = Engine.from_file(datafile('Squad/Parts/Engine/liquidEngineLV-T30/liquidEngineLV-T30.cfg'))
# np.random.seed(1)
# wheesly.acceleration /= 2
# wheesly.deceleration /= 2
simAngle(wheesly, mass, TT, 1, 0, errors)
# simAngle(LV_T30, mass, TT, 0, 2, errors)