Skip to content

Commit

Permalink
Update abstract.jl solves #1045 (#1059)
Browse files Browse the repository at this point in the history
* Update abstract.jl

The culprit behind #1045 was the use of poly! for user defined polygons. As a first step, I replaced it with 
`scatter!(p, p.pos; p.color, p.marker, p.markersize, p.agentsplotkwargs...)` and generating the plot with the custom polygon worked. In that case I think the whole if else statement is no longer necessary so I removed it.

```
if user_used_polygons(p.agent_marker[], p.marker[])
poly!(p, p.marker; p.color, p.marker, p.markersize, p.agentsplotkwargs...)
else
scatter!(p, p.pos; p.color, p.marker, p.markersize, p.agentsplotkwargs...)
end
```

* fix issue with poly!

* Update Project.toml

---------

Co-authored-by: Adriano Meligrana <[email protected]>
  • Loading branch information
amynang and Tortar authored Jul 17, 2024
1 parent e13ef62 commit 62601fb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Agents"
uuid = "46ada45e-f475-11e8-01d0-f70cc89e6671"
authors = ["George Datseris", "Tim DuBois", "Aayush Sabharwal", "Ali Vahdati", "Adriano Meligrana"]
version = "6.0.16"
version = "6.0.17"

[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Expand Down
2 changes: 1 addition & 1 deletion ext/AgentsVisualizations/src/spaces/abstract.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Agents.agents_space_dimensionality(model::ABM) =

function Agents.agentsplot!(ax::Axis, p::ABMP)
if user_used_polygons(p.agent_marker[], p.marker[])
poly!(p, p.marker; p.color, p.marker, p.markersize, p.agentsplotkwargs...)
poly!(p, p.marker; p.color, p.agentsplotkwargs...)
else
scatter!(p, p.pos; p.color, p.marker, p.markersize, p.agentsplotkwargs...)
end
Expand Down

0 comments on commit 62601fb

Please sign in to comment.