# Freely moving agents in a GridSpace-like environment

**URL:** <https://discourse.julialang.org/t/freely-moving-agents-in-a-gridspace-like-environment/81586>\
**Category:** Modelling & Simulations\
**Tags:** agents\
**Created:** [May 24, 2022, 1:44pm UTC](https://discourse.julialang.org/t/freely-moving-agents-in-a-gridspace-like-environment/81586 "2022-05-24T13:44:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Demlore](https://avatars.discourse-cdn.com/v4/letter/d/8797f3/32.png) [@Demlore](https://discourse.julialang.org/u/Demlore)\
**Post date:** [May 24, 2022, 1:44pm UTC](https://discourse.julialang.org/t/freely-moving-agents-in-a-gridspace-like-environment/81586/1 "2022-05-24T13:44:14Z")

</div>

I am currently trying to implement a model similar to  
the model “Predator-prey dynamics” from the Example Zoo.  
My current issue is that i need freely moving agents in a space made out  
of square patches just like the example model.  
As far as I know agents with float-coordinates can’t be added to a GridSpace  
as it uses integer-coordinates for an agents’ position.  
Is there a way to implement a model that contains agents with float-coordinates  
moving in a GridSpace-like environment?

---

<div class="post-metadata">

**Author:** ![Libbum](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/libbum/32/3935_2.png) [@Libbum](https://discourse.julialang.org/u/Libbum)\
**Post date:** [May 24, 2022, 1:57pm UTC](https://discourse.julialang.org/t/freely-moving-agents-in-a-gridspace-like-environment/81586/2 "2022-05-24T13:57:03Z")

</div>

[ContinuousSpace](https://juliadynamics.github.io/Agents.jl/stable/api/#Agents.ContinuousSpace) will give you float-coordinates and allow you to move around the space ‘freely’ in the way I assume you’re thinking.

`ContinuousSpace` actually [uses `GridSpace` internally](https://github.com/JuliaDynamics/Agents.jl/blob/2d9a86ff172891af14285a3f51265620e26dd77b/src/spaces/continuous.jl#L56) to assist with nearest neighbour lookups. So you can, in principle, access `model.space.s` if you need to use the grid style coordinate system.
