The swarm position is the current position of the swarm relative to the global optimum – in this case, the hidden treasure. It is constrained within the upper and lower domain bounds as shown in the following. But remember, these two are hyperparameters entered in the same panel!:
private double UpdateSwarmPosition(double Pos, double Speed)
{
double OutPos = Pos + Speed;
return Math.Max(Math.Min(OutPos, upperBoundDomain), lowerBoundDomain);
}