diff --git a/MOT Capture Process Simulation/@MOTSimulator/computeCollisionProbability.m b/MOT Capture Process Simulation/@MOTSimulator/computeCollisionProbability.m new file mode 100644 index 0000000..7b34fe7 --- /dev/null +++ b/MOT Capture Process Simulation/@MOTSimulator/computeCollisionProbability.m @@ -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 \ No newline at end of file