miloszzieba / coronatrace-ios

1 stars 1 forks source link

Infection possibility algorithm #7

Open leszko11 opened 4 years ago

miloszzieba commented 4 years ago

Maybe do something ultra simple first, then enhance?

We have 2 data sets - local user location and infected user location. We should get first timestamp in each dataset and take max(localTimestamp, infectedTimestamp). Then starting from this point, check each minute and calculate distance between users. If it's close (let's take 20 meters), it's possible contact. If we don't have any location updates for that time, let's assume, user was not moving.

My ideas about next enhancements:

  1. Calculating speed between nodes. If it's high, then infected person was in vehicle. If local user was not moving as fast, he should be safe.
  2. Calculating lines between 2 nodes of each user and check would lines cross path