Added some better logging

This commit is contained in:
Connor
2021-10-12 01:36:39 -06:00
parent 7727e436e8
commit c7913d2944
6 changed files with 78 additions and 10 deletions

View File

@@ -28,20 +28,24 @@
launch_window = DateTime(1992,11,1), DateTime(1992,12,1)
latest_arrival = DateTime(1993,6,1)
planets = [ Earth, Venus ]
best, archive = mbh(planets, launch_window, latest_arrival, 2, 3)
best, archive = mbh(planets, launch_window, latest_arrival, 10, 5)
@test typeof(best) == Mission
p = plot(best, title="MBH Test Solution")
savefig(p,"../plots/mbh_test_1_phase.html")
store(best, "missions/mbh_1_phase_best")
store(archive, "missions/mbh_1_phase_archive")
# Now for a more complicated two-phase mission, with a bigger date range
# This is known to have a solution though
planets = [Earth, Venus, Mars]
launch_window = DateTime(2021,6,1), DateTime(2022,6,1)
latest_arrival = DateTime(2024,1,1)
best, archive = mbh(planets, launch_window, latest_arrival, 10, 3)
best, archive = mbh(planets, launch_window, latest_arrival, 20, 5)
@test typeof(best) == Mission
p = plot(best, title="MBH Test Solution")
savefig(p,"../plots/mbh_test_2_phase.html")
store(best, "missions/mbh_2_phase_best")
store(archive, "missions/mbh_2_phase_archive")
# Now for a real stress test - the old ten-year, 5-phase Jovian mission
# This is known to have a solution... tough to find though
@@ -49,9 +53,11 @@
planets = [Earth, Venus, Earth, Mars, Earth, Jupiter]
launch_window = DateTime(2023,4,1), DateTime(2023,7,1)
latest_arrival = DateTime(2033,1,1)
best, archive = mbh(planets, launch_window, latest_arrival, 100, 3)
best, archive = mbh(planets, launch_window, latest_arrival, 200, 10)
@test typeof(best) == Mission
p = plot(best, title="MBH Test Solution")
savefig(p,"../plots/mbh_test_5_phase.html")
store(best, "missions/mbh_5_phase_best")
store(archive, "missions/mbh_5_phase_archive")
end

View File

@@ -22,6 +22,7 @@
# Now we can plot the results to check visually
p = plot(m, title="NLP Test Solution")
savefig(p,"../plots/nlp_test_1_phase.html")
store(m, "missions/nlp_1_phase")
# Now we can look at a slightly more complicated trajectory
flybys = [Earth, Venus, Mars]
@@ -42,6 +43,7 @@
@test typeof(m) == Mission
p = plot(m, title="NLP Test Solution (2 Phases)")
savefig(p,"../plots/nlp_test_2_phase.html")
store(m, "missions/nlp_2_phase")
# Here is the final, most complicated, trajectory to test
flybys = [Earth, Venus, Earth, Mars, Earth, Jupiter]
@@ -67,5 +69,6 @@
@test typeof(m) == Mission
p = plot(m, title="NLP Test Solution (5 Phases)")
savefig(p,"../plots/nlp_test_5_phase.html")
store(m, "missions/nlp_5_phase")
end

View File

@@ -14,9 +14,9 @@ catch
end
@testset "All Tests" begin
# include("plotting.jl")
# include("inner_loop/laguerre-conway.jl")
# include("inner_loop/propagator.jl")
# include("inner_loop/nlp_solver.jl")
include("plotting.jl")
include("inner_loop/laguerre-conway.jl")
include("inner_loop/propagator.jl")
include("inner_loop/nlp_solver.jl")
include("inner_loop/monotonic_basin_hopping.jl")
end