You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Orbits/julia_code/Module/tests/test_states_and_transitions.jl

63 lines
1.4 KiB
Julia

using Test, Flux, LinearAlgebra
include("../src/Orbits.jl")
using .Orbits
#=
The purpose of this document is to organize tests of the state structs and state transition functions
=#
@testset "States and Physical models testing" verbose=true begin
n_const = 2
n_debr = 3
n_data = 5
#built structs
u = UniformDataConstructor(n_data,0,5,2,3)
s = u(n_const,n_debr)
b = BasicPhysics(
0.05
,0.02*LinearAlgebra.ones(n_const,n_const)
,0.1
,0.002
,0.002
,0.2
)
a2 = ones(n_const,n_data)
#test that dimensions match etc
@test size(b.satellite_collision_rates)[1] == size(s.stocks)[1]
@test size(b.satellite_collision_rates)[2] == size(s.stocks)[1]
@test n_data == size(s.stocks)[2]
@test n_data == size(s.debris)[2]
@test size(s.stocks) == size(a2)
@testset "DataConstructor and states" begin
@test u.N == 5
@test length(s.debris) != 3
@test length(s.stocks) != 2
@test length(s.stocks) == 10
@test length(s.debris) == 15
@test size(s.stocks) == (2,5)
@test size(s.debris) == (3,5)
end
@testset "BasicPhysics" begin
@testset "Survival Functions" verbose = true begin
@test survival_rates_1(s,b) <: AbstractArray
end
@testset "Transitions" begin
@test true
end
end
end #States and physcial models testing