Maybe nearing the final commit

This commit is contained in:
Connor
2022-04-18 10:59:25 -06:00
parent 0fb875c777
commit 5b6656a9a6
3598 changed files with 79349 additions and 572 deletions

View File

@@ -1,9 +1,8 @@
include("src/Thesis.jl")
using .Thesis
using Thesis
using Dates
using SPICE
using LinearAlgebra
using PlotlyJS: savefig
using PlotlyJS
try
furnsh("../../spice_files/naif0012.tls")
@@ -25,7 +24,7 @@ function easy_cost(m::Union{Mission, Mission_Guess}, C3::Float64, v∞::Float64)
tof += phase.tof
end
tof = tof/(20Thesis.year)
return 3norm_mass + norm_C3 + tof
return 3norm_mass + norm_C3
end
sc = Sc("mySat", 200., 3200., 0.00025, 1, 1.0)
@@ -47,22 +46,25 @@ Thesis.mbh(fbs) = mbh(fbs,
max_v∞,
latest_arrival,
easy_cost,
search_patience=10_000,
drill_patience=200,
verbose=true)
search_patience=200,
drill_patience=50,
verbose=true,
)
function log(m::Mission, archive::Vector{Mission}, planets::Vector{Body})
function log(archive::Vector{Mission}, planets::Vector{Body})
abbrev = join([ planet.name[1] for planet in planets ])
p = plot(m, title="Best $(abbrev) Trajectory")
savefig(p,"archive/$(abbrev).html")
store(m, "archive/$(abbrev)")
store(archive, "archive/$(abbrev)_archive")
println(length(archive))
for m in archive
println(abbrev)
store(m, "archive/$(abbrev)_$(easy_cost(m, 200., 200.))")
end
end
log(_::Nothing, _::Vector{Mission}, _::Vector{Body}) = println("No Mission Found...")
planets = [Earth, Mars, Mars, Jupiter, Saturn]
best, archive = mbh(planets)
log(best, archive, planets)
println("Complete!")
planets = [Earth, Saturn]
latest_arrival = ideal_launch + Year(5)
best, archive, missions = mbh(planets)
log(missions, planets)
p = scatter(;x=1:length(missions), y=easy_cost.(missions, 200., 200.), mode="markers")
PlotlyJS.plot(p)