\frac{e_c - e_n}{\sqrt{2}} & \text{if } dx = dy \text{ (diagonal move)}
\frac{e_c - e_n}{1} & \text{if } dx \neq dy \text{ (orthogonal move)} \end{cases} $ $
Using the last movement vector $ V_{last} = [dx_{last}, dy_{last}] $ and the direction vector $ V_{direction} = [i-x, j-y] $ .
$ $ I_{i,j} = \left( \frac{1 + \text{cosine_similarity}(V_{last}, V_{direction})}{2} \right) $ $
Blend slope and inertia using: $ $ W_{i,j}^{raw} = (1 - \omega) \psi I_{i,j} + \omega \phi S_{i,j} $ $
Compute the transition probabilities by applying the softmax function to the combined weights directly: $ $ P((x, y) \to (i,j)) = \text{softmax}(W^{raw}){i,j} \to \frac{e^{W^{raw}{i,j}}}{\sum_{(k,l) \in \text{neighbors}} e^{W^{raw}_{k,l}}} $ $ Here, $ (k, l) $ ranges over all positions neighboring $ (x, y) $ that are potential candidates for movement, excluding the current position itself and any positions that would constitute an immediate return to the last position.