Skip to content
This repository was archived by the owner on Jun 26, 2024. It is now read-only.

Commit be79977

Browse files
committed
plotting best firefly
1 parent ae0b0f1 commit be79977

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,10 @@ for t in tqdm(1:ITERATION_NUMBER)
7272
end
7373

7474
best = sort(pop, by=p->p.cost)[1]
75-
println("Best firefly: ", best)
76-
# x = range(0,stop=2*pi,length=1000); y = sin.(3*x + 4*cos.(2*x))
75+
best_x = [n.x for n in best.path]
76+
best_y = [n.y for n in best.path]
77+
plot(best_x, best_y, "-")
78+
7779
x = [n.x for n in nodes]
7880
y = [n.y for n in nodes]
7981
plot(x, y, "ro", markersize=2.0)

0 commit comments

Comments
 (0)