Try this:
sim.partNeighbours(x, y, 2, elem.DEFAULT_PT_VIRS)
This returns a list of particle IDs matching the element in the 4th field, which you can iterate through. You'd need to do this for all three elements, though.
Thanks I'll try that