Skip to content

Commit

Permalink
feat: limiting the credibility minimum value
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanCapistrano committed Mar 10, 2024
1 parent 749bfbf commit 41dba6f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/java/reputation/node/models/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -835,8 +835,12 @@ private float calculateCredibility(
);
}

/* Limitando o valor máximo da credibilidade. */
nodeCredibility = (nodeCredibility > 1) ? 1 : nodeCredibility;
/* Limitando o valor máximo e mínimo da credibilidade. */
if (nodeCredibility > 1) {
nodeCredibility = 1;
} else if (nodeCredibility < -10) {
nodeCredibility = -10;
}
}

/* Salvando a nova credibilidade. */
Expand Down

0 comments on commit 41dba6f

Please sign in to comment.