9 lines
308 B
Matlab
9 lines
308 B
Matlab
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 |