Skip to content
Snippets Groups Projects
Commit 8b9dce77 authored by Zhong Yi's avatar Zhong Yi
Browse files

trace vout

parent da683e86
No related branches found
No related tags found
No related merge requests found
......@@ -75,8 +75,26 @@ class Traj3D:
xyz = np.array(self.__Traj3D)
x, y, z = xyz[:, 0], xyz[:, 1], xyz[:, 2]
self.ax.plot(x, y, z, label="distance : "+label)
self.ax.plot(x[:AGRANDISSEMENT], y[:AGRANDISSEMENT], z[:AGRANDISSEMENT], color="red")
self.ax.plot(x[-1-AGRANDISSEMENT:], y[-1-AGRANDISSEMENT:], z[-1-AGRANDISSEMENT:], color="red")
self.ax.plot(x[:AGRANDISSEMENT], y[:AGRANDISSEMENT],
z[:AGRANDISSEMENT], color="red")
self.ax.plot(x[-1-AGRANDISSEMENT:], y[-1-AGRANDISSEMENT:],
z[-1-AGRANDISSEMENT:], color="red")
plt.legend()
plt.show()
def draw_bouts(self, label):
plt.figure(7)
xyz = np.array(self.__Traj3D)
x, y, z = xyz[:, 0], xyz[:, 1], xyz[:, 2]
self.ax.plot(x[:AGRANDISSEMENT+100], y[:AGRANDISSEMENT+100],
z[:AGRANDISSEMENT+100], color="blue")
self.ax.plot(x[-1-AGRANDISSEMENT-100:], y[-1-AGRANDISSEMENT-100:],
z[-1-AGRANDISSEMENT-100:], color="blue")
self.ax.plot(x[:AGRANDISSEMENT], y[:AGRANDISSEMENT],
z[:AGRANDISSEMENT], color="red")
self.ax.plot(x[-1-AGRANDISSEMENT:], y[-1-AGRANDISSEMENT:],
z[-1-AGRANDISSEMENT:], color="red")
plt.legend()
plt.show()
......
......@@ -159,8 +159,10 @@ def generation():
print(rot_table.distance(seq), "(distance de base)")
traj_final.compute(seq, final_tab)
traj_final.draw(str(int(final_tab.distance(seq))))
traj_final.write("data/traj_final.png")
# traj_final.draw(str(int(final_tab.distance(seq))))
# traj_final.write("data/traj_final.png")
traj_final.draw_bouts(str(int(final_tab.distance(seq))))
traj_final.write("data/traj_final_bouts.png")
print("time :", time.time()-time0)
plt.figure(5)
......@@ -171,7 +173,8 @@ def generation():
plt.yscale('log')
plt.grid()
plt.legend()
plt.savefig('data/evo.png')
plt.savefig("data/évolution_graph_size_"+str(size)+"nbiter_"+str(nb_iter)+"_croisement_" +
str(nom_croisement)+"_selection_"+str(nom_selection)+"AGRANDISSEMENT"+str(AGRANDISSEMENT)+".png")
def main():
......@@ -202,6 +205,8 @@ def main():
traj.compute(seq, rot_table)
traj_final.compute(seq, final_tab)
traj_final2.compute(seq2, final_tab)
traj_final.draw_bouts(str(int(final_tab.distance(seq))))
traj_final.write("data/traj_final_bouts.png")
traj.draw(str(rot_table.distance(seq)))
traj.write(args.filename+".png")
......@@ -278,9 +283,10 @@ if __name__ == "__main__":
# evolution_fitness()
'''
fitness_size()
main()
test_opt()
tests_croisements()
tests_selection()
'''
generation()
# generation()
main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment