Wrapped the calculation of the collision event probability in its own function.

This commit is contained in:
Karthik 2021-07-11 14:39:26 +02:00
parent 951c2e3935
commit bb5f70ce7f

View File

@ -0,0 +1,9 @@
function ret = computeCollisionProbability(this)
collision = rand(1);
CollisionProbability = 1 - exp(-this.TimeSpentInInteractionRegion/this.CollisionTime);
if this.BackgroundCollision && collision <= CollisionProbability
ret = true;
else
ret = false;
end
end