The problem is quite simple: My function, neighbours (created because I don't know how to get the number of elements from non-array tables such as the one returned by the sim.partNeighbours function), can't recognize neutrons when they're layered within pixels which already have another particle of a different element inside (for example other NTRM particles).
Is there any way of using coordinates to get a list of the ids of all particles (or, preferably, all particles of a specific type) within those coordinates?