1
0
This repository has been archived on 2023-11-30. You can view files and clone it, but cannot push or open issues or pull requests.
dtux__serveur-vote-lalis/include/Condorcet/Examples/Examples-with-html/vote_data/ComplexeVoteConf.php

92 lines
1.5 KiB
PHP
Raw Normal View History

2022-09-21 12:39:11 +02:00
<?php
declare(strict_types=1);
// Candidates
$election->addCandidate('A');
$election->addCandidate('C');
$election->addCandidate('B');
$election->addCandidate('E');
$election->addCandidate('D');
// Votes
$vote = [];
$vote[1] = 'A';
$vote[2] = 'C';
$vote[3] = 'B';
$vote[4] = 'E';
$vote[5] = 'D';
for ($i = 1; $i <= 5; $i++) {
$election->addVote($vote, 'coucou');
}
$vote = 'A>D>E>C>B';
for ($i = 1; $i <= 5; $i++) {
$election->addVote($vote);
}
$vote = 'B>E>D>A'; // It is not mandatory to indicate the role or last. It will be automatically deducted from the previous.
for ($i = 1; $i <= 8; $i++) {
$election->addVote($vote);
}
$vote = [];
$vote[1] = 'C';
$vote[2] = 'A';
$vote[3] = 'B';
$vote[4] = 'E';
// It is not mandatory to indicate the role or last. It will be automatically deducted from the previous.
for ($i = 1; $i <= 3; $i++) {
$election->addVote($vote);
}
$vote = [];
$vote[1] = 'C';
$vote[2] = 'A';
$vote[3] = 'E';
$vote[4] = 'B';
$vote[5] = 'D';
for ($i = 1; $i <= 7; $i++) {
$election->addVote($vote);
}
$vote = [];
$vote[1] = 'C';
$vote[2] = 'B';
$vote[3] = 'A';
$vote[4] = 'D';
$vote[5] = 'E';
for ($i = 1; $i <= 2; $i++) {
$election->addVote($vote);
}
$vote = [];
$vote[1] = 'D';
$vote[2] = 'C';
$vote[3] = 'E';
$vote[4] = 'B';
$vote[5] = 'A';
for ($i = 1; $i <= 7; $i++) {
$election->addVote($vote);
}
$vote = [];
$vote[1] = 'E';
$vote[2] = 'B';
$vote[3] = 'A';
$vote[4] = 'D';
$vote[5] = 'C';
for ($i = 1; $i <= 8; $i++) {
$election->addVote($vote);
}