temporary point on the inner loop wrapper

This commit is contained in:
Connor
2021-09-02 21:40:19 -06:00
parent 4d180f577a
commit 9298a7a6f3
19 changed files with 96 additions and 23 deletions

View File

@@ -6,8 +6,10 @@ module Thesis
include("./spacecraft.jl")
include("./conversions.jl")
include("./plotting.jl")
include("./laguerre-conway.jl")
include("./propagator.jl")
include("./find_closest.jl")
include("./monotonic_basin_hopping.jl")
include("./inner_loop/laguerre-conway.jl")
include("./inner_loop/propagator.jl")
include("./inner_loop/find_closest.jl")
include("./inner_loop/monotonic_basin_hopping.jl")
include("./inner_loop/phase.jl")
include("./inner_loop/inner_loop.jl")
end

View File

@@ -0,0 +1,25 @@
using Dates
export inner_loop
"""
This is it. The outer function call for the inner loop. After this is done,
there's only the outer loop left to do. And that's pretty easy.
"""
function inner_loop(launch_date::DateTime,
RLA::Float64,
DLA::Float64,
phases::Vector{Phase})
# First we need to do some quick checks that the mission is well formed
for i in 1:length(phases)
if i == 1
@assert phases[i].from_planet == "Earth"
else
@assert phases[i].from_planet == phases[i-1].to_planet
@assert phases[i].v∞_outgoing == phases[i-1].v∞_incoming
end
end
return RLA + DLA + phases[1].v∞_incoming
end

View File

@@ -1,3 +1,5 @@
export mbh
function pareto(α::Float64, n::Int)
s = rand((-1,1), (n,3))
r = rand(Float64, (n,3))
@@ -54,10 +56,9 @@ function mbh(start::AbstractVector,
end
push!(archive, x_current)
end
if i >= num_iters
break
end
if i >= num_iters break end
end
if verbose println() end
current_best_mass = 1e8
best = archive[1]

View File

@@ -0,0 +1,9 @@
export Phase
struct Phase
from_planet::String
to_planet::String
time_of_flight::Float64 # seconds
v∞_outgoing::Float64 # Km/s
v∞_incoming::Float64 # Km/s
end

View File

@@ -18,7 +18,6 @@ end
function plot_orbits(paths::Vector{Vector{Vector{Float64}}};
primary::String="Earth",
plot_theme::Symbol=:juno,
labels::Vector{String}=Vector{String}(),
title::String="Spacecraft Position",
colors::Vector{String}=Vector{String}())
@@ -49,7 +48,7 @@ function plot_orbits(paths::Vector{Vector{Vector{Float64}}};
showscale=false,
colorscale = p_colors[primary])
layout = Layout(;title="Orbit Plot",
layout = Layout(;title=title,
width=1000,
height=600,
paper_bgcolor="#222529",

View File

@@ -1,5 +1,4 @@
export Sc
struct Sc{T <: Real}
mass::T
mass_flow_rate::Float64