mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-01 14:07:54 +01:00
Fixed ArithmetricException in AnalysisUtils #438
This commit is contained in:
parent
34069d2477
commit
b1e82f7ebc
@ -186,15 +186,17 @@ public class AnalysisUtils {
|
|||||||
|
|
||||||
double probability = 1.0;
|
double probability = 1.0;
|
||||||
|
|
||||||
|
if (!similarM.isEmpty()) {
|
||||||
int stickM = 0;
|
int stickM = 0;
|
||||||
for (StickyData stickyData : stickyStuckM) {
|
for (StickyData stickyData : stickyStuckM) {
|
||||||
if (similarM.contains(stickyData)) {
|
if (similarM.contains(stickyData)) {
|
||||||
stickM++;
|
stickM++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
probability *= (stickM / similarM.size());
|
probability *= (stickM / similarM.size());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!similarW.isEmpty()) {
|
||||||
int stickW = 0;
|
int stickW = 0;
|
||||||
for (StickyData stickyData : stickyStuckW) {
|
for (StickyData stickyData : stickyStuckW) {
|
||||||
if (similarW.contains(stickyData)) {
|
if (similarW.contains(stickyData)) {
|
||||||
@ -203,6 +205,7 @@ public class AnalysisUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
probability *= (stickW / similarW.size());
|
probability *= (stickW / similarW.size());
|
||||||
|
}
|
||||||
return probability;
|
return probability;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user