My model uses a 2D grid called GridSpaceSingle, which restricts each cell to a maximum of one agent. I would like to switch the positions of two agents. Unfortunately, this functionality is not currently available, but appears to be a new feature in an upcoming release. I thought I might copy and paste the function into my project for the time being, but that quickly became messy, as it relies on internal functions, and some do not appear to be implemented. I was wondering if someone can recommend a workaround until the new features are relased?
Thanks. Unfortunately, I am at an impasse. So I would like to implement a stopgap solution. What you described makes sense. I should have been more descriptive about the workaround. Given that GridSpaceSingle is is restricted to one agent per cell, are there any precautions I need to take? Can I just use remove_agent! and add_agent!, and directly modify the pos fields, or is there anything special I need to do?
the point indeed is to first remove both agents and then to re-add them, this way you respect the one-agent per position restriction in a GridSpaceSingle