Skip to content
Extraits de code Groupes Projets
Valider b3e25b9b rédigé par Phokopi's avatar Phokopi
Parcourir les fichiers

MAJ dec 2022

parent be224be6
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
A DemiiSel
B EquIInoxE
C IILLEGAL
D LiMiTeD
E PRIISME
F SobrIIÉté
#!/bin/env python3 #!/usr/bin/python3
""" """
This script transforms votes in number form into votes in mathematical form. This script transforms votes in number form into votes in mathematical form.
......
...@@ -24,7 +24,7 @@ cat resultats_complets_bruts_shuf.txt | while read line; do ...@@ -24,7 +24,7 @@ cat resultats_complets_bruts_shuf.txt | while read line; do
BALLOT=$(tail -1 resultats_partiels_out.txt) BALLOT=$(tail -1 resultats_partiels_out.txt)
echo -e "Bulletin n°${NUMERO_BULLETIN} : ${BALLOT}\n" echo -e "Bulletin n°${NUMERO_BULLETIN} : ${BALLOT}\n"
# utilisation de l'appli condorcet, on stocke le résultat dans le fichiet condorcet_output_partiel.txt # utilisation de l'appli condorcet, on stocke le résultat dans le fichiet condorcet_output_partiel.txt
./vendor/bin/condorcet election --candidates candidates.txt --votes resultats_partiels_out.txt SchulzeWinning -p > condorcet_output_partiel.txt condorcet election --candidates candidates.txt --votes resultats_partiels_out.txt SchulzeWinning -p > condorcet_output_partiel.txt
# On stocke la ligne du ou des gagnants dans ligne_gagnants_partiels.txt, à traiter dans toDot.py # On stocke la ligne du ou des gagnants dans ligne_gagnants_partiels.txt, à traiter dans toDot.py
sed -e/Schulze/\{ -e:1 -en\;b1 -e\} -ed condorcet_output_partiel.txt > temp.txt && sed 4!d temp.txt > ligne_gagnants_partiels.txt sed -e/Schulze/\{ -e:1 -en\;b1 -e\} -ed condorcet_output_partiel.txt > temp.txt && sed 4!d temp.txt > ligne_gagnants_partiels.txt
# On extrait la matrice des duels vers matrice_duels_partiel.yaml, puis appelle toDot.py pour générer l'image du graphe dans graphe_partiel.dot.png # On extrait la matrice des duels vers matrice_duels_partiel.yaml, puis appelle toDot.py pour générer l'image du graphe dans graphe_partiel.dot.png
...@@ -34,7 +34,7 @@ cat resultats_complets_bruts_shuf.txt | while read line; do ...@@ -34,7 +34,7 @@ cat resultats_complets_bruts_shuf.txt | while read line; do
echo -e "Graphe mis à jour.\n" echo -e "Graphe mis à jour.\n"
# on affiche le classement # on affiche le classement
sed -e/Schulze/\{ -e:1 -en\;b1 -e\} -ed condorcet_output_partiel.txt sed -e/Schulze/\{ -e:1 -en\;b1 -e\} -ed condorcet_output_partiel.txt
#sleep 2 sleep 4
done done
#echo "Fin. ${NUMERO_BULLETIN} bulletins ont été comptabilisés." #echo "Fin. ${NUMERO_BULLETIN} bulletins ont été comptabilisés."
#!/bin/env python3 #!/usr/bin/python3
import yaml import yaml
translate = { translate = {
"A" : "A", "DemiiSel" : "DemiiSel",
"B" : "B", "EquIInoxE" : "EquIInoxE",
"C" : "C", "IILLEGAL" : "IILLEGAL",
"D" : "D", "LiMiTeD" : "LiMiTeD",
"E" : "E", "PRIISME" : "PRIISME",
"F" : "F" "SobrIIÉté" : "SobrIIÉté"
} }
colors = { colors = {
"A" : "#0C631E", "DemiiSel" : "#0C631E",
"B" : "#6AD5CF", "EquIInoxE" : "#6AD5CF",
"C" : "#1B56D3", "IILLEGAL" : "#1B56D3",
"D" : "#FF00FF", "LiMiTeD" : "#FF00FF",
"E" : "#EF7A37", "PRIISME" : "#EF7A37",
"F" : "#CF9F00" "SobrIIÉté" : "#CF9F00"
} }
pos = { pos = {
"A" : "0,0!", "DemiiSel" : "0,0!",
"B" : "1,2!", "EquIInoxE" : "1,2!",
"C" : "3,2!", "IILLEGAL" : "3,2!",
"D" : "4,0!", "LiMiTeD" : "4,0!",
"E" : "3,-2!", "PRIISME" : "3,-2!",
"F" : "1,-2!" "SobrIIÉté" : "1,-2!"
} }
# On récupère la liste des gagnants # On récupère la liste des gagnants
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter