commit b104c861e78fef52ee8fbc4c3193ac68e38dce44 Author: Jose Date: Fri Oct 10 02:14:54 2025 +0200 monorepo diff --git a/proyecto-java/.classpath b/proyecto-java/.classpath new file mode 100644 index 0000000..72396c3 --- /dev/null +++ b/proyecto-java/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/proyecto-java/.project b/proyecto-java/.project new file mode 100644 index 0000000..275279d --- /dev/null +++ b/proyecto-java/.project @@ -0,0 +1,17 @@ + + + proyecto-java-evaluacion-continua-2o-cuatrimestre-ic2-lab1-yoshibv + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/proyecto-java/data/Coches.csv b/proyecto-java/data/Coches.csv new file mode 100644 index 0000000..7517945 --- /dev/null +++ b/proyecto-java/data/Coches.csv @@ -0,0 +1,157 @@ +Manufacturer;Model;Sales in thousands;4-year resale value;Vehicle type;Price in thousands;Engine size;Horsepower;Wheelbase;Width;Length;Curb weight;Fuel capacity;Fuel efficiency;Latest Launch;Color1;Color2;Color3;Color4;Color5 +Acura ;Integra ;16919;16.36;Passenger;21.5;1.8;140;101.2;67.3;172.4;2.639;13.2;28;02/02/2014;BLANCO;NEGRO;ROJO;AZUL; +Acura ;TL ;39384;19.875;Passenger;28.4;3.2;225;108.1;70.3;192.9;3.517;17.2;25;06/03/2015;BLANCO;NEGRO;ROJO;AZUL; +Acura ;CL ;14114;18.225;Passenger;29.295;3.2;225;106.9;70.6;192;3.47;17.2;26;01/04/2014;BLANCO;NEGRO;ROJO;AZUL; +Acura ;RL ;8588;29.725;Passenger;42;3.5;210;114.6;71.4;196.6;3.85;18;22;03/10/2015;BLANCO;NEGRO;ROJO;AZUL; +Audi ;A4 ;20397;22.255;Passenger;23.99;1.8;150;102.6;68.2;178;2.998;16.4;27;10/08/2015;BLANCO;NEGRO;ROJO;AZUL; +Audi ;A6 ;1878;23.555;Passenger;33.95;2.8;200;108.7;76.1;192;3.561;18.5;22;08/09/2015;BLANCO;NEGRO;ROJO;AZUL; +Audi ;A8 ;138;39;Passenger;62;4.2;310;113;74;198.2;3.902;23.7;21;27/02/2014;BLANCO;GRIS;ROJO;AZUL; +BMW ;323i ;19747;0.0;Passenger;26.99;2.5;170;107.3;68.4;176;3.179;16.6;26;28/06/2015;BLANCO;GRIS;ROJO;AZUL; +BMW ;328i ;9231;28.675;Passenger;33.4;2.8;193;107.3;68.5;176;3.197;16.6;24;29/01/2014;BLANCO;GRIS;ROJO;AZUL; +BMW ;528i ;17527;36.125;Passenger;38.9;2.8;193;111.4;70.9;188;3.472;18.5;25;04/04/2015;BLANCO;GRIS;ROJO;AZUL; +Buick ;Century ;91561;12.475;Passenger;21.975;3.1;175;109;72.7;194.6;3.368;17.5;25;11/02/2015;BLANCO;GRIS;ROJO;AZUL; +Buick ;Regal ;3935;13.74;Passenger;25.3;3.8;240;109;72.7;196.2;3.543;17.5;23;09/03/2015;BLANCO;GRIS;ROJO;AZUL; +Buick ;Park Avenue ;27851;20.19;Passenger;31.965;3.8;205;113.8;74.7;206.8;3.778;18.5;24;23/03/2014;BLANCO;GRIS;ROJO;AZUL; +Buick ;LeSabre ;83257;13.36;Passenger;27.885;3.8;205;112.2;73.5;200;3.591;17.5;25;23/07/2015;BLANCO;GRIS;ROJO;AZUL; +Cadillac ;DeVille ;63729;22.525;Passenger;39.895;4.6;275;115.3;74.5;207.2;3.978;18.5;22;23/02/2014;BLANCO;GRIS;ROJO;AZUL;GRIS +Cadillac ;Seville ;15943;27.1;Passenger;44.475;4.6;275;112.2;75;201;0;18.5;22;29/04/2015;BLANCO;GRIS;ROJO;AZUL;GRIS +Cadillac ;Eldorado ;6536;25.725;Passenger;39.665;4.6;275;108;75.5;200.6;3.843;19;22;27/11/2015;BLANCO;NEGRO;GRIS;AZUL;GRIS +Cadillac ;Catera ;11185;18.225;Passenger;31.01;3;200;107.4;70.3;194.8;3.77;18;22;28/09/2015;BLANCO;NEGRO;GRIS;AZUL;GRIS +Cadillac ;Escalade ;14785;0.0;Car;46.225;5.7;255;117.5;77;201.2;5.572;30;15;17/04/2014;BLANCO;NEGRO;GRIS;AZUL;GRIS +Chevrolet ;Cavalier ;145519;9.25;Passenger;13.26;2.2;115;104.1;67.9;180.9;2.676;14.3;27;17/08/2015;BLANCO;NEGRO;GRIS;AZUL;GRIS +Chevrolet ;Malibu ;135126;11.225;Passenger;16.535;3.1;170;107;69.4;190.4;3.051;15;25;19/03/2014;BLANCO;AMARILLO;GRIS;AZUL;GRIS +Chevrolet ;Lumina ;24629;10.31;Passenger;18.89;3.1;175;107.5;72.5;200.9;3.33;16.6;25;24/05/2015;BLANCO;AMARILLO;GRIS;AZUL;GRIS +Chevrolet ;Monte Carlo ;42593;11.525;Passenger;19.39;3.4;180;110.5;72.7;197.9;3.34;17;27;22/12/2015;BLANCO;AMARILLO;GRIS;AZUL;GRIS +Chevrolet ;Camaro ;26402;13.025;Passenger;24.34;3.8;200;101.1;74.1;193.2;3.5;16.8;25;23/10/2015;BLANCO;AMARILLO;GRIS;AZUL;GRIS +Chevrolet ;Corvette ;17947;36.225;Passenger;45.705;5.7;345;104.5;73.6;179.7;3.21;19.1;22;05/12/2014;BLANCO;AMARILLO;GRIS;AZUL;AMARILLO +Chevrolet ;Prizm ;32299;9.125;Passenger;13.96;1.8;120;97.1;66.7;174.3;2.398;13.2;33;09/11/2015;BLANCO;AMARILLO;GRIS;AZUL;AMARILLO +Chevrolet ;Metro ;21855;5.16;Passenger;9.235;1;55;93.1;62.6;149.4;1.895;10.3;45;13/04/2014;BLANCO;AMARILLO;ROJO;AZUL;AMARILLO +Chevrolet ;Impala ;107995;0.0;Passenger;18.89;3.4;180;110.5;73;200;3.389;17;27;18/06/2015;BLANCO;AMARILLO;ROJO;AZUL;AMARILLO +Chrysler ;Sebring Coupe ;7854;12.36;Passenger;19.84;2.5;163;103.7;69.7;190.9;2.967;15.9;24;16/01/2014;BLANCO;AMARILLO;ROJO;AZUL;AMARILLO +Chrysler ;Sebring Conv. ;32775;14.18;Passenger;24.495;2.5;168;106;69.2;193;3.332;16;24;17/11/2015;BLANCO;AMARILLO;ROJO;GRIS;AMARILLO +Chrysler ;Concorde ;31148;13.725;Passenger;22.245;2.7;200;113;74.4;209.1;3.452;17;26;06/06/2014;BLANCO;AMARILLO;ROJO;GRIS;AMARILLO +Chrysler ;Cirrus ;32306;12.64;Passenger;16.48;2;132;108;71;186;2.911;16;27;10/06/2015;BLANCO;AMARILLO;ROJO;GRIS;AMARILLO +Chrysler ;LHS ;13462;17.325;Passenger;28.34;3.5;253;113;74.4;207.7;3.564;17;23;05/08/2014;BLANCO;AMARILLO;ROJO;GRIS;AMARILLO +Chrysler ;300M ;30696;0.0;Passenger;29.185;3.5;253;113;74.4;197.8;3.567;17;23;02/10/2014;BLANCO;NEGRO;ROJO;GRIS;AMARILLO +Dodge ;Neon ;76034;7.75;Passenger;12.64;2;132;105;74.4;174.4;2.567;12.5;29;12/12/2015;BLANCO;NEGRO;ROJO;GRIS;AMARILLO +Dodge ;Avenger ;4734;12.545;Passenger;19.045;2.5;163;103.7;69.1;190.2;2.879;15.9;24;07/01/2014;BLANCO;NEGRO;ROJO;GRIS;AMARILLO +Dodge ;Stratus ;71186;10.185;Passenger;20.23;2.5;168;108;71;186;3.058;16;24;31/10/2015;BLANCO;NEGRO;ROJO;GRIS; +Dodge ;Intrepid ;88028;12.275;Passenger;22.505;2.7;202;113;74.7;203.7;3.489;17;0;06/02/2014;BLANCO;NEGRO;AMARILLO;GRIS; +Dodge ;Viper ;916;58.47;Passenger;69.725;8;450;96.2;75.7;176.7;3.375;19;16;08/07/2015;BLANCO;NEGRO;AMARILLO;AZUL; +Dodge ;Ram Pickup ;227061;15.06;Car;19.46;5.2;230;138.7;79.3;224.2;4.47;26;17;03/06/2014;BLANCO;NEGRO;AMARILLO;AZUL; +Dodge ;Ram Wagon ;16767;15.51;Car;21.315;3.9;175;109.6;78.8;192.6;4.245;32;15;01/06/2014;BLANCO;NEGRO;AMARILLO;AZUL; +Dodge ;Ram Van ;31038;13.425;Car;18.575;3.9;175;127.2;78.8;208.5;4.298;32;16;26/07/2014;BLANCO;NEGRO;AMARILLO;AZUL; +Dodge ;Dakota ;111313;11.26;Car;16.98;2.5;120;131;71.5;215;3.557;22;19;25/11/2015;BLANCO;NEGRO;AMARILLO;AZUL; +Dodge ;Durango ;101323;0.0;Car;26.31;5.2;230;115.7;71.7;193.5;4.394;25;17;27/06/2014;BLANCO;NEGRO;AMARILLO;AZUL; +Dodge ;Caravan ;181749;12.025;Car;19.565;2.4;150;113.3;76.8;186.3;3.533;20;24;09/01/2015;BLANCO;NEGRO;AMARILLO;AZUL; +Ford ;Escort ;70227;7.425;Passenger;12.07;2;110;98.4;67;174.7;2.468;12.7;30;31/03/2014;BLANCO;NEGRO;AMARILLO;AZUL; +Ford ;Mustang ;113369;12.76;Passenger;21.56;3.8;190;101.3;73.1;183.2;3.203;15.7;24;31/01/2014;BLANCO;NEGRO;AMARILLO;AZUL; +Ford ;Contour ;35068;8.835;Passenger;17.035;2.5;170;106.5;69.1;184.6;2.769;15;25;20/08/2014;BLANCO;NEGRO;AMARILLO;AZUL; +Ford ;Taurus ;245815;10.055;Passenger;17.885;3;155;108.5;73;197.6;3.368;16;24;20/12/2015;BLANCO;NEGRO;AMARILLO;AZUL; +Ford ;Focus ;17567;0.0;Passenger;12.315;2;107;103;66.9;174.8;2.564;13.2;30;22/07/2014;BLANCO;NEGRO;AMARILLO;AZUL; +Ford ;Crown Victoria ;63403;14.21;Passenger;22.195;4.6;200;114.7;78.2;212;3.908;19;21;26/09/2015;BLANCO;NEGRO;ROJO;AZUL; +Ford ;Explorer ;276747;16.64;Car;31.93;4;210;111.6;70.2;190.7;3.876;21;19;25/04/2014;BLANCO;NEGRO;ROJO;AMARILLO; +Ford ;Windstar ;155787;13.175;Car;21.41;3;150;120.7;76.6;200.9;3.761;26;21;25/02/2014;BLANCO;NEGRO;ROJO;AMARILLO; +Ford ;Expedition ;125338;23.575;Car;36.135;4.6;240;119;78.7;204.6;4.808;26;16;14/09/2014;BLANCO;NEGRO;ROJO;AMARILLO; +Ford ;Ranger ;22065;7.85;Car;12.05;2.5;119;117.5;69.4;200.7;3.086;20;23;14/01/2014;BLANCO;NEGRO;ROJO;AMARILLO; +Ford ;F-Series ;540561;15.075;Car;26.935;4.6;220;138.5;79.1;224.5;4.241;25.1;18;16/08/2014;BLANCO;NEGRO;ROJO;AMARILLO; +Honda ;Civic ;199685;9.85;Passenger;12.885;1.6;106;103.2;67.1;175.1;2.339;11.9;32;21/10/2015;BLANCO;NEGRO;ROJO;AMARILLO; +Honda ;Accord ;230902;13.21;Passenger;15.35;2.3;135;106.9;70.3;188.8;2.932;17.1;27;20/05/2014;BLANCO;NEGRO;ROJO;AMARILLO; +Honda ;CR-V ;73203;17.71;Car;20.55;2;146;103.2;68.9;177.6;3.219;15.3;24;21/03/2014;BLANCO;NEGRO;ROJO;AMARILLO; +Honda ;Passport ;12855;17.525;Car;26.6;3.2;205;106.4;70.4;178.2;3.857;21.1;19;10/09/2014;BLANCO;NEGRO;ROJO;AMARILLO; +Honda ;Odyssey ;76029;19.49;Car;26;3.5;210;118.1;75.6;201.2;4.288;20;23;02/08/2014;BLANCO;NEGRO;ROJO;AMARILLO; +Hyundai ;Accent ;41184;5.86;Passenger;9.699;1.5;92;96.1;65.7;166.7;2.24;11.9;31;09/10/2014;BLANCO;NEGRO;ROJO;AMARILLO; +Hyundai ;Elantra ;66692;7.825;Passenger;11.799;2;140;100.4;66.9;174;2.626;14.5;27;15/11/2015;BLANCO;NEGRO;ROJO;AMARILLO; +Hyundai ;Sonata ;2945;8.91;Passenger;14.999;2.4;148;106.3;71.6;185.4;3.072;17.2;25;14/06/2014;BLANCO;NEGRO;ROJO;AMARILLO; +Infiniti ;I30 ;23713;19.69;Passenger;29.465;3;227;108.3;70.2;193.7;3.342;18.5;25;15/04/2014;BLANCO;NEGRO;ROJO;AZUL; +Jaguar ;S-Type ;15467;0.0;Passenger;42.8;3;240;114.5;71.6;191.3;3.65;18.4;21;11/03/2014;BLANCO;NEGRO;ROJO;AZUL; +Jeep ;Wrangler ;55557;13.475;Car;14.46;2.5;120;93.4;66.7;152;3.045;19;17;03/04/2014;BLANCO;NEGRO;ROJO;AZUL; +Jeep ;Cherokee ;80556;13.775;Car;21.62;4;190;101.4;69.4;167.5;3.194;20;20;10/05/2014;BLANCO;NEGRO;ROJO;AZUL; +Jeep ;Grand Cherokee ;15704;18.81;Car;26.895;4;195;105.9;72.3;181.5;3.88;20.5;19;12/10/2015;BLANCO;NEGRO;ROJO;AZUL; +Lexus ;ES300 ;24072;26.975;Passenger;31.505;3;210;105.1;70.5;190.2;3.373;18.5;23;07/09/2014;BLANCO;NEGRO;ROJO;AZUL; +Lexus ;GS300 ;12698;32.075;Passenger;37.805;3;225;110.2;70.9;189.2;3.638;19.8;23;05/10/2014;BLANCO;NEGRO;ROJO;AZUL; +Lexus ;GS400 ;3334;0.0;Passenger;46.305;4;300;110.2;70.9;189.2;3.693;19.8;21;28/11/2014;BLANCO;NEGRO;ROJO;AZUL; +Lexus ;LS400 ;6375;40.375;Passenger;54.005;4;290;112.2;72;196.7;3.89;22.5;22;29/03/2014;BLANCO;NEGRO;ROJO;AZUL; +Lexus ;LX470 ;9126;0.0;Car;60.105;4.7;230;112.2;76.4;192.5;5.401;25.4;15;30/10/2014;BLANCO;NEGRO;ROJO;AZUL; +Lexus ;RX300 ;51238;0.0;Car;34.605;3;220;103;71.5;180.1;3.9;17.2;21;01/04/2014;BLANCO;NEGRO;ROJO;AZUL; +Lincoln ;Continental ;13798;20.525;Passenger;39.08;4.6;275;109;73.6;208.5;3.868;20;22;08/03/2014;BLANCO;NEGRO;ROJO;AZUL; +Lincoln ;Town car ;48911;21.725;Passenger;43.33;4.6;215;117.7;78.2;215.3;4.121;19;21;06/04/2014;BLANCO;NEGRO;ROJO;AZUL; +Lincoln ;Navigator ;22925;0.0;Car;42.66;5.4;300;119;79.9;204.8;5.393;30;15;23/12/2014;BLANCO;NEGRO;ROJO;AZUL; +Mitsubishi ;Mirage ;26232;8.325;Passenger;13.987;1.8;113;98.4;66.5;173.6;2.25;13.2;30;23/04/2014;BLANCO;NEGRO;ROJO;AZUL; +Mitsubishi ;Eclipse ;42541;10.395;Passenger;19.047;2.4;154;100.8;68.9;175.4;2.91;15.9;24;24/11/2014;BLANCO;NEGRO;ROJO;AZUL; +Mitsubishi ;Galant ;55616;10.595;Passenger;17.357;2.4;145;103.7;68.5;187.8;2.945;16.3;25;29/01/2014;BLANCO;NEGRO;ROJO;AZUL; +Mitsubishi ;Diamante ;5711;16.575;Passenger;24.997;3.5;210;107.1;70.3;194.1;3.443;19;22;28/08/2014;BLANCO;NEGRO;ROJO;AZUL; +Mitsubishi ;3000GT ;11;20.94;Passenger;25.45;3;161;97.2;72.4;180.3;3.131;19.8;21;29/06/2014;BLANCO;NEGRO;ROJO;AZUL; +Mitsubishi ;Montero ;11337;19.125;Car;31.807;3.5;200;107.3;69.9;186.6;4.52;24.3;18;17/01/2014;BLANCO;NEGRO;ROJO;AZUL; +Mitsubishi ;Montero Sport ;39348;13.88;Car;22.527;3;173;107.3;66.7;178.3;3.51;19.5;20;18/05/2014;BLANCO;NEGRO;ROJO;AZUL; +Mercury ;Mystique ;14351;8.8;Passenger;16.24;2;125;106.5;69.1;184.8;2.769;15;28;19/12/2014;BLANCO;NEGRO;ROJO;AZUL; +Mercury ;Cougar ;26529;13.89;Passenger;16.54;2;125;106.4;69.6;185;2.892;16;30;23/02/2014;BLANCO;NEGRO;ROJO;AZUL; +Mercury ;Sable ;67956;11.03;Passenger;19.035;3;153;108.5;73;199.7;3.379;16;24;22/09/2014;BLANCO;NEGRO;ROJO;AZUL; +Mercury ;Grand Marquis ;81174;14.875;Passenger;22.605;4.6;200;114.7;78.2;212;3.958;19;21;24/07/2014;BLANCO;NEGRO;ROJO;AZUL; +Mercury ;Mountaineer ;27609;20.43;Car;27.56;4;210;111.6;70.2;190.1;3.876;21;18;13/02/2008;BLANCO;NEGRO;ROJO;AZUL; +Mercury ;Villager ;2038;14.795;Car;22.51;3.3;170;112.2;74.9;194.7;3.944;20;21;20/10/2009;BLANCO;NEGRO;ROJO;AZUL; +Mercedes-Benz;C-Class ;18392;26.05;Passenger;31.75;2.3;185;105.9;67.7;177.4;3.25;16.4;26;24/04/2015;BLANCO;NEGRO;ROJO;AZUL; +Mercedes-Benz;E-Class ;27602;41.45;Passenger;49.9;3.2;221;111.5;70.8;189.4;3.823;21.1;25;07/12/2015;BLANCO;NEGRO;ROJO;AZUL; +Mercedes-Benz;S-Class ;16774;50.375;Passenger;69.7;4.3;275;121.5;73.1;203.1;4.133;23.2;21;13/06/2015;BLANCO;NEGRO;ROJO;AZUL; +Mercedes-Benz;SL-Class ;3311;58.6;Passenger;82.6;5;302;99;71.3;177.1;4.125;21.1;20;17/03/2015;BLANCO;NEGRO;ROJO;AZUL; +Mercedes-Benz;SLK ;7998;0.0;Passenger;38.9;2.3;190;94.5;67.5;157.9;3.055;15.9;26;16/01/2015;BLANCO;NEGRO;ROJO;AZUL; +Mercedes-Benz;SLK230 ;1526;0.0;Passenger;41;2.3;185;94.5;67.5;157.3;2.975;14;27;08/06/2015;BLANCO;NEGRO;ROJO;AZUL; +Mercedes-Benz;CLK Coupe ;11592;0.0;Passenger;41.6;3.2;215;105.9;67.8;180.3;3.213;16.4;26;07/08/2015;BLANCO;NEGRO;ROJO;AZUL; +Mercedes-Benz;CL500 ;954;0.0;Passenger;85.5;5;302;113.6;73.1;196.6;4.115;23.2;20;04/11/2015;BLANCO;NEGRO;ROJO;AZUL; +Mercedes-Benz;M-Class ;28976;0.0;Car;35.3;3.2;215;111;72.2;180.6;4.387;19;20;02/10/2015;BLANCO;NEGRO;ROJO;AZUL; +Nissan ;Sentra ;42643;8.45;Passenger;13.499;1.8;126;99.8;67.3;177.5;2.593;13.2;30;31/08/2015;BLANCO;NEGRO;ROJO;AZUL; +Nissan ;Altima ;88094;11.295;Passenger;20.39;2.4;155;103.1;69.1;183.5;3.012;15.9;25;08/02/2015;BLANCO;NEGRO;ROJO;AZUL; +Nissan ;Maxima ;79853;15.125;Passenger;26.249;3;222;108.3;70.3;190.5;3.294;18.5;25;05/06/2015;BLANCO;NEGRO;ROJO;AZUL; +Nissan ;Quest ;27308;15.38;Car;26.399;3.3;170;112.2;74.9;194.8;3.991;20;21;03/07/2015;BLANCO;NEGRO;ROJO;AZUL; +Nissan ;Pathfinder ;42574;17.81;Car;29.299;3.3;170;106.3;71.7;182.6;3.947;21;19;25/09/2015;BLANCO;NEGRO;ROJO;AZUL; +Nissan ;Xterra ;54158;0.0;Car;22.799;3.3;170;104.3;70.4;178;3.821;19.4;18;24/01/2015;BLANCO;NEGRO;ROJO;AZUL; +Nissan ;Frontier ;65005;0.0;Car;17.89;3.3;170;116.1;66.5;196.1;3.217;19.4;18;27/08/2015;BLANCO;NEGRO;ROJO;AZUL; +Oldsmobile ;Cutlass ;1112;11.24;Passenger;18.145;3.1;150;107;69.4;192;3.102;15.2;25;31/05/2015;BLANCO;NEGRO;ROJO;AZUL; +Oldsmobile ;Intrigue ;38554;0.0;Passenger;24.15;3.5;215;109;73.6;195.9;3.455;18;0;04/01/2015;BLANCO;NEGRO;ROJO;AZUL; +Oldsmobile ;Alero ;80255;0.0;Passenger;18.27;2.4;150;107;70.1;186.7;2.958;15;27;20/10/2009;BLANCO;NEGRO;ROJO;AZUL; +Oldsmobile ;Aurora ;1469;19.89;Passenger;36.229;4;250;113.8;74.4;205.4;3.967;18.5;22;18/02/2015;BLANCO;NEGRO;ROJO;AZUL; +Oldsmobile ;Bravada ;20017;19.925;Car;31.598;4.3;190;107;67.8;181.2;4.068;17.5;19;21/09/2015;BLANCO;NEGRO;ROJO;AZUL; +Oldsmobile ;Silhouette ;24361;15.24;Car;25.345;3.4;185;120;72.2;201.4;3.948;25;22;25/06/2015;BLANCO;NEGRO;ROJO;AZUL; +Plymouth ;Neon ;32734;7.75;Passenger;12.64;2;132;105;74.4;174.4;2.559;12.5;29;26/04/2015;BLANCO;NEGRO;ROJO;AZUL; +Plymouth ;Breeze ;524;9.8;Passenger;16.08;2;132;108;71;186.3;2.942;16;27;14/11/2015;BLANCO;NEGRO;ROJO;AZUL; +Plymouth ;Voyager ;24155;12.025;Car;18.85;2.4;150;113.3;76.8;186.3;3.528;20;24;24/04/2015;BLANCO;NEGRO;ROJO;AZUL; +Plymouth ;Prowler ;1872;0.0;Passenger;43;3.5;253;113.3;76.3;165.4;2.85;12;21;27/06/2014;BLANCO;NEGRO;ROJO;AZUL; +Pontiac ;Sunfire ;51645;13.79;Passenger;21.61;2.4;150;104.1;68.4;181.9;2.906;15;27;25/01/2014;BLANCO;NEGRO;ROJO;AZUL; +Pontiac ;Grand Am ;131097;10.29;Passenger;19.72;3.4;175;107;70.4;186.3;3.091;15.2;25;26/11/2014;BLANCO;NEGRO;ROJO;AZUL; +Pontiac ;Firebird ;19911;17.805;Passenger;25.31;3.8;200;101.1;74.5;193.4;3.492;16.8;25;16/06/2014;BLANCO;NEGRO;ROJO;AZUL; +Pontiac ;Grand Prix ;92364;14.01;Passenger;21.665;3.8;195;110.5;72.7;196.5;3.396;18;25;15/10/2014;BLANCO;NEGRO;ROJO;AZUL; +Pontiac ;Bonneville ;35945;13.225;Passenger;23.755;3.8;205;112.2;72.6;202.5;3.59;17.5;24;18/05/2015;BLANCO;NEGRO;ROJO;AZUL; +Pontiac ;Montana ;39572;0.0;Car;25.635;3.4;185;120;72.7;201.3;3.942;25;23;22/07/2014;BLANCO;NEGRO;ROJO;AZUL; +Porsche ;Boxter ;8982;41.25;Passenger;41.43;2.7;217;95.2;70.1;171;2.778;17;22;19/02/2014;BLANCO;NEGRO;ROJO;AZUL; +Porsche ;Carrera Coupe ;128;60.625;Passenger;71.02;3.4;300;92.6;69.5;174.5;3.032;17;21;21/12/2014;BLANCO;NEGRO;ROJO;AZUL; +Porsche ;Carrera Cabriolet;1866;67.55;Passenger;74.97;3.4;300;92.6;69.5;174.5;3.075;17;23;07/11/2015;BLANCO;NEGRO;ROJO;AZUL; +Saab ;5-Sep;9191;0.0;Passenger;33.12;2.3;170;106.4;70.6;189.2;3.28;18.5;23;11/09/2014;BLANCO;NEGRO;ROJO;AZUL; +Saab ;3-Sep;12115;0.0;Passenger;26.1;2;185;102.6;67.4;182.2;2.99;16.9;23;06/12/2015;BLANCO;NEGRO;ROJO;AZUL; +Saturn ;SL ;8062;9.2;Passenger;10.685;1.9;100;102.4;66.4;176.9;2.332;12.1;33;16/08/2014;BLANCO;NEGRO;ROJO;AZUL; +Saturn ;SC ;24546;10.59;Passenger;12.535;1.9;100;102.4;66.4;180;2.367;12.1;33;16/03/2015;BLANCO;NEGRO;ROJO;AZUL; +Saturn ;SW ;5223;10.79;Passenger;14.29;1.9;124;102.4;66.4;176.9;2.452;12.1;31;15/01/2015;BLANCO;NEGRO;ROJO;AZUL; +Saturn ;LW ;8472;0.0;Passenger;18.835;2.2;137;106.5;69;190.4;3.075;13.1;27;08/05/2015;BLANCO;NEGRO;ROJO;AZUL; +Saturn ;LS ;49989;0.0;Passenger;15.01;2.2;137;106.5;69;190.4;2.91;13.1;28;12/04/2014;BLANCO;NEGRO;ROJO;AZUL; +Subaru ;Outback ;47107;0.0;Passenger;22.695;2.5;165;103.5;67.5;185.8;3.415;16.9;25;07/07/2015;BLANCO;NEGRO;ROJO;AZUL; +Subaru ;Forester ;33028;0.0;Car;20.095;2.5;165;99.4;68.3;175.2;3.125;15.9;24;09/10/2014;BLANCO;NEGRO;ROJO;AZUL; +Toyota ;Corolla ;142535;10.025;Passenger;13.108;1.8;120;97;66.7;174;2.42;13.2;33;04/11/2015;BLANCO;NEGRO;ROJO;AZUL; +Toyota ;Camry ;247994;13.245;Passenger;17.518;2.2;133;105.2;70.1;188.5;2.998;18.5;27;02/10/2015;BLANCO;NEGRO;ROJO;AZUL; +Toyota ;Avalon ;63849;18.14;Passenger;25.545;3;210;107.1;71.7;191.9;3.417;18.5;26;31/08/2015;BLANCO;NEGRO;ROJO;AZUL; +Toyota ;Celica ;33269;15.445;Passenger;16.875;1.8;140;102.4;68.3;170.5;2.425;14.5;31;29/12/2014;BLANCO;NEGRO;ROJO;AZUL; +Toyota ;Tacoma ;84087;9.575;Car;11.528;2.4;142;103.3;66.5;178.7;2.58;15.1;23;08/01/2015;BLANCO;NEGRO;ROJO;AZUL; +Toyota ;Sienna ;65119;0.0;Car;22.368;3;194;114.2;73.4;193.5;3.759;20.9;22;10/05/2014;BLANCO;NEGRO;ROJO;AZUL; +Toyota ;RAV4 ;25106;13.325;Car;16.888;2;127;94.9;66.7;163.8;2.668;15.3;27;05/06/2015;BLANCO;NEGRO;ROJO;AZUL; +Toyota ;4Runner ;68411;19.425;Car;22.288;2.7;150;105.3;66.5;183.3;3.44;18.5;23;03/07/2015;BLANCO;NEGRO;ROJO;AZUL; +Toyota ;Land Cruiser ;9835;34.08;Car;51.728;4.7;230;112.2;76.4;192.5;5.115;25.4;15;25/09/2015;BLANCO;NEGRO;ROJO;AZUL; +Volkswagen ;Golf ;9761;11.425;Passenger;14.9;2;115;98.9;68.3;163.3;2.767;14.5;26;24/01/2015;BLANCO;NEGRO;ROJO;AZUL; +Volkswagen ;Jetta ;83721;13.24;Passenger;16.7;2;115;98.9;68.3;172.3;2.853;14.5;26;27/08/2015;BLANCO;NEGRO;ROJO;AZUL; +Volkswagen ;Passat ;51102;16.725;Passenger;21.2;1.8;150;106.4;68.5;184.1;3.043;16.4;27;30/10/2014;BLANCO;NEGRO;ROJO;AZUL; +Volkswagen ;Cabrio ;9569;16.575;Passenger;19.99;2;115;97.4;66.7;160.4;3.079;13.7;26;31/05/2015;BLANCO;NEGRO;ROJO;AZUL; +Volkswagen ;GTI ;5596;13.76;Passenger;17.5;2;115;98.9;68.3;163.3;2.762;14.6;26;04/01/2015;BLANCO;NEGRO;ROJO;AZUL; +Volkswagen ;Beetle ;49463;0.0;Passenger;15.9;2;115;98.9;67.9;161.1;2.769;14.5;26;20/10/2015;BLANCO;NEGRO;ROJO;AZUL; +Volvo ;S40 ;16957;0.0;Passenger;23.4;1.9;160;100.5;67.6;176.6;2.998;15.8;25;18/02/2015;BLANCO;NEGRO;ROJO;AZUL; +Volvo ;V40 ;3545;0.0;Passenger;24.4;1.9;160;100.5;67.6;176.6;3.042;15.8;25;21/09/2015;BLANCO;NEGRO;ROJO;AZUL; +Volvo ;S70 ;15245;0.0;Passenger;27.5;2.4;168;104.9;69.3;185.9;3.208;17.9;25;24/11/2014;BLANCO;NEGRO;ROJO;AZUL; +Volvo ;V70 ;17531;0.0;Passenger;28.8;2.4;168;104.9;69.3;186.2;3.259;17.9;25;25/06/2015;BLANCO;NEGRO;ROJO;AZUL; +Volvo ;C70 ;3493;0.0;Passenger;45.5;2.3;236;104.9;71.5;185.7;3.601;18.5;23;26/04/2015;BLANCO;NEGRO;ROJO;AZUL; +Volvo ;S80 ;18969;0.0;Passenger;36;2.9;201;109.9;72.1;189.8;3.6;21.1;24;14/11/2015;BLANCO;NEGRO;ROJO;AZUL; \ No newline at end of file diff --git a/proyecto-java/docs/README.md b/proyecto-java/docs/README.md new file mode 100644 index 0000000..57ab467 --- /dev/null +++ b/proyecto-java/docs/README.md @@ -0,0 +1,179 @@ +# Proyecto del Segundo Cuatrimestre Fundamentos de Programación (Curso 22/23) +## 👤 Autor: José Manuel Amador Gallardo    |    🪪 UVUS: ------- + +El dataset consta de varias propiedades de coches (como pueden ser fabricante, modelo, color, tamaño del motor, capacidad de combustible, etc). + +## 🟥 Estructura de las carpetas del proyecto +├─ **📁 src**: Contiene los diferentes archivos que forman parte del proyecto.
+ |     ├─ **📦 fp.coches**: Paquete que contiene los tipos del proyecto.
+ |      |     ├─ 📄 Coche.java
+ |      |     ├─ 📄 Concesionario.java
+ |      |     └─ 📄 FactoriaCoches.java
+ |     ├─ **📦 fp.coches.test**: Paquete que contiene las clases de test del proyecto.
+ |      |     ├─ 📄 TestCoche.java
+ |      |     ├─ 📄 TestConcesionario.java
+ |      |     └─ 📄 TestFactoriaCoches.java
+ |     ├─ **📦 fp.common**: Paquete que contiene los tipos auxiliares del proyecto.
+ |      |     ├─ 📄 ColorCoche.java
+ |      |     ├─ 📄 Motor.java
+ |      |     └─ 📄 TipoCoche.java
+ |     └─ **📦 fp.utiles**: Paquete que contiene las clases de utilidad.
+ |            ├─ 📄 Checkers.java
+ |            ├─ 📄 Fichero.java
+ |            ├─ 📄 Mostrar.java
+ |            └─ 📄 Parsers.java
+├─ **📁 data**: Contiene el dataset del proyecto.
+ |    └─ **📄 coches.csv**: Datos sobre coches de varios fabricantes. +
+└─ **📁 docs**: Contiene la documentación del proyecto.
+     └─ **📄 README.md** +: Documentación. + +## 🟥 Estructura del *dataset* +El dataset está compuesto por 20 columnas, con la siguiente descripción: +* **Manufacturer**: de tipo ``String``, representa el nombre del fabricante. +* **Model**: de tipo ``String``, representa el modelo del vehículo. +* **Sales in thousands**: de tipo ``Integer``, representa el número de ventas en miles. +* **4-year resale value**: de tipo ``Float/Double``, representa el valor de reventa a los cuatro años. +* **Vehicle type**: de tipo ``String``, representa el tipo de vehículo. +* **Price in thousands**: de tipo ``Float/Double``, representa el precio en miles del vehículo. +* **Engine size**: de tipo ``Float/Double``, representa el tamaño del motor en L. +* **Horsepower**: de tipo Integer, representa la potencia del vehículo en CV. +* **Wheelbase**: de tipo ``Float/Double``, representa la distancia entre los dos ejes de las ruedas. +* **Width**: de tipo ``Float/Double``, representa el ancho del vehículo. +* **Length**: de tipo ``Float/Double``, representa el largo del vehículo. +* **Curb weight**: de tipo ``Float/Double``, representa el peso en vacío del vehículo. +* **Fuel capacity**: de tipo ``Float/Double``, representa la capacidad de combustible del vehículo. +* **Fuel efficiency**: de tipo ``Integer``, representa la eficiencia del combustible. +* **Latest launch**: de tipo ``String``, representa el último lanzamiento del vehículo. +* **Color 1**: de tipo ``String``, representa el primer color disponible del vehículo. +* **Color 2**: de tipo ``String``, representa el segundo color disponible del vehículo. +* **Color 3**: de tipo ``String``, representa el tercer color disponible del vehículo. +* **Color 4**: de tipo ``String``, representa el cuarto color disponible del vehículo. +* **Color 5**: de tipo ``String``, representa el quinto color disponible del vehículo. + +## 🟥 Tipos implementados +### 🔷 **Tipo Coche** +Tipo base con métodos básicos: +Constructor/es, Getters & Setters, toString, equals, compareTo + +**PROPIEDADES**: +| Propiedad | Tipo | Descripción | +|-------------|-----------------------|----------------------------------------| +fabricante | ``String`` | consultable y modificable. +modelo | ``String`` | consultable y modificable. +potencia | ``Integer`` | consultable y modificable. +tamañoMotor | ``Float`` | consultable y modificable. +tipo | ``TipoCoche`` | consultable y modificable. +precio | ``Integer`` | consultable y modificable. +salidaMercado | ``LocalDate`` | consultable y modificable. +listaColores | ``List`` | consultable y modificable. + +**CONSTRUCTORES**: +- **C1:** Un parámetro por cada propiedad. +- **C2:** Sólo recibe como parámetros el fabricante, el modelo y la lista de colores. + +**RESTRICCIONES**: +- **R1:** el precio no puede ser negativo. +- **R2:** la lista de colores no puede ser ```null```. + +**CRITERIO DE IGUALDAD**: +- Sirve para saber si dos objetos tipo Coche son iguales. + +**CRITERIO DE ORDENACIÓN**: +- Compara el nombre del fabricante para ordenar por nombre de fabricante. + +**OTRAS OPERACIONES**: +- tipoCocheParser: Convierte el tipo de vehículo para el toString (ej.) ``TipoCoche.PASSENGER`` a ``"Passenger"``. +- salidaMercadoParser: Convierte el formato ``YYYY-MM-dd`` a ``dd/MM/YYYY``. +- getFormatoCorto: Devuelve el toString en un formato más comprimido "one-line". +- toString: Formatea el tipo en un String legible. +- hashCode: Generea un hashcode. + +### 🔷 **Tipo Concesionario** +Tipo contenedor de tipos Coche con métodos básicos (L58). + +**PROPIEDADES**: +| Propiedad | Tipo | Descripción | +|-------------|-----------------------|----------------------------------------| +coches | ``Set`` | consultable y modificable. + +**CONSTRUCTORES**: +- **C1:** Un parámetro por cada propiedad. +- **C2:** Constructor vacío que devuelve un Set<Coche> vacío. + +**CRITERIO DE IGUALDAD**: +- Sirve para saber si dos objetos tipo Concesionario son iguales. + +**OTRAS OPERACIONES**: +- getNumeroCoches: Devuelve el número total de tipos Coche en coches. +- añadirCoche: Añade un tipo Coche a coches. +- eliminarCoche: Elimina un tipo Coche de coches. +- añadirColCoches: Añade una colección de tipos Coche a coches. +- existeCochePrecioMenor: Devuelve un ``Boolean`` que es ``true`` si existe un tipo Coche con un precio menor a uno dado. +- getMediaLitros: Devuelve un ``Integer`` que es la media de capacidad del motor de los coches. +- getCochesPorMarca: Devuelve una ``List`` con los tipos Coche que sean de la marca dada. +- getCochesPorFecha: Devuelve un ``Map>`` que agrupa los tipos Coche por fecha. +- getNumeroCochesPorAnyo: Devuelve un ``Map`` que cuenta el número de tipos Coche y los agrupa por año. +- toString: Formatea el tipo en un String legible. +- hashCode: Generea un hashcode. + +**MÉTODOS USANDO STREAMS** +- existeCochePrecioMenorStream: Devuelve un ``Boolean`` que es ``true`` si existe un tipo Coche con un precio menor a uno dado. +- getMediaLitrosStream: Devuelve un ``Integer`` que es la media de capacidad del motor de los coches. +- getCochesPorMarcaStream: Devuelve una ``List`` con los tipos Coche que sean de la marca dada. +- getCocheMasCaroPorMarca: Devuelve un tipo ``Coche`` el cual tiene la propiedad Precio más alta de entre todos los de la marca dada. +- getFiltroPrecioOrdenadoPorMarca: Devuelve una ``List`` ordenada por orden natural y habiendo filtrado sus tipos ``Coche`` anteriormente por un precio dado (siendo mayor o menor que este). +- getCochesPorFechaStream: Devuelve un ``Map>`` agrupando los coches por su fecha de salida, es decir, la clave es la fecha y el valor el conjunto de coches de esa fecha. +- getFabricantesDistintos: Devuelve una ``List`` que contiene los nombres de los fabricantes distintos sin repetición. +- getCochesMasCarosPorFecha: Devuelve un ``Map`` donde la clave es la fecha de salida al mercado y el valor el coche más caro de esa fecha. +- getCochesConMejorMotorPorFabricante: Devuelve un ``SortedMap>`` donde la clave es el fabricante y el valor es la lista de coches ordenados por la comparación de orden natural de los motores. +- getCocheMasCaro: Devuelve una String con el fabricante, modelo y fecha del coche más caro de todos. + +### 🔷 **Tipo FactoriaCoches** +Tipo para leer fichero CSV y parsear cadenas del CSV. +**MÉTODOS**: +- leerCoches: Lee el fichero CSV y devuelve un tipo Concesionario. +- parseaCoches: Parsea un string tipo ``"Fabricante;Modelo;Tamaño;Potencia;Capacidad;Eficiencia;Tipo;Precio;salidaMercado;listaColores"`` para crear un tipo Coche. + +## 🟥 Tipos auxiliares +### 🔷 **Motor** +Tipo auxiliar que funciona como subtipo de los tipos Coche para definir el Motor de los coches. + +**PROPIEDADES**: +| Propiedad | Tipo | Descripción | +|-------------|-----------------------|----------------------------------------| +tamaño | ``Double`` | consultable y modificable. +potencia | ``Integer`` | consultable y modificable. +capacidad | ``Double`` | consultable y modificable. +eficiencia | ``Integer`` | consultable y modificable. + +**CONSTRUCTORES**: +- **C1:** Un parámetro por cada propiedad. +- **C2:** Constructor a partir de String. + +**CRITERIO DE IGUALDAD**: +- Sirve para saber si dos objetos tipo Motor son iguales. + +**CRITERIO DE ORDENACIÓN**: +- Compara propiedad por propiedad de dos tipos Motor. + +**OTRAS OPERACIONES**: +- toString: Formatea el tipo en un String legible. +- hashCode: Generea un hashcode. + +### 🔷 **TipoCoche** +Enumerado para el tipo de vehículo, si es Passenger o Car. + +### 🔷 **ColorCoche** +Enumerado para los colores. + +## 🟥 Tipos útiles +### 🔷 **Checkers**: +Métodos para lanzar excepciones con mensajes de error custom. +### 🔷 **Fichero**: +Métodos para leer ficheros y manejar sus datos. +### 🔷 **Mostrar**: +Método para mostrar n elementos de una colección. +### 🔷 **Parsers**: +Método para parsear algunos tipos. diff --git a/proyecto-java/src/fp/coches/Coche.java b/proyecto-java/src/fp/coches/Coche.java new file mode 100644 index 0000000..10f0c88 --- /dev/null +++ b/proyecto-java/src/fp/coches/Coche.java @@ -0,0 +1,145 @@ +package fp.coches; + +import java.time.LocalDate; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +import fp.common.ColorCoche; +import fp.common.Motor; +import fp.common.TipoCoche; +import fp.utiles.Checkers; +import fp.utiles.Parsers; + +public class Coche implements Comparable{ + private String fabricante; + private String modelo; + private Motor motor; + private TipoCoche tipo; + private Integer precio; + private LocalDate salidaMercado; + private List listaColores = new ArrayList(); + + public Coche(String fab,String mod,Motor motor,TipoCoche tipo,Integer prec,LocalDate salMerc,List cols) { + /* Constructor que recibe todas las propiedades básicas para + * luego generar tipos base con dichas propiedades. + */ + Checkers.check("El precio no puede ser negativo",prec>=0); + Checkers.check("Los colores no pueden ser null", listaColores!=null); + this.fabricante = fab; + this.modelo = mod; + this.motor = motor; + this.tipo = tipo; + this.precio = prec; + this.salidaMercado = salMerc; + this.listaColores = cols; + } + + public Coche(String fab, String mod, List cols) { + /* Constructor que recibe el nombre del fabricante (String), + * el modelo (String) y una lista de colores (List) + * para generar tipos base pero con propiedades reducidas y + * consideradas importantes. + */ + Checkers.check("Los colores no pueden ser null", listaColores!=null); + this.fabricante = fab; + this.modelo = mod; + this.listaColores = cols; + } + + //GETTERS Y SETTERS + public String getFabricante() { + return fabricante; + } + + public String getModelo() { + return modelo; + } + + public Motor getMotor() { + return motor; + } + + public Integer getPrecio() { + return this.precio; + } + + public void setPrecio(Integer precio) { + this.precio = precio; + } + + public LocalDate getSalidaMercado() { + return salidaMercado; + } + + public TipoCoche getTipo() { + return tipo; + } + + public List getListaColores() { + return listaColores; + } + + //FORMATO CORTO + public String getFormatoCorto() { + return getFabricante() + " " + + getModelo() + " (" + + getPrecio() + "€) - " + + getTipo() + " - " + + Parsers.salidaMercadoParser(getSalidaMercado()) + " - " + + getListaColores(); + } + + //TOSTRING + @Override + public String toString() { + return "Coche [fabricante=" + fabricante + ", modelo=" + modelo + ", motor=" + motor + ", tipo=" + tipo + + ", precio=" + precio + ", salidaMercado=" + salidaMercado + ", listaColores=" + listaColores + "]"; + } + + // HASHCODE + @Override + public int hashCode() { + return Objects.hash(fabricante, listaColores, modelo, motor, precio, salidaMercado, tipo); + } + + // EQUALS + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Coche other = (Coche) obj; + return Objects.equals(fabricante, other.fabricante) && Objects.equals(listaColores, other.listaColores) + && Objects.equals(modelo, other.modelo) && Objects.equals(motor, other.motor) + && Objects.equals(precio, other.precio) && Objects.equals(salidaMercado, other.salidaMercado) + && tipo == other.tipo; + } + + // COMPARETO + @Override + public int compareTo(Coche c) { + // Compara todas las propiedades en cascada + int res; + if(c==null) { + throw new NullPointerException(); + } + res = getFabricante().compareTo(c.getFabricante()); + if(res == 0) { + res = getModelo().compareTo(c.getModelo()); + if(res==0) { + res = getMotor().compareTo(c.getMotor()); + if(res==0) { + res = getPrecio().compareTo(c.getPrecio()); + if(res==0) { + res = getSalidaMercado().compareTo(c.getSalidaMercado()); + } + } + } + } + return res; + } +} diff --git a/proyecto-java/src/fp/coches/Concesionario.java b/proyecto-java/src/fp/coches/Concesionario.java new file mode 100644 index 0000000..dcb6bfd --- /dev/null +++ b/proyecto-java/src/fp/coches/Concesionario.java @@ -0,0 +1,333 @@ +package fp.coches; + +import java.time.LocalDate; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.SortedMap; +import java.util.TreeMap; +import java.util.function.Function; +import java.util.stream.Collector; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +public class Concesionario { + private Set coches; + + public Concesionario() { + /* Constructor vacío */ + super(); + this.coches = new HashSet(); + } + + public Concesionario(Set c) { + /* Constructor que recibe un Set para generar + * un tipo contenedor + */ + super(); + this.coches = c; + } + + public Concesionario(Stream streamCoche) { + /* Constructor que recibe las propiedades básicas y un stream + * del tipo base para generar un tipo contenedor a través del + * stream */ + super(); + this.coches = streamCoche.collect(Collectors.toCollection(() -> new HashSet())); + } + + //HASHCODE + @Override + public int hashCode() { + return Objects.hash(coches); + } + + //EQUALS + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Concesionario other = (Concesionario) obj; + return Objects.equals(coches, other.coches); + } + + //GETTERS + public Set getCoches() { + return new HashSet(coches); + } + + public Integer getNumeroCoches() { + /* Método que no recibe parámetros y devuelve + * el número de tipos base en el tipo contenedor */ + return coches.size(); + } + + public void añadirCoche(Coche c) { + /* Método que añade un tipo base al + * tipo contenedor */ + coches.add(c); + } + + public void eliminarCoche(Coche c) { + /* Método que elimina un tipo base del + * tipo contenedor */ + coches.remove(c); + } + + public void añadirColCoches(Collection cc) { + /* Método que recibe como parámetro una colección + * de tipos base y la añade al tipo contenedor */ + coches.addAll(cc); + } + + public Boolean existeCochePrecioMenor(Integer p) { + /* Métoto que recibe como parámetro un entero p + * y devuelve true si existe un coche con precio + * menor a p */ + Boolean res = false; + for(Coche c:coches) { + if(c.getPrecio() getCochesPorMarca(String marca){ + /* Método que recibe un String que es la marca + * para luego devolver una lista de tipos base + * filtrando por la marca dada */ + List aux = new ArrayList(); + for(Coche c:coches) { + if(c.getFabricante().equals(marca)) { + aux.add(c); + } + } + return aux; + } + + public Map> getCochesPorFecha(){ + /* Método que no recibe parámetros y devuelve un map + * que tiene como clave la fecha de salida y como valor el + * conjunto de tipos base que salieron en dicha fecha */ + Map> res = new HashMap>(); + for(Coche c: coches) { + LocalDate key = c.getSalidaMercado(); + if(res.containsKey(key)) { + res.get(key).add(c); + } else { + Set aux = new HashSet(); + aux.add(c); + res.put(key, aux); + } + } + return res; + } + + public Map getNumeroCochesPorAnyo(){ + /* Método para obtener en un map el número de coches agrupados por año */ + Map res = new HashMap(); + for(Coche c: coches) { + Integer key = c.getSalidaMercado().getYear(); + if(res.containsKey(key)) { + Long aux = res.get(key); + aux++; + res.put(key, aux); + } else { + res.put(key, 1l); + } + } + return res; + } + + /* MÉTODOS REHECHOS CON STREAMS PARA ENTREGA 3 */ + + public Boolean existeCochePrecioMenorStream(Integer p) { + /* Método que recibe como parámetro un entero p + * y devuelve true si existe un coche con precio + * menor a p */ + return getCoches().stream() + .anyMatch(x -> x.getPrecio() x.getMotor().getTamaño()) + .average().getAsDouble(); + } + + public List getCochesPorMarcaStream(String marca){ + /* Método que recibe un String que es la marca + * para luego devolver una lista de tipos base + * filtrando por la marca dada */ + return getCoches().stream() + .filter(x -> x.getFabricante().equals(marca)) + .toList(); + } + + public Coche getCocheMasCaroPorMarca(String marca) { + /* Método que recibe un String que es la marca + * para luego devolver un objeto del tipo base + * con la propiedad del precio en su valor máximo + * y filtrando por la marca dada */ + return getCoches().stream() + .filter(x -> x.getFabricante().equals(marca)) + .max(Comparator.comparing(Coche::getPrecio)) + .get(); + } + + public List getFiltroPrecioOrdenadoPorMarca(Integer precio) { + /* Método que recibe un precio para primero filtrar + * los tipos base del contenedor por este (siendo + * el precio del tipo base menor o igual al dado). + * Luego se ordena por marca y se devuelve una lista. */ + return getCoches().stream() + .filter(x -> x.getPrecio() <= precio) + .sorted(Comparator.comparing(Coche::getFabricante)) + .toList(); + + } + + public Map> getCochesPorFechaStream(){ + /* Método que no recibe parámetros y devuelve un map + * que tiene como clave la fecha de salida y como valor el + * conjunto de tipos base que salieron en dicha fecha */ + return getCoches().stream() + .collect(Collectors.groupingBy(x -> x.getSalidaMercado(), + Collectors.toSet())); + } + + public List getFabricantesDistintos() { + /* Método que no recibe parámetros y devuelve una + * lista con los nombres de los fabricantes + * sin repetirse ninguno */ + return getCoches().stream() + .map(Coche::getFabricante) + .distinct() + .collect(Collectors.collectingAndThen(Collectors.toList(), + lista -> List.copyOf(lista))); + } + + public Map getCochesMasCarosPorFecha() { + /* Método que no recibe parámetros y devuelve un map + * que tiene como clave la fecha de salida al mercado + * y como valor el coche más caro de esa fecha */ + return getCoches().stream() + .sorted(Comparator.comparing(Coche::getPrecio)) + .collect(Collectors.groupingBy(Coche::getSalidaMercado, + Collectors.collectingAndThen(Collectors.toList(), + lista -> List.copyOf(lista) + .stream() + .max(Comparator.comparing(Coche::getPrecio)).get()))); + + } + + public SortedMap> getCochesConMejorMotorPorFabricante() { + /* Método que no recibe parámetros y devuelve un map + * que tiene como clave el nombre del fabricante y como + * valor una lista de coches coches ordenados por la + * comparación de orden natural de los motores */ + return getCoches().stream() + .sorted(Comparator.comparing(Coche::getMotor)) + .collect(Collectors.groupingBy( + Coche::getFabricante, + TreeMap::new, + Collectors.toList() + )); + + } + + public String getCocheMasCaro() { + /* Método que no recibe parámetros y devuelve el coche más + * caro de entre todos y su fecha de salida. */ + Map mapaCoches = getCochesMasCarosPorFecha(); + Coche masCaro = mapaCoches.values().stream() + .max(Comparator.comparing(Coche::getPrecio)) + .get(); + return masCaro.getFabricante()+" "+masCaro.getModelo()+" ("+masCaro.getSalidaMercado()+")"; + } + + + // DEFENSA ================================================================================== + + public Double getMediaPreciosDelFabricante(String fabricante) { + /* Recibe un String que es el fabricante y devuelve la media + * de los precios de los coches de ese fabricante. */ + return getCoches().stream() + .filter(x->x.getFabricante().equals(fabricante)) + .mapToDouble(x -> x.getPrecio()) + .average().getAsDouble(); + } + + public Double getMediaPreciosDelFabricanteBucle(String fabricante) { + /* Recibe un String que es el fabricante y devuelve la media + * de los precios de los coches de ese fabricante. */ + Double i = 0.0; + Integer n = 0; + for(Coche c:getCoches()) { + if(c.getFabricante().equals(fabricante)) { + n++; + i+=c.getPrecio(); + } + } + return i/n; + } + + public Integer getMedianaPreciosDelFabricante(String fabricante) { + /* Recibe un string que es el fabricante por el que se filtrará. + * Luego calcula una lista de precios de los coches de ese fabricante. + * Por último calcula la mediana de los precios. + * Sea n el número total de datos: + * - Si es impar -> mediana = n/2 + * - Si es par -> mediana = ((n/2)+(n/2)-1)/2 */ + Integer res = 0; + Function f = x->x.getPrecio(); + List listaPrecios = getCoches().stream() + .filter(x->x.getFabricante().equals(fabricante)) + .collect(Collectors.toList()) + .stream() + .map(f).collect(Collectors.toList()); + Integer n = listaPrecios.size(); + if(n%2!=0) { + res = listaPrecios.get(n/2); + } else if(n%2==0) { + res = (listaPrecios.get(n/2)+listaPrecios.get((n/2)-1))/2; + } + return res; + } + + public Map getPorcentajeCochesConPrecioMayorA(Double p) { + Function f = x->x.getPrecio(); + return getCoches().stream() + .filter(x->x.getPrecio()>p) + .collect(Collectors.groupingBy(Coche::getFabricante, + Collectors.collectingAndThen(Collectors.toList(),f))); + } + + +} diff --git a/proyecto-java/src/fp/coches/FactoriaCoches.java b/proyecto-java/src/fp/coches/FactoriaCoches.java new file mode 100644 index 0000000..136981a --- /dev/null +++ b/proyecto-java/src/fp/coches/FactoriaCoches.java @@ -0,0 +1,71 @@ +package fp.coches; + +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.stream.Stream; + +import fp.common.ColorCoche; +import fp.common.Motor; +import fp.common.TipoCoche; +import fp.utiles.Fichero; + + +public class FactoriaCoches { + /* Lee el fichero CSV y devuelve un tipo Concesionario cuya única + * propiedad es un Set de tipos Coche*/ + public static Concesionario leerCoches(String rutaFichero) { + List lista = Fichero.leerFichero(rutaFichero, true); + Set aux = new HashSet(); + for(String s:lista) { + aux.add(parseaCoches(s)); + } + return new Concesionario(aux); + } + + public static List leeAtributos(String rutaFichero){ + List lista = Fichero.leerFichero(rutaFichero, false); + String strAttrs = lista.get(0); + String[] strAttrsTrozos = strAttrs.split(";"); + List res = Arrays.asList(strAttrsTrozos); + return res; + } + + public static Concesionario leerCochesStream(String rutaFichero) { + List lista = Fichero.leerFichero(rutaFichero, true); + Stream streamCoche = lista.stream().map(FactoriaCoches::parseaCoches); + return new Concesionario(streamCoche); + } + + public static Coche parseaCoches(String cocheString) { + /* Parsea un string tipo + * "Fabricante;Modelo;Tamaño;Potencia;Capacidad;Eficiencia;Tipo;Precio;salidaMercado;listaColores" + * para crear un tipo Coche*/ + String[] csa = cocheString.split(";"); + String fabricante = csa[0].trim(); + String modelo = csa[1].trim(); + Motor motor = new Motor(csa[6].trim()+";"+csa[7].trim()+";"+csa[12].trim()+";"+csa[13].trim()); + TipoCoche tipo = TipoCoche.valueOf(csa[4]); + Integer precio = (int) (Double.parseDouble(csa[5].trim())*1000); + LocalDate salidaMercado = LocalDate.parse(csa[14].trim(), + DateTimeFormatter.ofPattern("dd/MM/yyyy")); + String colores = null; + if(Arrays.asList(csa).size()==20) { + colores = csa[15]+","+csa[16]+","+csa[17]+","+csa[18]+","+csa[19]; + } else if(Arrays.asList(csa).size()==19) { + colores = csa[15]+","+csa[16]+","+csa[17]+","+csa[18]; + } + List listaColoresString = Arrays.asList(colores.split(",")); + List listaColores = new ArrayList(); + for(String s:listaColoresString) { + listaColores.add(ColorCoche.valueOf(s)); + } + return new Coche(fabricante,modelo,motor,tipo,precio,salidaMercado,listaColores); + } + + +} diff --git a/proyecto-java/src/fp/coches/TestFactoriaDefensa.java b/proyecto-java/src/fp/coches/TestFactoriaDefensa.java new file mode 100644 index 0000000..28ee153 --- /dev/null +++ b/proyecto-java/src/fp/coches/TestFactoriaDefensa.java @@ -0,0 +1,12 @@ +package fp.coches; + +import java.util.List; + +public class TestFactoriaDefensa { + public static void main(String[] args) { + List listAttrs = FactoriaCoches.leeAtributos("./data/Coches.csv"); + for(int i = 0; i listaColores1 = new ArrayList(); + private static Coche c1 = new Coche("Audi","A4",new Motor(1.8,150,13.2,28),TipoCoche.Passenger,23990,LocalDate.of(2015, 8, 15),listaColores1); + private static List listaColores2 = new ArrayList(); + private static Coche c2 = new Coche("Volkswagen","Passat",new Motor(1.8,150,13.2,28),TipoCoche.Passenger,21200,LocalDate.of(2014, 10, 30),listaColores2); + + public static void print(Object o) { + System.out.println(o); + } + + private static void TesteoCoche() { + print("\n-------------- PRUEBA DEL OBJETO c1 --------------"); + print("Formato completo:"); + print(c1); + print("Formato corto:"); + print(c1.getFormatoCorto()); + print("--------------------------------------------------"); + + print("\n-------------- PRUEBA DEL OBJETO c2 --------------"); + print("Formato completo:"); + print(c2); + print("Formato corto:"); + print(c2.getFormatoCorto()); + print("--------------------------------------------------"); + } + + private static void TestCompareTo() { + print("\n-------------- PRUEBA DEL compareTo --------------"); + print(c1.compareTo(c2)); + if(c1.compareTo(c2)<0) { + print(c1.getFabricante()+" "+c1.getModelo() + " va antes que " + c2.getFabricante()+" "+c2.getModelo()); + } else if(c1.compareTo(c2)>0) { + print(c1.getFabricante()+" "+c1.getModelo() + " va después que " + c2.getFabricante()+" "+c2.getModelo()); + } else { + print(c1.getFabricante()+" "+c1.getModelo() + " y " + c2.getFabricante()+" "+c2.getModelo() + " son iguales"); + } + print("--------------------------------------------------"); + } + + private static void TestEquals() { + print("\n--------------- PRUEBA DEL equals ---------------"); + print(c1.equals(c2)); + if(c1.equals(c2)==true) { + print(c1.getFabricante()+" "+c1.getModelo()+" es igual que "+c2.getFabricante()+" "+c2.getModelo()); + } else { + print(c1.getFabricante()+" "+c1.getModelo()+" es distinto a "+c2.getFabricante()+" "+c2.getModelo()); + } + print("--------------------------------------------------"); + } + + private static void TestMotor() { + print("\n-------------- PRUEBA DEL OBJETO Motor -----------"); + print("c1: " + c1.getMotor()); + print("c2: " + c2.getMotor()); + print("--------------------------------------------------"); + } + + public static void llenarListas() { + listaColores1.add(ColorCoche.NEGRO); + listaColores1.add(ColorCoche.ROJO); + listaColores1.add(ColorCoche.BLANCO); + listaColores1.add(ColorCoche.AZUL); + listaColores2.add(ColorCoche.NEGRO); + listaColores2.add(ColorCoche.ROJO); + listaColores2.add(ColorCoche.BLANCO); + listaColores2.add(ColorCoche.AZUL); + } + + public static void main(String[] args) { + llenarListas(); + TesteoCoche(); + TestMotor(); + TestEquals(); + TestCompareTo(); + } + +} diff --git a/proyecto-java/src/fp/coches/test/TestConcesionario.java b/proyecto-java/src/fp/coches/test/TestConcesionario.java new file mode 100644 index 0000000..ea66d87 --- /dev/null +++ b/proyecto-java/src/fp/coches/test/TestConcesionario.java @@ -0,0 +1,120 @@ +package fp.coches.test; + +import java.util.List; +import java.util.Scanner; + +import fp.coches.Coche; +import fp.coches.Concesionario; +import fp.coches.FactoriaCoches; +import fp.utiles.Mostrar; + +public class TestConcesionario { + private static Concesionario setCo = FactoriaCoches.leerCoches("./data/coches.csv"); + + public static void print(Object o) { + System.out.println(o); + } + + public static void initOptions() { + print("Elige una opción: "); + print("1. Métodos normales"); + print("2. Métodos con Stream"); + } + + public static void TesteoConcesionario() { + print("\n-------------- PRUEBA DE getNumeroCoches --------------"); + print("Número de coches: \n" + setCo.getNumeroCoches()); + print("---------------------------------------------------------"); + + print("\n-------------- PRUEBA DE existeCochePrecioMenor --------------"); + print("Existe coche con precio < 15000: \n" + setCo.existeCochePrecioMenor(15000)); + print("----------------------------------------------------------------"); + + print("\n-------------- PRUEBA DE getMediaLitros --------------"); + print("Media del tamaño del motor: \n" + setCo.getMediaLitros()); + print("--------------------------------------------------------"); + + print("\n-------------- PRUEBA DE getCochesPorMarca --------------"); + print("Coches de la marca Chevrolet:"); + List listaFiltradaCoches = setCo.getCochesPorMarca("Chevrolet"); + Mostrar.mostrar(listaFiltradaCoches, listaFiltradaCoches.size()); + print("-----------------------------------------------------------"); + + print("\n-------------- PRUEBA DE getCochesPorFecha --------------"); + print("Coches por fecha: \n" + setCo.getCochesPorFecha()); + print("-----------------------------------------------------------"); + + print("\n-------------- PRUEBA DE getNumeroCochesPorAnyo --------------"); + print("Número de coches por año: \n" + setCo.getNumeroCochesPorAnyo()); + print("----------------------------------------------------------------"); + } + + public static void TesteoConcesionarioStream() { + print("\n-------------- PRUEBA DE existeCochePrecioMenorStream --------------"); + print("Existe coche con precio < 15000: \n" + setCo.existeCochePrecioMenorStream(15000)); + print("----------------------------------------------------------------"); + + print("\n-------------- PRUEBA DE getMediaLitrosStream --------------"); + print("Media del tamaño del motor: \n" + setCo.getMediaLitrosStream()); + print("--------------------------------------------------------"); + + print("\n-------------- PRUEBA DE getCochesPorMarcaStream --------------"); + print("Coches de la marca Chevrolet:"); + List listaFiltradaCoches = setCo.getCochesPorMarcaStream("Chevrolet"); + Mostrar.mostrar(listaFiltradaCoches, listaFiltradaCoches.size()); + print("-----------------------------------------------------------"); + + print("\n-------------- PRUEBA DE getCocheMasCaroPorMarca --------------"); + print("Coche de la marca Audi más caro: \n" + setCo.getCocheMasCaroPorMarca("Audi")); + print("----------------------------------------------------------------"); + + print("\n-------------- PRUEBA DE getFiltroPrecioOrdenadoPorMarca --------------"); + print("Coches con precio <= 35000€ ordenados por marca:"); + List aux = setCo.getFiltroPrecioOrdenadoPorMarca(35000); + Mostrar.mostrar(aux, aux.size()); + print("----------------------------------------------------------------"); + + print("\n-------------- PRUEBA DE getCochesPorFechaStream --------------"); + print("Coches por fecha: \n" + setCo.getCochesPorFechaStream()); + print("-----------------------------------------------------------"); + + print("\n-------------- PRUEBA DE getFabricantesDistintos --------------"); + print("Fabricantes distintos: \n" + setCo.getFabricantesDistintos()); + print("-----------------------------------------------------------"); + + print("\n-------------- PRUEBA DE getCochesMasCarosPorFecha --------------"); + print("Coches más caros por fecha: \n" + setCo.getCochesMasCarosPorFecha()); + print("-----------------------------------------------------------"); + + print("\n-------------- PRUEBA DE getCochesConMejorMotorPorFabricante --------------"); + print("Coches con mejor motor por Fabricante: \n" + setCo.getCochesConMejorMotorPorFabricante()); + print("-----------------------------------------------------------"); + + print("\n-------------- PRUEBA DE getCocheMasCaro --------------"); + print("Coche más caro de todos y su fecha: \n" + setCo.getCocheMasCaro()); + print("-----------------------------------------------------------"); + } + + public static void main(String[] args) { + /* Se puede elegir ver los métodos normales + * o implementados con Stream para no tener que + * hacer scroll todo el rato para verlos. */ + initOptions(); + Scanner input = new Scanner(System.in); + int opcion = input.nextInt(); + input.close(); + while(true) { + if(opcion == 1) { + TesteoConcesionario(); + break; + } else if(opcion == 2) { + TesteoConcesionarioStream(); + break; + } else { + print("Error"); + break; + } + } + + } +} diff --git a/proyecto-java/src/fp/coches/test/TestConcesionarioDefensa.java b/proyecto-java/src/fp/coches/test/TestConcesionarioDefensa.java new file mode 100644 index 0000000..3ce5ac9 --- /dev/null +++ b/proyecto-java/src/fp/coches/test/TestConcesionarioDefensa.java @@ -0,0 +1,20 @@ +package fp.coches.test; + +import fp.coches.Concesionario; +import fp.coches.FactoriaCoches; + +public class TestConcesionarioDefensa { + private static Concesionario setCo = FactoriaCoches.leerCoches("./data/coches.csv"); + + public static void print(Object o) { + System.out.println(o); + } + + public static void main(String[] args) { + print("Media de precios de Audi: "+setCo.getMediaPreciosDelFabricante("Audi")); + print("Media de precios de Audi (Bucle): "+setCo.getMediaPreciosDelFabricanteBucle("Audi")); + print("Mediana de precios de Acura: "+setCo.getMedianaPreciosDelFabricante("Audi")); + print("Porcentaje de coches con precio mayor a 15000: "+setCo.getPorcentajeCochesConPrecioMayorA(15000.0)); + } + +} \ No newline at end of file diff --git a/proyecto-java/src/fp/coches/test/TestFactoriaCoches.java b/proyecto-java/src/fp/coches/test/TestFactoriaCoches.java new file mode 100644 index 0000000..5ba304b --- /dev/null +++ b/proyecto-java/src/fp/coches/test/TestFactoriaCoches.java @@ -0,0 +1,27 @@ +package fp.coches.test; + +import fp.coches.FactoriaCoches; +import fp.utiles.Mostrar; + +public class TestFactoriaCoches { + public static void print(Object o) { + System.out.println(o); + } + + public static void TestFactoria() { + print("-------------- PRUEBA DE FactoriaCoches -----------"); + print("[leerCoches]"); + Mostrar.mostrar(FactoriaCoches.leerCoches("./data/Coches.csv").getCoches(), 10); + print(".\n.\n."); + print("[leerCochesStream]"); + Mostrar.mostrar(FactoriaCoches.leerCochesStream("./data/Coches.csv").getCoches(), 10); + print(".\n.\n."); + print("---------------------------------------------------"); + } + + public static void main(String[] args) { + // TODO Apéndice de método generado automáticamente + TestFactoria(); + } + +} diff --git a/proyecto-java/src/fp/common/ColorCoche.java b/proyecto-java/src/fp/common/ColorCoche.java new file mode 100644 index 0000000..2c41ebc --- /dev/null +++ b/proyecto-java/src/fp/common/ColorCoche.java @@ -0,0 +1,15 @@ +package fp.common; + +public enum ColorCoche { + ROJO("ROJO"),NEGRO("NEGRO"),AMARILLO("AMARILLO"),AZUL("AZUL"),VERDE("VERDE"),BLANCO("BLANCO"),GRIS("GRIS"); + + private String color; + + ColorCoche(String s){ + this.color = s; + } + + public String getTipo() { + return color; + } +} diff --git a/proyecto-java/src/fp/common/Motor.java b/proyecto-java/src/fp/common/Motor.java new file mode 100644 index 0000000..55b10c7 --- /dev/null +++ b/proyecto-java/src/fp/common/Motor.java @@ -0,0 +1,83 @@ +package fp.common; + +import java.util.Objects; + +public class Motor implements Comparable { + private Double tamaño; + private Integer potencia; + private Double capacidad; + private Integer eficiencia; + + public Motor(double tamaño, int potencia, double capacidad, int eficiencia) { + /* Constructor que recibe todas las propiedades */ + this.tamaño = tamaño; + this.potencia = potencia; + this.capacidad = capacidad; + this.eficiencia = eficiencia; + } + + public Motor(String s) { + /* Constructor a partir de String */ + String[] partes = s.split(";"); + this.tamaño = Double.valueOf(partes[0].trim()); + this.potencia = Integer.decode(partes[1].trim()); + this.capacidad = Double.valueOf(partes[2].trim()); + this.eficiencia = Integer.decode(partes[3].trim()); + this.eficiencia = Integer.decode(partes[3].trim()); + } + + // GETTERS + public Double getTamaño() { + return tamaño; + } + + public Integer getPotencia() { + return potencia; + } + + public Double getCapacidad() { + return capacidad; + } + + public Integer getEficiencia() { + return eficiencia; + } + + //TOSTRING + @Override + public String toString() { + return "Motor [tamaño=" + tamaño + ", potencia=" + potencia + ", capacidad=" + capacidad + ", eficiencia=" + + eficiencia + "]"; + } + + //HASHCODE + @Override + public int hashCode() { + return Objects.hash(capacidad, eficiencia, potencia, tamaño); + } + + //EQUALS + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Motor other = (Motor) obj; + return Objects.equals(capacidad, other.capacidad) && Objects.equals(eficiencia, other.eficiencia) + && Objects.equals(potencia, other.potencia) && Objects.equals(tamaño, other.tamaño); + } + + //COMPARETO + @Override + public int compareTo(Motor o) { + // Compara todas las propiedades + this.getTamaño().compareTo(o.getTamaño()); + this.getPotencia().compareTo(o.getPotencia()); + this.getCapacidad().compareTo(o.getCapacidad()); + this.getEficiencia().compareTo(o.getEficiencia()); + return 0; + } +} diff --git a/proyecto-java/src/fp/common/TipoCoche.java b/proyecto-java/src/fp/common/TipoCoche.java new file mode 100644 index 0000000..18f5f9f --- /dev/null +++ b/proyecto-java/src/fp/common/TipoCoche.java @@ -0,0 +1,15 @@ +package fp.common; + +public enum TipoCoche { + Passenger("PASSENGER"), Car("CAR"); + + private String tipo; + + TipoCoche(String s){ + this.tipo = s; + } + + public String getTipo() { + return tipo; + } +} diff --git a/proyecto-java/src/fp/utiles/Checkers.java b/proyecto-java/src/fp/utiles/Checkers.java new file mode 100644 index 0000000..3a6685e --- /dev/null +++ b/proyecto-java/src/fp/utiles/Checkers.java @@ -0,0 +1,43 @@ +package fp.utiles; + +/** + * @author reinaqu + * Clase de utilidad con mtodos para facilitar la gestin de restricciones. + */ +public class Checkers { + + /** + * @param textoRestriccion + * Mensaje que se incluir en la excepcin elevada + * @param condicion + * Expresin booleana que ha de cumplirse para que no se eleve una excepcin + * @throws IllegalArgumentException si no se cumple la condicin + * + */ + public static void check(String textoRestriccion, Boolean condicion) { + if (!condicion) { + throw new IllegalArgumentException( + Thread.currentThread().getStackTrace()[2].getClassName() + + "." + + Thread.currentThread().getStackTrace()[2].getMethodName() + + ": " + + textoRestriccion); + } + } + + /** + * @param parametros Lista de parmetros para los que se quiere realizar una comprobacin de nulidad. + * @throws IllegalArgumentException si alguno de los parmetros es nulo. + */ + public static void checkNoNull(Object... parametros) { + for (int i = 0; i < parametros.length; i++) { + if (parametros[i] == null) { + throw new IllegalArgumentException( + Thread.currentThread().getStackTrace()[2].getClassName() + + "." + + Thread.currentThread().getStackTrace()[2].getMethodName() + + ": el parametro " + (i + 1) + " es nulo"); + } + } + } +} diff --git a/proyecto-java/src/fp/utiles/Fichero.java b/proyecto-java/src/fp/utiles/Fichero.java new file mode 100644 index 0000000..8894c1f --- /dev/null +++ b/proyecto-java/src/fp/utiles/Fichero.java @@ -0,0 +1,53 @@ +package fp.utiles; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.List; + +public class Fichero { + public static List leerFichero(String nomfich){ + /* Método que recibe un String que es la ruta del fichero a leer + * para luego intentar leer el fichero por línea y asignarlo en l. + * Lanza una IOException si hay algún error al leer el fichero. + * Devuelve la lista de Strings de haber leído el fichero. */ + List l=null; + try { + l = Files.lines(Paths.get(nomfich),StandardCharsets.UTF_8).toList(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } +// l.remove((int) 0); + return l; + } + public static List leerFichero(String nomfich, Boolean quitarCabecera){ + /* Método exactamente igual que el anterior pero que recibe un booleano + * como parámetro para elegir quitar la cabecera del CSV en caso de que + * tenga */ + List l=null; + try { + l = Files.readAllLines(Paths.get(nomfich),StandardCharsets.UTF_8); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + if(quitarCabecera) { + l.remove((int) 0); + } + return l; + } + public static void escribeFichero(List cadenas, String nombreFichero) { + /* Método que recibe como parámetro una lista de strings y una string que + * es la ruta del fichero donde se va a escribir dicha lista de strings + * línea por línea. Lanza una IOException si hay algún error al escribir + * en el fichero. */ + try { + Files.write(Paths.get(nombreFichero), cadenas, StandardCharsets.UTF_8); + } catch(IOException e) { + System.out.println("Error en la escritura del fichero"); + } + } +} diff --git a/proyecto-java/src/fp/utiles/Mostrar.java b/proyecto-java/src/fp/utiles/Mostrar.java new file mode 100644 index 0000000..ffb78b2 --- /dev/null +++ b/proyecto-java/src/fp/utiles/Mostrar.java @@ -0,0 +1,22 @@ +package fp.utiles; + +import java.util.Collection; + +public class Mostrar { + /* Bucle para imprimir una cantidad n de objetos de una colección*/ + public static void mostrar(Collection coleccion, Integer n) { + if (n> coleccion.size()) { + n= coleccion.size(); + } + int i = 0; + for (T e : coleccion) { + if (i< n) { + System.out.println(e); + }else { + break; + } + i++; + + } + } +} diff --git a/proyecto-java/src/fp/utiles/Parsers.java b/proyecto-java/src/fp/utiles/Parsers.java new file mode 100644 index 0000000..dab6fcc --- /dev/null +++ b/proyecto-java/src/fp/utiles/Parsers.java @@ -0,0 +1,23 @@ +package fp.utiles; + +import java.time.LocalDate; + +import fp.common.TipoCoche; + +public class Parsers { + /* Parsea PASSENGER y CAR del enumerado TipoCoche a los strings "Passenger" y "Car" */ + public static String tipoCocheParser(TipoCoche tipo) { + String res = null; + if(tipo==TipoCoche.Passenger) { + res = "Passenger"; + } else if(tipo==TipoCoche.Car) { + res = "Car"; + } + return res; + } + + public static String salidaMercadoParser(LocalDate fecha) { + /* Parsea la fecha a formato dd/MM/YYYY */ + return fecha.getDayOfMonth() + "/" + fecha.getMonthValue() + "/" + fecha.getYear(); + } +} diff --git a/proyecto-java/src/fp/utiles/Utiles.java b/proyecto-java/src/fp/utiles/Utiles.java new file mode 100644 index 0000000..5c89880 --- /dev/null +++ b/proyecto-java/src/fp/utiles/Utiles.java @@ -0,0 +1,20 @@ +package fp.utiles; + +import java.util.HashMap; +import java.util.Map; + +public class Utiles extends HashMap{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public String getKey(Object value) { + return this + .entrySet() + .stream() + .filter(entry -> value.equals(entry.getValue())) + .map(Map.Entry::getKey).toString(); + + } +} diff --git a/proyecto-python/LICENSE b/proyecto-python/LICENSE new file mode 100644 index 0000000..e62ec04 --- /dev/null +++ b/proyecto-python/LICENSE @@ -0,0 +1,674 @@ +GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/proyecto-python/README.md b/proyecto-python/README.md new file mode 100644 index 0000000..dc9fea8 --- /dev/null +++ b/proyecto-python/README.md @@ -0,0 +1,98 @@ +# Proyecto del Primer Cuatrimestre Fundamentos de Programación (Curso 22/23) +Autor/a: José Manuel Amador Gallardo    UVUS:XXXNNNN
+ +El dataset es una información sobre la empresa de alquiler de bicicletas, Capital Bikeshare en Washington D.C. durante los años 2011/2012. Consta de 16 columnas de las cuales una es de tipo fecha y el resto varía entre *int*, *float* y *bool*. + + +## Estructura de las carpetas del proyecto + +* **/src**: Contiene los diferentes módulos de Python que conforman el proyecto. + * **bike_renting_info.py**: Contiene las funciones principales del proyecto, como leer el fichero ```data.csv``` o varios filtros. + * **bike_renting_info_test.py**: Contiene las funciones que testean las funciones definidas en ```bike_renting_info.py```. +* **/src/modules**: Contiene los diferentes módulos de Python que conforman el proyecto. + * **parsers.py**: Contiene funciones auxiliares para hacer parse de algunos datos. +* **/data**: Contiene el dataset del proyecto. + * **data.csv**: Datos recopilados sobre la empresa de alquiler de bicicletas, Capital Bikeshare en Washington D.C. durante los años 2011/2012. + +## Estructura del *dataset* + +En el dataset se encuentran los siguientes datos: + +* **instant**: de tipo *int*, representa el índice del registro +* **dteday**: de tipo *datetime*, representa la fecha +* **season**: de tipo *int*, representa la estación +* **yr**: de tipo *bool*, representa el año +* **mnth**: de tipo *int*, representa el mes +* **holiday**: de tipo *bool*, representa si es vacaciones o no +* **weekday**: de tipo *int*, representa el día de la semana +* **workingday**: de tipo *bool*, representa si el día es laborable o no +* **weathersit**: de tipo *int*, representa el clima +* **temp**: de tipo *float*, representa la temperatura en Celsius +* **atemp**: de tipo *float*, representa la sensación térmica en Celsius +* **hum**: de tipo *float*, representa los valores de humedad +* **windspeed**: de tipo *float*, representa la velocidad del viento +* **casual**: de tipo *int*, representa los usuarios casuales (no registrados) +* **registered**: de tipo *int*, representa los usuarios registrados +* **cnt**: de tipo *int*, representa las bicicletas totales alquiladas entre casuales y registrados + +## Tipos implementados + +Se ha implementado una *namedtuple* llamada **tupla_datos** la cual almacena los datos del fichero .csv + +## Funciones implementadas + +### bike_renting_info.py + +#### BLOQUE I +* **lee_fichero**: Lee un fichero csv y añade sus líneas a una lista de namedtuples del tipo definido: Registro. +* **filtra_por_estacion**: Filtra los datos respecto a una estación y devuelve una lista con las namedtuples de tipo Registro de dicha estación. +* **total_usuarios_registrados_por_estacion**: Calcula el total de usuarios registrados en una estación concreta. + +#### BLOQUE II +* **maximo_usuarios_registrados_por_estacion_y_año**: Devuelve el número de usuarios registrados durante una estación de un año específico. +* **ordena_usuarios_registrados_por_estacion_y_año**: Devuelve una lista de namedtuples tipo Registro ordenadas de mayor a menor según el valor numérico de los usuarios registrados para una estación y año concretos. +* **vacaciones_por_mes_y_año**: Devuelve un diccionario con los días que son festivos de cada mes. En el diccionario las claves son los meses y los valores son listas con los días (dd/MM/YYYY). + +#### BLOQUE III +* **total_laborables_por_mes_y_año**: Devuelve un diccionario en el cuál las claves son los meses y los valores el total de días laborables (int). +* **moda_temperatura**: Devuelve el valor de temperatura más repetido durante los dos años. +* **humedad_maxima_por_mes_y_año**: Devuelve un diccionario con el máximo porcentual de humedad filtrado por mes y año. En el diccionario las claves son los meses y el valor el máximo de temperatura (float). +* **incremento_usuarios_registrados**: Devuelve una lista con los incrementos porcentuales del 2012 respecto al 2011. Cada valor corresponde a un mes [ 0->Enero,1->Febrero,...,12->Diciembre ] + +#### BLOQUE IV +* **dibuja_grafica_incremento_usuarios_registrados**: Grafica una gráfica respecto a los incrementos porcentuales mencionados. + +### bike_renting_info_test.py + +#### BLOQUE I +* **lee_fichero_test**: Testea la función *lee_fichero* printeando los registros leídos y dos intervalos de datos. +* **filtra_por_estacion_test**: Testea la función *filtra_por_estacion* printeando los registros leídos y dos intervalos de datos. +* **total_usuarios_registrados_por_estacion_test**: Testea la función *total_usuarios_registrados_por_estacion* printeando la cantidad total de usuarios registrados en una estación. + +#### BLOQUE II +* **maximo_usuarios_registrados_por_estacion_y_año_test**: Testea la función *maximo_usuarios_registrados_por_estacion_y_año* printeando el máximo de usuarios registrados según los parámetros dados (estación y año). +* **ordena_usuarios_registrados_por_estacion_y_año_test**: Testea la función *ordena_usuarios_registrados_por_estacion_y_año* printeando la lista de namedtuples tipo Registro ordenadas según usuarios registrados. +* **vacaciones_por_mes_y_año_test**: Testea la función *vacaciones_por_mes_y_año* y devuelve los datos de los días que son festivos, en su formato de fecha completa, metidos en una lista. Dicha lista es el valor de las claves del diccionario, que son los meses. + +#### BLOQUE III +* **total_laborables_por_mes_y_año_test**: Testea la función *total_laborables_por_mes_y_año* printeando el diccionario completo. +* **moda_temperatura_test**: Testea la función *moda_temperatura* printeando la moda de temperatura. +* **humedad_maxima_por_mes_y_año_test**: Testea la función *humedad_maxima_por_mes_y_año* printeando el diccionario completo. +* **incremento_usuarios_registrados_test**: Testea la función *incremento_usuarios_registrados* los incrementos porcentuales por mes. + +#### BLOQUE IV +* **dibuja_grafica_incremento_usuarios_registrados_test**: Testea la función *dibuja_grafica_incremento_usuarios_registrados* graficando una gráfica respecto a los incrementos porcentuales mencionados. + +### parsers.py +* **year_parser**: Convierte el *bool* de *yr* en un *int* año. +* **season_parser**: Convierte el *int* de *season* en un *string* con el nombre de la estación. +* **weekday_parser**: Convierte el *int* de weekday en un *string* con el nombre del día de la semana. +* **month_parser**: Convierte el *int* de *mnth* en un *string* con el nombre del mes. +* **temp_parser**: Multiplica la temperatura por su máximo. +* **atemp_parser**: Multiplica la sensación térmica por su máximo. +* **hum_parser**: Multiplica la humedad por su máximo. +* **wind_parser**: Multiplica la velocidad del viento por su máximo. +* **num_to_word**: Parsea los años *2011* y *2012* a *DosMilOnce* y *DosMilDoce* para usos posteriores en una namedtuple. +* **date_parser**: Convierte el *string* de *dteday* en *datetime*. +* **int_to_bool**: Convierte los *int* 1 y 0 a los *bool* True y False. +* **bcolors (class)**: Un class para aplicar colores a la consola y mejorar la legibilidad. diff --git a/proyecto-python/data/data.csv b/proyecto-python/data/data.csv new file mode 100644 index 0000000..245758a --- /dev/null +++ b/proyecto-python/data/data.csv @@ -0,0 +1,732 @@ +instant,dteday,season,yr,mnth,holiday,weekday,workingday,weathersit,temp,atemp,hum,windspeed,casual,registered,cnt +1,2011-01-01,1,0,1,0,6,0,2,0.344167,0.363625,0.805833,0.160446,331,654,985 +2,2011-01-02,1,0,1,0,0,0,2,0.363478,0.353739,0.696087,0.248539,131,670,801 +3,2011-01-03,1,0,1,0,1,1,1,0.196364,0.189405,0.437273,0.248309,120,1229,1349 +4,2011-01-04,1,0,1,0,2,1,1,0.2,0.212122,0.590435,0.160296,108,1454,1562 +5,2011-01-05,1,0,1,0,3,1,1,0.226957,0.22927,0.436957,0.1869,82,1518,1600 +6,2011-01-06,1,0,1,0,4,1,1,0.204348,0.233209,0.518261,0.0895652,88,1518,1606 +7,2011-01-07,1,0,1,0,5,1,2,0.196522,0.208839,0.498696,0.168726,148,1362,1510 +8,2011-01-08,1,0,1,0,6,0,2,0.165,0.162254,0.535833,0.266804,68,891,959 +9,2011-01-09,1,0,1,0,0,0,1,0.138333,0.116175,0.434167,0.36195,54,768,822 +10,2011-01-10,1,0,1,0,1,1,1,0.150833,0.150888,0.482917,0.223267,41,1280,1321 +11,2011-01-11,1,0,1,0,2,1,2,0.169091,0.191464,0.686364,0.122132,43,1220,1263 +12,2011-01-12,1,0,1,0,3,1,1,0.172727,0.160473,0.599545,0.304627,25,1137,1162 +13,2011-01-13,1,0,1,0,4,1,1,0.165,0.150883,0.470417,0.301,38,1368,1406 +14,2011-01-14,1,0,1,0,5,1,1,0.16087,0.188413,0.537826,0.126548,54,1367,1421 +15,2011-01-15,1,0,1,0,6,0,2,0.233333,0.248112,0.49875,0.157963,222,1026,1248 +16,2011-01-16,1,0,1,0,0,0,1,0.231667,0.234217,0.48375,0.188433,251,953,1204 +17,2011-01-17,1,0,1,1,1,0,2,0.175833,0.176771,0.5375,0.194017,117,883,1000 +18,2011-01-18,1,0,1,0,2,1,2,0.216667,0.232333,0.861667,0.146775,9,674,683 +19,2011-01-19,1,0,1,0,3,1,2,0.292174,0.298422,0.741739,0.208317,78,1572,1650 +20,2011-01-20,1,0,1,0,4,1,2,0.261667,0.25505,0.538333,0.195904,83,1844,1927 +21,2011-01-21,1,0,1,0,5,1,1,0.1775,0.157833,0.457083,0.353242,75,1468,1543 +22,2011-01-22,1,0,1,0,6,0,1,0.0591304,0.0790696,0.4,0.17197,93,888,981 +23,2011-01-23,1,0,1,0,0,0,1,0.0965217,0.0988391,0.436522,0.2466,150,836,986 +24,2011-01-24,1,0,1,0,1,1,1,0.0973913,0.11793,0.491739,0.15833,86,1330,1416 +25,2011-01-25,1,0,1,0,2,1,2,0.223478,0.234526,0.616957,0.129796,186,1799,1985 +26,2011-01-26,1,0,1,0,3,1,3,0.2175,0.2036,0.8625,0.29385,34,472,506 +27,2011-01-27,1,0,1,0,4,1,1,0.195,0.2197,0.6875,0.113837,15,416,431 +28,2011-01-28,1,0,1,0,5,1,2,0.203478,0.223317,0.793043,0.1233,38,1129,1167 +29,2011-01-29,1,0,1,0,6,0,1,0.196522,0.212126,0.651739,0.145365,123,975,1098 +30,2011-01-30,1,0,1,0,0,0,1,0.216522,0.250322,0.722174,0.0739826,140,956,1096 +31,2011-01-31,1,0,1,0,1,1,2,0.180833,0.18625,0.60375,0.187192,42,1459,1501 +32,2011-02-01,1,0,2,0,2,1,2,0.192174,0.23453,0.829565,0.053213,47,1313,1360 +33,2011-02-02,1,0,2,0,3,1,2,0.26,0.254417,0.775417,0.264308,72,1454,1526 +34,2011-02-03,1,0,2,0,4,1,1,0.186957,0.177878,0.437826,0.277752,61,1489,1550 +35,2011-02-04,1,0,2,0,5,1,2,0.211304,0.228587,0.585217,0.127839,88,1620,1708 +36,2011-02-05,1,0,2,0,6,0,2,0.233333,0.243058,0.929167,0.161079,100,905,1005 +37,2011-02-06,1,0,2,0,0,0,1,0.285833,0.291671,0.568333,0.1418,354,1269,1623 +38,2011-02-07,1,0,2,0,1,1,1,0.271667,0.303658,0.738333,0.0454083,120,1592,1712 +39,2011-02-08,1,0,2,0,2,1,1,0.220833,0.198246,0.537917,0.36195,64,1466,1530 +40,2011-02-09,1,0,2,0,3,1,2,0.134783,0.144283,0.494783,0.188839,53,1552,1605 +41,2011-02-10,1,0,2,0,4,1,1,0.144348,0.149548,0.437391,0.221935,47,1491,1538 +42,2011-02-11,1,0,2,0,5,1,1,0.189091,0.213509,0.506364,0.10855,149,1597,1746 +43,2011-02-12,1,0,2,0,6,0,1,0.2225,0.232954,0.544167,0.203367,288,1184,1472 +44,2011-02-13,1,0,2,0,0,0,1,0.316522,0.324113,0.457391,0.260883,397,1192,1589 +45,2011-02-14,1,0,2,0,1,1,1,0.415,0.39835,0.375833,0.417908,208,1705,1913 +46,2011-02-15,1,0,2,0,2,1,1,0.266087,0.254274,0.314348,0.291374,140,1675,1815 +47,2011-02-16,1,0,2,0,3,1,1,0.318261,0.3162,0.423478,0.251791,218,1897,2115 +48,2011-02-17,1,0,2,0,4,1,1,0.435833,0.428658,0.505,0.230104,259,2216,2475 +49,2011-02-18,1,0,2,0,5,1,1,0.521667,0.511983,0.516667,0.264925,579,2348,2927 +50,2011-02-19,1,0,2,0,6,0,1,0.399167,0.391404,0.187917,0.507463,532,1103,1635 +51,2011-02-20,1,0,2,0,0,0,1,0.285217,0.27733,0.407826,0.223235,639,1173,1812 +52,2011-02-21,1,0,2,1,1,0,2,0.303333,0.284075,0.605,0.307846,195,912,1107 +53,2011-02-22,1,0,2,0,2,1,1,0.182222,0.186033,0.577778,0.195683,74,1376,1450 +54,2011-02-23,1,0,2,0,3,1,1,0.221739,0.245717,0.423043,0.094113,139,1778,1917 +55,2011-02-24,1,0,2,0,4,1,2,0.295652,0.289191,0.697391,0.250496,100,1707,1807 +56,2011-02-25,1,0,2,0,5,1,2,0.364348,0.350461,0.712174,0.346539,120,1341,1461 +57,2011-02-26,1,0,2,0,6,0,1,0.2825,0.282192,0.537917,0.186571,424,1545,1969 +58,2011-02-27,1,0,2,0,0,0,1,0.343478,0.351109,0.68,0.125248,694,1708,2402 +59,2011-02-28,1,0,2,0,1,1,2,0.407273,0.400118,0.876364,0.289686,81,1365,1446 +60,2011-03-01,1,0,3,0,2,1,1,0.266667,0.263879,0.535,0.216425,137,1714,1851 +61,2011-03-02,1,0,3,0,3,1,1,0.335,0.320071,0.449583,0.307833,231,1903,2134 +62,2011-03-03,1,0,3,0,4,1,1,0.198333,0.200133,0.318333,0.225754,123,1562,1685 +63,2011-03-04,1,0,3,0,5,1,2,0.261667,0.255679,0.610417,0.203346,214,1730,1944 +64,2011-03-05,1,0,3,0,6,0,2,0.384167,0.378779,0.789167,0.251871,640,1437,2077 +65,2011-03-06,1,0,3,0,0,0,2,0.376522,0.366252,0.948261,0.343287,114,491,605 +66,2011-03-07,1,0,3,0,1,1,1,0.261739,0.238461,0.551304,0.341352,244,1628,1872 +67,2011-03-08,1,0,3,0,2,1,1,0.2925,0.3024,0.420833,0.12065,316,1817,2133 +68,2011-03-09,1,0,3,0,3,1,2,0.295833,0.286608,0.775417,0.22015,191,1700,1891 +69,2011-03-10,1,0,3,0,4,1,3,0.389091,0.385668,0,0.261877,46,577,623 +70,2011-03-11,1,0,3,0,5,1,2,0.316522,0.305,0.649565,0.23297,247,1730,1977 +71,2011-03-12,1,0,3,0,6,0,1,0.329167,0.32575,0.594583,0.220775,724,1408,2132 +72,2011-03-13,1,0,3,0,0,0,1,0.384348,0.380091,0.527391,0.270604,982,1435,2417 +73,2011-03-14,1,0,3,0,1,1,1,0.325217,0.332,0.496957,0.136926,359,1687,2046 +74,2011-03-15,1,0,3,0,2,1,2,0.317391,0.318178,0.655652,0.184309,289,1767,2056 +75,2011-03-16,1,0,3,0,3,1,2,0.365217,0.36693,0.776522,0.203117,321,1871,2192 +76,2011-03-17,1,0,3,0,4,1,1,0.415,0.410333,0.602917,0.209579,424,2320,2744 +77,2011-03-18,1,0,3,0,5,1,1,0.54,0.527009,0.525217,0.231017,884,2355,3239 +78,2011-03-19,1,0,3,0,6,0,1,0.4725,0.466525,0.379167,0.368167,1424,1693,3117 +79,2011-03-20,1,0,3,0,0,0,1,0.3325,0.32575,0.47375,0.207721,1047,1424,2471 +80,2011-03-21,2,0,3,0,1,1,2,0.430435,0.409735,0.737391,0.288783,401,1676,2077 +81,2011-03-22,2,0,3,0,2,1,1,0.441667,0.440642,0.624583,0.22575,460,2243,2703 +82,2011-03-23,2,0,3,0,3,1,2,0.346957,0.337939,0.839565,0.234261,203,1918,2121 +83,2011-03-24,2,0,3,0,4,1,2,0.285,0.270833,0.805833,0.243787,166,1699,1865 +84,2011-03-25,2,0,3,0,5,1,1,0.264167,0.256312,0.495,0.230725,300,1910,2210 +85,2011-03-26,2,0,3,0,6,0,1,0.265833,0.257571,0.394167,0.209571,981,1515,2496 +86,2011-03-27,2,0,3,0,0,0,2,0.253043,0.250339,0.493913,0.1843,472,1221,1693 +87,2011-03-28,2,0,3,0,1,1,1,0.264348,0.257574,0.302174,0.212204,222,1806,2028 +88,2011-03-29,2,0,3,0,2,1,1,0.3025,0.292908,0.314167,0.226996,317,2108,2425 +89,2011-03-30,2,0,3,0,3,1,2,0.3,0.29735,0.646667,0.172888,168,1368,1536 +90,2011-03-31,2,0,3,0,4,1,3,0.268333,0.257575,0.918333,0.217646,179,1506,1685 +91,2011-04-01,2,0,4,0,5,1,2,0.3,0.283454,0.68625,0.258708,307,1920,2227 +92,2011-04-02,2,0,4,0,6,0,2,0.315,0.315637,0.65375,0.197146,898,1354,2252 +93,2011-04-03,2,0,4,0,0,0,1,0.378333,0.378767,0.48,0.182213,1651,1598,3249 +94,2011-04-04,2,0,4,0,1,1,1,0.573333,0.542929,0.42625,0.385571,734,2381,3115 +95,2011-04-05,2,0,4,0,2,1,2,0.414167,0.39835,0.642083,0.388067,167,1628,1795 +96,2011-04-06,2,0,4,0,3,1,1,0.390833,0.387608,0.470833,0.263063,413,2395,2808 +97,2011-04-07,2,0,4,0,4,1,1,0.4375,0.433696,0.602917,0.162312,571,2570,3141 +98,2011-04-08,2,0,4,0,5,1,2,0.335833,0.324479,0.83625,0.226992,172,1299,1471 +99,2011-04-09,2,0,4,0,6,0,2,0.3425,0.341529,0.8775,0.133083,879,1576,2455 +100,2011-04-10,2,0,4,0,0,0,2,0.426667,0.426737,0.8575,0.146767,1188,1707,2895 +101,2011-04-11,2,0,4,0,1,1,2,0.595652,0.565217,0.716956,0.324474,855,2493,3348 +102,2011-04-12,2,0,4,0,2,1,2,0.5025,0.493054,0.739167,0.274879,257,1777,2034 +103,2011-04-13,2,0,4,0,3,1,2,0.4125,0.417283,0.819167,0.250617,209,1953,2162 +104,2011-04-14,2,0,4,0,4,1,1,0.4675,0.462742,0.540417,0.1107,529,2738,3267 +105,2011-04-15,2,0,4,1,5,0,1,0.446667,0.441913,0.67125,0.226375,642,2484,3126 +106,2011-04-16,2,0,4,0,6,0,3,0.430833,0.425492,0.888333,0.340808,121,674,795 +107,2011-04-17,2,0,4,0,0,0,1,0.456667,0.445696,0.479583,0.303496,1558,2186,3744 +108,2011-04-18,2,0,4,0,1,1,1,0.5125,0.503146,0.5425,0.163567,669,2760,3429 +109,2011-04-19,2,0,4,0,2,1,2,0.505833,0.489258,0.665833,0.157971,409,2795,3204 +110,2011-04-20,2,0,4,0,3,1,1,0.595,0.564392,0.614167,0.241925,613,3331,3944 +111,2011-04-21,2,0,4,0,4,1,1,0.459167,0.453892,0.407083,0.325258,745,3444,4189 +112,2011-04-22,2,0,4,0,5,1,2,0.336667,0.321954,0.729583,0.219521,177,1506,1683 +113,2011-04-23,2,0,4,0,6,0,2,0.46,0.450121,0.887917,0.230725,1462,2574,4036 +114,2011-04-24,2,0,4,0,0,0,2,0.581667,0.551763,0.810833,0.192175,1710,2481,4191 +115,2011-04-25,2,0,4,0,1,1,1,0.606667,0.5745,0.776667,0.185333,773,3300,4073 +116,2011-04-26,2,0,4,0,2,1,1,0.631667,0.594083,0.729167,0.3265,678,3722,4400 +117,2011-04-27,2,0,4,0,3,1,2,0.62,0.575142,0.835417,0.3122,547,3325,3872 +118,2011-04-28,2,0,4,0,4,1,2,0.6175,0.578929,0.700833,0.320908,569,3489,4058 +119,2011-04-29,2,0,4,0,5,1,1,0.51,0.497463,0.457083,0.240063,878,3717,4595 +120,2011-04-30,2,0,4,0,6,0,1,0.4725,0.464021,0.503333,0.235075,1965,3347,5312 +121,2011-05-01,2,0,5,0,0,0,2,0.451667,0.448204,0.762083,0.106354,1138,2213,3351 +122,2011-05-02,2,0,5,0,1,1,2,0.549167,0.532833,0.73,0.183454,847,3554,4401 +123,2011-05-03,2,0,5,0,2,1,2,0.616667,0.582079,0.697083,0.342667,603,3848,4451 +124,2011-05-04,2,0,5,0,3,1,2,0.414167,0.40465,0.737083,0.328996,255,2378,2633 +125,2011-05-05,2,0,5,0,4,1,1,0.459167,0.441917,0.444167,0.295392,614,3819,4433 +126,2011-05-06,2,0,5,0,5,1,1,0.479167,0.474117,0.59,0.228246,894,3714,4608 +127,2011-05-07,2,0,5,0,6,0,1,0.52,0.512621,0.54125,0.16045,1612,3102,4714 +128,2011-05-08,2,0,5,0,0,0,1,0.528333,0.518933,0.631667,0.0746375,1401,2932,4333 +129,2011-05-09,2,0,5,0,1,1,1,0.5325,0.525246,0.58875,0.176,664,3698,4362 +130,2011-05-10,2,0,5,0,2,1,1,0.5325,0.522721,0.489167,0.115671,694,4109,4803 +131,2011-05-11,2,0,5,0,3,1,1,0.5425,0.5284,0.632917,0.120642,550,3632,4182 +132,2011-05-12,2,0,5,0,4,1,1,0.535,0.523363,0.7475,0.189667,695,4169,4864 +133,2011-05-13,2,0,5,0,5,1,2,0.5125,0.4943,0.863333,0.179725,692,3413,4105 +134,2011-05-14,2,0,5,0,6,0,2,0.520833,0.500629,0.9225,0.13495,902,2507,3409 +135,2011-05-15,2,0,5,0,0,0,2,0.5625,0.536,0.867083,0.152979,1582,2971,4553 +136,2011-05-16,2,0,5,0,1,1,1,0.5775,0.550512,0.787917,0.126871,773,3185,3958 +137,2011-05-17,2,0,5,0,2,1,2,0.561667,0.538529,0.837917,0.277354,678,3445,4123 +138,2011-05-18,2,0,5,0,3,1,2,0.55,0.527158,0.87,0.201492,536,3319,3855 +139,2011-05-19,2,0,5,0,4,1,2,0.530833,0.510742,0.829583,0.108213,735,3840,4575 +140,2011-05-20,2,0,5,0,5,1,1,0.536667,0.529042,0.719583,0.125013,909,4008,4917 +141,2011-05-21,2,0,5,0,6,0,1,0.6025,0.571975,0.626667,0.12065,2258,3547,5805 +142,2011-05-22,2,0,5,0,0,0,1,0.604167,0.5745,0.749583,0.148008,1576,3084,4660 +143,2011-05-23,2,0,5,0,1,1,2,0.631667,0.590296,0.81,0.233842,836,3438,4274 +144,2011-05-24,2,0,5,0,2,1,2,0.66,0.604813,0.740833,0.207092,659,3833,4492 +145,2011-05-25,2,0,5,0,3,1,1,0.660833,0.615542,0.69625,0.154233,740,4238,4978 +146,2011-05-26,2,0,5,0,4,1,1,0.708333,0.654688,0.6775,0.199642,758,3919,4677 +147,2011-05-27,2,0,5,0,5,1,1,0.681667,0.637008,0.65375,0.240679,871,3808,4679 +148,2011-05-28,2,0,5,0,6,0,1,0.655833,0.612379,0.729583,0.230092,2001,2757,4758 +149,2011-05-29,2,0,5,0,0,0,1,0.6675,0.61555,0.81875,0.213938,2355,2433,4788 +150,2011-05-30,2,0,5,1,1,0,1,0.733333,0.671092,0.685,0.131225,1549,2549,4098 +151,2011-05-31,2,0,5,0,2,1,1,0.775,0.725383,0.636667,0.111329,673,3309,3982 +152,2011-06-01,2,0,6,0,3,1,2,0.764167,0.720967,0.677083,0.207092,513,3461,3974 +153,2011-06-02,2,0,6,0,4,1,1,0.715,0.643942,0.305,0.292287,736,4232,4968 +154,2011-06-03,2,0,6,0,5,1,1,0.62,0.587133,0.354167,0.253121,898,4414,5312 +155,2011-06-04,2,0,6,0,6,0,1,0.635,0.594696,0.45625,0.123142,1869,3473,5342 +156,2011-06-05,2,0,6,0,0,0,2,0.648333,0.616804,0.6525,0.138692,1685,3221,4906 +157,2011-06-06,2,0,6,0,1,1,1,0.678333,0.621858,0.6,0.121896,673,3875,4548 +158,2011-06-07,2,0,6,0,2,1,1,0.7075,0.65595,0.597917,0.187808,763,4070,4833 +159,2011-06-08,2,0,6,0,3,1,1,0.775833,0.727279,0.622083,0.136817,676,3725,4401 +160,2011-06-09,2,0,6,0,4,1,2,0.808333,0.757579,0.568333,0.149883,563,3352,3915 +161,2011-06-10,2,0,6,0,5,1,1,0.755,0.703292,0.605,0.140554,815,3771,4586 +162,2011-06-11,2,0,6,0,6,0,1,0.725,0.678038,0.654583,0.15485,1729,3237,4966 +163,2011-06-12,2,0,6,0,0,0,1,0.6925,0.643325,0.747917,0.163567,1467,2993,4460 +164,2011-06-13,2,0,6,0,1,1,1,0.635,0.601654,0.494583,0.30535,863,4157,5020 +165,2011-06-14,2,0,6,0,2,1,1,0.604167,0.591546,0.507083,0.269283,727,4164,4891 +166,2011-06-15,2,0,6,0,3,1,1,0.626667,0.587754,0.471667,0.167912,769,4411,5180 +167,2011-06-16,2,0,6,0,4,1,2,0.628333,0.595346,0.688333,0.206471,545,3222,3767 +168,2011-06-17,2,0,6,0,5,1,1,0.649167,0.600383,0.735833,0.143029,863,3981,4844 +169,2011-06-18,2,0,6,0,6,0,1,0.696667,0.643954,0.670417,0.119408,1807,3312,5119 +170,2011-06-19,2,0,6,0,0,0,2,0.699167,0.645846,0.666667,0.102,1639,3105,4744 +171,2011-06-20,2,0,6,0,1,1,2,0.635,0.595346,0.74625,0.155475,699,3311,4010 +172,2011-06-21,3,0,6,0,2,1,2,0.680833,0.637646,0.770417,0.171025,774,4061,4835 +173,2011-06-22,3,0,6,0,3,1,1,0.733333,0.693829,0.7075,0.172262,661,3846,4507 +174,2011-06-23,3,0,6,0,4,1,2,0.728333,0.693833,0.703333,0.238804,746,4044,4790 +175,2011-06-24,3,0,6,0,5,1,1,0.724167,0.656583,0.573333,0.222025,969,4022,4991 +176,2011-06-25,3,0,6,0,6,0,1,0.695,0.643313,0.483333,0.209571,1782,3420,5202 +177,2011-06-26,3,0,6,0,0,0,1,0.68,0.637629,0.513333,0.0945333,1920,3385,5305 +178,2011-06-27,3,0,6,0,1,1,2,0.6825,0.637004,0.658333,0.107588,854,3854,4708 +179,2011-06-28,3,0,6,0,2,1,1,0.744167,0.692558,0.634167,0.144283,732,3916,4648 +180,2011-06-29,3,0,6,0,3,1,1,0.728333,0.654688,0.497917,0.261821,848,4377,5225 +181,2011-06-30,3,0,6,0,4,1,1,0.696667,0.637008,0.434167,0.185312,1027,4488,5515 +182,2011-07-01,3,0,7,0,5,1,1,0.7225,0.652162,0.39625,0.102608,1246,4116,5362 +183,2011-07-02,3,0,7,0,6,0,1,0.738333,0.667308,0.444583,0.115062,2204,2915,5119 +184,2011-07-03,3,0,7,0,0,0,2,0.716667,0.668575,0.6825,0.228858,2282,2367,4649 +185,2011-07-04,3,0,7,1,1,0,2,0.726667,0.665417,0.637917,0.0814792,3065,2978,6043 +186,2011-07-05,3,0,7,0,2,1,1,0.746667,0.696338,0.590417,0.126258,1031,3634,4665 +187,2011-07-06,3,0,7,0,3,1,1,0.72,0.685633,0.743333,0.149883,784,3845,4629 +188,2011-07-07,3,0,7,0,4,1,1,0.75,0.686871,0.65125,0.1592,754,3838,4592 +189,2011-07-08,3,0,7,0,5,1,2,0.709167,0.670483,0.757917,0.225129,692,3348,4040 +190,2011-07-09,3,0,7,0,6,0,1,0.733333,0.664158,0.609167,0.167912,1988,3348,5336 +191,2011-07-10,3,0,7,0,0,0,1,0.7475,0.690025,0.578333,0.183471,1743,3138,4881 +192,2011-07-11,3,0,7,0,1,1,1,0.7625,0.729804,0.635833,0.282337,723,3363,4086 +193,2011-07-12,3,0,7,0,2,1,1,0.794167,0.739275,0.559167,0.200254,662,3596,4258 +194,2011-07-13,3,0,7,0,3,1,1,0.746667,0.689404,0.631667,0.146133,748,3594,4342 +195,2011-07-14,3,0,7,0,4,1,1,0.680833,0.635104,0.47625,0.240667,888,4196,5084 +196,2011-07-15,3,0,7,0,5,1,1,0.663333,0.624371,0.59125,0.182833,1318,4220,5538 +197,2011-07-16,3,0,7,0,6,0,1,0.686667,0.638263,0.585,0.208342,2418,3505,5923 +198,2011-07-17,3,0,7,0,0,0,1,0.719167,0.669833,0.604167,0.245033,2006,3296,5302 +199,2011-07-18,3,0,7,0,1,1,1,0.746667,0.703925,0.65125,0.215804,841,3617,4458 +200,2011-07-19,3,0,7,0,2,1,1,0.776667,0.747479,0.650417,0.1306,752,3789,4541 +201,2011-07-20,3,0,7,0,3,1,1,0.768333,0.74685,0.707083,0.113817,644,3688,4332 +202,2011-07-21,3,0,7,0,4,1,2,0.815,0.826371,0.69125,0.222021,632,3152,3784 +203,2011-07-22,3,0,7,0,5,1,1,0.848333,0.840896,0.580417,0.1331,562,2825,3387 +204,2011-07-23,3,0,7,0,6,0,1,0.849167,0.804287,0.5,0.131221,987,2298,3285 +205,2011-07-24,3,0,7,0,0,0,1,0.83,0.794829,0.550833,0.169171,1050,2556,3606 +206,2011-07-25,3,0,7,0,1,1,1,0.743333,0.720958,0.757083,0.0908083,568,3272,3840 +207,2011-07-26,3,0,7,0,2,1,1,0.771667,0.696979,0.540833,0.200258,750,3840,4590 +208,2011-07-27,3,0,7,0,3,1,1,0.775,0.690667,0.402917,0.183463,755,3901,4656 +209,2011-07-28,3,0,7,0,4,1,1,0.779167,0.7399,0.583333,0.178479,606,3784,4390 +210,2011-07-29,3,0,7,0,5,1,1,0.838333,0.785967,0.5425,0.174138,670,3176,3846 +211,2011-07-30,3,0,7,0,6,0,1,0.804167,0.728537,0.465833,0.168537,1559,2916,4475 +212,2011-07-31,3,0,7,0,0,0,1,0.805833,0.729796,0.480833,0.164813,1524,2778,4302 +213,2011-08-01,3,0,8,0,1,1,1,0.771667,0.703292,0.550833,0.156717,729,3537,4266 +214,2011-08-02,3,0,8,0,2,1,1,0.783333,0.707071,0.49125,0.20585,801,4044,4845 +215,2011-08-03,3,0,8,0,3,1,2,0.731667,0.679937,0.6575,0.135583,467,3107,3574 +216,2011-08-04,3,0,8,0,4,1,2,0.71,0.664788,0.7575,0.19715,799,3777,4576 +217,2011-08-05,3,0,8,0,5,1,1,0.710833,0.656567,0.630833,0.184696,1023,3843,4866 +218,2011-08-06,3,0,8,0,6,0,2,0.716667,0.676154,0.755,0.22825,1521,2773,4294 +219,2011-08-07,3,0,8,0,0,0,1,0.7425,0.715292,0.752917,0.201487,1298,2487,3785 +220,2011-08-08,3,0,8,0,1,1,1,0.765,0.703283,0.592083,0.192175,846,3480,4326 +221,2011-08-09,3,0,8,0,2,1,1,0.775,0.724121,0.570417,0.151121,907,3695,4602 +222,2011-08-10,3,0,8,0,3,1,1,0.766667,0.684983,0.424167,0.200258,884,3896,4780 +223,2011-08-11,3,0,8,0,4,1,1,0.7175,0.651521,0.42375,0.164796,812,3980,4792 +224,2011-08-12,3,0,8,0,5,1,1,0.708333,0.654042,0.415,0.125621,1051,3854,4905 +225,2011-08-13,3,0,8,0,6,0,2,0.685833,0.645858,0.729583,0.211454,1504,2646,4150 +226,2011-08-14,3,0,8,0,0,0,2,0.676667,0.624388,0.8175,0.222633,1338,2482,3820 +227,2011-08-15,3,0,8,0,1,1,1,0.665833,0.616167,0.712083,0.208954,775,3563,4338 +228,2011-08-16,3,0,8,0,2,1,1,0.700833,0.645837,0.578333,0.236329,721,4004,4725 +229,2011-08-17,3,0,8,0,3,1,1,0.723333,0.666671,0.575417,0.143667,668,4026,4694 +230,2011-08-18,3,0,8,0,4,1,1,0.711667,0.662258,0.654583,0.233208,639,3166,3805 +231,2011-08-19,3,0,8,0,5,1,2,0.685,0.633221,0.722917,0.139308,797,3356,4153 +232,2011-08-20,3,0,8,0,6,0,1,0.6975,0.648996,0.674167,0.104467,1914,3277,5191 +233,2011-08-21,3,0,8,0,0,0,1,0.710833,0.675525,0.77,0.248754,1249,2624,3873 +234,2011-08-22,3,0,8,0,1,1,1,0.691667,0.638254,0.47,0.27675,833,3925,4758 +235,2011-08-23,3,0,8,0,2,1,1,0.640833,0.606067,0.455417,0.146763,1281,4614,5895 +236,2011-08-24,3,0,8,0,3,1,1,0.673333,0.630692,0.605,0.253108,949,4181,5130 +237,2011-08-25,3,0,8,0,4,1,2,0.684167,0.645854,0.771667,0.210833,435,3107,3542 +238,2011-08-26,3,0,8,0,5,1,1,0.7,0.659733,0.76125,0.0839625,768,3893,4661 +239,2011-08-27,3,0,8,0,6,0,2,0.68,0.635556,0.85,0.375617,226,889,1115 +240,2011-08-28,3,0,8,0,0,0,1,0.707059,0.647959,0.561765,0.304659,1415,2919,4334 +241,2011-08-29,3,0,8,0,1,1,1,0.636667,0.607958,0.554583,0.159825,729,3905,4634 +242,2011-08-30,3,0,8,0,2,1,1,0.639167,0.594704,0.548333,0.125008,775,4429,5204 +243,2011-08-31,3,0,8,0,3,1,1,0.656667,0.611121,0.597917,0.0833333,688,4370,5058 +244,2011-09-01,3,0,9,0,4,1,1,0.655,0.614921,0.639167,0.141796,783,4332,5115 +245,2011-09-02,3,0,9,0,5,1,2,0.643333,0.604808,0.727083,0.139929,875,3852,4727 +246,2011-09-03,3,0,9,0,6,0,1,0.669167,0.633213,0.716667,0.185325,1935,2549,4484 +247,2011-09-04,3,0,9,0,0,0,1,0.709167,0.665429,0.742083,0.206467,2521,2419,4940 +248,2011-09-05,3,0,9,1,1,0,2,0.673333,0.625646,0.790417,0.212696,1236,2115,3351 +249,2011-09-06,3,0,9,0,2,1,3,0.54,0.5152,0.886957,0.343943,204,2506,2710 +250,2011-09-07,3,0,9,0,3,1,3,0.599167,0.544229,0.917083,0.0970208,118,1878,1996 +251,2011-09-08,3,0,9,0,4,1,3,0.633913,0.555361,0.939565,0.192748,153,1689,1842 +252,2011-09-09,3,0,9,0,5,1,2,0.65,0.578946,0.897917,0.124379,417,3127,3544 +253,2011-09-10,3,0,9,0,6,0,1,0.66,0.607962,0.75375,0.153608,1750,3595,5345 +254,2011-09-11,3,0,9,0,0,0,1,0.653333,0.609229,0.71375,0.115054,1633,3413,5046 +255,2011-09-12,3,0,9,0,1,1,1,0.644348,0.60213,0.692174,0.088913,690,4023,4713 +256,2011-09-13,3,0,9,0,2,1,1,0.650833,0.603554,0.7125,0.141804,701,4062,4763 +257,2011-09-14,3,0,9,0,3,1,1,0.673333,0.6269,0.697083,0.1673,647,4138,4785 +258,2011-09-15,3,0,9,0,4,1,2,0.5775,0.553671,0.709167,0.271146,428,3231,3659 +259,2011-09-16,3,0,9,0,5,1,2,0.469167,0.461475,0.590417,0.164183,742,4018,4760 +260,2011-09-17,3,0,9,0,6,0,2,0.491667,0.478512,0.718333,0.189675,1434,3077,4511 +261,2011-09-18,3,0,9,0,0,0,1,0.5075,0.490537,0.695,0.178483,1353,2921,4274 +262,2011-09-19,3,0,9,0,1,1,2,0.549167,0.529675,0.69,0.151742,691,3848,4539 +263,2011-09-20,3,0,9,0,2,1,2,0.561667,0.532217,0.88125,0.134954,438,3203,3641 +264,2011-09-21,3,0,9,0,3,1,2,0.595,0.550533,0.9,0.0964042,539,3813,4352 +265,2011-09-22,3,0,9,0,4,1,2,0.628333,0.554963,0.902083,0.128125,555,4240,4795 +266,2011-09-23,4,0,9,0,5,1,2,0.609167,0.522125,0.9725,0.0783667,258,2137,2395 +267,2011-09-24,4,0,9,0,6,0,2,0.606667,0.564412,0.8625,0.0783833,1776,3647,5423 +268,2011-09-25,4,0,9,0,0,0,2,0.634167,0.572637,0.845,0.0503792,1544,3466,5010 +269,2011-09-26,4,0,9,0,1,1,2,0.649167,0.589042,0.848333,0.1107,684,3946,4630 +270,2011-09-27,4,0,9,0,2,1,2,0.636667,0.574525,0.885417,0.118171,477,3643,4120 +271,2011-09-28,4,0,9,0,3,1,2,0.635,0.575158,0.84875,0.148629,480,3427,3907 +272,2011-09-29,4,0,9,0,4,1,1,0.616667,0.574512,0.699167,0.172883,653,4186,4839 +273,2011-09-30,4,0,9,0,5,1,1,0.564167,0.544829,0.6475,0.206475,830,4372,5202 +274,2011-10-01,4,0,10,0,6,0,2,0.41,0.412863,0.75375,0.292296,480,1949,2429 +275,2011-10-02,4,0,10,0,0,0,2,0.356667,0.345317,0.791667,0.222013,616,2302,2918 +276,2011-10-03,4,0,10,0,1,1,2,0.384167,0.392046,0.760833,0.0833458,330,3240,3570 +277,2011-10-04,4,0,10,0,2,1,1,0.484167,0.472858,0.71,0.205854,486,3970,4456 +278,2011-10-05,4,0,10,0,3,1,1,0.538333,0.527138,0.647917,0.17725,559,4267,4826 +279,2011-10-06,4,0,10,0,4,1,1,0.494167,0.480425,0.620833,0.134954,639,4126,4765 +280,2011-10-07,4,0,10,0,5,1,1,0.510833,0.504404,0.684167,0.0223917,949,4036,4985 +281,2011-10-08,4,0,10,0,6,0,1,0.521667,0.513242,0.70125,0.0454042,2235,3174,5409 +282,2011-10-09,4,0,10,0,0,0,1,0.540833,0.523983,0.7275,0.06345,2397,3114,5511 +283,2011-10-10,4,0,10,1,1,0,1,0.570833,0.542925,0.73375,0.0423042,1514,3603,5117 +284,2011-10-11,4,0,10,0,2,1,2,0.566667,0.546096,0.80875,0.143042,667,3896,4563 +285,2011-10-12,4,0,10,0,3,1,3,0.543333,0.517717,0.90625,0.24815,217,2199,2416 +286,2011-10-13,4,0,10,0,4,1,2,0.589167,0.551804,0.896667,0.141787,290,2623,2913 +287,2011-10-14,4,0,10,0,5,1,2,0.550833,0.529675,0.71625,0.223883,529,3115,3644 +288,2011-10-15,4,0,10,0,6,0,1,0.506667,0.498725,0.483333,0.258083,1899,3318,5217 +289,2011-10-16,4,0,10,0,0,0,1,0.511667,0.503154,0.486667,0.281717,1748,3293,5041 +290,2011-10-17,4,0,10,0,1,1,1,0.534167,0.510725,0.579583,0.175379,713,3857,4570 +291,2011-10-18,4,0,10,0,2,1,2,0.5325,0.522721,0.701667,0.110087,637,4111,4748 +292,2011-10-19,4,0,10,0,3,1,3,0.541739,0.513848,0.895217,0.243339,254,2170,2424 +293,2011-10-20,4,0,10,0,4,1,1,0.475833,0.466525,0.63625,0.422275,471,3724,4195 +294,2011-10-21,4,0,10,0,5,1,1,0.4275,0.423596,0.574167,0.221396,676,3628,4304 +295,2011-10-22,4,0,10,0,6,0,1,0.4225,0.425492,0.629167,0.0926667,1499,2809,4308 +296,2011-10-23,4,0,10,0,0,0,1,0.421667,0.422333,0.74125,0.0995125,1619,2762,4381 +297,2011-10-24,4,0,10,0,1,1,1,0.463333,0.457067,0.772083,0.118792,699,3488,4187 +298,2011-10-25,4,0,10,0,2,1,1,0.471667,0.463375,0.622917,0.166658,695,3992,4687 +299,2011-10-26,4,0,10,0,3,1,2,0.484167,0.472846,0.720417,0.148642,404,3490,3894 +300,2011-10-27,4,0,10,0,4,1,2,0.47,0.457046,0.812917,0.197763,240,2419,2659 +301,2011-10-28,4,0,10,0,5,1,2,0.330833,0.318812,0.585833,0.229479,456,3291,3747 +302,2011-10-29,4,0,10,0,6,0,3,0.254167,0.227913,0.8825,0.351371,57,570,627 +303,2011-10-30,4,0,10,0,0,0,1,0.319167,0.321329,0.62375,0.176617,885,2446,3331 +304,2011-10-31,4,0,10,0,1,1,1,0.34,0.356063,0.703333,0.10635,362,3307,3669 +305,2011-11-01,4,0,11,0,2,1,1,0.400833,0.397088,0.68375,0.135571,410,3658,4068 +306,2011-11-02,4,0,11,0,3,1,1,0.3775,0.390133,0.71875,0.0820917,370,3816,4186 +307,2011-11-03,4,0,11,0,4,1,1,0.408333,0.405921,0.702083,0.136817,318,3656,3974 +308,2011-11-04,4,0,11,0,5,1,2,0.403333,0.403392,0.6225,0.271779,470,3576,4046 +309,2011-11-05,4,0,11,0,6,0,1,0.326667,0.323854,0.519167,0.189062,1156,2770,3926 +310,2011-11-06,4,0,11,0,0,0,1,0.348333,0.362358,0.734583,0.0920542,952,2697,3649 +311,2011-11-07,4,0,11,0,1,1,1,0.395,0.400871,0.75875,0.057225,373,3662,4035 +312,2011-11-08,4,0,11,0,2,1,1,0.408333,0.412246,0.721667,0.0690375,376,3829,4205 +313,2011-11-09,4,0,11,0,3,1,1,0.4,0.409079,0.758333,0.0621958,305,3804,4109 +314,2011-11-10,4,0,11,0,4,1,2,0.38,0.373721,0.813333,0.189067,190,2743,2933 +315,2011-11-11,4,0,11,1,5,0,1,0.324167,0.306817,0.44625,0.314675,440,2928,3368 +316,2011-11-12,4,0,11,0,6,0,1,0.356667,0.357942,0.552917,0.212062,1275,2792,4067 +317,2011-11-13,4,0,11,0,0,0,1,0.440833,0.43055,0.458333,0.281721,1004,2713,3717 +318,2011-11-14,4,0,11,0,1,1,1,0.53,0.524612,0.587083,0.306596,595,3891,4486 +319,2011-11-15,4,0,11,0,2,1,2,0.53,0.507579,0.68875,0.199633,449,3746,4195 +320,2011-11-16,4,0,11,0,3,1,3,0.456667,0.451988,0.93,0.136829,145,1672,1817 +321,2011-11-17,4,0,11,0,4,1,2,0.341667,0.323221,0.575833,0.305362,139,2914,3053 +322,2011-11-18,4,0,11,0,5,1,1,0.274167,0.272721,0.41,0.168533,245,3147,3392 +323,2011-11-19,4,0,11,0,6,0,1,0.329167,0.324483,0.502083,0.224496,943,2720,3663 +324,2011-11-20,4,0,11,0,0,0,2,0.463333,0.457058,0.684583,0.18595,787,2733,3520 +325,2011-11-21,4,0,11,0,1,1,3,0.4475,0.445062,0.91,0.138054,220,2545,2765 +326,2011-11-22,4,0,11,0,2,1,3,0.416667,0.421696,0.9625,0.118792,69,1538,1607 +327,2011-11-23,4,0,11,0,3,1,2,0.440833,0.430537,0.757917,0.335825,112,2454,2566 +328,2011-11-24,4,0,11,1,4,0,1,0.373333,0.372471,0.549167,0.167304,560,935,1495 +329,2011-11-25,4,0,11,0,5,1,1,0.375,0.380671,0.64375,0.0988958,1095,1697,2792 +330,2011-11-26,4,0,11,0,6,0,1,0.375833,0.385087,0.681667,0.0684208,1249,1819,3068 +331,2011-11-27,4,0,11,0,0,0,1,0.459167,0.4558,0.698333,0.208954,810,2261,3071 +332,2011-11-28,4,0,11,0,1,1,1,0.503478,0.490122,0.743043,0.142122,253,3614,3867 +333,2011-11-29,4,0,11,0,2,1,2,0.458333,0.451375,0.830833,0.258092,96,2818,2914 +334,2011-11-30,4,0,11,0,3,1,1,0.325,0.311221,0.613333,0.271158,188,3425,3613 +335,2011-12-01,4,0,12,0,4,1,1,0.3125,0.305554,0.524583,0.220158,182,3545,3727 +336,2011-12-02,4,0,12,0,5,1,1,0.314167,0.331433,0.625833,0.100754,268,3672,3940 +337,2011-12-03,4,0,12,0,6,0,1,0.299167,0.310604,0.612917,0.0957833,706,2908,3614 +338,2011-12-04,4,0,12,0,0,0,1,0.330833,0.3491,0.775833,0.0839583,634,2851,3485 +339,2011-12-05,4,0,12,0,1,1,2,0.385833,0.393925,0.827083,0.0622083,233,3578,3811 +340,2011-12-06,4,0,12,0,2,1,3,0.4625,0.4564,0.949583,0.232583,126,2468,2594 +341,2011-12-07,4,0,12,0,3,1,3,0.41,0.400246,0.970417,0.266175,50,655,705 +342,2011-12-08,4,0,12,0,4,1,1,0.265833,0.256938,0.58,0.240058,150,3172,3322 +343,2011-12-09,4,0,12,0,5,1,1,0.290833,0.317542,0.695833,0.0827167,261,3359,3620 +344,2011-12-10,4,0,12,0,6,0,1,0.275,0.266412,0.5075,0.233221,502,2688,3190 +345,2011-12-11,4,0,12,0,0,0,1,0.220833,0.253154,0.49,0.0665417,377,2366,2743 +346,2011-12-12,4,0,12,0,1,1,1,0.238333,0.270196,0.670833,0.06345,143,3167,3310 +347,2011-12-13,4,0,12,0,2,1,1,0.2825,0.301138,0.59,0.14055,155,3368,3523 +348,2011-12-14,4,0,12,0,3,1,2,0.3175,0.338362,0.66375,0.0609583,178,3562,3740 +349,2011-12-15,4,0,12,0,4,1,2,0.4225,0.412237,0.634167,0.268042,181,3528,3709 +350,2011-12-16,4,0,12,0,5,1,2,0.375,0.359825,0.500417,0.260575,178,3399,3577 +351,2011-12-17,4,0,12,0,6,0,2,0.258333,0.249371,0.560833,0.243167,275,2464,2739 +352,2011-12-18,4,0,12,0,0,0,1,0.238333,0.245579,0.58625,0.169779,220,2211,2431 +353,2011-12-19,4,0,12,0,1,1,1,0.276667,0.280933,0.6375,0.172896,260,3143,3403 +354,2011-12-20,4,0,12,0,2,1,2,0.385833,0.396454,0.595417,0.0615708,216,3534,3750 +355,2011-12-21,1,0,12,0,3,1,2,0.428333,0.428017,0.858333,0.2214,107,2553,2660 +356,2011-12-22,1,0,12,0,4,1,2,0.423333,0.426121,0.7575,0.047275,227,2841,3068 +357,2011-12-23,1,0,12,0,5,1,1,0.373333,0.377513,0.68625,0.274246,163,2046,2209 +358,2011-12-24,1,0,12,0,6,0,1,0.3025,0.299242,0.5425,0.190304,155,856,1011 +359,2011-12-25,1,0,12,0,0,0,1,0.274783,0.279961,0.681304,0.155091,303,451,754 +360,2011-12-26,1,0,12,1,1,0,1,0.321739,0.315535,0.506957,0.239465,430,887,1317 +361,2011-12-27,1,0,12,0,2,1,2,0.325,0.327633,0.7625,0.18845,103,1059,1162 +362,2011-12-28,1,0,12,0,3,1,1,0.29913,0.279974,0.503913,0.293961,255,2047,2302 +363,2011-12-29,1,0,12,0,4,1,1,0.248333,0.263892,0.574167,0.119412,254,2169,2423 +364,2011-12-30,1,0,12,0,5,1,1,0.311667,0.318812,0.636667,0.134337,491,2508,2999 +365,2011-12-31,1,0,12,0,6,0,1,0.41,0.414121,0.615833,0.220154,665,1820,2485 +366,2012-01-01,1,1,1,0,0,0,1,0.37,0.375621,0.6925,0.192167,686,1608,2294 +367,2012-01-02,1,1,1,1,1,0,1,0.273043,0.252304,0.381304,0.329665,244,1707,1951 +368,2012-01-03,1,1,1,0,2,1,1,0.15,0.126275,0.44125,0.365671,89,2147,2236 +369,2012-01-04,1,1,1,0,3,1,2,0.1075,0.119337,0.414583,0.1847,95,2273,2368 +370,2012-01-05,1,1,1,0,4,1,1,0.265833,0.278412,0.524167,0.129987,140,3132,3272 +371,2012-01-06,1,1,1,0,5,1,1,0.334167,0.340267,0.542083,0.167908,307,3791,4098 +372,2012-01-07,1,1,1,0,6,0,1,0.393333,0.390779,0.531667,0.174758,1070,3451,4521 +373,2012-01-08,1,1,1,0,0,0,1,0.3375,0.340258,0.465,0.191542,599,2826,3425 +374,2012-01-09,1,1,1,0,1,1,2,0.224167,0.247479,0.701667,0.0989,106,2270,2376 +375,2012-01-10,1,1,1,0,2,1,1,0.308696,0.318826,0.646522,0.187552,173,3425,3598 +376,2012-01-11,1,1,1,0,3,1,2,0.274167,0.282821,0.8475,0.131221,92,2085,2177 +377,2012-01-12,1,1,1,0,4,1,2,0.3825,0.381938,0.802917,0.180967,269,3828,4097 +378,2012-01-13,1,1,1,0,5,1,1,0.274167,0.249362,0.5075,0.378108,174,3040,3214 +379,2012-01-14,1,1,1,0,6,0,1,0.18,0.183087,0.4575,0.187183,333,2160,2493 +380,2012-01-15,1,1,1,0,0,0,1,0.166667,0.161625,0.419167,0.251258,284,2027,2311 +381,2012-01-16,1,1,1,1,1,0,1,0.19,0.190663,0.5225,0.231358,217,2081,2298 +382,2012-01-17,1,1,1,0,2,1,2,0.373043,0.364278,0.716087,0.34913,127,2808,2935 +383,2012-01-18,1,1,1,0,3,1,1,0.303333,0.275254,0.443333,0.415429,109,3267,3376 +384,2012-01-19,1,1,1,0,4,1,1,0.19,0.190038,0.4975,0.220158,130,3162,3292 +385,2012-01-20,1,1,1,0,5,1,2,0.2175,0.220958,0.45,0.20275,115,3048,3163 +386,2012-01-21,1,1,1,0,6,0,2,0.173333,0.174875,0.83125,0.222642,67,1234,1301 +387,2012-01-22,1,1,1,0,0,0,2,0.1625,0.16225,0.79625,0.199638,196,1781,1977 +388,2012-01-23,1,1,1,0,1,1,2,0.218333,0.243058,0.91125,0.110708,145,2287,2432 +389,2012-01-24,1,1,1,0,2,1,1,0.3425,0.349108,0.835833,0.123767,439,3900,4339 +390,2012-01-25,1,1,1,0,3,1,1,0.294167,0.294821,0.64375,0.161071,467,3803,4270 +391,2012-01-26,1,1,1,0,4,1,2,0.341667,0.35605,0.769583,0.0733958,244,3831,4075 +392,2012-01-27,1,1,1,0,5,1,2,0.425,0.415383,0.74125,0.342667,269,3187,3456 +393,2012-01-28,1,1,1,0,6,0,1,0.315833,0.326379,0.543333,0.210829,775,3248,4023 +394,2012-01-29,1,1,1,0,0,0,1,0.2825,0.272721,0.31125,0.24005,558,2685,3243 +395,2012-01-30,1,1,1,0,1,1,1,0.269167,0.262625,0.400833,0.215792,126,3498,3624 +396,2012-01-31,1,1,1,0,2,1,1,0.39,0.381317,0.416667,0.261817,324,4185,4509 +397,2012-02-01,1,1,2,0,3,1,1,0.469167,0.466538,0.507917,0.189067,304,4275,4579 +398,2012-02-02,1,1,2,0,4,1,2,0.399167,0.398971,0.672917,0.187187,190,3571,3761 +399,2012-02-03,1,1,2,0,5,1,1,0.313333,0.309346,0.526667,0.178496,310,3841,4151 +400,2012-02-04,1,1,2,0,6,0,2,0.264167,0.272725,0.779583,0.121896,384,2448,2832 +401,2012-02-05,1,1,2,0,0,0,2,0.265833,0.264521,0.687917,0.175996,318,2629,2947 +402,2012-02-06,1,1,2,0,1,1,1,0.282609,0.296426,0.622174,0.1538,206,3578,3784 +403,2012-02-07,1,1,2,0,2,1,1,0.354167,0.361104,0.49625,0.147379,199,4176,4375 +404,2012-02-08,1,1,2,0,3,1,2,0.256667,0.266421,0.722917,0.133721,109,2693,2802 +405,2012-02-09,1,1,2,0,4,1,1,0.265,0.261988,0.562083,0.194037,163,3667,3830 +406,2012-02-10,1,1,2,0,5,1,2,0.280833,0.293558,0.54,0.116929,227,3604,3831 +407,2012-02-11,1,1,2,0,6,0,3,0.224167,0.210867,0.73125,0.289796,192,1977,2169 +408,2012-02-12,1,1,2,0,0,0,1,0.1275,0.101658,0.464583,0.409212,73,1456,1529 +409,2012-02-13,1,1,2,0,1,1,1,0.2225,0.227913,0.41125,0.167283,94,3328,3422 +410,2012-02-14,1,1,2,0,2,1,2,0.319167,0.333946,0.50875,0.141179,135,3787,3922 +411,2012-02-15,1,1,2,0,3,1,1,0.348333,0.351629,0.53125,0.1816,141,4028,4169 +412,2012-02-16,1,1,2,0,4,1,2,0.316667,0.330162,0.752917,0.091425,74,2931,3005 +413,2012-02-17,1,1,2,0,5,1,1,0.343333,0.351629,0.634583,0.205846,349,3805,4154 +414,2012-02-18,1,1,2,0,6,0,1,0.346667,0.355425,0.534583,0.190929,1435,2883,4318 +415,2012-02-19,1,1,2,0,0,0,2,0.28,0.265788,0.515833,0.253112,618,2071,2689 +416,2012-02-20,1,1,2,1,1,0,1,0.28,0.273391,0.507826,0.229083,502,2627,3129 +417,2012-02-21,1,1,2,0,2,1,1,0.287826,0.295113,0.594348,0.205717,163,3614,3777 +418,2012-02-22,1,1,2,0,3,1,1,0.395833,0.392667,0.567917,0.234471,394,4379,4773 +419,2012-02-23,1,1,2,0,4,1,1,0.454167,0.444446,0.554583,0.190913,516,4546,5062 +420,2012-02-24,1,1,2,0,5,1,2,0.4075,0.410971,0.7375,0.237567,246,3241,3487 +421,2012-02-25,1,1,2,0,6,0,1,0.290833,0.255675,0.395833,0.421642,317,2415,2732 +422,2012-02-26,1,1,2,0,0,0,1,0.279167,0.268308,0.41,0.205229,515,2874,3389 +423,2012-02-27,1,1,2,0,1,1,1,0.366667,0.357954,0.490833,0.268033,253,4069,4322 +424,2012-02-28,1,1,2,0,2,1,1,0.359167,0.353525,0.395833,0.193417,229,4134,4363 +425,2012-02-29,1,1,2,0,3,1,2,0.344348,0.34847,0.804783,0.179117,65,1769,1834 +426,2012-03-01,1,1,3,0,4,1,1,0.485833,0.475371,0.615417,0.226987,325,4665,4990 +427,2012-03-02,1,1,3,0,5,1,2,0.353333,0.359842,0.657083,0.144904,246,2948,3194 +428,2012-03-03,1,1,3,0,6,0,2,0.414167,0.413492,0.62125,0.161079,956,3110,4066 +429,2012-03-04,1,1,3,0,0,0,1,0.325833,0.303021,0.403333,0.334571,710,2713,3423 +430,2012-03-05,1,1,3,0,1,1,1,0.243333,0.241171,0.50625,0.228858,203,3130,3333 +431,2012-03-06,1,1,3,0,2,1,1,0.258333,0.255042,0.456667,0.200875,221,3735,3956 +432,2012-03-07,1,1,3,0,3,1,1,0.404167,0.3851,0.513333,0.345779,432,4484,4916 +433,2012-03-08,1,1,3,0,4,1,1,0.5275,0.524604,0.5675,0.441563,486,4896,5382 +434,2012-03-09,1,1,3,0,5,1,2,0.410833,0.397083,0.407083,0.4148,447,4122,4569 +435,2012-03-10,1,1,3,0,6,0,1,0.2875,0.277767,0.350417,0.22575,968,3150,4118 +436,2012-03-11,1,1,3,0,0,0,1,0.361739,0.35967,0.476957,0.222587,1658,3253,4911 +437,2012-03-12,1,1,3,0,1,1,1,0.466667,0.459592,0.489167,0.207713,838,4460,5298 +438,2012-03-13,1,1,3,0,2,1,1,0.565,0.542929,0.6175,0.23695,762,5085,5847 +439,2012-03-14,1,1,3,0,3,1,1,0.5725,0.548617,0.507083,0.115062,997,5315,6312 +440,2012-03-15,1,1,3,0,4,1,1,0.5575,0.532825,0.579583,0.149883,1005,5187,6192 +441,2012-03-16,1,1,3,0,5,1,2,0.435833,0.436229,0.842083,0.113192,548,3830,4378 +442,2012-03-17,1,1,3,0,6,0,2,0.514167,0.505046,0.755833,0.110704,3155,4681,7836 +443,2012-03-18,1,1,3,0,0,0,2,0.4725,0.464,0.81,0.126883,2207,3685,5892 +444,2012-03-19,1,1,3,0,1,1,1,0.545,0.532821,0.72875,0.162317,982,5171,6153 +445,2012-03-20,1,1,3,0,2,1,1,0.560833,0.538533,0.807917,0.121271,1051,5042,6093 +446,2012-03-21,2,1,3,0,3,1,2,0.531667,0.513258,0.82125,0.0895583,1122,5108,6230 +447,2012-03-22,2,1,3,0,4,1,1,0.554167,0.531567,0.83125,0.117562,1334,5537,6871 +448,2012-03-23,2,1,3,0,5,1,2,0.601667,0.570067,0.694167,0.1163,2469,5893,8362 +449,2012-03-24,2,1,3,0,6,0,2,0.5025,0.486733,0.885417,0.192783,1033,2339,3372 +450,2012-03-25,2,1,3,0,0,0,2,0.4375,0.437488,0.880833,0.220775,1532,3464,4996 +451,2012-03-26,2,1,3,0,1,1,1,0.445833,0.43875,0.477917,0.386821,795,4763,5558 +452,2012-03-27,2,1,3,0,2,1,1,0.323333,0.315654,0.29,0.187192,531,4571,5102 +453,2012-03-28,2,1,3,0,3,1,1,0.484167,0.47095,0.48125,0.291671,674,5024,5698 +454,2012-03-29,2,1,3,0,4,1,1,0.494167,0.482304,0.439167,0.31965,834,5299,6133 +455,2012-03-30,2,1,3,0,5,1,2,0.37,0.375621,0.580833,0.138067,796,4663,5459 +456,2012-03-31,2,1,3,0,6,0,2,0.424167,0.421708,0.738333,0.250617,2301,3934,6235 +457,2012-04-01,2,1,4,0,0,0,2,0.425833,0.417287,0.67625,0.172267,2347,3694,6041 +458,2012-04-02,2,1,4,0,1,1,1,0.433913,0.427513,0.504348,0.312139,1208,4728,5936 +459,2012-04-03,2,1,4,0,2,1,1,0.466667,0.461483,0.396667,0.100133,1348,5424,6772 +460,2012-04-04,2,1,4,0,3,1,1,0.541667,0.53345,0.469583,0.180975,1058,5378,6436 +461,2012-04-05,2,1,4,0,4,1,1,0.435,0.431163,0.374167,0.219529,1192,5265,6457 +462,2012-04-06,2,1,4,0,5,1,1,0.403333,0.390767,0.377083,0.300388,1807,4653,6460 +463,2012-04-07,2,1,4,0,6,0,1,0.4375,0.426129,0.254167,0.274871,3252,3605,6857 +464,2012-04-08,2,1,4,0,0,0,1,0.5,0.492425,0.275833,0.232596,2230,2939,5169 +465,2012-04-09,2,1,4,0,1,1,1,0.489167,0.476638,0.3175,0.358196,905,4680,5585 +466,2012-04-10,2,1,4,0,2,1,1,0.446667,0.436233,0.435,0.249375,819,5099,5918 +467,2012-04-11,2,1,4,0,3,1,1,0.348696,0.337274,0.469565,0.295274,482,4380,4862 +468,2012-04-12,2,1,4,0,4,1,1,0.3975,0.387604,0.46625,0.290429,663,4746,5409 +469,2012-04-13,2,1,4,0,5,1,1,0.4425,0.431808,0.408333,0.155471,1252,5146,6398 +470,2012-04-14,2,1,4,0,6,0,1,0.495,0.487996,0.502917,0.190917,2795,4665,7460 +471,2012-04-15,2,1,4,0,0,0,1,0.606667,0.573875,0.507917,0.225129,2846,4286,7132 +472,2012-04-16,2,1,4,1,1,0,1,0.664167,0.614925,0.561667,0.284829,1198,5172,6370 +473,2012-04-17,2,1,4,0,2,1,1,0.608333,0.598487,0.390417,0.273629,989,5702,6691 +474,2012-04-18,2,1,4,0,3,1,2,0.463333,0.457038,0.569167,0.167912,347,4020,4367 +475,2012-04-19,2,1,4,0,4,1,1,0.498333,0.493046,0.6125,0.0659292,846,5719,6565 +476,2012-04-20,2,1,4,0,5,1,1,0.526667,0.515775,0.694583,0.149871,1340,5950,7290 +477,2012-04-21,2,1,4,0,6,0,1,0.57,0.542921,0.682917,0.283587,2541,4083,6624 +478,2012-04-22,2,1,4,0,0,0,3,0.396667,0.389504,0.835417,0.344546,120,907,1027 +479,2012-04-23,2,1,4,0,1,1,2,0.321667,0.301125,0.766667,0.303496,195,3019,3214 +480,2012-04-24,2,1,4,0,2,1,1,0.413333,0.405283,0.454167,0.249383,518,5115,5633 +481,2012-04-25,2,1,4,0,3,1,1,0.476667,0.470317,0.427917,0.118792,655,5541,6196 +482,2012-04-26,2,1,4,0,4,1,2,0.498333,0.483583,0.756667,0.176625,475,4551,5026 +483,2012-04-27,2,1,4,0,5,1,1,0.4575,0.452637,0.400833,0.347633,1014,5219,6233 +484,2012-04-28,2,1,4,0,6,0,2,0.376667,0.377504,0.489583,0.129975,1120,3100,4220 +485,2012-04-29,2,1,4,0,0,0,1,0.458333,0.450121,0.587083,0.116908,2229,4075,6304 +486,2012-04-30,2,1,4,0,1,1,2,0.464167,0.457696,0.57,0.171638,665,4907,5572 +487,2012-05-01,2,1,5,0,2,1,2,0.613333,0.577021,0.659583,0.156096,653,5087,5740 +488,2012-05-02,2,1,5,0,3,1,1,0.564167,0.537896,0.797083,0.138058,667,5502,6169 +489,2012-05-03,2,1,5,0,4,1,2,0.56,0.537242,0.768333,0.133696,764,5657,6421 +490,2012-05-04,2,1,5,0,5,1,1,0.6275,0.590917,0.735417,0.162938,1069,5227,6296 +491,2012-05-05,2,1,5,0,6,0,2,0.621667,0.584608,0.756667,0.152992,2496,4387,6883 +492,2012-05-06,2,1,5,0,0,0,2,0.5625,0.546737,0.74,0.149879,2135,4224,6359 +493,2012-05-07,2,1,5,0,1,1,2,0.5375,0.527142,0.664167,0.230721,1008,5265,6273 +494,2012-05-08,2,1,5,0,2,1,2,0.581667,0.557471,0.685833,0.296029,738,4990,5728 +495,2012-05-09,2,1,5,0,3,1,2,0.575,0.553025,0.744167,0.216412,620,4097,4717 +496,2012-05-10,2,1,5,0,4,1,1,0.505833,0.491783,0.552083,0.314063,1026,5546,6572 +497,2012-05-11,2,1,5,0,5,1,1,0.533333,0.520833,0.360417,0.236937,1319,5711,7030 +498,2012-05-12,2,1,5,0,6,0,1,0.564167,0.544817,0.480417,0.123133,2622,4807,7429 +499,2012-05-13,2,1,5,0,0,0,1,0.6125,0.585238,0.57625,0.225117,2172,3946,6118 +500,2012-05-14,2,1,5,0,1,1,2,0.573333,0.5499,0.789583,0.212692,342,2501,2843 +501,2012-05-15,2,1,5,0,2,1,2,0.611667,0.576404,0.794583,0.147392,625,4490,5115 +502,2012-05-16,2,1,5,0,3,1,1,0.636667,0.595975,0.697917,0.122512,991,6433,7424 +503,2012-05-17,2,1,5,0,4,1,1,0.593333,0.572613,0.52,0.229475,1242,6142,7384 +504,2012-05-18,2,1,5,0,5,1,1,0.564167,0.551121,0.523333,0.136817,1521,6118,7639 +505,2012-05-19,2,1,5,0,6,0,1,0.6,0.566908,0.45625,0.083975,3410,4884,8294 +506,2012-05-20,2,1,5,0,0,0,1,0.620833,0.583967,0.530417,0.254367,2704,4425,7129 +507,2012-05-21,2,1,5,0,1,1,2,0.598333,0.565667,0.81125,0.233204,630,3729,4359 +508,2012-05-22,2,1,5,0,2,1,2,0.615,0.580825,0.765833,0.118167,819,5254,6073 +509,2012-05-23,2,1,5,0,3,1,2,0.621667,0.584612,0.774583,0.102,766,4494,5260 +510,2012-05-24,2,1,5,0,4,1,1,0.655,0.6067,0.716667,0.172896,1059,5711,6770 +511,2012-05-25,2,1,5,0,5,1,1,0.68,0.627529,0.747083,0.14055,1417,5317,6734 +512,2012-05-26,2,1,5,0,6,0,1,0.6925,0.642696,0.7325,0.198992,2855,3681,6536 +513,2012-05-27,2,1,5,0,0,0,1,0.69,0.641425,0.697083,0.215171,3283,3308,6591 +514,2012-05-28,2,1,5,1,1,0,1,0.7125,0.6793,0.67625,0.196521,2557,3486,6043 +515,2012-05-29,2,1,5,0,2,1,1,0.7225,0.672992,0.684583,0.2954,880,4863,5743 +516,2012-05-30,2,1,5,0,3,1,2,0.656667,0.611129,0.67,0.134329,745,6110,6855 +517,2012-05-31,2,1,5,0,4,1,1,0.68,0.631329,0.492917,0.195279,1100,6238,7338 +518,2012-06-01,2,1,6,0,5,1,2,0.654167,0.607962,0.755417,0.237563,533,3594,4127 +519,2012-06-02,2,1,6,0,6,0,1,0.583333,0.566288,0.549167,0.186562,2795,5325,8120 +520,2012-06-03,2,1,6,0,0,0,1,0.6025,0.575133,0.493333,0.184087,2494,5147,7641 +521,2012-06-04,2,1,6,0,1,1,1,0.5975,0.578283,0.487083,0.284833,1071,5927,6998 +522,2012-06-05,2,1,6,0,2,1,2,0.540833,0.525892,0.613333,0.209575,968,6033,7001 +523,2012-06-06,2,1,6,0,3,1,1,0.554167,0.542292,0.61125,0.077125,1027,6028,7055 +524,2012-06-07,2,1,6,0,4,1,1,0.6025,0.569442,0.567083,0.15735,1038,6456,7494 +525,2012-06-08,2,1,6,0,5,1,1,0.649167,0.597862,0.467917,0.175383,1488,6248,7736 +526,2012-06-09,2,1,6,0,6,0,1,0.710833,0.648367,0.437083,0.144287,2708,4790,7498 +527,2012-06-10,2,1,6,0,0,0,1,0.726667,0.663517,0.538333,0.133721,2224,4374,6598 +528,2012-06-11,2,1,6,0,1,1,2,0.720833,0.659721,0.587917,0.207713,1017,5647,6664 +529,2012-06-12,2,1,6,0,2,1,2,0.653333,0.597875,0.833333,0.214546,477,4495,4972 +530,2012-06-13,2,1,6,0,3,1,1,0.655833,0.611117,0.582083,0.343279,1173,6248,7421 +531,2012-06-14,2,1,6,0,4,1,1,0.648333,0.624383,0.569583,0.253733,1180,6183,7363 +532,2012-06-15,2,1,6,0,5,1,1,0.639167,0.599754,0.589583,0.176617,1563,6102,7665 +533,2012-06-16,2,1,6,0,6,0,1,0.631667,0.594708,0.504167,0.166667,2963,4739,7702 +534,2012-06-17,2,1,6,0,0,0,1,0.5925,0.571975,0.59875,0.144904,2634,4344,6978 +535,2012-06-18,2,1,6,0,1,1,2,0.568333,0.544842,0.777917,0.174746,653,4446,5099 +536,2012-06-19,2,1,6,0,2,1,1,0.688333,0.654692,0.69,0.148017,968,5857,6825 +537,2012-06-20,2,1,6,0,3,1,1,0.7825,0.720975,0.592083,0.113812,872,5339,6211 +538,2012-06-21,3,1,6,0,4,1,1,0.805833,0.752542,0.567917,0.118787,778,5127,5905 +539,2012-06-22,3,1,6,0,5,1,1,0.7775,0.724121,0.57375,0.182842,964,4859,5823 +540,2012-06-23,3,1,6,0,6,0,1,0.731667,0.652792,0.534583,0.179721,2657,4801,7458 +541,2012-06-24,3,1,6,0,0,0,1,0.743333,0.674254,0.479167,0.145525,2551,4340,6891 +542,2012-06-25,3,1,6,0,1,1,1,0.715833,0.654042,0.504167,0.300383,1139,5640,6779 +543,2012-06-26,3,1,6,0,2,1,1,0.630833,0.594704,0.373333,0.347642,1077,6365,7442 +544,2012-06-27,3,1,6,0,3,1,1,0.6975,0.640792,0.36,0.271775,1077,6258,7335 +545,2012-06-28,3,1,6,0,4,1,1,0.749167,0.675512,0.4225,0.17165,921,5958,6879 +546,2012-06-29,3,1,6,0,5,1,1,0.834167,0.786613,0.48875,0.165417,829,4634,5463 +547,2012-06-30,3,1,6,0,6,0,1,0.765,0.687508,0.60125,0.161071,1455,4232,5687 +548,2012-07-01,3,1,7,0,0,0,1,0.815833,0.750629,0.51875,0.168529,1421,4110,5531 +549,2012-07-02,3,1,7,0,1,1,1,0.781667,0.702038,0.447083,0.195267,904,5323,6227 +550,2012-07-03,3,1,7,0,2,1,1,0.780833,0.70265,0.492083,0.126237,1052,5608,6660 +551,2012-07-04,3,1,7,1,3,0,1,0.789167,0.732337,0.53875,0.13495,2562,4841,7403 +552,2012-07-05,3,1,7,0,4,1,1,0.8275,0.761367,0.457917,0.194029,1405,4836,6241 +553,2012-07-06,3,1,7,0,5,1,1,0.828333,0.752533,0.450833,0.146142,1366,4841,6207 +554,2012-07-07,3,1,7,0,6,0,1,0.861667,0.804913,0.492083,0.163554,1448,3392,4840 +555,2012-07-08,3,1,7,0,0,0,1,0.8225,0.790396,0.57375,0.125629,1203,3469,4672 +556,2012-07-09,3,1,7,0,1,1,2,0.710833,0.654054,0.683333,0.180975,998,5571,6569 +557,2012-07-10,3,1,7,0,2,1,2,0.720833,0.664796,0.6675,0.151737,954,5336,6290 +558,2012-07-11,3,1,7,0,3,1,1,0.716667,0.650271,0.633333,0.151733,975,6289,7264 +559,2012-07-12,3,1,7,0,4,1,1,0.715833,0.654683,0.529583,0.146775,1032,6414,7446 +560,2012-07-13,3,1,7,0,5,1,2,0.731667,0.667933,0.485833,0.08085,1511,5988,7499 +561,2012-07-14,3,1,7,0,6,0,2,0.703333,0.666042,0.699167,0.143679,2355,4614,6969 +562,2012-07-15,3,1,7,0,0,0,1,0.745833,0.705196,0.717917,0.166667,1920,4111,6031 +563,2012-07-16,3,1,7,0,1,1,1,0.763333,0.724125,0.645,0.164187,1088,5742,6830 +564,2012-07-17,3,1,7,0,2,1,1,0.818333,0.755683,0.505833,0.114429,921,5865,6786 +565,2012-07-18,3,1,7,0,3,1,1,0.793333,0.745583,0.577083,0.137442,799,4914,5713 +566,2012-07-19,3,1,7,0,4,1,1,0.77,0.714642,0.600417,0.165429,888,5703,6591 +567,2012-07-20,3,1,7,0,5,1,2,0.665833,0.613025,0.844167,0.208967,747,5123,5870 +568,2012-07-21,3,1,7,0,6,0,3,0.595833,0.549912,0.865417,0.2133,1264,3195,4459 +569,2012-07-22,3,1,7,0,0,0,2,0.6675,0.623125,0.7625,0.0939208,2544,4866,7410 +570,2012-07-23,3,1,7,0,1,1,1,0.741667,0.690017,0.694167,0.138683,1135,5831,6966 +571,2012-07-24,3,1,7,0,2,1,1,0.750833,0.70645,0.655,0.211454,1140,6452,7592 +572,2012-07-25,3,1,7,0,3,1,1,0.724167,0.654054,0.45,0.1648,1383,6790,8173 +573,2012-07-26,3,1,7,0,4,1,1,0.776667,0.739263,0.596667,0.284813,1036,5825,6861 +574,2012-07-27,3,1,7,0,5,1,1,0.781667,0.734217,0.594583,0.152992,1259,5645,6904 +575,2012-07-28,3,1,7,0,6,0,1,0.755833,0.697604,0.613333,0.15735,2234,4451,6685 +576,2012-07-29,3,1,7,0,0,0,1,0.721667,0.667933,0.62375,0.170396,2153,4444,6597 +577,2012-07-30,3,1,7,0,1,1,1,0.730833,0.684987,0.66875,0.153617,1040,6065,7105 +578,2012-07-31,3,1,7,0,2,1,1,0.713333,0.662896,0.704167,0.165425,968,6248,7216 +579,2012-08-01,3,1,8,0,3,1,1,0.7175,0.667308,0.6775,0.141179,1074,6506,7580 +580,2012-08-02,3,1,8,0,4,1,1,0.7525,0.707088,0.659583,0.129354,983,6278,7261 +581,2012-08-03,3,1,8,0,5,1,2,0.765833,0.722867,0.6425,0.215792,1328,5847,7175 +582,2012-08-04,3,1,8,0,6,0,1,0.793333,0.751267,0.613333,0.257458,2345,4479,6824 +583,2012-08-05,3,1,8,0,0,0,1,0.769167,0.731079,0.6525,0.290421,1707,3757,5464 +584,2012-08-06,3,1,8,0,1,1,2,0.7525,0.710246,0.654167,0.129354,1233,5780,7013 +585,2012-08-07,3,1,8,0,2,1,2,0.735833,0.697621,0.70375,0.116908,1278,5995,7273 +586,2012-08-08,3,1,8,0,3,1,2,0.75,0.707717,0.672917,0.1107,1263,6271,7534 +587,2012-08-09,3,1,8,0,4,1,1,0.755833,0.699508,0.620417,0.1561,1196,6090,7286 +588,2012-08-10,3,1,8,0,5,1,2,0.715833,0.667942,0.715833,0.238813,1065,4721,5786 +589,2012-08-11,3,1,8,0,6,0,2,0.6925,0.638267,0.732917,0.206479,2247,4052,6299 +590,2012-08-12,3,1,8,0,0,0,1,0.700833,0.644579,0.530417,0.122512,2182,4362,6544 +591,2012-08-13,3,1,8,0,1,1,1,0.720833,0.662254,0.545417,0.136212,1207,5676,6883 +592,2012-08-14,3,1,8,0,2,1,1,0.726667,0.676779,0.686667,0.169158,1128,5656,6784 +593,2012-08-15,3,1,8,0,3,1,1,0.706667,0.654037,0.619583,0.169771,1198,6149,7347 +594,2012-08-16,3,1,8,0,4,1,1,0.719167,0.654688,0.519167,0.141796,1338,6267,7605 +595,2012-08-17,3,1,8,0,5,1,1,0.723333,0.2424,0.570833,0.231354,1483,5665,7148 +596,2012-08-18,3,1,8,0,6,0,1,0.678333,0.618071,0.603333,0.177867,2827,5038,7865 +597,2012-08-19,3,1,8,0,0,0,2,0.635833,0.603554,0.711667,0.08645,1208,3341,4549 +598,2012-08-20,3,1,8,0,1,1,2,0.635833,0.595967,0.734167,0.129979,1026,5504,6530 +599,2012-08-21,3,1,8,0,2,1,1,0.649167,0.601025,0.67375,0.0727708,1081,5925,7006 +600,2012-08-22,3,1,8,0,3,1,1,0.6675,0.621854,0.677083,0.0702833,1094,6281,7375 +601,2012-08-23,3,1,8,0,4,1,1,0.695833,0.637008,0.635833,0.0845958,1363,6402,7765 +602,2012-08-24,3,1,8,0,5,1,2,0.7025,0.6471,0.615,0.0721458,1325,6257,7582 +603,2012-08-25,3,1,8,0,6,0,2,0.661667,0.618696,0.712917,0.244408,1829,4224,6053 +604,2012-08-26,3,1,8,0,0,0,2,0.653333,0.595996,0.845833,0.228858,1483,3772,5255 +605,2012-08-27,3,1,8,0,1,1,1,0.703333,0.654688,0.730417,0.128733,989,5928,6917 +606,2012-08-28,3,1,8,0,2,1,1,0.728333,0.66605,0.62,0.190925,935,6105,7040 +607,2012-08-29,3,1,8,0,3,1,1,0.685,0.635733,0.552083,0.112562,1177,6520,7697 +608,2012-08-30,3,1,8,0,4,1,1,0.706667,0.652779,0.590417,0.0771167,1172,6541,7713 +609,2012-08-31,3,1,8,0,5,1,1,0.764167,0.6894,0.5875,0.168533,1433,5917,7350 +610,2012-09-01,3,1,9,0,6,0,2,0.753333,0.702654,0.638333,0.113187,2352,3788,6140 +611,2012-09-02,3,1,9,0,0,0,2,0.696667,0.649,0.815,0.0640708,2613,3197,5810 +612,2012-09-03,3,1,9,1,1,0,1,0.7075,0.661629,0.790833,0.151121,1965,4069,6034 +613,2012-09-04,3,1,9,0,2,1,1,0.725833,0.686888,0.755,0.236321,867,5997,6864 +614,2012-09-05,3,1,9,0,3,1,1,0.736667,0.708983,0.74125,0.187808,832,6280,7112 +615,2012-09-06,3,1,9,0,4,1,2,0.696667,0.655329,0.810417,0.142421,611,5592,6203 +616,2012-09-07,3,1,9,0,5,1,1,0.703333,0.657204,0.73625,0.171646,1045,6459,7504 +617,2012-09-08,3,1,9,0,6,0,2,0.659167,0.611121,0.799167,0.281104,1557,4419,5976 +618,2012-09-09,3,1,9,0,0,0,1,0.61,0.578925,0.5475,0.224496,2570,5657,8227 +619,2012-09-10,3,1,9,0,1,1,1,0.583333,0.565654,0.50375,0.258713,1118,6407,7525 +620,2012-09-11,3,1,9,0,2,1,1,0.5775,0.554292,0.52,0.0920542,1070,6697,7767 +621,2012-09-12,3,1,9,0,3,1,1,0.599167,0.570075,0.577083,0.131846,1050,6820,7870 +622,2012-09-13,3,1,9,0,4,1,1,0.6125,0.579558,0.637083,0.0827208,1054,6750,7804 +623,2012-09-14,3,1,9,0,5,1,1,0.633333,0.594083,0.6725,0.103863,1379,6630,8009 +624,2012-09-15,3,1,9,0,6,0,1,0.608333,0.585867,0.501667,0.247521,3160,5554,8714 +625,2012-09-16,3,1,9,0,0,0,1,0.58,0.563125,0.57,0.0901833,2166,5167,7333 +626,2012-09-17,3,1,9,0,1,1,2,0.580833,0.55305,0.734583,0.151742,1022,5847,6869 +627,2012-09-18,3,1,9,0,2,1,2,0.623333,0.565067,0.8725,0.357587,371,3702,4073 +628,2012-09-19,3,1,9,0,3,1,1,0.5525,0.540404,0.536667,0.215175,788,6803,7591 +629,2012-09-20,3,1,9,0,4,1,1,0.546667,0.532192,0.618333,0.118167,939,6781,7720 +630,2012-09-21,3,1,9,0,5,1,1,0.599167,0.571971,0.66875,0.154229,1250,6917,8167 +631,2012-09-22,3,1,9,0,6,0,1,0.65,0.610488,0.646667,0.283583,2512,5883,8395 +632,2012-09-23,4,1,9,0,0,0,1,0.529167,0.518933,0.467083,0.223258,2454,5453,7907 +633,2012-09-24,4,1,9,0,1,1,1,0.514167,0.502513,0.492917,0.142404,1001,6435,7436 +634,2012-09-25,4,1,9,0,2,1,1,0.55,0.544179,0.57,0.236321,845,6693,7538 +635,2012-09-26,4,1,9,0,3,1,1,0.635,0.596613,0.630833,0.2444,787,6946,7733 +636,2012-09-27,4,1,9,0,4,1,2,0.65,0.607975,0.690833,0.134342,751,6642,7393 +637,2012-09-28,4,1,9,0,5,1,2,0.619167,0.585863,0.69,0.164179,1045,6370,7415 +638,2012-09-29,4,1,9,0,6,0,1,0.5425,0.530296,0.542917,0.227604,2589,5966,8555 +639,2012-09-30,4,1,9,0,0,0,1,0.526667,0.517663,0.583333,0.134958,2015,4874,6889 +640,2012-10-01,4,1,10,0,1,1,2,0.520833,0.512,0.649167,0.0908042,763,6015,6778 +641,2012-10-02,4,1,10,0,2,1,3,0.590833,0.542333,0.871667,0.104475,315,4324,4639 +642,2012-10-03,4,1,10,0,3,1,2,0.6575,0.599133,0.79375,0.0665458,728,6844,7572 +643,2012-10-04,4,1,10,0,4,1,2,0.6575,0.607975,0.722917,0.117546,891,6437,7328 +644,2012-10-05,4,1,10,0,5,1,1,0.615,0.580187,0.6275,0.10635,1516,6640,8156 +645,2012-10-06,4,1,10,0,6,0,1,0.554167,0.538521,0.664167,0.268025,3031,4934,7965 +646,2012-10-07,4,1,10,0,0,0,2,0.415833,0.419813,0.708333,0.141162,781,2729,3510 +647,2012-10-08,4,1,10,1,1,0,2,0.383333,0.387608,0.709583,0.189679,874,4604,5478 +648,2012-10-09,4,1,10,0,2,1,2,0.446667,0.438112,0.761667,0.1903,601,5791,6392 +649,2012-10-10,4,1,10,0,3,1,1,0.514167,0.503142,0.630833,0.187821,780,6911,7691 +650,2012-10-11,4,1,10,0,4,1,1,0.435,0.431167,0.463333,0.181596,834,6736,7570 +651,2012-10-12,4,1,10,0,5,1,1,0.4375,0.433071,0.539167,0.235092,1060,6222,7282 +652,2012-10-13,4,1,10,0,6,0,1,0.393333,0.391396,0.494583,0.146142,2252,4857,7109 +653,2012-10-14,4,1,10,0,0,0,1,0.521667,0.508204,0.640417,0.278612,2080,4559,6639 +654,2012-10-15,4,1,10,0,1,1,2,0.561667,0.53915,0.7075,0.296037,760,5115,5875 +655,2012-10-16,4,1,10,0,2,1,1,0.468333,0.460846,0.558333,0.182221,922,6612,7534 +656,2012-10-17,4,1,10,0,3,1,1,0.455833,0.450108,0.692917,0.101371,979,6482,7461 +657,2012-10-18,4,1,10,0,4,1,2,0.5225,0.512625,0.728333,0.236937,1008,6501,7509 +658,2012-10-19,4,1,10,0,5,1,2,0.563333,0.537896,0.815,0.134954,753,4671,5424 +659,2012-10-20,4,1,10,0,6,0,1,0.484167,0.472842,0.572917,0.117537,2806,5284,8090 +660,2012-10-21,4,1,10,0,0,0,1,0.464167,0.456429,0.51,0.166054,2132,4692,6824 +661,2012-10-22,4,1,10,0,1,1,1,0.4875,0.482942,0.568333,0.0814833,830,6228,7058 +662,2012-10-23,4,1,10,0,2,1,1,0.544167,0.530304,0.641667,0.0945458,841,6625,7466 +663,2012-10-24,4,1,10,0,3,1,1,0.5875,0.558721,0.63625,0.0727792,795,6898,7693 +664,2012-10-25,4,1,10,0,4,1,2,0.55,0.529688,0.800417,0.124375,875,6484,7359 +665,2012-10-26,4,1,10,0,5,1,2,0.545833,0.52275,0.807083,0.132467,1182,6262,7444 +666,2012-10-27,4,1,10,0,6,0,2,0.53,0.515133,0.72,0.235692,2643,5209,7852 +667,2012-10-28,4,1,10,0,0,0,2,0.4775,0.467771,0.694583,0.398008,998,3461,4459 +668,2012-10-29,4,1,10,0,1,1,3,0.44,0.4394,0.88,0.3582,2,20,22 +669,2012-10-30,4,1,10,0,2,1,2,0.318182,0.309909,0.825455,0.213009,87,1009,1096 +670,2012-10-31,4,1,10,0,3,1,2,0.3575,0.3611,0.666667,0.166667,419,5147,5566 +671,2012-11-01,4,1,11,0,4,1,2,0.365833,0.369942,0.581667,0.157346,466,5520,5986 +672,2012-11-02,4,1,11,0,5,1,1,0.355,0.356042,0.522083,0.266175,618,5229,5847 +673,2012-11-03,4,1,11,0,6,0,2,0.343333,0.323846,0.49125,0.270529,1029,4109,5138 +674,2012-11-04,4,1,11,0,0,0,1,0.325833,0.329538,0.532917,0.179108,1201,3906,5107 +675,2012-11-05,4,1,11,0,1,1,1,0.319167,0.308075,0.494167,0.236325,378,4881,5259 +676,2012-11-06,4,1,11,0,2,1,1,0.280833,0.281567,0.567083,0.173513,466,5220,5686 +677,2012-11-07,4,1,11,0,3,1,2,0.295833,0.274621,0.5475,0.304108,326,4709,5035 +678,2012-11-08,4,1,11,0,4,1,1,0.352174,0.341891,0.333478,0.347835,340,4975,5315 +679,2012-11-09,4,1,11,0,5,1,1,0.361667,0.355413,0.540833,0.214558,709,5283,5992 +680,2012-11-10,4,1,11,0,6,0,1,0.389167,0.393937,0.645417,0.0578458,2090,4446,6536 +681,2012-11-11,4,1,11,0,0,0,1,0.420833,0.421713,0.659167,0.1275,2290,4562,6852 +682,2012-11-12,4,1,11,1,1,0,1,0.485,0.475383,0.741667,0.173517,1097,5172,6269 +683,2012-11-13,4,1,11,0,2,1,2,0.343333,0.323225,0.662917,0.342046,327,3767,4094 +684,2012-11-14,4,1,11,0,3,1,1,0.289167,0.281563,0.552083,0.199625,373,5122,5495 +685,2012-11-15,4,1,11,0,4,1,2,0.321667,0.324492,0.620417,0.152987,320,5125,5445 +686,2012-11-16,4,1,11,0,5,1,1,0.345,0.347204,0.524583,0.171025,484,5214,5698 +687,2012-11-17,4,1,11,0,6,0,1,0.325,0.326383,0.545417,0.179729,1313,4316,5629 +688,2012-11-18,4,1,11,0,0,0,1,0.3425,0.337746,0.692917,0.227612,922,3747,4669 +689,2012-11-19,4,1,11,0,1,1,2,0.380833,0.375621,0.623333,0.235067,449,5050,5499 +690,2012-11-20,4,1,11,0,2,1,2,0.374167,0.380667,0.685,0.082725,534,5100,5634 +691,2012-11-21,4,1,11,0,3,1,1,0.353333,0.364892,0.61375,0.103246,615,4531,5146 +692,2012-11-22,4,1,11,1,4,0,1,0.34,0.350371,0.580417,0.0528708,955,1470,2425 +693,2012-11-23,4,1,11,0,5,1,1,0.368333,0.378779,0.56875,0.148021,1603,2307,3910 +694,2012-11-24,4,1,11,0,6,0,1,0.278333,0.248742,0.404583,0.376871,532,1745,2277 +695,2012-11-25,4,1,11,0,0,0,1,0.245833,0.257583,0.468333,0.1505,309,2115,2424 +696,2012-11-26,4,1,11,0,1,1,1,0.313333,0.339004,0.535417,0.04665,337,4750,5087 +697,2012-11-27,4,1,11,0,2,1,2,0.291667,0.281558,0.786667,0.237562,123,3836,3959 +698,2012-11-28,4,1,11,0,3,1,1,0.296667,0.289762,0.50625,0.210821,198,5062,5260 +699,2012-11-29,4,1,11,0,4,1,1,0.28087,0.298422,0.555652,0.115522,243,5080,5323 +700,2012-11-30,4,1,11,0,5,1,1,0.298333,0.323867,0.649583,0.0584708,362,5306,5668 +701,2012-12-01,4,1,12,0,6,0,2,0.298333,0.316904,0.806667,0.0597042,951,4240,5191 +702,2012-12-02,4,1,12,0,0,0,2,0.3475,0.359208,0.823333,0.124379,892,3757,4649 +703,2012-12-03,4,1,12,0,1,1,1,0.4525,0.455796,0.7675,0.0827208,555,5679,6234 +704,2012-12-04,4,1,12,0,2,1,1,0.475833,0.469054,0.73375,0.174129,551,6055,6606 +705,2012-12-05,4,1,12,0,3,1,1,0.438333,0.428012,0.485,0.324021,331,5398,5729 +706,2012-12-06,4,1,12,0,4,1,1,0.255833,0.258204,0.50875,0.174754,340,5035,5375 +707,2012-12-07,4,1,12,0,5,1,2,0.320833,0.321958,0.764167,0.1306,349,4659,5008 +708,2012-12-08,4,1,12,0,6,0,2,0.381667,0.389508,0.91125,0.101379,1153,4429,5582 +709,2012-12-09,4,1,12,0,0,0,2,0.384167,0.390146,0.905417,0.157975,441,2787,3228 +710,2012-12-10,4,1,12,0,1,1,2,0.435833,0.435575,0.925,0.190308,329,4841,5170 +711,2012-12-11,4,1,12,0,2,1,2,0.353333,0.338363,0.596667,0.296037,282,5219,5501 +712,2012-12-12,4,1,12,0,3,1,2,0.2975,0.297338,0.538333,0.162937,310,5009,5319 +713,2012-12-13,4,1,12,0,4,1,1,0.295833,0.294188,0.485833,0.174129,425,5107,5532 +714,2012-12-14,4,1,12,0,5,1,1,0.281667,0.294192,0.642917,0.131229,429,5182,5611 +715,2012-12-15,4,1,12,0,6,0,1,0.324167,0.338383,0.650417,0.10635,767,4280,5047 +716,2012-12-16,4,1,12,0,0,0,2,0.3625,0.369938,0.83875,0.100742,538,3248,3786 +717,2012-12-17,4,1,12,0,1,1,2,0.393333,0.4015,0.907083,0.0982583,212,4373,4585 +718,2012-12-18,4,1,12,0,2,1,1,0.410833,0.409708,0.66625,0.221404,433,5124,5557 +719,2012-12-19,4,1,12,0,3,1,1,0.3325,0.342162,0.625417,0.184092,333,4934,5267 +720,2012-12-20,4,1,12,0,4,1,2,0.33,0.335217,0.667917,0.132463,314,3814,4128 +721,2012-12-21,4,1,12,0,5,1,2,0.326667,0.301767,0.556667,0.374383,221,3402,3623 +722,2012-12-22,4,1,12,0,6,0,1,0.265833,0.236113,0.44125,0.407346,205,1544,1749 +723,2012-12-23,4,1,12,0,0,0,1,0.245833,0.259471,0.515417,0.133083,408,1379,1787 +724,2012-12-24,4,1,12,0,1,1,2,0.231304,0.2589,0.791304,0.0772304,174,746,920 +725,2012-12-25,4,1,12,1,2,0,2,0.291304,0.294465,0.734783,0.168726,440,573,1013 +726,2012-12-26,4,1,12,0,3,1,3,0.243333,0.220333,0.823333,0.316546,9,432,441 +727,2012-12-27,4,1,12,0,4,1,2,0.254167,0.226642,0.652917,0.350133,247,1867,2114 +728,2012-12-28,4,1,12,0,5,1,2,0.253333,0.255046,0.59,0.155471,644,2451,3095 +729,2012-12-29,4,1,12,0,6,0,2,0.253333,0.2424,0.752917,0.124383,159,1182,1341 +730,2012-12-30,4,1,12,0,0,0,1,0.255833,0.2317,0.483333,0.350754,364,1432,1796 +731,2012-12-31,4,1,12,0,1,1,2,0.215833,0.223487,0.5775,0.154846,439,2290,2729 diff --git a/proyecto-python/src/__pycache__/bike_renting_info.cpython-39-DESKTOP-3U00DC0.pyc b/proyecto-python/src/__pycache__/bike_renting_info.cpython-39-DESKTOP-3U00DC0.pyc new file mode 100644 index 0000000..688f869 Binary files /dev/null and b/proyecto-python/src/__pycache__/bike_renting_info.cpython-39-DESKTOP-3U00DC0.pyc differ diff --git a/proyecto-python/src/__pycache__/bike_renting_info.cpython-39.pyc b/proyecto-python/src/__pycache__/bike_renting_info.cpython-39.pyc new file mode 100644 index 0000000..aec3ec0 Binary files /dev/null and b/proyecto-python/src/__pycache__/bike_renting_info.cpython-39.pyc differ diff --git a/proyecto-python/src/__pycache__/main.cpython-39.pyc b/proyecto-python/src/__pycache__/main.cpython-39.pyc new file mode 100644 index 0000000..947ea89 Binary files /dev/null and b/proyecto-python/src/__pycache__/main.cpython-39.pyc differ diff --git a/proyecto-python/src/__pycache__/rent_bikes_info.cpython-39.pyc b/proyecto-python/src/__pycache__/rent_bikes_info.cpython-39.pyc new file mode 100644 index 0000000..a868c2e Binary files /dev/null and b/proyecto-python/src/__pycache__/rent_bikes_info.cpython-39.pyc differ diff --git a/proyecto-python/src/bike_renting_info.py b/proyecto-python/src/bike_renting_info.py new file mode 100644 index 0000000..2d0161d --- /dev/null +++ b/proyecto-python/src/bike_renting_info.py @@ -0,0 +1,328 @@ +from collections import namedtuple, Counter +import csv +import datetime +import string +from modules.parsers import * +import matplotlib.pyplot as plt + +#----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# PRIMERA ENTREGA +#----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +tupla_datos = namedtuple("Registro", ["instant","dteday","season","yr","mnth","holiday","weekday","workingday","weathersit","temp","atemp","hum","windspeed","casual","registered","cnt"]) + +def lee_fichero(fichero): + ''' + Función que lee un fichero csv codificado en utf-8 + y convierte los datos en una lista de tuplas. Los + valores de esta lista de tuplas luego se asignan a + la namedtuple definida al principio. + + ARGUMENTOS: + - fichero (string): ruta del fichero + DEVUELVE: + - tupla_datos (namedtuple): ["Registro", (instant, dteday, season, yr, mnth, holiday, weekday, workingday, weathersit, temp, atemp, hum, windspeed, casual, registered, cnt)] -> [str, (int, str, int, int, int, bool, int, bool, int, float, float, float, float, int, int, int)] + + Cada columna de data.csv se corresponde con un día del año con los datos: + - Día + - Fecha + - Estación + - Año + - Mes + - Vacaciones (S/N) + - Día de la semana + - Día laborable (S/N) + - Clima + - Temperatura (ºC) + - Sensación térmica + - Humedad (%) + - Velocidad del viento (Km/h) + - Usuario no registrado + - Usuario registrado + - Alquileres totales de bicis (usuarios registrados y no registrados) + ''' + with open(fichero, encoding="utf-8") as f: + lector = csv.reader(f) + next(lector) + registros = [] + for registro in lector: + instant = int(registro[0]) + dteday = date_parser(str(registro[1])) + season = season_parser(int(registro[2])) + yr = year_parser(int(registro[3])) + mnth = month_parser(int(registro[4])) + holiday = int_to_bool(int(registro[5])) + weekday = weekday_parser(int(registro[6])) + workingday = int_to_bool(int(registro[7])) + weathersit = int(registro[8]) + temp = temp_parser(float(registro[9])) + atemp = atemp_parser(float(registro[10])) + hum = hum_parser(float(registro[11])) + windspeed = wind_parser(float(registro[12])) + casual = int(registro[13]) + registered = int(registro[14]) + cnt = int(registro[15]) + tupla_registros = tupla_datos(instant,dteday, season, yr, mnth, holiday, weekday, workingday, weathersit, temp, atemp, hum, windspeed, casual, registered, cnt) + registros.append(tupla_registros) + return registros + +#----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# SEGUNDA ENTREGA +#----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +# ================================ BLOQUE I =============================== +def filtra_por_estacion(datos, estacion): + """ + Esta función recorre la namedtuple tipo Registro buscando + la estación especificada para filtrar los datos respecto + a ella. + + ARGUMENTOS: + datos (lista): lista de namedtuples tipo Registro + estacion (string): Invierno, Primavera, Verano, Otoño + + DEVUELVE: + filtro (lista): datos filtrados respecto a la estación especificada + """ + return [d for d in datos if estacion == d.season] + +def total_usuarios_registrados_por_estacion(datos, estacion): + """ + Esta función calcula el total de usuarios registrados + durante una estación concreta. + + ARGUMENTOS: + datos (lista): lista de namedtuples tipo Registro + estacion (string): Invierno, Primavera, Verano, Otoño + + DEVUELVE: + registrados (int): número total de usuarios registrados + durante la estación + """ + return sum(d.registered for d in datos if estacion==d.season) +# ========================================================================= + +# =============================== BLOQUE II =============================== +def maximo_usuarios_registrados_por_estacion_y_año(datos, estacion, año): + """ + Esta función calcula el máximo de usuarios registrados durante + una estación concreta de un año específico. + + ARGUMENTOS: + datos (lista): lista de namedtuples tipo Registro + estacion (string): Invierno, Primavera, Verano, Otoño + año (int): 2011, 2012 + + DEVUELVE: + lista (list): [Registro(instant, dteday, season, yr, mnth, holiday, weekday, workingday, weathersit, temp, atemp, hum, windspeed, casual, registered, cnt)] + """ + return max([d.registered for d in datos if estacion == d.season and año == d.yr]) + +def ordena_usuarios_registrados_por_estacion_y_año(datos, estacion, año): + """ + Esta función devuelve una lista de namedtuples tipo Registro + ordenadas de mayor a menor filtrando por los usuarios + registrados en cada estación de un año específico. + + ARGUMENTOS: + datos (lista): lista de namedtuples tipo Registro + estacion (string): Invierno, Primavera, Verano, Otoño + año (int): 2011, 2012 + + DEVUELVE: + lista (list): [Registro(instant, dteday, season, yr, mnth, holiday, weekday, workingday, weathersit, temp, atemp, hum, windspeed, casual, registered, cnt)] + """ + return sorted([d for d in datos if año == d.yr and estacion == d.season], key=lambda d: d.registered, reverse=True) + +def vacaciones_por_mes_y_año(datos): + ''' + Esta función devuelve un diccionario con los días (fecha completa) + que son festivos de cada mes. En el diccionario la clave es el mes + y el valor la lista de días. + + ARGUMENTOS: + datos (lista): lista de namedtuples tipo Registro + + DEVUELVE: + s (dict) -> {Mes:[Días festivos]} + ''' + s = dict() + # Creación del diccionario + for d in datos: + key = d.mnth + if key not in s: + s[key] = [] + elif key in s: + if d.mnth in s.keys() and d.holiday == True: + s[d.mnth].append(datetime.strftime(d.dteday,"%d/%m/%Y")) + return s +# ========================================================================= + +#----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# TERCERA ENTREGA +#----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +# =============================== BLOQUE III ============================== +def total_laborables_por_mes_y_año(datos, año): + ''' + Esta función devuelve un diccionario con los días (fecha completa) + que son festivos de cada mes. En el diccionario la clave es el mes + y el valor la lista de días. + + ARGUMENTOS: + datos (lista): lista de namedtuples tipo Registro + + DEVUELVE: + s (dict) -> {Mes:[Días festivos]} + ''' + s = dict() + # Creación del diccionario + for d in datos: + key = d.mnth + if key not in s: + s[key] = 0 + elif key in s: + if d.mnth in s.keys() and d.workingday == True and año == d.yr: + s[d.mnth]+=1 + return s + +def moda_temperatura(datos): + ''' + Esta función devuelve un diccionario tipo Counter + con las veces que se repite cada valor de temperatura + (d.temp) para luego ver cuál se repite más. + + ARGUMENTOS: + datos (lista): lista de namedtuples tipo Registro + + DEVUELVE: + s (dict) -> Counter({d.temp:veces}) + ''' + return Counter([d.temp for d in datos]) + +def humedad_maxima_por_mes_y_año(datos, año): + ''' + Esta función devuelve un diccionario en el que las + claves son los meses y los valores el valor máximo + de humedad en porcentajes (%). + + ARGUMENTOS: + datos (lista): lista de namedtuples tipo Registro + + DEVUELVE: + s (dict) -> {d.mnth:max(d.hum)} + ''' + s = dict() + # Creación del diccionario + for d in datos: + key = d.mnth + if key not in s: + s[key] = 0 + elif key in s: + if d.mnth in s.keys() and año == d.yr: + s[d.mnth]=max([d.hum for d in datos if key == d.mnth]) + return s + +def incremento_usuarios_registrados(datos): + ''' + Esta función devuelve una lista de los incrementos + porcentuales de usuarios registrados del 2012 respecto + al 2011. + + ARGUMENTOS: + datos (lista): lista de namedtuples tipo Registro + + DEVUELVE: + l (list) -> [porcentaje_Enero,...,porcentaje_Diciembre] + ''' + meses = [] + for d in datos: + if d.mnth not in meses: + meses.append(d.mnth) + + s_2011 = dict() + for d in datos: + key = d.mnth + if key not in s_2011: + s_2011[key] = 0 + elif key in s_2011: + for mes in meses: + if mes == d.mnth: + s_2011[d.mnth]=sum(d.registered for d in datos if 2011 == d.yr and key == d.mnth) + + s_2012 = dict() + for d in datos: + key = d.mnth + if key not in s_2012: + s_2012[key] = 0 + elif key in s_2012: + for mes in meses: + if mes == d.mnth: + s_2012[d.mnth]=sum(d.registered for d in datos if 2012 == d.yr and key == d.mnth) + + l = [] + for d in datos: + incremento_porcentual = round((s_2012[d.mnth]-s_2011[d.mnth])/s_2011[d.mnth]*100,2) + if incremento_porcentual not in l: + l.append(incremento_porcentual) + + return l +# ========================================================================= + +# =============================== BLOQUE IV =============================== +def dibuja_grafica_incremento_usuarios_registrados(datos): + ''' + Esta función grafica una gráfica basada en los datos de la función + anterior, la cuál calculaba los incrementos porcentuales de los usuarios + registrados por mes. + + ARGUMENTOS: + datos (lista): lista de namedtuples tipo Registro + + DEVUELVE: + none (dibuja una gráfica) + ''' + v = incremento_usuarios_registrados(datos) + m = [i for i in range(1,13)] + plt.plot(m,v) + plt.title("Incremento porcentual respecto a meses") + plt.xlabel("Meses en números") + plt.ylabel("Incremento porcentual usuarios registrados") + plt.show() +# ========================================================================= + +# =============================== DEFENSA ================================= +def estacion_temperatura_humedad(datos): + ''' + Esta función toma como parámetro el dataset y devuelve + la estació, temperatura y humedad en tuplas en una lista. + ARGUMENTOS: + datos (lista): lista de namedtuples tipo Registro + DEVUELVE: + lista (list): lista de tuplas tipo [(estacion,temperatura,humedad)] + ''' + climatologia = namedtuple("Clima","Estacion,Temperatura,Humedad") + lista = [] + for d in datos: + tupla = climatologia(d.season,d.temp,d.hum) + lista.append(tupla) + return lista + +def media_temperaturas_por_estacion(datos, humedad): + s = dict() + for d in datos: + key = d.season + if d.hum > humedad: + if key not in s: + s[key] = [d.temp] + elif key in s: + s[key].append(d.temp) + + t = dict() + for i in s: + key = d.season + if key not in t: + t[key] = 0 + elif key in t: + t[key] = sum(s[i])/len(s) + return t +# ========================================================================= \ No newline at end of file diff --git a/proyecto-python/src/bike_renting_info_test.py b/proyecto-python/src/bike_renting_info_test.py new file mode 100644 index 0000000..540a7d1 --- /dev/null +++ b/proyecto-python/src/bike_renting_info_test.py @@ -0,0 +1,143 @@ +from bike_renting_info import * + +# MÉTODO DE LECTURA DEL FICHERO +def lee_fichero_test(datos): + print(f"\n\n{colores.FAIL}{colores.BOLD}PRUEBA DE LA FUNCIÓN lee_fichero{colores.ENDC}") + print(datos[0:2]) + print(".\n.\n.") + print(datos[729:731]) + + print(f"{colores.OKCYAN}Se han leído", len(datos), f"registros de datos.{colores.ENDC}\n\n") + +# ================================ BLOQUE I =============================== +def filtra_por_estacion_test(datos): + s = "Primavera" + d = filtra_por_estacion(datos, s) + print(f"{colores.FAIL}{colores.BOLD}PRUEBA DE LA FUNCIÓN filtra_por_estacion{colores.ENDC}") + print(d[0:2]) + print(".\n.\n.") + print(d[len(d)-2:len(d)]) + + print(f"{colores.OKCYAN}Se han leido",len(d),f"datos sobre la estación {s}.{colores.ENDC}\n\n") + +def total_usuarios_registrados_por_estacion_test(datos): + s = "Invierno" + d = total_usuarios_registrados_por_estacion(datos, s) + print(f"{colores.FAIL}{colores.BOLD}PRUEBA DE LA FUNCIÓN total_usuarios_registrados_por_estacion{colores.ENDC}") + print(f"{colores.OKCYAN}Se registraron",d,f"usuarios en {s}.{colores.ENDC}\n\n") +# ========================================================================= + + + +# =============================== BLOQUE II =============================== +def maximo_usuarios_registrados_por_estacion_y_año_test(datos): + s = "Otoño" + y = 2011 + d = maximo_usuarios_registrados_por_estacion_y_año(datos,s,y) + print(f"{colores.FAIL}{colores.BOLD}PRUEBA DE LA FUNCIÓN maximo_usuarios_registrados_por_estacion_y_año{colores.ENDC}") + print(f"{colores.OKCYAN}El máximo de usuarios registrados en {s} en el año {y} es {d}.{colores.ENDC}\n\n") + +def ordena_usuarios_registrados_por_estacion_y_año_test(datos): + y = 2011 + s = "Verano" + d = ordena_usuarios_registrados_por_estacion_y_año(datos,s,y) + print(f"{colores.FAIL}{colores.BOLD}PRUEBA DE LA FUNCIÓN ordena_usuarios_registrados_por_estacion_y_año{colores.ENDC}") + print(d[:3],"\n.\n.\n.\n",d[len(d)-3:len(d)]) + print(f"{colores.OKCYAN}Se han leído",len(d),f"datos de {s} del año {y} {colores.ENDC}\n\n") + +def vacaciones_por_mes_y_año_test(datos): + d = vacaciones_por_mes_y_año(datos) + print(f"{colores.FAIL}{colores.BOLD}PRUEBA DE LA FUNCIÓN vacaciones_por_mes_y_año{colores.ENDC}") + print(f"{d}") + print(f"{colores.OKCYAN}Cada valor de las claves corresponde a la lista de días festivos.{colores.ENDC}\n\n") +# ========================================================================= + + + +# =============================== BLOQUE III ============================== +def total_laborables_por_mes_y_año_test(datos): + y = 2011 + d = total_laborables_por_mes_y_año(datos, y) + print(f"{colores.FAIL}{colores.BOLD}PRUEBA DE LA FUNCIÓN total_laborables_por_mes_y_año{colores.ENDC}") + print(f"{colores.OKCYAN}Datos del año: {y}{colores.ENDC}") + print(f"{d}") + print(f"{colores.OKCYAN}Cada valor de las claves corresponde al total de días laborables de cada mes.{colores.ENDC}\n\n") + +def moda_temperatura_test(datos): + d = moda_temperatura(datos) + print(f"{colores.FAIL}{colores.BOLD}PRUEBA DE LA FUNCIÓN moda_temperatura{colores.ENDC}") + print(f"{colores.OKCYAN}La temperatura más repetida es {d.most_common(1)[0][0]}ºC.{colores.ENDC}\n\n") + +def humedad_maxima_por_mes_y_año_test(datos): + y = 2011 + d = humedad_maxima_por_mes_y_año(datos,y) + print(f"{colores.FAIL}{colores.BOLD}PRUEBA DE LA FUNCIÓN humedad_maxima_por_mes_y_año{colores.ENDC}") + print(f"{colores.OKCYAN}Datos del año: {y}{colores.ENDC}") + print(f"{d}") + print(f"{colores.OKCYAN}Cada valor de las claves corresponde al máximo de humedad de cada mes.{colores.ENDC}\n\n") + +def incremento_usuarios_registrados_test(datos): + d = incremento_usuarios_registrados(datos) + print(f"{colores.FAIL}{colores.BOLD}PRUEBA DE LA FUNCIÓN incremento_usuarios_registrados{colores.ENDC}") + print(f"Incremento de usuarios registrados en Enero: {d[0]} %") + print(f"Incremento de usuarios registrados en Febrero: {d[1]} %") + print(f"Incremento de usuarios registrados en Marzo: {d[2]} %") + print(f"Incremento de usuarios registrados en Abril: {d[3]} %") + print(f"Incremento de usuarios registrados en Mayo: {d[4]} %") + print(f"Incremento de usuarios registrados en Junio: {d[5]} %") + print(f"Incremento de usuarios registrados en Julio: {d[6]} %") + print(f"Incremento de usuarios registrados en Agosto: {d[7]} %") + print(f"Incremento de usuarios registrados en Septiembre: {d[8]} %") + print(f"Incremento de usuarios registrados en Octubre: {d[9]} %") + print(f"Incremento de usuarios registrados en Noviembre: {d[10]} %") + print(f"Incremento de usuarios registrados en Diciembre: {d[11]} %") + print(f"{colores.OKCYAN}Datos del año 2012 respecto a 2011.{colores.ENDC}\n\n") +# ========================================================================= + + + +# =============================== BLOQUE IV =============================== +def dibuja_grafica_incremento_usuarios_registrados_test(datos): + print(f"{colores.FAIL}{colores.BOLD}PRUEBA DE LA FUNCIÓN dibuja_grafica_incremento_usuarios_registrados{colores.ENDC}") + print(f"{colores.OKCYAN}Se ha dibujado la gráfica.{colores.ENDC}\n\n") + dibuja_grafica_incremento_usuarios_registrados(datos) +# ========================================================================= + + + + +# =============================== DEFENSA =============================== +def estacion_temperatura_humedad_test(datos): + d = estacion_temperatura_humedad(datos) + print(f"{colores.FAIL}{colores.BOLD}PRUEBA DE LA FUNCIÓN estacion_temperatura_humedad{colores.ENDC}") + print(d[:3],"\n.\n.\n.\n",d[len(d)-3:len(d)],"\n\n") + +def media_temperaturas_por_estacion_test(datos): + t = 25.0 + d = media_temperaturas_por_estacion(datos,t) + print(f"{colores.FAIL}{colores.BOLD}PRUEBA DE LA FUNCIÓN media_temperaturas_por_estacion{colores.ENDC}") + print(d) + print("\n\n") +# ========================================================================= + +# PROGRAMA PRINCIPAL (main) +def main(): + datalist = lee_fichero("./data/data.csv") + + lee_fichero_test(datalist) + filtra_por_estacion_test(datalist) + total_usuarios_registrados_por_estacion_test(datalist) + maximo_usuarios_registrados_por_estacion_y_año_test(datalist) + ordena_usuarios_registrados_por_estacion_y_año_test(datalist) + vacaciones_por_mes_y_año_test(datalist) + total_laborables_por_mes_y_año_test(datalist) + moda_temperatura_test(datalist) + humedad_maxima_por_mes_y_año_test(datalist) + incremento_usuarios_registrados_test(datalist) + dibuja_grafica_incremento_usuarios_registrados_test(datalist) + estacion_temperatura_humedad_test(datalist) + media_temperaturas_por_estacion_test(datalist) + + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/proyecto-python/src/modules/__pycache__/aux_functions.cpython-39.pyc b/proyecto-python/src/modules/__pycache__/aux_functions.cpython-39.pyc new file mode 100644 index 0000000..c2a27f5 Binary files /dev/null and b/proyecto-python/src/modules/__pycache__/aux_functions.cpython-39.pyc differ diff --git a/proyecto-python/src/modules/__pycache__/parsers.cpython-39.pyc b/proyecto-python/src/modules/__pycache__/parsers.cpython-39.pyc new file mode 100644 index 0000000..5032992 Binary files /dev/null and b/proyecto-python/src/modules/__pycache__/parsers.cpython-39.pyc differ diff --git a/proyecto-python/src/modules/parsers.py b/proyecto-python/src/modules/parsers.py new file mode 100644 index 0000000..6da2790 --- /dev/null +++ b/proyecto-python/src/modules/parsers.py @@ -0,0 +1,223 @@ +from datetime import datetime + +def year_parser(año): + """ + Este parser convierte valores int a valores str de los años leídos. + + ARGUMENTOS: + año (int): año leído de los datos del .csv + + DEVUELVE: + res (str): año leído convertido a str + """ + res = None + if año == 1: + res = 2012 + elif año == 0: + res = 2011 + return res + +def season_parser(estacion): + """ + Este parser convierte valores int a valores str de las estaciones leídas. + + ARGUMENTOS: + estacion (int): estación leída de los datos del .csv + + DEVUELVE: + res (str): estación leída convertida a str + """ + res = None + if estacion == 1: + res = "Invierno" + elif estacion == 2: + res = "Primavera" + elif estacion == 3: + res = "Verano" + elif estacion == 4: + res = "Otoño" + return res + +def weekday_parser(dia): + """ + Este parser convierte valores int a valores str de los días leídos. + + ARGUMENTOS: + dia (int): día leído de los datos del .csv + + DEVUELVE: + res (str): día leído convertido a str + """ + res = None + if dia == 0: + res = "Domingo" + elif dia == 1: + res = "Lunes" + elif dia == 2: + res = "Martes" + elif dia == 3: + res = "Miércoles" + elif dia == 4: + res = "Jueves" + elif dia == 5: + res = "Viernes" + elif dia == 6: + res = "Sábado" + return res + +def month_parser(mes): + """ + Este parser convierte valores int a valores str de los meses leídos. + + ARGUMENTOS: + mes (int): mes leído de los datos del .csv + + DEVUELVE: + res (str): mes leído convertido a str + """ + res = None + if mes == 1: + res = "Enero" + elif mes == 2: + res = "Febrero" + elif mes == 3: + res = "Marzo" + elif mes == 4: + res = "Abril" + elif mes == 5: + res = "Mayo" + elif mes == 6: + res = "Junio" + elif mes == 7: + res = "Julio" + elif mes == 8: + res = "Agosto" + elif mes == 9: + res = "Septiembre" + elif mes == 10: + res = "Octubre" + elif mes == 11: + res = "Noviembre" + elif mes == 12: + res = "Diciembre" + return res + +def temp_parser(temp): + """ + Este parser convierte los valores de temperatura + a sus valores reales multiplicándolos por su máximo + y redondeando a dos cifras decimales. + + ARGUMENTOS: + temp (float): temperatura leída de los datos del .csv + + DEVUELVE: + res (float): temperatura leída convertida a su valor real en celsius + """ + res = round(temp * 41, 2) + return res + +def atemp_parser(atemp): + """ + Este parser convierte los valores de sensación térmica + a sus valores reales multiplicándolos por su máximo + y redondeando a dos cifras decimales. + + ARGUMENTOS: + temp (float): sensación térmica leída de los datos del .csv + + DEVUELVE: + res (float): sensación térmica leída convertida a su valor real en celsius + """ + res = round(atemp * 50, 2) + return res + +def hum_parser(hum): + """ + Este parser convierte los valores de humedad + a sus valores reales multiplicándolos por su máximo + y redondeando a dos cifras decimales. + + ARGUMENTOS: + temp (float): humedad leída de los datos del .csv + + DEVUELVE: + res (float): humedad leída convertida a su valor real en porcentaje + """ + res = round(hum * 100, 2) + return res + +def wind_parser(windspeed): + """ + Este parser convierte los valores de velocidad del viento + a sus valores reales multiplicándolos por su máximo + y redondeando a dos cifras decimales. + + ARGUMENTOS: + temp (float): velocidad del viento leída de los datos del .csv + + DEVUELVE: + res (float): velocidad del viento leída convertida a su valor real en km/h + """ + res = round(windspeed * 67, 2) + return res + +def num_to_word(num): + """ + Este parser convierte valores int a valores str de los años. + + ARGUMENTOS: + num (int): año en int leído de los datos del .csv + + DEVUELVE: + res (str): año en int leído convertido a año en str + """ + if num == 2011: + res = "Dos_Mil_Once" + elif num == 2012: + res = "Dos_Mil_Doce" + return res + +def date_parser(fecha): + """ + Este parser convierte valores str a valores datetime de las fechas leídas. + + ARGUMENTOS: + fecha (str): fecha leída de los datos del .csv + + DEVUELVE: + res (datetime): fecha leída convertida a datetime + """ + res = datetime.strptime(fecha, "%Y-%m-%d").date() + return res + +def int_to_bool(int): + """ + Este parser convierte valores int a valores bool. + + ARGUMENTOS: + int (int): int leído de los datos del .csv + + DEVUELVE: + res (bool): int leído convertido a bool + """ + if int == 1: + res = True + else: + res = False + return res + +class colores: + """ + Class para poner colores en la consola al ejecutar bike_renting_info_test + y así mejorar la legibilidad de las salidas de las funciones test. + """ + HEADER = '\033[95m' + OKBLUE = '\033[94m' + OKCYAN = '\033[96m' + OKGREEN = '\033[92m' + WARNING = '\033[93m' + FAIL = '\033[91m' + ENDC = '\033[0m' + BOLD = '\033[1m' + UNDERLINE = '\033[4m'