Agents with an extent

I am currently working on an ABM for growing bacteria using Agents.jl (akin to the, now outdated, example in the documentation) and it got me wondering whether it is/could be possible to have an “extensive” agent as opposed to a singular one. That is, I would like its position to be determined from not one but two different points in space (or three, or a variable number, or even a line segment). I tried playing around with LazySets.jl to see if I could define the bacteria as a line segment, but boy did that not work.
Eitherway, if it was possible to define it in terms of just two points I would be happy, as that could cut down the neighbour-search a significant amount.
Cheers from a newbie,

This sounds like a nice extension to Agents.jl like a package extension or a submodule.

It has to be an extension because the assumption that agents are “point particles” is very fundamental to the way we find nearby agents and this unfortunately would be hard to adjust so that agents have extent… To accommodate for agents with extent you would likely need to create a new space type that starts as a duplicate of the current ContinuousSpace and is then adjusted so that nearby_agents works differently and takes into account the fact that agents have size.

Maybe someone has already worked on something like this. Agents with size are not uncommon, e.g., the bacteria model does something like this but hard coding the size instead.

1 Like

Alright I see. Do you by chance know whether it is possible to easily implement a weaker form of my proposition; to do a neighbour-search simultaneously from fx both the position (the center-of-mass of the bacterium) and the end-nodes?

Position of an agent is used in two ways mainly (IIUC):

  1. determine the distance between two agents.
  2. allocate agents from continuous space to discrete grid.

So by modifying the distance calculation, any shape can be determined (and this custom shape can depend on many parameters in the agent).
For usage #2, a single “center-of-mass”-like position can be left alone with the standard position definition.

In other words, overriding the distance function with shape based info should make the agents behave with any reasonable shape, as long as they are smaller than the discrete grids cells they hash into.

Sure you can always search for nearby agents given a position argument. You can first search using the center of mass and then the edges of the polygon. How you combine the resulting information I am not sure. And if course the resulting list of nearby agents would be based on their center of mass.


George Datseris (he/him)