-
Notifications
You must be signed in to change notification settings - Fork 0
/
warmup.jl
25 lines (19 loc) · 797 Bytes
/
warmup.jl
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
# run our functions once so that they start precompiling
println("Warm-up start")
include("./main.jl")
@info "Warm-up: optimizing"
for tmax in 0.0:0.5:4.0
# we go from infeasible to feasible, should trigger most of JuMP's relevant internals
result = opt_controls_temp(;opt_parameters=Dict("temp_overshoot" => tmax, "temp_goal" => tmax))
result = opt_controls_temp(;opt_parameters=Dict("temp_overshoot" => 999.0, "temp_goal" => tmax))
MsgPack.pack(result)
end
forward_controls_temp()
@info "Warm-up: HTTP server"
t = @async run("127.0.0.1", 40404)
sleep(5)
download("http://127.0.0.1:40404/index.html")
# this is async because it blocks for some reason
@async Base.throwto(t, InterruptException())
sleep(2) # i am pulling these numbers out of thin air
println("Warm-up done")