Let \(\mathbf{x}_k,\mathbf{x}_l\) be the spatial coordinates of the unit \(k,l \in U\). The classical euclidean distance is given by
$$d^2(k,l) = (\mathbf{x}_k - \mathbf{x}_l)^\top (\mathbf{x}_k - \mathbf{x}_l). $$
When the points are distributed on a \(N_1 \times N_2\) regular grid of \(R^2\).
It is possible to consider the units like they were placed on a tore. It can be illustrated by Pac-Man passing through the wall to get away from ghosts. Specifically,
we could consider two units on the same column (resp. row) that are on the opposite have a small distance,
$$ d^2_T(k,l) = min( (x_{k_1} - x_{l_1})^2,
(x_{k_1} + N_1 - x_{l_1})^2,
(x_{k_1} - N_1 - x_{l_1})^2) +$$
$$ min( (x_{k_2} - x_{l_2})^2,
(x_{k_2} + N_2 - x_{l_2})^2,
(x_{k_2} - N_2 - x_{l_2})^2).$$
The option toreBound
specify the length of the tore in the case of \(N_1 = N_2 = N\).
It is omitted if the tore
option is equal to FALSE
.