Skip to content

Commit

Permalink
Do not override thetas if sum is less or equals to 0
Browse files Browse the repository at this point in the history
Closes #4390
  • Loading branch information
s1monw committed Dec 10, 2013
1 parent dade4a2 commit a3c93ec
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -203,8 +203,9 @@ public WeightFunction(float indexBalance, float shardBalance, float primaryBalan
sum = indexBalance + shardBalance;
if (sum <= 0.0f) {
thetaMap.put(operation, defaultTheta);
} else {
thetaMap.put(operation, new float[]{shardBalance / sum, indexBalance / sum, 0});
}
thetaMap.put(operation, new float[]{shardBalance / sum, indexBalance / sum, 0});
break;
case BALANCE:
case ALLOCATE:
Expand Down

0 comments on commit a3c93ec

Please sign in to comment.