with Preferences; with Candidates; with Rationals; with Ada.Containers.Ordered_Maps; with Ada.Containers.Vectors; generic with package Given_Prefs is new Preferences (<>); package Bundles is type Bundle is private; Empty_Bundle : constant Bundle; package Bundle_Vectors is new Ada.Containers.Vectors with (Index_Type => Positive, Element_Type => Bundle); package Bundle_Maps is new Ada.Containers.Ordered_Maps (Key_Type => Candidates.CandidateID, Element_Type => Bundle_Vectors.Vector); procedure Read_Bundles (Filename : in String; Result : out Bundle_Maps.Map); procedure Add (To : in out Bundle; Item : in Given_Prefs.Preference_Array); procedure Transfer (This : in out Bundle; From, To : in Candidates.CandidateID; Excluded : in Candidates.CandidateID_Vector; Value : in Rationals.Fraction; Result : out Bundle); function Count_Votes (This : in Bundle) return Natural; function Count_Papers (This : in Bundle) return Natural; private use type Rationals.Fraction; type Paper_Lot is record How_Many : Positive := 1; Prefs : Given_Prefs.Preference_Array; end record; package Paper_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => Paper_Lot); type Bundle is record Papers : Paper_Vectors.Vector := Paper_Vectors.Empty_Vector; Worth : Rationals.Fraction := 1 / 1; end record; end Bundles;