本文整理匯總了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)