CalculadoraEscons is a class that calculates the number of seats belonging to each party in an election process, using the D'Hondt's method.
To use this class you have to:
1.- Create an object:
$aCalc = new CalculadoraEscons();
2.- Call the class with the list of parties and votes collected by each of them, and the number of seats to distribute:
$aPartits = array('CiU' => 4367,'PSC' => 2252, 'ERC' => 2131,'ICV' => 403,'PP' => 287,'IPE' => 234);
$aEscons = $aCalc->calcula($aPartits,17);
The "calcula" method returns an array where the keys are the names of the parties and the values are the seats assigned to them.
2005-05-21, Manel Zaera
CalculadoraEscons is free software released under the GNU GPL license, la qual podeu consultar a http://www.gnu.org/copyleft/gpl.html |