Im seeking help with an agent based definition - please help

Hello all, quite a bit of writing, but I wanted to be thorough,

I’ve been working on a definition using PedSim to map the movements of agents through a given city. I will add the base rhino and grasshopper files for anyone that is interested in taking a jab at this. There are a couple problems with the .gh file right now I hope someone here is able to help me with - two are specifically pedsim related the other is general grasshopper.

What I’ve done so far: I’ve collected a couple thousand "points of interest divided among 22 different programs (for example: bank, library, gym, art gallery, etc) from GIS that seemed interesting to map. The agents spawn at random points along the streets of the city, and as they are created receive an individual exit point to go to. On the way, the agents seek out some random set of interests. The intent, is after letting a couple thousand agents loose, each with different individual interests and paths, I will find some interesting movement structure in the city.

Problem 1) Agents get stuck. If you begin the simulation agents are born and flock to their exit gates. Many (but confusingly, not all) find their exits, but don’t “die” instead they kind of drift around in circles around the exit points. Similarly, if the agents are given interest to seek out they can get stuck in a similar fashion on their target points, never abandoning the interest as they are meant to.

Problem 2) I can’t properly integrate the environment curves into the definition. It either crashes the whole thing or the agent just ignore them. Even when the curves are added to whole, I am unsure if the agents will be able to successfully find interests along their path to exits points because the streets are to narrow. Any ideas here? Is there a way to make agents know where to the next closest interest is located without actually seeing it while confining their movement to the provided curves? I feel as though the way people really navigate in a city is more guided (either they know the path to the place they are heading because they live there or are using google maps) so a “go to the interest because they happen to see it” method seems unrealistic except perhaps for tourists that are just wandering around aimlessly.

Problem 3) The last question is a basic grasshopper question: I will need to move the interest points outside of buildings. Right now most are points inside a curve and they need to be outside to be accessible by the agents. I thought of pointclosestcurve to get them to the closest edge of a given curve they are in, then use that vector to push them a little further outside the curve. The problem is that sometimes the points are inside buildings that has a shared wall with another building, this would mean that occasionally, a point would just move into another curve. Any ideas to solve this?

Some notes regarding the work so far: the grasshopper file may not be “on” when it launches. To make the agents start, youll have to reset the boolean toggle and hit the pedsim reset located in the small purple group near the top of the page. I have added the building curve footprints as internalized curves in a separate definition (in the next post) because of the size - copy paste that into the targets .gh to have everything together.

Please feel more than free to ask questions. I really need help here, any assistance would be very much appreciated.

Edit: added the correct .gh definition

Targets1234567.gh (1.1 MB)

Building Curves.gh (2.4 MB)