Subversion Repositories eFlore/Applications.del

Compare Revisions

Ignore whitespace Rev 1832 → Rev 1833

/trunk/src/org/tela_botanica/del/client/services/CalculVoteDeterminationService.java
11,6 → 11,7
import org.tela_botanica.del.client.modeles.VoteDetermination;
 
 
 
public class CalculVoteDeterminationService {
public static List<MoyenneVote> calculerVoteDeterminationPlusPopulaire(List<PropositionDetermination> propositions) {
54,26 → 55,13
 
for (String cle : cles) {
String idAuteur = cle;
boolean voteEstPositif = votes.get(cle).getVote() == 1 ? true : false;
 
if (estUnAuteurIdentifie(idAuteur)) {
// un votant identifiant compte comme deux votants supplémentaires
// il a donc un vote 3 fois supérieur
if (voteEstPositif) {
//scoreVote += 3;
scoreVote += 1;
} /*else {
scoreVote -= 3;
}*/
} else {
if (voteEstPositif) {
scoreVote += 1;
} /*else {
scoreVote -= 1;
}*/
}
boolean voteEstPositif = votes.get(cle).getVote() == 1;
// un votant identifiant compte comme deux votants supplémentaires
// il a donc un vote 3 fois supérieur
int valeurVote = estUnAuteurIdentifie(idAuteur) ? 3 : 1;
scoreVote += voteEstPositif ? valeurVote : -valeurVote;
}
scoreVote = (scoreVote / nbVotants) * 100;
}
return new MoyenneVote((new Double(scoreVote)).intValue(), propositionDetermination);