among all the direction.

Usually, it cost O(n log n) to

build the kd tree out of end point.

But once you have one you can in log and modify it.

So basic log in which is quite small, and do all the rand search,

like and finding all the agent which are in the are of agent of interest in

o of n, the square root of n which helps you a lot in large system.

There are other interesting structure like r trees and

I once spent time in that but if you ever realistic system with lots of agent and

you need to be fast, you have to think about the that you will use.

An alternative is to use a Eulerian approach,

in that case the environment is a regular grid of cells,

a bit like is really similar, but

every cell contains a list of agents It's a list of agent like a showed you earlier.

The agent don't have to know their exact position, because they can pretend that

they are roughly at the same spots every cell is a spot and all the agents.

It's like every cell is a well stirred mixture.

And so it's fast to compute the interaction communication before,

because you can say, okay first that's every agent can communicate with every

other agent in the same place that they are in contact.

But for

longer communication agents you can include the neighboring cells and so on.

Movement is easy.

You just move and then jump to the adjusting cell in the correct direction.

And it allows to nice parallism.

It allows to compute the interaction really fast.

To couple it with other model, like cellular automata, finite differences.

And of course you will lose some special

spatial precision because in this approach, the agent is

unnecessarily has a discrete position instead of having a continuous one.

So the physique may not be correct if you have a dynamic.

Of course you can combine both approaches.

The variable time is really interesting to consider it also.

You don't have to use continuous time, because most of the time,