JuliaDynamics / Agents.jl

Agent-based modeling framework in Julia
https://juliadynamics.github.io/Agents.jl/stable/
MIT License
725 stars 117 forks source link

Fix model creation with ContinuousAgent{D} #856

Closed mastrof closed 1 year ago

mastrof commented 1 year ago

Closes #855. I added an extra check to the do_checks function to allow the creation of models with calls of the form ABM(ContinuousAgent{D}, ContinuousSpace((1,1)) for backward compatibility, even though this now results in model being not concretely typed. This change is also mentioned in the welcome message and in the warning for agents with non-concrete types.

I used a regex for the check instead of subtyping because I did not find another easy way to only get the case where ContinuousAgent{D} is used with a Float64 space.

codecov-commenter commented 1 year ago

Codecov Report

Merging #856 (1aea485) into main (3cd0f35) will increase coverage by 0.03%. Report is 2 commits behind head on main. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #856      +/-   ##
==========================================
+ Coverage   70.80%   70.83%   +0.03%     
==========================================
  Files          42       42              
  Lines        2788     2788              
==========================================
+ Hits         1974     1975       +1     
+ Misses        814      813       -1     
Files Changed Coverage Δ
src/Agents.jl 100.00% <ø> (ø)
src/core/model_concrete.jl 89.15% <100.00%> (+0.13%) :arrow_up:

... and 1 file with indirect coverage changes

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

Tortar commented 1 year ago

thanks!