To receive notifications about scheduled maintenance, please subscribe to the mailing-list You can subscribe to the mailing-list at

Commit fe417f69 authored by Victor's avatar Victor
Browse files

overloading show for world and sim

parent eb64136a
......@@ -101,13 +101,9 @@ Base.copy(m::Missing) = missing
Base.copy(n::Nothing) = nothing
function, a::AbstractAgent)
print(io,"pos: ")
show(io, a.x_history)
print(io,"t: ")
show(io, a.t_history)
function, a::Agent{A,R,T,U,V}) where {A,R,T,U,V}
println(io, "Agent with indices of type", T)
Base.summary(A::AbstractAgent) = string(TYPE_COLOR,nameof(typeof(a)),NO_COLOR," with uType ",TYPE_COLOR,eltype(a.x_history))
......@@ -33,6 +33,9 @@ Base.lastindex(s::Simulation) = get_size(s)
Base.getindex(s::Simulation,measure::String) = [agg[measure] for agg in s.df_agg]
function, s::Simulation{A,S,T,F}) where {A,S,T,F}
println(io, "Simulation with agents of type", A)
# TODO: define two functions with signatures
# function add_entry!(s::Simulation{A,S,T,F},w::World) where {A,S,T,F<:Function}
# function add_entry!(s::Simulation{A,S,T,F},w::World) where {A,S,T,F<:Nothing}
......@@ -34,6 +34,10 @@ Get x of world without geotrait.
Base.getindex(w::World,i) = w.agents[i]
function, w::World{A,S,T}) where {A,S,T}
println(io, "World with agents of type", A)
addAgent!(w::World,a::AbstractAgent) = begin
Markdown is supported
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