Maybe nearing the final commit
This commit is contained in:
42
julia/cost_table.jl
Normal file
42
julia/cost_table.jl
Normal file
@@ -0,0 +1,42 @@
|
||||
using Thesis
|
||||
using SPICE
|
||||
using LinearAlgebra
|
||||
using Dates
|
||||
using PlotlyJS
|
||||
|
||||
try
|
||||
furnsh("../../spice_files/naif0012.tls")
|
||||
furnsh("../../spice_files/de430.bsp")
|
||||
catch
|
||||
furnsh("spice_files/naif0012.tls")
|
||||
furnsh("spice_files/de430.bsp")
|
||||
end
|
||||
|
||||
function cost(m::Union{Mission, Mission_Guess})
|
||||
norm_mass = (m.start_mass - prop(m)[7]) / m.start_mass
|
||||
norm_C3 = ( m.launch_v∞ ⋅ m.launch_v∞ ) / 200.
|
||||
return 3norm_mass + norm_C3
|
||||
end
|
||||
|
||||
function get_id(m::Mission)
|
||||
letters = "E"
|
||||
for phase in m.phases letters *= phase.planet.name[1] end
|
||||
letters *= " "
|
||||
letters *= string(cost(m))
|
||||
return letters
|
||||
end
|
||||
|
||||
missions = Vector{Mission}()
|
||||
folders = readdir("/home/connor/projects/thesis/archive/saturn", join=true)
|
||||
for folder in folders
|
||||
try
|
||||
push!(missions, ingest(folder * "/mission"))
|
||||
catch e
|
||||
println("Ingestion failure")
|
||||
end
|
||||
end
|
||||
|
||||
sorted_missions = sort(missions, by=cost)
|
||||
|
||||
@show get_id.(sorted_missions)
|
||||
|
||||
Reference in New Issue
Block a user