Currently we have a very minimal implementation for this issue. Before agents move they search for borders on which they are located at, and if they replaced to another worker this list is used.
It would be nice to have a better solution for this.
See hu.aitia.ds.spatial.core.Agent#checkIfAtBorder() and #getClosestBorder().