Skip to content

Commit

Permalink
Fix scatter bug in Visualization extension (#1003)
Browse files Browse the repository at this point in the history
* Fix scatter bug in Visualization extension

* Update sample.jl

* Update sample.jl
  • Loading branch information
Tortar authored Mar 12, 2024
1 parent 6ea4453 commit 50e7965
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ext/AgentsVisualizations/src/spaces/abstract.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ end
function Agents.abmplot_pos(model::ABM, offset)
postype = agents_space_dimensionality(abmspace(model)) == 3 ? Point3f : Point2f
if isnothing(offset)
return [postype(model[i].pos) for i in allids(model)]
return postype[postype(model[i].pos) for i in allids(model)]
else
return [postype(model[i].pos .+ offset(model[i])) for i in allids(model)]
return postype[postype(model[i].pos .+ offset(model[i])) for i in allids(model)]
end
end

Expand Down
2 changes: 1 addition & 1 deletion src/simulations/sample.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ end
function copy_agent(agent::A, model, id_new; kwargs...) where {A<:AbstractAgent}
if ismultiagentsumtype(A)
args_sum_t = new_args_sum_t(agent, model; kwargs...)
newagent = MixedStructTypes.constructor(agent)(id_new, args_sum_t...)
newagent = kindconstructor(agent)(id_new, args_sum_t...)
else
args_t = new_args_t(agent, model; kwargs...)
newagent = A(id_new, args_t...)
Expand Down

0 comments on commit 50e7965

Please sign in to comment.