Changes wrt the original model are colored blue.
Every step, we:
Let new agents enter on the left:
With probability $p_\text{entry}$ at $x=0.01$, and only if there is not already
an agent between $x=0$ and $x=2\cdot r_\text{max}$
Agents are initialized with initial direction to the right $\vec{e}_\text{target}=[1,0]$
Agents have an intrinsic speed $v_{d,\text{max}}^i$, which
is fixed per agent at a value sampled from the single T-cell go-speeds.
Find contacts and compute ve:
Agents on the same line are in "contact" if their x coordinates are
within distance $r^i + r^j$.
An agent $i$ which has other agents $j$ in contact gets
an escape velocity $\vec{v}_e^{ij}$ directed away from the average
positions of its contacting neighbors $j$. The magnitude of $\vec{v}_e$ is equal to the
$v_{d,\text{max}}^i$.
Update radii:
Agents $i$ in contact with other agents get radius $r^i = r_\text{min}$.
When agents are not in contact, their radius increases with amount
$\Delta r = \frac{r_\text{max}}{\tau / \Delta t}$ per time step, until
its max radius $r_\text{max}$ is reached. Here, $\tau$ is a constant (0.5 sec)
and $\Delta t = \frac{r_\text{min}}{2*\text{max}(v_{d,\text{max}})}$
Small filled circles reflect $r_\text{min}$ (with color reflecting
the agent's $v_{d,\text{max}}^i$). Red circles reflect the current $r^i$.
Update positions:
Agents with contacts have velocity vector $\vec{v}^i = \vec{v}_e^{ij}$ (escape velocity) as defined above.
Agents with no contacts have velocity $\vec{v}^i = \vec{v}_d^i$,
with direction $\vec{e}_\text{target}$ and magnitude:
$v_d^i = v_{d,\text{max}}^i \cdot [ \frac{r^i - r_\text{min}}{r_\text{max} - r_\text{min}} ]^\beta$
(where $\beta = 0.9$)
Update each position: $x^i(t) = x^i(t-\Delta t) + \vec{v}^i(t)\Delta t$
Attempt turning:
Agents can attempt to turn spontaneously (i.e. flip their target direction)
with probability $p_\text{turn}$. (This probability depends on the duration of
the persistent interval so far, and is matched to the hazard function of the
T-cell data).
Turn attempts only succeed if the cell is not contacting another
cell in the direction it wants to turn (contacts as defined above).
Agents that have been "static" in the past $t_\text{mem}$ steps (i.e.,
have moved on average at less than 10% of their $v_{d,\text{max}}$) can also
attempt to turn with probability $p_\text{switch}$. Again, this only succeeds
if they are "free" in that direction.
Boundaries are open; agents stochastically enter from the left, and they are removed
from the model when they leave the field of view.
App
For the visualization, we consider agents in "contact" if their distance is smaller
than 2.5 times $r_\text{max}$; they are then connected by a thick red line.