-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmake_videos.jl
More file actions
74 lines (65 loc) · 2.02 KB
/
make_videos.jl
File metadata and controls
74 lines (65 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
using Cxx
using Libdl
using LinearAlgebra
using StatsBase
using Colors
using Random
using BSON: @save, @load
include("pancakerobot.jl")
#fitness((90, 0, inch_matrix), 0, 30, "graphs/inch_flat", true)
#fitness((90, 0, inch_matrix), 15, 30, "graphs/inch_hill", true)
#fitness((0, MAX_PRESS, roll_matrix), 0, 30, "graphs/roll_flat", true)
#fitness((0, MAX_PRESS, roll_matrix), 15, 30, "graphs/roll_hill", true)
#= Get the best robot from each sample
for E in [0, 15]
best_worker = nothing; best_fit = -Inf
for W in 1:60
File = "genomes_$E/worker_$(lpad(W, 2, "0"))_results.bson"
@load File results
g, worker, fit, rng = results[end]
if fit > best_fit
best_fit = fit
best_worker = deepcopy(worker)
end
end
fitness(best_worker, E, 30, "graphs/genomes_$(E)_BEST")
best_worker = nothing; best_fit = -Inf
for W in 1:60
File = "genomes_semi_$E/worker_$(lpad(W, 2, "0"))_results.bson"
@load File results
g, worker, fit, rng = results[end]
if fit > best_fit
best_fit = fit
best_worker = deepcopy(worker)
end
end
fitness(best_worker, E, 30, "graphs/genomes_semi_$(E)_BEST")
best_worker = nothing; best_fit = -Inf
for W in 1:60
File = "genomes_closed_$E/worker_$(lpad(W, 2, "0"))_results.bson"
@load File results
g, worker, fit, rng = results[end]
if fit > best_fit
best_fit = fit
best_worker = deepcopy(worker)
end
end
fitness(best_worker, E, 30, "graphs/genomes_closed_$(E)_BEST")
end=#
# Get some random samples for videos
for E in [0, 15]
for W in rand(1:60, 10)
File = "genomes_$E/worker_$(lpad(W, 2, "0"))_results.bson"
@load File results
g, worker, fit, rng = results[end]
fitness(worker, E, 30, "graphs/genomes_$(E)_$W")
File = "genomes_semi_$E/worker_$(lpad(W, 2, "0"))_results.bson"
@load File results
g, worker, fit, rng = results[end]
fitness(worker, E, 30, "graphs/genomes_semi_$(E)_$W")
File = "genomes_closed_$E/worker_$(lpad(W, 2, "0"))_results.bson"
@load File results
g, worker, fit, rng = results[end]
fitness(worker, E, 30, "graphs/genomes_closed_$(E)_$W")
end
end