-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unnoticed breaking change in #846: broken model creation with ContinuousAgent{D}
#855
Comments
This problem was mentioned at some point in #846 but maybe it flew past us: even if now I add an exception for the |
yes, we need to revision the |
The agents you create with ContinuousAgent{D}(...) are concretely typed; but the ABM does not know it in advance. julia> ABM(ContinuousAgent{2}, ContinuousSpace((1,1)); warn=false) |> typeof
StandardABM{ContinuousSpace{2, true, Float64, typeof(no_vel_update)}, ContinuousAgent{2}, typeof(fastest), Nothing, TaskLocalRNG} (alias for Agents.SingleContainerABM{ContinuousSpace{2, true, Float64, typeof(Agents.no_vel_update)}, ContinuousAgent{2}, Dict{Int64, ContinuousAgent{2}}, typeof(Agents.Schedulers.fastest), Nothing, Random.TaskLocalRNG})
julia> ABM(ContinuousAgent{2,Float64}, ContinuousSpace((1,1))) |> typeof
StandardABM{ContinuousSpace{2, true, Float64, typeof(no_vel_update)}, ContinuousAgent{2, Float64}, typeof(fastest), Nothing, TaskLocalRNG} (alias for Agents.SingleContainerABM{ContinuousSpace{2, true, Float64, typeof(Agents.no_vel_update)}, ContinuousAgent{2, Float64}, Dict{Int64, ContinuousAgent{2, Float64}}, typeof(Agents.Schedulers.fastest), Nothing, Random.TaskLocalRNG}) |
On main this now errors:
We had agreed to never use
ContinuousAgent{D}
without specifying the second typeT
, but with the back and forth between different versions and the additional checks on the space type at some point it has slipped through and seems we have broken compatibility for model creation. Now sinceContinuousAgent{2}
is not concrete, we fail the check against the spaceextent
.I guess we should just add an exception to the
do_checks
functionThe text was updated successfully, but these errors were encountered: