Let $F(r)$ be any function satisfying the following properties:
- $F(r)$ is well defined for $r\in[0,1]$.
- $F(r)\geq 0$ for $r\in[0,1]$.
- $F(r)$ is decreasing for $r\in[0,1]$.
Then a repulsive interaction satisfying your conditions can be built as follows:
For two agents $a$ and $b$, their positions at time $t_{i+1}$ are determined from their positions at time $t_i$ as follows:
$$a(t_{i+1})=a(t_i)+(1-\delta_{a(t_i)0})(1-\delta_{a(t_i)1})\text{sgn}(a(t_i)-b(t_i))F(|a(t_i)-b(t_i)|)$$$$a(t_{i+1})=g\bigg(a(t_i)+\text{sgn}\big(a(t_i)-b(t_i)\big)F\big(|a(t_i)-b(t_i)|\big)\bigg)$$ $$b(t_{i+1})=b(t_i)+(1-\delta_{b(t_i)0})(1-\delta_{b(t_i)1})\text{sgn}(b(t_i)-a(t_i))F(|a(t_i)-b(t_i)|)$$$$b(t_{i+1})=g\bigg(b(t_i)+\text{sgn}\big(b(t_i)-a(t_i)\big)F\big(|a(t_i)-b(t_i)|\big)\bigg)$$
where
$$\text{sgn}(x)=\begin{cases}1 & \text{if }x>0 \\ 0 & \text{if }x=0 \\ -1 & \text{if }x<0\end{cases}$$
is the usual "sign function", and
$$\delta_{yz}=\begin{cases}1 & \text{if }y=z\\ 0 & \text{if }y\neq z\end{cases}$$$$g(x)=\begin{cases}0 & \text{if }x<0\\x&\text{if }0\leq x\leq 1\\1&\text{if }x>1\end{cases}$$
is the Kronecker deltaa "limiter" function. The sign function ensures that the force is pointing the right direction to be repulsive, and the Kronecker deltas shut the force off once the agent hits$g$ function ensures that the end ofresults always fall in the unit interval.
There are an infinity of possible choices for $F$; examples include:
- $F(r)=\mu(1-r)$
- $F(r)=\mu(1-r^n)$
- $F(r)=\frac{\mu}{r+\epsilon}$
- $F(r)=e^{-\mu r}$