final corrections before submission

This commit is contained in:
Edoardo Vergerio
2026-09-06 17:42:44 +02:00
parent 268fda0a6b
commit f046d06e21
15 changed files with 487 additions and 248 deletions
+5 -4
View File
@@ -7,7 +7,6 @@ import pickle
import matplotlib.pyplot as plt
import numpy as np
import os
np.seterr(divide='raise', invalid='raise')
#if the results folder does not exist, create it
if not os.path.exists('results'):
@@ -220,17 +219,19 @@ def make_plots(Ngames,Nbattles):
plt.savefig('plots/pokemon_types_distribution.pdf')
if __name__ == "__main__":
Ngames = 1000
Nbattles = 150
print("Generating data")
for i in range(Ngames):
#automatic player creation (choose a random starter pokemon)
starter_choice = random.choice(gd.available_starters)
#print(f"Generating data for {starter_choice}, game {i}...")
print(f"Generating data for {starter_choice}, game {i}...")
results = Main(starter_choice = starter_choice, Nbattles=Nbattles)
pickle_out = open(f"results/{starter_choice}_game_{i}_{Nbattles}_battles.pickle",'wb')
pickle.dump(results,pickle_out)
pickle_out.close()
print("Generating plots")
make_plots(Ngames, Nbattles)
make_plots(Ngames, Nbattles)
print("Finished!")