If time stamps are too far apart then similarity must be 0

This commit is contained in:
Reinhard Pointner 2016-08-12 00:30:21 +08:00
parent ecf9cf96dd
commit e5dc94afa9
1 changed files with 1 additions and 1 deletions

View File

@ -22,7 +22,7 @@ public class TimeStampMetric implements SimilarityMetric {
if (t1 > 0 && t2 > 0) {
float delta = Math.abs(t1 - t2);
return delta > epoch ? 1 : 1 - (delta / epoch);
return delta > epoch ? 0 : 1 - (delta / epoch);
}
return -1;