Commit 86387bba authored by Victor's avatar Victor
Browse files

changed EVOID to EvoId

parent 06411318
Pipeline #99045 canceled with stage
using LightGraphs
using Test
using Revise,EVOID
using Revise,EvoId
##### SPACES #####
mysegment = DiscreteSegment(1,10)
......@@ -23,19 +23,19 @@ myspace2 = (mysegment,mycontinuoussegment,real2d)
@test eltype(myspace2) == Tuple{Int64,Float64,Float64}
# increment on infinite spaces
@test EVOID.get_inc(0.,myline) (0.)
@test EVOID.get_inc(0.,mydiscreteline) (0.)
@test !(EVOID.get_inc(1.,myline) 0.)
@test EvoId.get_inc(0.,myline) (0.)
@test EvoId.get_inc(0.,mydiscreteline) (0.)
@test !(EvoId.get_inc(1.,myline) 0.)
@test !(get_inc(1,1.,myline) 0.)
# @test !(get_inc(1,1.,mydiscreteline) ≈ 0.)
@test typeof(EVOID.get_inc([1.,0.],real2d)) == Vector{Float64}
@test typeof(EvoId.get_inc([1.,0.],real2d)) == Vector{Float64}
@test typeof(get_inc([1.,0.],[1.,0.],real2d)) == Vector{Float64}
@test typeof(EVOID.get_inc([1.],real2d)) == Vector{Float64}
@test typeof(EVOID.get_inc(1.,real2d)) == Vector{Float64}
# EVOID._get_inc([1.],real2d)
# EVOID.initpos(myspace2)
@test typeof(EvoId.get_inc([1.],real2d)) == Vector{Float64}
@test typeof(EvoId.get_inc(1.,real2d)) == Vector{Float64}
# EvoId._get_inc([1.],real2d)
# EvoId.initpos(myspace2)
# increment on finite spaces
......@@ -44,10 +44,10 @@ myspace2 = (mysegment,mycontinuoussegment,real2d)
@test mysegment.s - eps() < get_inc(5.,100.,mysegment) + 5. < mysegment.e + eps()
@test mycontinuoussegment.s < get_inc(0.,100.,mycontinuoussegment) < mycontinuoussegment.e
mysegment2 = DiscreteSegment(-1,1)
@test EVOID._reflect1D(0.,2.0,mysegment2) .0
@test EVOID._reflect1D(0.,-2.0,mysegment2) .0
@test EVOID._reflect1D(0.,4.0,mysegment2) .0
@test EVOID._reflect1D(0.,1.1,mysegment2) 1 - .1
@test EvoId._reflect1D(0.,2.0,mysegment2) .0
@test EvoId._reflect1D(0.,-2.0,mysegment2) .0
@test EvoId._reflect1D(0.,4.0,mysegment2) .0
@test EvoId._reflect1D(0.,1.1,mysegment2) 1 - .1
end
#checking if graph works
......@@ -79,15 +79,15 @@ end
@test nancestors(increment_x!(a2,myspace,p_myspace,2.)) > 1
@test !isnothing(increment_x!(a4,myspace2,p_myspace2,2.))
@test !isnothing(increment_x!(a5,myspace2,p_myspace2,2.))
@test typeof(EVOID._get_xinc(a2,myspace,p_myspace,0.)) == typeof(get_x(a2))
@test typeof(EvoId._get_xinc(a2,myspace,p_myspace,0.)) == typeof(get_x(a2))
# testing if get_xinc does not modify the value of a4
a4 = Agent(myspace2,[1,1.,[1.,1]],rates=true)
_xinc = EVOID._get_xinc(a4,myspace2,p_myspace2,0.)
_xinc = EvoId._get_xinc(a4,myspace2,p_myspace2,0.)
@test get_x(a4) == [1,1.,[1.,1]]
end
# @show EVOID._get_xinc(a4,myspace2,p_myspace2,0.)
# @show EvoId._get_xinc(a4,myspace2,p_myspace2,0.)
@testset "Multidimensional spaces" begin
myspace = (RealSpace{10,Float64}(),)
a1 = Agent(myspace)
......
using LightGraphs
using Test
using Revise,EVOID
using Revise,EvoId
using UnPack
myspace = (GraphSpace(SimpleGraph(10,10)),RealSpace{1,Float64}())
myagents = [Agent(myspace,ancestors=true,rates=true) for i in 1:10]
......@@ -16,7 +16,7 @@ p = Dict{String,Any}();@pack! p = d,b,D,mu,NMax
@test eltype(myagents) <: AbstractAgentM
@test typeof(myagents) <: Vector{A} where {A<:AbstractAgentM}
w = EVOID.World(myagents,myspace,p)
w = EvoId.World(myagents,myspace,p)
@test typeof(w.p["D"][1]) == Int64
@test size(w) 10
newa = give_birth(1,w)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment