Skip to content

Commit

Permalink
Fix some flag misuse in sim_gameplay, reran params as a result
Browse files Browse the repository at this point in the history
  • Loading branch information
Ickaser committed Dec 12, 2020
1 parent 095692a commit 080511c
Show file tree
Hide file tree
Showing 124 changed files with 40,227 additions and 40,227 deletions.
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
plt.title("Damage per Second",fontsize=24)
plt.plot(time[0:etod], DPS[0:etod])
# plt.plot(time[0:etod], err[0:etod])
plt.text(0, 1.2, f"SAE={SAE}")
plt.text(0, 1.2, f"SAE={SAE:.2f}")
# plt.plot(time[0:etod], interr_arr[0:etod])
plt.plot([0,etod],[SP_DPS,SP_DPS])
plt.xlabel('Time (sec)',fontsize=18)
Expand Down
12 changes: 6 additions & 6 deletions params.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
# plt.plot(time[0:etod],HP_char[0:etod],'k',label='HP')
# etod_list.append(etod)
# etod_arr = np.array(etod_list)
HP_arr_arr = np.array([sim.sim_gameplay(style, skill, adj=True)[0] for n in range(N_sim)])
HP_arr_arr = np.array([sim.sim_gameplay(style, skill, adj=True, control=False)[0] for n in range(N_sim)])
HP_arr = np.mean(HP_arr_arr, axis=0)
enem_arr_arr = np.array([sim.sim_gameplay(style, skill, adj=True)[2] for n in range(N_sim)])
etod_arr = np.array([sim.sim_gameplay(style, skill)[3] for n in range(N_sim)])
enem_arr_arr = np.array([sim.sim_gameplay(style, skill, adj=True, control=False)[2] for n in range(N_sim)])
etod_arr = np.array([sim.sim_gameplay(style, skill, control=False)[3] for n in range(N_sim)])

np.savetxt(proj_dir+"sim_results/"+f"sim_results_skill{skill}_style{style[0]}_mod.txt", HP_arr.T, fmt="%d")
np.savetxt(proj_dir+"sim_results/"+f"sim_results_skill{skill}_style{style[0]}.txt", etod_arr.T, fmt="%d")
Expand Down Expand Up @@ -101,13 +101,13 @@
alt_DPS = 100/alt_etod
gain = DPS[-1]-alt_DPS
gain_list.append(gain)
plt.plot(time[:etod-step], DPS[:etod])
# plt.plot(range(1,11), sim, "x", color=col_list[i],)
# plt.plot(time[:etod-step], DPS[:etod])
# # plt.plot(range(1,11), sim, "x", color=col_list[i],)
pass
tau_arr.append(np.mean(tau_list))
gain_arr.append(np.mean(gain_list))
plt.title(f"skill {j+1}, style {lab_list[i][:3]}")
plt.show()
# plt.show()
# plt.plot(range(1, 11), np.mean(st, axis=1), "-", color=col_list[i], label=lab_list[i]+" playstyle")
tau_arr = np.array(tau_arr)
gain_arr = np.array(gain_arr)
Expand Down
60 changes: 30 additions & 30 deletions params.txt
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
3.574000000000000199e+01 -6.242717980375666470e-02
3.446000000000000085e+01 1.304435965918380180e-01
4.153000000000000114e+01 -5.879696023767413959e-02
5.321999999999999886e+01 3.879314157956487152e-02
4.935999999999999943e+01 2.357783438531881048e-02
5.868999999999999773e+01 -6.021071420278685526e-02
6.448999999999999488e+01 7.782304327822712857e-03
6.278000000000000114e+01 -1.276809944581068848e-02
7.542000000000000171e+01 -6.536743029162225826e-03
8.393999999999999773e+01 -3.441385887854338157e-03
1.716000000000000014e+01 2.847442466421459817e-02
1.363000000000000078e+01 4.047846685856690968e-02
1.055000000000000071e+01 1.614982683306922795e-01
1.785000000000000142e+01 6.437181009130500675e-02
2.217000000000000171e+01 -1.758899726078352044e-01
2.687999999999999901e+01 -2.241218869792709345e-01
3.318999999999999773e+01 5.739180369944014981e-02
3.985000000000000142e+01 7.779416867895011523e-02
5.246000000000000085e+01 1.510374578315355938e-02
5.777000000000000313e+01 -3.228649657438432269e-02
1.942999999999999972e+01 -1.192044277121115103e-01
1.623999999999999844e+01 5.062283552325429897e-02
1.791000000000000014e+01 2.820243413758025813e-02
2.328000000000000114e+01 -1.275619677958871601e-01
2.264000000000000057e+01 7.001564563467839453e-02
2.605999999999999872e+01 2.003345165521419613e-01
3.543999999999999773e+01 6.725649503273839480e-02
4.088000000000000256e+01 -8.475918500560533642e-02
4.014999999999999858e+01 -4.075058819520085800e-03
3.815999999999999659e+01 8.247852360611236363e-04
4.561999999999999744e+01 1.982384643987719075e-01
4.693999999999999773e+01 1.782929771942503849e-01
5.328000000000000114e+01 1.602391580397824755e-01
5.460999999999999943e+01 1.567184716861552141e-01
6.293999999999999773e+01 1.223743752557228115e-01
7.442000000000000171e+01 1.011655220629657653e-01
9.100000000000000000e+01 8.333874241459503229e-02
1.215699999999999932e+02 6.350771156082424262e-02
1.846200000000000045e+02 4.557595316742356351e-02
3.668299999999999841e+02 2.020592726212615264e-02
2.478000000000000114e+01 1.594314897712776069e-01
2.667999999999999972e+01 1.678957024075548865e-01
2.932999999999999829e+01 1.507623533046491549e-01
3.087000000000000099e+01 1.453598682690153410e-01
3.445000000000000284e+01 1.217364169944258473e-01
4.202000000000000313e+01 1.129221115267862174e-01
5.028999999999999915e+01 8.077098689593863179e-02
6.565999999999999659e+01 6.468731962282266157e-02
9.673000000000000398e+01 4.438735451752435363e-02
1.924000000000000057e+02 2.293567079582133073e-02
1.775000000000000000e+01 2.340200067737308043e-01
1.796999999999999886e+01 2.030988390215613670e-01
1.826999999999999957e+01 2.091497047741837922e-01
2.033999999999999986e+01 1.782352618263565724e-01
2.501999999999999957e+01 1.654364693572846490e-01
2.846000000000000085e+01 1.255309524602614135e-01
3.407000000000000028e+01 9.085536691831608280e-02
4.503000000000000114e+01 8.036238858923029638e-02
6.473000000000000398e+01 5.698813080874887138e-02
1.273900000000000006e+02 2.658620994471256813e-02
2 changes: 1 addition & 1 deletion sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def PID(i,SPH, H, H_last, Kc,tau_I, tau_D, INTerr_prev, A_last, i_last): #where


# Model Gameplay Simulation
def sim_gameplay(style, skill, adj=True, control=True):
def sim_gameplay(style, skill, adj=False, control=True):
# set up arrays, values
HP_char = np.zeros(Npts) #Character Health
HP_char[0] = HP0
Expand Down
Loading

0 comments on commit 080511c

Please sign in to comment.