# Geometric Constraints and Collision Detection

**URL:** https://discourse.julialang.org/t/geometric-constraints-and-collision-detection/105695
**Category:** Modelling & Simulations
**Tags:** agents
**Created:** [November 2, 2023, 12:20pm UTC](https://discourse.julialang.org/t/geometric-constraints-and-collision-detection/105695 "2023-11-02T12:20:13Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![InesP](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/inesp/32/42792_2.png) [@InesP](https://discourse.julialang.org/u/InesP)
#### Post date: [November 2, 2023, 12:20pm UTC](https://discourse.julialang.org/t/geometric-constraints-and-collision-detection/105695/1 "2023-11-02T12:20:13Z")

</div>

Hey 😊 I have a few questions about the Agents.jl and collision implementation.

I am using the Agents.jl library to model crowd dynamics in closed and geometrically constrained spaces. My first approach to this problem was through Helbing’s social forces model. However, despite creating a walkmap, i.e., a BitArray indicating the positions where agents can walk (similar to the example 3D Mixed-Agent Ecosystem with Pathfinding), I had agents walking in the forbidden areas. I used the AStar() to compute the landfinder, however the social forces did not seem to use that information to constrain the agents to a walkable tile. Therefore, to solve this problem I implemented a collision detection algorithm with tiles from the BitArray.

My question to you is: is there a simpler way, already implemented within the Agents.jl library, to deal with this problem?

Thank you so much for your attention 😊  
Inês
