Compare commits
19 Commits
9ee8a06dd6
...
1.04.26-la
| Author | SHA1 | Date | |
|---|---|---|---|
| 603ac5dbbd | |||
| fda799a8a4 | |||
| 038d4b3b88 | |||
| 4efb0d71ba | |||
| 8708b00b49 | |||
| 2e3da3d249 | |||
| 375fb3f3ed | |||
| 9026c901ba | |||
| cf3d5b4929 | |||
| 0fb5604d2d | |||
| 1a1e7a24d9 | |||
| 19bf68c2aa | |||
| 6e4b3337fb | |||
| 6420a4c606 | |||
| 38a5e37380 | |||
| 3a6968f40f | |||
| 2bf0ca34df | |||
| 73e91b3264 | |||
| 4902c2c492 |
35
Projet.iml
35
Projet.iml
@@ -4,8 +4,43 @@
|
|||||||
<exclude-output />
|
<exclude-output />
|
||||||
<content url="file://$MODULE_DIR$">
|
<content url="file://$MODULE_DIR$">
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
|
||||||
</content>
|
</content>
|
||||||
<orderEntry type="inheritedJdk" />
|
<orderEntry type="inheritedJdk" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
<orderEntry type="module-library" scope="TEST">
|
||||||
|
<library name="JUnit6">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter/6.0.0/junit-jupiter-6.0.0.jar!/" />
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-api/6.0.0/junit-jupiter-api-6.0.0.jar!/" />
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/opentest4j/opentest4j/1.3.0/opentest4j-1.3.0.jar!/" />
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-commons/6.0.0/junit-platform-commons-6.0.0.jar!/" />
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar!/" />
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/jspecify/jspecify/1.0.0/jspecify-1.0.0.jar!/" />
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-params/6.0.0/junit-jupiter-params-6.0.0.jar!/" />
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-engine/6.0.0/junit-jupiter-engine-6.0.0.jar!/" />
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-engine/6.0.0/junit-platform-engine-6.0.0.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
|
<orderEntry type="module-library">
|
||||||
|
<library>
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter/6.0.0/junit-jupiter-6.0.0.jar!/" />
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-api/6.0.0/junit-jupiter-api-6.0.0.jar!/" />
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/opentest4j/opentest4j/1.3.0/opentest4j-1.3.0.jar!/" />
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-commons/6.0.0/junit-platform-commons-6.0.0.jar!/" />
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar!/" />
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/jspecify/jspecify/1.0.0/jspecify-1.0.0.jar!/" />
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-params/6.0.0/junit-jupiter-params-6.0.0.jar!/" />
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-engine/6.0.0/junit-jupiter-engine-6.0.0.jar!/" />
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-engine/6.0.0/junit-platform-engine-6.0.0.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
||||||
@@ -27,7 +27,7 @@ namespace ecoparasite {
|
|||||||
InputFactory o--> RawData
|
InputFactory o--> RawData
|
||||||
|
|
||||||
interface DataParsing {
|
interface DataParsing {
|
||||||
+ HashSet<Poisson> parse()
|
+ HashSet<T> parse()
|
||||||
}
|
}
|
||||||
|
|
||||||
exception InputFileException {
|
exception InputFileException {
|
||||||
@@ -41,12 +41,17 @@ namespace ecoparasite {
|
|||||||
+ String getMessage()
|
+ String getMessage()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exception InvalidParsingException {
|
||||||
|
- int parsingId
|
||||||
|
- String parsingClass
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace ecoparasite.poissons {
|
namespace ecoparasite.poissons {
|
||||||
|
|
||||||
class Poisson {
|
class Poisson {
|
||||||
- String specie
|
- String id
|
||||||
- Double length
|
- Double length
|
||||||
- Double weight
|
- Double weight
|
||||||
- Double infestation
|
- Double infestation
|
||||||
@@ -64,12 +69,54 @@ namespace ecoparasite {
|
|||||||
+ Mackerel()
|
+ Mackerel()
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class PartiePoisson {
|
class PartiePoisson {
|
||||||
|
- String name
|
||||||
|
- Double infestation
|
||||||
|
+ PartiePoisson(String name, Double infestation)
|
||||||
}
|
}
|
||||||
|
|
||||||
Poisson o--> PartiePoisson : # fishParts
|
Poisson o--> PartiePoisson : # fishParts
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace ecoparasite.population {
|
||||||
|
|
||||||
|
class Population implements ecoparasite.input.DataParsing {
|
||||||
|
- String id
|
||||||
|
- HashMap<Integer,PopulationArgs> perYear
|
||||||
|
+ Population()
|
||||||
|
}
|
||||||
|
|
||||||
|
Population o--> PopulationArgs : - total
|
||||||
|
|
||||||
|
class PopulationArgs {
|
||||||
|
- int year
|
||||||
|
- int number
|
||||||
|
- Double intensity
|
||||||
|
- Double abondance
|
||||||
|
+ PopulationArgs()
|
||||||
|
}
|
||||||
|
|
||||||
|
PopulationArgs o--> PopulationArgInterval : - length
|
||||||
|
PopulationArgs o--> PopulationArgInterval : - width
|
||||||
|
PopulationArgs o--> PopulationArgInterval : - prevalence
|
||||||
|
PopulationArgs o--> PopulationArgInterval : - ic
|
||||||
|
|
||||||
|
class PopulationArgInterval {
|
||||||
|
- Double min
|
||||||
|
- Double max
|
||||||
|
- Double mean
|
||||||
|
+ PopulationArgInterval()
|
||||||
|
+ PopulationArgInterval()
|
||||||
|
+ Double transformToDouble()
|
||||||
|
+ {static} PopulationArgInterval fromString()
|
||||||
|
}
|
||||||
|
|
||||||
|
class PopulationParsing {
|
||||||
|
+ {static} HashSet<Population> parseParasitesPeru()
|
||||||
|
- {static} void applyValueForParasitesPeru()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
namespace ecoparasite.unknown {
|
namespace ecoparasite.unknown {
|
||||||
|
|
||||||
note top of ecoparasite.unknown : Ce paquet est temporaire pour des classes / interfaces qui devront avoir plus de déclinaisons.
|
note top of ecoparasite.unknown : Ce paquet est temporaire pour des classes / interfaces qui devront avoir plus de déclinaisons.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
nom.merlu;m.size (mm);number of Anisakis sp L3;m.d15N (<EFBFBD>);m.d13C (<EFBFBD>);m.C/N;m.MeHg (ng g-1 dw);m.IHg (ng g-1 dw);m.THg (ng g-1 dw);m.PCB 101 (ng g-1 dw);m.PCB 118 (ng g-1 dw);m.PCB 138 (ng g-1 dw);m.PCB 149 (ng g-1 dw);m.PCB 153 (ng g-1 dw);m.PCB 180 (ng g-1 dw);m.PCB 194 (ng g-1 dw);m.HHCB (ng g-1 dw);m.AHTN (ng g-1 dw);m.EHMC (ng g-1 dw);;a.d15N (<EFBFBD>);a.d13C (<EFBFBD>);a.CN;a.MeHg (ng g-1 dw);a.IHg (ng g-1 dw);a.THg (ng g-1 dw);a.PCB 101 (ng g-1 dw);a.PCB 118 (ng g-1 dw);a.PCB 138 (ng g-1 dw);a.PCB 149 (ng g-1 dw);a.PCB 153 (ng g-1 dw);a.PCB 180 (ng g-1 dw);a.PCB 194 (ng g-1 dw);a.HHCB (ng g-1 dw);a.AHTN (ng g-1 dw);a.OC (ng g-1 dw)
|
nom.merlu;m.size (mm);number of Anisakis sp L3;m.d15N (‰);m.d13C (‰);m.C/N;m.MeHg (ng g-1 dw);m.IHg (ng g-1 dw);m.THg (ng g-1 dw);m.PCB 101 (ng g-1 dw);m.PCB 118 (ng g-1 dw);m.PCB 138 (ng g-1 dw);m.PCB 149 (ng g-1 dw);m.PCB 153 (ng g-1 dw);m.PCB 180 (ng g-1 dw);m.PCB 194 (ng g-1 dw);m.HHCB (ng g-1 dw);m.AHTN (ng g-1 dw);m.EHMC (ng g-1 dw);;a.d15N (‰);a.d13C (‰);a.CN;a.MeHg (ng g-1 dw);a.IHg (ng g-1 dw);a.THg (ng g-1 dw);a.PCB 101 (ng g-1 dw);a.PCB 118 (ng g-1 dw);a.PCB 138 (ng g-1 dw);a.PCB 149 (ng g-1 dw);a.PCB 153 (ng g-1 dw);a.PCB 180 (ng g-1 dw);a.PCB 194 (ng g-1 dw);a.HHCB (ng g-1 dw);a.AHTN (ng g-1 dw);a.OC (ng g-1 dw)
|
||||||
150318 HKE01;425;237;13.36;-18.23;3.10;610.21;244.26;854.48;2.85;1.59;28.78;9.10;32.84;22.60;3.40;1.26;<LOQ;<LOQ;;10.84;-19.32;5.88;67.69;8.57;76.26;18.26;10.74;45.90;17.54;41.19;32.64;<LOQ;<LOQ;<LOQ;83.21
|
150318 HKE01;425;237;13.36;-18.23;3.10;610.21;244.26;854.48;2.85;1.59;28.78;9.10;32.84;22.60;3.40;1.26;<LOQ;<LOQ;;10.84;-19.32;5.88;67.69;8.57;76.26;18.26;10.74;45.90;17.54;41.19;32.64;<LOQ;<LOQ;<LOQ;83.21
|
||||||
150318 HKE08;527;276;13.44;-18.22;3.15;749.39;1110.64;1860.03;3.25;1.32;27.91;8.73;34.12;22.66;1.73;0.19;<LOQ;<LOQ;;11.57;-18.74;5.01;77.88;14.85;92.73;11.56;6.56;31.88;15.19;37.80;21.68;<LOQ;3.38;2.31;63.30
|
150318 HKE08;527;276;13.44;-18.22;3.15;749.39;1110.64;1860.03;3.25;1.32;27.91;8.73;34.12;22.66;1.73;0.19;<LOQ;<LOQ;;11.57;-18.74;5.01;77.88;14.85;92.73;11.56;6.56;31.88;15.19;37.80;21.68;<LOQ;3.38;2.31;63.30
|
||||||
150318 HKE09;540;454;13.53;-17.99;3.11;796.23;299.18;1095.40;3.74;3.39;25.72;9.04;32.81;13.87;2.80;1.09;0.11;<LOQ;;11.13;-18.69;5.23;86.01;16.39;102.40;10.74;9.06;63.45;22.81;73.25;47.00;<LOQ;1.96;<LOQ;36.78
|
150318 HKE09;540;454;13.53;-17.99;3.11;796.23;299.18;1095.40;3.74;3.39;25.72;9.04;32.81;13.87;2.80;1.09;0.11;<LOQ;;11.13;-18.69;5.23;86.01;16.39;102.40;10.74;9.06;63.45;22.81;73.25;47.00;<LOQ;1.96;<LOQ;36.78
|
||||||
|
|||||||
|
9
data/testComplete.csv
Normal file
9
data/testComplete.csv
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
Sample_code;Station;Latitude;Longitude;Depth;d13C_raw;d13C_corr;d15N;C_N;StandardLength;TrophicLevel;Anisakis_abdominalcavity;Anisakis_Liver;Anisakis_gonads;Anisakis_stomach;NParasitesViscera;Anisakis_Muscle_Right;Anisakis_Muscle_Left;Aniskis_Muscle_total;NParasitesTotal
|
||||||
|
TRACTRA_S0575_A0439;S0575;48.8692264;-4.3976635;96.84;-20.09735065;-19.14374028;12.52361179;4.316778148;257;3.117572211;7;1;0;1;9;1;3;4;13
|
||||||
|
TRACTRA_S0575_A0440;S0575;48.8692264;-4.3976635;96.84;-20.02738845;-19.42703789;12.25444555;3.959950061;252;3.038405671;263;5;0;21;289;12;11;23;312
|
||||||
|
TRACTRA_S0575_A0441;S0575;48.8692264;-4.3976635;96.84;-19.82735569;-18.83090708;12.97020596;4.360049101;254;3.248923438;51;1;12;1;65;2;3;5;70
|
||||||
|
TRACTRA_S0575_A0442;S0575;48.8692264;-4.3976635;96.84;-19.37802102;-18.26777864;13.43393806;4.4749923;242;3.385315231;158;6;0;1;165;9;19;28;193
|
||||||
|
TRACTRA_S0575_A0443;S0575;48.8692264;-4.3976635;96.84;-18.20541518;-18.20541518;12.68793425;3.369189318;254;3.165902347;67;1;10;1;79;1;6;7;86
|
||||||
|
TRACTRA_S0575_A0444;S0575;48.8692264;-4.3976635;96.84;-20.21559661;-18.91007641;12.62442312;4.672242625;251;3.147222601;140;1;0;0;141;3;6;9;150
|
||||||
|
TRACTRA_S0575_A0888;S0575;48.8692264;-4.3976635;96.84;-20.21559661;-18.91007641;12.62442312;4.672242625;259;3.147222601;;;;;;;;;
|
||||||
|
TRACTRA_S0575_A0445;S0575;48.8692264;-4.3976635;96.84;-19.43517323;-19.13886211;11.25439721;3.65283952;258;2.744273805;281;5;0;3;289;1;8;9;298
|
||||||
|
112
data/testNettoie.csv
Normal file
112
data/testNettoie.csv
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
Sample_code;Station;Latitude;Longitude;Depth;d13C_raw;d13C_corr;d15N;C_N;StandardLength;TrophicLevel;Anisakis_abdominalcavity;Anisakis_Liver;Anisakis_gonads;Anisakis_stomach;NParasitesViscera;Anisakis_Muscle_Right;Anisakis_Muscle_Left;Aniskis_Muscle_total;NParasitesTotal
|
||||||
|
TRACTRA_S0575_A0439;S0575;48.8692264;-4.3976635;96.84;-20.09735065;-19.14374028;12.52361179;4.316778148;257;3.117572211;7;1;0;1;9;1;3;4;13
|
||||||
|
TRACTRA_S0575_A0440;S0575;48.8692264;-4.3976635;96.84;-20.02738845;-19.42703789;12.25444555;3.959950061;252;3.038405671;263;5;0;21;289;12;11;23;312
|
||||||
|
TRACTRA_S0575_A0441;S0575;48.8692264;-4.3976635;96.84;-19.82735569;-18.83090708;12.97020596;4.360049101;254;3.248923438;51;1;12;1;65;2;3;5;70
|
||||||
|
TRACTRA_S0575_A0442;S0575;48.8692264;-4.3976635;96.84;-19.37802102;-18.26777864;13.43393806;4.4749923;242;3.385315231;158;6;0;1;165;9;19;28;193
|
||||||
|
TRACTRA_S0575_A0443;S0575;48.8692264;-4.3976635;96.84;-18.20541518;-18.20541518;12.68793425;3.369189318;254;3.165902347;67;1;10;1;79;1;6;7;86
|
||||||
|
TRACTRA_S0575_A0444;S0575;48.8692264;-4.3976635;96.84;-20.21559661;-18.91007641;12.62442312;4.672242625;251;3.147222601;140;1;0;0;141;3;6;9;150
|
||||||
|
TRACTRA_S0575_A0445;S0575;48.8692264;-4.3976635;96.84;-19.43517323;-19.13886211;11.25439721;3.65283952;258;2.744273805;281;5;0;3;289;1;8;9;298
|
||||||
|
TRACTRA_S0575_A0446;S0575;48.8692264;-4.3976635;96.84;-19.98304621;-19.35255493;11.69796704;3.990395229;250;2.87473552;113;2;6;5;126;2;9;11;137
|
||||||
|
TRACTRA_S0575_A0447;S0575;48.8692264;-4.3976635;96.84;-19.4952816;-18.88631609;11.96007648;3.968652028;244;2.951826533;81;2;0;0;83;0;3;3;86
|
||||||
|
TRACTRA_S0575_A0448;S0575;48.8692264;-4.3976635;96.84;-19.94560166;-19.34814395;11.90664648;3.957027986;244;2.936111826;182;0;1;4;187;10;20;30;217
|
||||||
|
TRACTRA_S0577_A0454;S0577;49.2061879;-4.3343404;94.02;-19.0301808;-18.69065175;12.62744746;3.696493987;230;3.212854832;23;0;0;1;24;0;0;0;24
|
||||||
|
TRACTRA_S0577_A0455;S0577;49.2061879;-4.3343404;94.02;-20.15942978;-19.22294902;12.21916159;4.299475509;247;3.092770753;53;0;0;1;54;4;6;10;64
|
||||||
|
TRACTRA_S0577_A0456;S0577;49.2061879;-4.3343404;94.02;-21.11919287;-19.10756928;13.20207201;5.38547838;250;3.381862053;11;0;0;1;12;0;3;3;15
|
||||||
|
TRACTRA_S0577_A0457;S0577;49.2061879;-4.3343404;94.02;-20.47770851;-19.25004326;11.60824496;4.593601258;264;2.913089392;72;7;0;3;82;3;7;10;92
|
||||||
|
TRACTRA_S0577_A0458;S0577;49.2061879;-4.3343404;94.02;-18.80551346;-18.80551346;11.29371363;3.405172632;258;2.820580176;18;2;0;5;25;0;4;4;29
|
||||||
|
TRACTRA_S0577_A0459;S0577;49.2061879;-4.3343404;94.02;-18.55424078;-18.55424078;11.99334422;3.368856741;268;3.02635388;3;0;2;0;5;0;1;1;6
|
||||||
|
TRACTRA_S0577_A0460;S0577;49.2061879;-4.3343404;94.02;-20.65507746;-18.90565571;12.2504131;5.120628022;244;3.101962374;5;0;0;0;5;0;0;0;5
|
||||||
|
TRACTRA_S0577_A0461;S0577;49.2061879;-4.3343404;94.02;-20.2747196;-19.30665873;13.06496861;4.331374612;236;3.341537523;18;0;0;0;18;1;1;2;20
|
||||||
|
TRACTRA_S0577_A0462;S0577;49.2061879;-4.3343404;94.02;-20.4373078;-19.16897407;12.28972952;4.634680534;258;3.113526026;46;0;0;0;46;0;9;9;55
|
||||||
|
TRACTRA_S0577_A0463;S0577;49.2061879;-4.3343404;94.02;-19.45685166;-19.11472538;12.60426085;3.699117451;251;3.206035242;106;0;0;3;109;6;19;25;134
|
||||||
|
TRACTRA_S0754_A0805;S0754;49.6547785;-0.1474217;37.3;-17.83990445;-17.83990445;13.08890102;3.215085281;166;3.453596065;0;0;0;0;0;0;0;0;0
|
||||||
|
TRACTRA_S0754_A0806;S0754;49.6547785;-0.1474217;37.3;-20.15486746;-18.67023918;12.91860136;4.853159877;166;3.403507929;1;0;0;0;1;0;0;0;1
|
||||||
|
TRACTRA_S0754_A0807;S0754;49.6547785;-0.1474217;37.3;-18.26558775;-18.26558775;12.73923249;3.355335311;162;3.350752377;4;1;0;1;6;0;0;0;6
|
||||||
|
TRACTRA_S0754_A0808;S0754;49.6547785;-0.1474217;37.3;-18.30726304;-18.09681562;13.04657803;3.566108505;169;3.441148126;0;0;0;0;0;0;0;0;0
|
||||||
|
TRACTRA_S0754_A0809;S0754;49.6547785;-0.1474217;37.3;-17.48070316;-17.48070316;13.28439294;3.361704857;170;3.511093688;0;0;0;0;0;0;0;0;151
|
||||||
|
TRACTRA_S0754_A0810;S0754;49.6547785;-0.1474217;37.3;-17.78334513;-17.78334513;13.07882412;3.489125859;176;3.45063227;0;0;0;0;0;0;0;0;0
|
||||||
|
TRACTRA_S0754_A0811;S0754;49.6547785;-0.1474217;37.3;-18.28047178;-18.12027726;12.87224761;3.515348002;165;3.389874472;4;0;0;0;4;1;0;1;5
|
||||||
|
TRACTRA_S0754_A0812;S0754;49.6547785;-0.1474217;37.3;-20.27989332;-18.492208;13.65522298;5.159278103;193;3.620161346;4;0;0;0;4;0;0;0;4
|
||||||
|
TRACTRA_S0754_A0813;S0754;49.6547785;-0.1474217;37.3;-18.35389967;-18.35389967;12.72814789;3.262758686;165;3.347492203;1;0;0;0;1;0;0;0;1
|
||||||
|
TRACTRA_S0754_A0814;S0754;49.6547785;-0.1474217;37.3;-18.87880984;-18.22558141;13.21587;4.013362047;166;3.490939882;1;0;0;2;3;0;0;0;3
|
||||||
|
TRACTRA_S0613_A0725;S0613;49.6962144;-3.7446409;77.61;-20.02823743;-19.77660999;13.31184525;3.607704481;108;3.386206548;0;0;0;0;0;0;0;0;0
|
||||||
|
TRACTRA_S0613_A0726;S0613;49.6962144;-3.7446409;77.61;-19.51899808;-19.51899808;13.58432266;3.286796067;109;3.466346962;0;0;0;0;0;0;0;0;0
|
||||||
|
TRACTRA_S0613_A0727;S0613;49.6962144;-3.7446409;77.61;-20.25818465;-19.92813931;13.27363809;3.686914482;112;3.374969147;0;0;0;0;0;0;0;0;0
|
||||||
|
TRACTRA_S0613_A0728;S0613;49.6962144;-3.7446409;77.61;-19.89105861;-19.61530935;13.69693325;3.632069961;110;3.499467723;0;0;0;0;0;0;0;0;0
|
||||||
|
TRACTRA_S0613_A0729;S0613;49.6962144;-3.7446409;77.61;-20.56708371;-20.05444437;13.52500101;3.871352865;105;3.448899418;0;0;0;0;0;0;0;0;0
|
||||||
|
TRACTRA_S0613_A0730;S0613;49.6962144;-3.7446409;77.61;-19.84072681;-19.65364002;13.56220272;3.542511911;102;3.459841098;0;0;0;0;0;0;0;0;0
|
||||||
|
TRACTRA_S0613_A0731;S0613;49.6962144;-3.7446409;77.61;-19.40353102;-19.40353102;13.7894348;3.4531337;112;3.526674063;0;0;0;0;0;0;0;0;0
|
||||||
|
TRACTRA_S0613_A0732;S0613;49.6962144;-3.7446409;77.61;-19.72032526;-19.72032526;13.78440755;3.440747909;108;3.525195458;0;0;0;1;1;0;0;0;1
|
||||||
|
TRACTRA_S0613_A0733;S0613;49.6962144;-3.7446409;77.61;-20.51675191;-20.25700129;13.69190599;3.615909722;108;3.497989118;0;0;0;0;0;0;0;0;0
|
||||||
|
TRACTRA_S0613_A0734;S0613;49.6962144;-3.7446409;77.61;-19.85158269;-19.85158269;13.74821128;3.427824163;105;3.514549498;0;0;0;0;0;0;0;0;0
|
||||||
|
TRACTRA_S0613_A0735;S0613;49.6962144;-3.7446409;77.61;-19.52985396;-18.77319749;12.19277752;4.117834812;155;3.057068981;0;0;0;0;0;0;0;0;0
|
||||||
|
TRACTRA_S0613_A0736;S0613;49.6962144;-3.7446409;77.61;-18.71566314;-18.30038536;12.72566692;3.773007861;151;3.213801156;0;0;0;0;0;0;0;0;0
|
||||||
|
TRACTRA_S0613_A0737;S0613;49.6962144;-3.7446409;77.61;-18.55578567;-18.55578567;12.52055477;3.488579888;148;3.153474054;1;0;0;0;1;0;0;0;1
|
||||||
|
TRACTRA_S0613_A0738;S0613;49.6962144;-3.7446409;77.61;-18.64559339;-18.23789283;12.46525493;3.765354093;159;3.137209395;0;0;0;0;0;0;0;0;0
|
||||||
|
TRACTRA_S0613_A0739;S0613;49.6962144;-3.7446409;77.61;-18.41367237;-18.41367237;12.2078593;3.420834314;152;3.061504797;0;0;0;1;1;0;0;0;1
|
||||||
|
TRACTRA_S0613_A0740;S0613;49.6962144;-3.7446409;77.61;-19.79532951;-18.68335824;12.39487331;4.476738651;152;3.116508919;2;0;0;0;2;0;0;0;2
|
||||||
|
TRACTRA_S0613_A0741;S0613;49.6962144;-3.7446409;77.61;-19.33543506;-18.69166914;12.3576716;4.003803955;168;3.105567239;1;0;0;0;1;0;0;0;1
|
||||||
|
TRACTRA_S0613_A0742;S0613;49.6962144;-3.7446409;77.61;-18.99002077;-18.43223945;12.39386786;3.916950835;155;3.116213198;0;0;0;0;0;0;0;0;0
|
||||||
|
TRACTRA_S0613_A0743;S0613;49.6962144;-3.7446409;77.61;-18.75711286;-18.24630612;12.60501272;3.869501751;152;3.178314625;0;0;0;0;0;0;0;0;0
|
||||||
|
TRACTRA_S0613_A0744;S0613;49.6962144;-3.7446409;77.61;-18.72454522;-18.36228847;12.90363187;3.719451262;154;3.266143788;0;0;0;1;1;0;0;0;1
|
||||||
|
TRACTRA_S0639_A0745;S0639;49.8793196;-3.3251101;73.12;-18.6902161;-18.22204182;12.52076814;3.826438667;161;3.191653695;0;0;0;0;0;0;0;0;0
|
||||||
|
TRACTRA_S0639_A0746;S0639;49.8793196;-3.3251101;73.12;-19.314296;-19.05048806;13.17690571;3.620008022;140;3.384635333;0;0;0;0;0;0;0;0;0
|
||||||
|
TRACTRA_S0639_A0747;S0639;49.8793196;-3.3251101;73.12;-17.51895714;-17.51895714;12.92408206;3.193663511;151;3.310275436;1;0;0;0;1;0;0;0;1
|
||||||
|
TRACTRA_S0639_A0748;S0639;49.8793196;-3.3251101;73.12;-18.54923123;-18.54923123;12.58497732;3.228276352;157;3.210538748;6;0;0;1;7;0;0;0;7
|
||||||
|
TRACTRA_S0639_A0749;S0639;49.8793196;-3.3251101;73.12;-19.71753247;-18.8812651;12.99631739;4.198249861;152;3.33152112;0;0;0;0;0;0;0;0;0
|
||||||
|
TRACTRA_S0639_A0750;S0639;49.8793196;-3.3251101;73.12;-17.97247492;-17.97247492;12.93612128;3.493877982;164;3.313816383;3;0;0;0;3;0;0;0;3
|
||||||
|
TRACTRA_S0639_A0751;S0639;49.8793196;-3.3251101;73.12;-18.22683924;-18.22683924;13.03042851;3.308824647;156;3.341553805;0;1;0;0;1;0;0;0;1
|
||||||
|
TRACTRA_S0639_A0752;S0639;49.8793196;-3.3251101;73.12;-18.65472341;-18.39365742;12.7986735;3.617238364;160;3.273390566;0;0;0;0;0;0;0;0;0
|
||||||
|
TRACTRA_S0639_A0753;S0639;49.8793196;-3.3251101;73.12;-18.20120563;-18.00843545;13.09162789;3.548252699;147;3.359553621;1;0;0;0;1;0;0;0;1
|
||||||
|
TRACTRA_S0639_A0754;S0639;49.8793196;-3.3251101;73.12;-18.62711798;-18.62711798;12.45154262;3.427913827;152;3.171293247;0;0;0;0;0;0;0;0;0
|
||||||
|
TRACTRA_S0670_A0765;S0670;49.9406453;-2.5046981;66.38;-18.39954403;-18.16590933;13.53933859;3.589530001;219;3.44755523;45;1;0;4;50;0;4;4;54
|
||||||
|
TRACTRA_S0670_A0766;S0670;49.9406453;-2.5046981;66.38;-22.61073263;-18.6255476;12.78760162;7.378974781;231;3.226456121;80;1;0;2;83;5;9;14;97
|
||||||
|
TRACTRA_S0670_A0767;S0670;49.9406453;-2.5046981;66.38;-18.96116815;-18.96116815;12.2484873;3.306833193;288;3.067893087;64;0;0;0;64;8;18;26;90
|
||||||
|
TRACTRA_S0670_A0768;S0670;49.9406453;-2.5046981;66.38;-19.73216097;-19.37320368;12.70497102;3.716118472;229;3.202153002;8;0;0;0;8;0;1;1;9
|
||||||
|
TRACTRA_S0670_A0769;S0670;49.9406453;-2.5046981;66.38;-19.16557551;-19.16557551;12.74729401;3.415841427;239;3.214600941;81;3;36;0;120;6;9;15;135
|
||||||
|
TRACTRA_S0670_A0770;S0670;49.9406453;-2.5046981;66.38;-18.85003405;-18.85003405;13.00526273;3.264809579;243;3.290474094;192;1;6;0;199;18;19;37;236
|
||||||
|
TRACTRA_S0670_A0771;S0670;49.9406453;-2.5046981;66.38;-18.87285623;-18.87285623;11.61767317;3.362037589;241;2.882359518;28;2;17;3;50;1;2;3;53
|
||||||
|
TRACTRA_S0670_A0772;S0670;49.9406453;-2.5046981;66.38;-20.42774137;-18.87583805;12.42181004;4.921114462;224;3.118870361;3;16;3;1;23;0;0;0;23
|
||||||
|
TRACTRA_S0670_A0773;S0670;49.9406453;-2.5046981;66.38;-18.57716014;-18.24889867;14.27092176;3.685112599;230;3.662726749;19;1;5;2;27;0;0;0;27
|
||||||
|
TRACTRA_S0670_A0774;S0670;49.9406453;-2.5046981;66.38;-18.91850059;-18.38588965;14.00892228;3.891526197;234;3.585668078;2;0;0;6;8;0;0;0;8
|
||||||
|
TRACTRA_S0705_A0775;S0705;49.9998717;-0.7750398;59.36;-19.22709617;-19.0603341;12.51350986;3.521981887;251;3.145733742;98;8;0;0;106;11;3;14;120
|
||||||
|
TRACTRA_S0705_A0776;S0705;49.9998717;-0.7750398;59.36;-20.77205862;-19.64910728;14.18929884;4.487829645;215;3.638612855;0;0;0;0;0;0;0;0;0
|
||||||
|
TRACTRA_S0705_A0777;S0705;49.9998717;-0.7750398;59.36;-19.9693132;-18.92818389;13.0183627;4.405181126;215;3.294219873;5;0;0;1;6;0;0;0;6
|
||||||
|
TRACTRA_S0705_A0778;S0705;49.9998717;-0.7750398;59.36;-18.89369387;-18.89369387;13.11711635;3.426883767;236;3.323265064;111;9;2;2;124;29;28;57;181
|
||||||
|
TRACTRA_S0705_A0779;S0705;49.9998717;-0.7750398;59.36;-18.92842328;-18.22356212;13.5907308;4.065516322;229;3.462563431;44;2;1;1;48;2;12;14;62
|
||||||
|
TRACTRA_S0705_A0780;S0705;49.9998717;-0.7750398;59.36;-18.87583303;-18.71659415;12.63241731;3.51438271;261;3.180706523;96;1;13;3;113;9;7;16;129
|
||||||
|
TRACTRA_S0705_A0781;S0705;49.9998717;-0.7750398;59.36;-19.76589811;-18.66433058;15.14962771;4.466229823;207;3.921062522;0;1;0;1;2;0;0;0;2
|
||||||
|
TRACTRA_S0705_A0782;S0705;49.9998717;-0.7750398;59.36;-18.77561389;-18.16356616;14.4432368;3.971765386;254;3.71330049;20;3;13;0;36;1;1;2;38
|
||||||
|
TRACTRA_S0705_A0783;S0705;49.9998717;-0.7750398;59.36;-19.35112977;-18.1144013;14.06535293;4.602756025;228;3.602158177;32;0;0;0;32;4;7;11;43
|
||||||
|
TRACTRA_S0705_A0784;S0705;49.9998717;-0.7750398;59.36;-18.20109028;-17.73148198;14.78585151;3.827887172;251;3.814069521;0;0;0;6;6;0;0;0;6
|
||||||
|
TRACTRA_S0601_A0715;S0601;50.0395506;-4.3793424;74.88;-18.23504384;-18.23504384;12.2973445;3.424281959;155;3.161278164;4;0;0;0;4;0;0;0;4
|
||||||
|
TRACTRA_S0601_A0716;S0601;50.0395506;-4.3793424;74.88;-18.88442269;-18.88442269;12.35666615;3.350603714;152;3.178725708;1;0;0;2;3;0;0;0;3
|
||||||
|
TRACTRA_S0601_A0717;S0601;50.0395506;-4.3793424;74.88;-18.29820531;-18.06396027;12.98105165;3.590146502;154;3.362368502;0;0;0;1;1;0;0;0;1
|
||||||
|
TRACTRA_S0601_A0718;S0601;50.0395506;-4.3793424;74.88;-19.62558306;-18.95671633;13.34603061;4.029158314;156;3.469715256;0;0;0;0;0;0;0;0;0
|
||||||
|
TRACTRA_S0601_A0719;S0601;50.0395506;-4.3793424;74.88;-20.07659542;-18.94064042;12.474304;4.500964647;159;3.213325075;0;0;0;0;0;0;0;0;0
|
||||||
|
TRACTRA_S0601_A0720;S0601;50.0395506;-4.3793424;74.88;-18.89823926;-18.55339871;13.00216613;3.701859148;150;3.368578645;3;0;0;2;5;0;0;0;5
|
||||||
|
TRACTRA_S0601_A0721;S0601;50.0395506;-4.3793424;74.88;-17.76626731;-17.76626731;12.53262019;3.313925804;145;3.230476898;0;0;0;0;0;0;0;0;0
|
||||||
|
TRACTRA_S0601_A0722;S0601;50.0395506;-4.3793424;74.88;-18.21530588;-18.21530588;12.60300181;3.423564038;152;3.251177374;0;0;0;0;0;0;0;0;0
|
||||||
|
TRACTRA_S0601_A0723;S0601;50.0395506;-4.3793424;74.88;-18.81533984;-18.22521349;12.76487953;3.949622567;160;3.298788469;0;0;0;1;1;0;0;0;1
|
||||||
|
TRACTRA_S0601_A0724;S0601;50.0395506;-4.3793424;74.88;-18.39196061;-18.19326953;12.75482502;3.554233413;147;3.295831258;1;0;0;0;1;0;0;0;1
|
||||||
|
TRACTRA_S0718_A0453;S0718;50.0998065;-1.1453948;55.61;-18.66460368;-18.66460368;12.90165426;3.445225076;231;3.267606025;36;1;0;0;37;2;9;11;48
|
||||||
|
TRACTRA_S0718_A0785;S0718;50.0998065;-1.1453948;55.61;-18.85995673;-18.50810575;13.29144678;3.70894039;206;3.382250883;1;0;0;0;1;0;0;0;1
|
||||||
|
TRACTRA_S0718_A0786;S0718;50.0998065;-1.1453948;55.61;-19.93855287;-18.51682147;12.26561804;4.789627677;213;3.080536549;13;0;0;0;13;4;4;8;21
|
||||||
|
TRACTRA_S0718_A0787;S0718;50.0998065;-1.1453948;55.61;-19.29556272;-18.58424925;13.6320461;4.072033803;217;3.482427155;1;0;0;0;1;0;0;0;1
|
||||||
|
TRACTRA_S0718_A0788;S0718;50.0998065;-1.1453948;55.61;-18.65654164;-17.87326585;13.75296894;4.144723017;215;3.517992695;0;0;0;0;0;0;0;0;0
|
||||||
|
TRACTRA_S0718_A0789;S0718;50.0998065;-1.1453948;55.61;-18.65654164;-17.87326585;13.75296894;4.144723017;212;3.517992695;0;0;0;0;0;0;0;0;0
|
||||||
|
TRACTRA_S0718_A0790;S0718;50.0998065;-1.1453948;55.61;-20.30767685;-18.92634633;14.50772898;4.748818703;216;3.739980943;0;0;0;0;0;0;0;0;0
|
||||||
|
TRACTRA_S0718_A0791;S0718;50.0998065;-1.1453948;55.61;-19.14771467;-18.81564248;13.41640037;3.688961812;206;3.419001941;5;0;0;0;5;0;0;0;5
|
||||||
|
TRACTRA_S0718_A0792;S0718;50.0998065;-1.1453948;55.61;-19.39677413;-18.69591383;13.03448575;4.061475047;205;3.306674109;9;0;0;1;10;0;0;0;10
|
||||||
|
TRACTRA_S0718_A0793;S0718;50.0998065;-1.1453948;55.61;-21.2999456;-18.95534509;13.954507;5.721818697;206;3.577268596;3;0;0;0;3;0;1;1;4
|
||||||
|
TRACTRA_S0718_A0794;S0718;50.0998065;-1.1453948;55.61;-20.11815351;-19.18867431;13.2057931;4.29240324;206;3.357058625;2;1;0;0;3;0;0;0;3
|
||||||
|
TRACTRA_S0648_A0755;S0648;50.1032755;-2.8780274;65.63;-18.14599476;-17.96730786;12.90100688;3.534027181;150;3.272095952;1;0;0;0;1;0;0;0;1
|
||||||
|
TRACTRA_S0648_A0756;S0648;50.1032755;-2.8780274;65.63;-19.88316505;-18.41350538;12.80469311;4.838040066;153;3.243768372;0;0;0;0;0;0;0;0;0
|
||||||
|
TRACTRA_S0648_A0757;S0648;50.1032755;-2.8780274;65.63;-17.38980316;-17.38980316;13.74375238;3.233544264;144;3.519962276;0;0;0;0;0;0;1;1;1
|
||||||
|
TRACTRA_S0648_A0758;S0648;50.1032755;-2.8780274;65.63;-18.19627608;-18.19627608;12.25189219;3.175007351;149;3.081179867;0;0;1;0;1;0;0;0;1
|
||||||
|
TRACTRA_S0648_A0759;S0648;50.1032755;-2.8780274;65.63;-20.22330338;-18.62749624;12.36124845;4.965461761;156;3.113343473;0;0;0;1;1;0;0;0;1
|
||||||
|
TRACTRA_S0648_A0760;S0648;50.1032755;-2.8780274;65.63;-18.55830703;-18.20627505;12.64148653;3.709123215;148;3.195766435;0;0;0;0;0;0;0;0;0
|
||||||
|
TRACTRA_S0648_A0761;S0648;50.1032755;-2.8780274;65.63;-18.58509829;-18.15123475;12.93673979;3.791781348;158;3.282605629;0;0;0;0;0;0;0;0;0
|
||||||
|
TRACTRA_S0648_A0762;S0648;50.1032755;-2.8780274;65.63;-19.22411937;-18.51036414;13.00526273;4.074500229;156;3.302759436;0;0;0;0;0;0;0;0;0
|
||||||
|
TRACTRA_S0648_A0763;S0648;50.1032755;-2.8780274;65.63;-20.13006074;-17.89104792;12.99518582;5.615164463;152;3.299795641;0;0;0;0;0;0;0;0;50000
|
||||||
|
TRACTRA_S0648_A0764;S0648;50.1032755;-2.8780274;65.63;-17.69007187;-17.69007187;12.89139372;3.154829903;144;3.269268552;21;0;0;0;21;0;0;0;21
|
||||||
|
41
src/ecoparasite/completion/Completion.java
Normal file
41
src/ecoparasite/completion/Completion.java
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
package ecoparasite.completion;
|
||||||
|
|
||||||
|
import ecoparasite.poisson.Poisson;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class incluant des méthodes Statiques de Completion des données
|
||||||
|
*/
|
||||||
|
public class Completion {
|
||||||
|
|
||||||
|
//TODO mais après remaniment
|
||||||
|
public static HashSet<Poisson> completePoissonMean(HashSet<Poisson> tablePoisson){
|
||||||
|
|
||||||
|
Double mean = mean(tablePoisson);
|
||||||
|
|
||||||
|
for (Poisson p : tablePoisson) {
|
||||||
|
if ( p.getInfestation() == null ) {
|
||||||
|
p.setInfestation(mean);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return tablePoisson;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Double mean(HashSet<Poisson> tablePoisson){
|
||||||
|
|
||||||
|
Double mean = 0.0;
|
||||||
|
|
||||||
|
for (Poisson p : tablePoisson){
|
||||||
|
if (p.getInfestation() != null) {
|
||||||
|
mean += p.getInfestation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return mean / tablePoisson.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -4,7 +4,26 @@ import ecoparasite.poisson.Poisson;
|
|||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Interface définissant la fonction de Parsing des données
|
||||||
|
*/
|
||||||
public interface DataParsing {
|
public interface DataParsing {
|
||||||
|
|
||||||
public HashSet<Poisson> parse(RawData data);
|
/**
|
||||||
|
* Permet de parser un élément à partir d'un objet RawData.
|
||||||
|
* @param data l'objet RawData
|
||||||
|
* @param parseTypeId Permet d'indiquer le type de Parsing que l'on veut.
|
||||||
|
* @return Un HashSet de données T retourné.
|
||||||
|
* @param <T> Notre paramètre générique adaptable à plusieurs classes.
|
||||||
|
* @throws RawDataOverflow Si on dépasse la taille de l'objet RawData.
|
||||||
|
* @throws InvalidParsingException Si le type de parsing n'existe pas.
|
||||||
|
*/
|
||||||
|
public static <T> HashSet<T> parse(RawData data, int parseTypeId ) throws RawDataOverflow, InvalidParsingException {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> HashSet<T> parse(RawData data) throws RawDataOverflow, InvalidParsingException {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,11 +2,13 @@ package ecoparasite.input;
|
|||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.lang.reflect.Array;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -18,6 +20,7 @@ public class InputFactory {
|
|||||||
|
|
||||||
final public static String DATA_MACKEREL = "Campagne/mackerel.97442.csv";
|
final public static String DATA_MACKEREL = "Campagne/mackerel.97442.csv";
|
||||||
final public static String DATA_MERLU = "Campagne/merlu2018_75164.csv";
|
final public static String DATA_MERLU = "Campagne/merlu2018_75164.csv";
|
||||||
|
final public static String DATA_PARASITES_PERU = "Combinés/ParasitesPeru2021.csv";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construit le chemin vers le fichier de données voulu.
|
* Construit le chemin vers le fichier de données voulu.
|
||||||
@@ -92,7 +95,7 @@ public class InputFactory {
|
|||||||
// Lecture des autres lignes.
|
// Lecture des autres lignes.
|
||||||
try {
|
try {
|
||||||
while ((line = reader.readLine()) != null) {
|
while ((line = reader.readLine()) != null) {
|
||||||
rowFields = line.split(separator);
|
rowFields = line.split(separator, -1);
|
||||||
for (int i = 0; i < rowFields.length; i++) {
|
for (int i = 0; i < rowFields.length; i++) {
|
||||||
ArrayList<String> element = data.get(i);
|
ArrayList<String> element = data.get(i);
|
||||||
element.add(rowFields[i]);
|
element.add(rowFields[i]);
|
||||||
|
|||||||
37
src/ecoparasite/input/InvalidParsingException.java
Normal file
37
src/ecoparasite/input/InvalidParsingException.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
package ecoparasite.input;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gère une exception lorsque qu'un type de parsing n'existe pas ou bien
|
||||||
|
* qu'une erreur est survenue durant le parsing d'une donnée.
|
||||||
|
*/
|
||||||
|
public class InvalidParsingException extends Exception {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* L'ID du parsing voulant être réalisé.
|
||||||
|
*/
|
||||||
|
private int parsingId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* De quel classe provient ce parsing.
|
||||||
|
*/
|
||||||
|
private String parsingSource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructeur.
|
||||||
|
* @param parsingId ID du parsing
|
||||||
|
* @param parsingSource La classe d'où provient ce parsing.
|
||||||
|
*/
|
||||||
|
public InvalidParsingException(int parsingId, String parsingSource) {
|
||||||
|
this.parsingId = parsingId;
|
||||||
|
this.parsingSource = parsingSource;
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getParsingId() {
|
||||||
|
return parsingId;
|
||||||
|
}
|
||||||
|
public String getParsingSource() {
|
||||||
|
return parsingSource;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -99,7 +99,7 @@ public class RawData {
|
|||||||
* Permet d'obtenir tous les champs d'une entrée.
|
* Permet d'obtenir tous les champs d'une entrée.
|
||||||
* @param index Entrée que vous voulez obtenir, le minimum est l'entrée 1. Le maximum dépend du Dataframe.
|
* @param index Entrée que vous voulez obtenir, le minimum est l'entrée 1. Le maximum dépend du Dataframe.
|
||||||
* @return Une HashMap <colonne, valeur>.
|
* @return Une HashMap <colonne, valeur>.
|
||||||
* @throws RawDataOverflow Si vous avez dépasses le maximum d'entrées du DataFrame.
|
* @throws RawDataOverflow Si vous avez dépassé le maximum d'entrées du DataFrame.
|
||||||
*/
|
*/
|
||||||
public HashMap<String,String> getEntry(int index) throws RawDataOverflow {
|
public HashMap<String,String> getEntry(int index) throws RawDataOverflow {
|
||||||
|
|
||||||
@@ -110,7 +110,7 @@ public class RawData {
|
|||||||
HashMap<String,String> entry = new HashMap<>();
|
HashMap<String,String> entry = new HashMap<>();
|
||||||
|
|
||||||
for( ArrayList<String> row : data ){
|
for( ArrayList<String> row : data ){
|
||||||
if( index > row.size()){
|
if( index >= row.size()){
|
||||||
throw new RawDataOverflow( index, row.size() );
|
throw new RawDataOverflow( index, row.size() );
|
||||||
}
|
}
|
||||||
entry.put( row.getFirst(), row.get( index ) );
|
entry.put( row.getFirst(), row.get( index ) );
|
||||||
|
|||||||
81
src/ecoparasite/nettoyage/Nettoyage.java
Normal file
81
src/ecoparasite/nettoyage/Nettoyage.java
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
package ecoparasite.nettoyage;
|
||||||
|
|
||||||
|
import ecoparasite.poisson.Poisson;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Définissant les méthodes statics de Nettoyage des données
|
||||||
|
*/
|
||||||
|
public class Nettoyage {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Methode Static de nettoyage des valeurs abérrante et absurde
|
||||||
|
* @param tablePoisson Un Hashset de Poisson contenant nos données
|
||||||
|
* @return Le Hashset de Poisson une fois qu'il est nettoyé
|
||||||
|
*/
|
||||||
|
public static HashSet<Poisson> nettoiePoissonMean(HashSet<Poisson> tablePoisson){
|
||||||
|
|
||||||
|
Double mean = mean(tablePoisson); //Moyenne
|
||||||
|
Double ecart = ecartType(tablePoisson); // Ecart Type
|
||||||
|
|
||||||
|
Double z = 0.0;
|
||||||
|
|
||||||
|
for (Poisson p : tablePoisson) {
|
||||||
|
z = ( p.getInfestation() - mean ) / ecart;
|
||||||
|
|
||||||
|
if ( z >= 2.5 ) {
|
||||||
|
p.setInfestation(mean);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return tablePoisson;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Methode Privée permettant de calculer la moyenne
|
||||||
|
* @param tablePoisson Un Hashset de Poisson contenant nos données
|
||||||
|
* @return Un Double correspondant à la moyenne
|
||||||
|
*/
|
||||||
|
private static Double mean(HashSet<Poisson> tablePoisson){
|
||||||
|
|
||||||
|
Double mean = 0.0;
|
||||||
|
|
||||||
|
for (Poisson p : tablePoisson){
|
||||||
|
mean += p.getInfestation();
|
||||||
|
}
|
||||||
|
|
||||||
|
return mean / tablePoisson.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Methode Privée permettant de calculer la variance
|
||||||
|
* @param tablePoisson Un Hashset de Poisson contenant nos données
|
||||||
|
* @return Un Double correspondant à la variance
|
||||||
|
*/
|
||||||
|
private static Double variance(HashSet<Poisson> tablePoisson){
|
||||||
|
|
||||||
|
Double vari = 0.0;
|
||||||
|
Double mean = mean(tablePoisson);
|
||||||
|
|
||||||
|
for (Poisson p : tablePoisson) {
|
||||||
|
vari += Math.pow( (p.getInfestation() - mean), 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
return vari / tablePoisson.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Methode Privée permettant de calculer l'écart-type
|
||||||
|
* @param tablePoisson Un Hashset de Poisson contenant nos données
|
||||||
|
* @return Un Double correspondant à l'écart-type
|
||||||
|
*/
|
||||||
|
private static Double ecartType(HashSet<Poisson> tablePoisson){
|
||||||
|
|
||||||
|
Double vari = variance(tablePoisson);
|
||||||
|
|
||||||
|
return Math.sqrt(vari);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,26 +1,92 @@
|
|||||||
package ecoparasite.poisson;
|
package ecoparasite.poisson;
|
||||||
|
|
||||||
import ecoparasite.input.DataParsing;
|
import ecoparasite.input.DataParsing;
|
||||||
|
import ecoparasite.input.InvalidParsingException;
|
||||||
import ecoparasite.input.RawData;
|
import ecoparasite.input.RawData;
|
||||||
|
import ecoparasite.input.RawDataOverflow;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import static java.lang.Double.valueOf;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hérite de Poisson.
|
* Hérite de Poisson.
|
||||||
* Ajoute les fonctions de Parsing liés aux données collectées sur le Mackerel.
|
* Ajoute les fonctions de Parsing liés aux données collectées sur le Mackerel.
|
||||||
*/
|
*/
|
||||||
public class Mackerel extends Poisson implements DataParsing {
|
public class Mackerel extends Poisson implements DataParsing {
|
||||||
public Mackerel(String species, Double length, Double infestation) {
|
|
||||||
super(species, length, null, infestation);
|
/**
|
||||||
|
* Constructeur de Mackerel
|
||||||
|
* @param length
|
||||||
|
* @param infestation
|
||||||
|
*/
|
||||||
|
public Mackerel(String id, Double length, Double infestation) {
|
||||||
|
super(id, length, null, infestation);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
public HashSet<Poisson> parse(RawData data) {
|
* Implémentation de la fonction parse de DataParsing.
|
||||||
|
* Renvoie un tableau de poissons à partir d'un RawData.
|
||||||
|
*
|
||||||
|
* @param data Notre RawData
|
||||||
|
* @param parseTypeId L'ID du type de parsing, ignoré ici.
|
||||||
|
* @return Le tableau de poissons.
|
||||||
|
* @throws RawDataOverflow Si on a un dépassement de données dans notre RawData.
|
||||||
|
* @throws InvalidParsingException
|
||||||
|
*/
|
||||||
|
public static HashSet<Poisson> parse(RawData data, int parseTypeId) throws RawDataOverflow, InvalidParsingException {
|
||||||
|
return Mackerel.parse(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implémentation de la fonction parse de Dataparsing
|
||||||
|
* @param data Notre RawData.
|
||||||
|
* @return tableau des poissons
|
||||||
|
* @throws RawDataOverflow Si on a un dépassement de données dans notre RawDataOverflow.
|
||||||
|
*/
|
||||||
|
public static HashSet<Poisson> parse(RawData data) throws RawDataOverflow {
|
||||||
|
|
||||||
|
HashMap<String,String> temp = new HashMap<>();
|
||||||
|
|
||||||
HashSet<Poisson> fishSet;
|
HashSet<Poisson> fishSet;
|
||||||
fishSet = new HashSet<>();
|
fishSet = new HashSet<>();
|
||||||
|
|
||||||
|
for (int i = 0; i < data.getData().getFirst().size(); i++) {
|
||||||
|
temp = data.getEntry(i);
|
||||||
|
|
||||||
|
String id = !Objects.equals(temp.get("Sample_code"), "") ? temp.get("Sample_code") : null;
|
||||||
|
Double size = !Objects.equals(temp.get("StandardLength"), "") ? valueOf(temp.get("StandardLength")) : null;
|
||||||
|
Double infes = !Objects.equals(temp.get("NParasitesTotal"), "") ? valueOf(temp.get("NParasitesTotal")) : null;
|
||||||
|
|
||||||
|
Poisson newP = new Mackerel(id,size,infes);
|
||||||
|
newP.setFishParts( Mackerel.parsePartiePoisson(temp) );
|
||||||
|
fishSet.add(newP);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return fishSet;
|
return fishSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param entry
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private static HashSet<PartiePoisson> parsePartiePoisson(HashMap<String,String> entry){
|
||||||
|
|
||||||
|
HashSet<PartiePoisson> response = new HashSet<>();
|
||||||
|
|
||||||
|
for( String k: entry.keySet() ){
|
||||||
|
if( k.contains( "Anisakis_" ) ){
|
||||||
|
String bodyPart = k.split( "Anisakis_" )[1];
|
||||||
|
Double value = !Objects.equals(entry.get(k), "") ? valueOf(entry.get(k)) : null;
|
||||||
|
PartiePoisson p = new PartiePoisson(bodyPart, value);
|
||||||
|
response.add(p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,15 @@
|
|||||||
package ecoparasite.poisson;
|
package ecoparasite.poisson;
|
||||||
|
|
||||||
import ecoparasite.input.DataParsing;
|
import ecoparasite.input.DataParsing;
|
||||||
|
import ecoparasite.input.InvalidParsingException;
|
||||||
import ecoparasite.input.RawData;
|
import ecoparasite.input.RawData;
|
||||||
|
import ecoparasite.input.RawDataOverflow;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
||||||
|
import static java.lang.Double.valueOf;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hérite de Poisson.
|
* Hérite de Poisson.
|
||||||
* Ajoute les fonctions de Parsing liés aux données collectées sur le Merlu.
|
* Ajoute les fonctions de Parsing liés aux données collectées sur le Merlu.
|
||||||
@@ -16,21 +21,43 @@ public class Merlu extends Poisson implements DataParsing {
|
|||||||
* @param length Un Wrapper Double representant la longueur/taille du poisson
|
* @param length Un Wrapper Double representant la longueur/taille du poisson
|
||||||
* @param infestation Un Wrapper Double representant le taux de parasite du poisson
|
* @param infestation Un Wrapper Double representant le taux de parasite du poisson
|
||||||
*/
|
*/
|
||||||
public Merlu(Double length, Double infestation) {
|
public Merlu(String id, Double length, Double infestation) {
|
||||||
super("Merlu", length, null, infestation);
|
super(id, length, null, infestation);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implémentation de la fonction parse de DataParsing.
|
||||||
|
* Renvoie un tableau de poissons à partir d'un RawData.
|
||||||
|
*
|
||||||
|
* @param data Notre RawData
|
||||||
|
* @param parseTypeId L'ID du type de parsing, ignoré ici.
|
||||||
|
* @return Le tableau de poissons.
|
||||||
|
* @throws RawDataOverflow Si on a un dépassement de données dans notre RawData.
|
||||||
|
*/
|
||||||
|
public static HashSet<Poisson> parse(RawData data, int parseTypeId) throws RawDataOverflow, InvalidParsingException {
|
||||||
|
return Mackerel.parse(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implémentation de la fonction parse de Dataparsing
|
* Implémentation de la fonction parse de Dataparsing
|
||||||
* @param data
|
* @param data Notre RawData
|
||||||
* @return tableau des poissons
|
* @return tableau des poissons
|
||||||
|
* @throws RawDataOverflow Si on a un dépassement des données de notre objet RawData.
|
||||||
*/
|
*/
|
||||||
@Override
|
public static HashSet<Poisson> parse(RawData data) throws RawDataOverflow {
|
||||||
public HashSet<Poisson> parse(RawData data) { //TODO
|
|
||||||
|
HashMap<String,String> temp = new HashMap<>();
|
||||||
|
|
||||||
HashSet<Poisson> fishSet;
|
HashSet<Poisson> fishSet;
|
||||||
fishSet = new HashSet<>();
|
fishSet = new HashSet<>();
|
||||||
|
|
||||||
|
for (int i = 0; i < data.getData().getFirst().size(); i++) {
|
||||||
|
temp = data.getEntry(i);
|
||||||
|
Poisson newP = new Merlu(temp.get("nom.merlu"),valueOf(temp.get("m.size (mm)")),valueOf(temp.get("number of Anisakis sp L3")));
|
||||||
|
|
||||||
|
fishSet.add(newP);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return fishSet;
|
return fishSet;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,61 @@
|
|||||||
package ecoparasite.poisson;
|
package ecoparasite.poisson;
|
||||||
|
|
||||||
public abstract class PartiePoisson {
|
/**
|
||||||
|
* Permet d'illustrer une partie d'un poisson.
|
||||||
|
*/
|
||||||
|
public class PartiePoisson {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Nom de la partie du poisson.
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Le taux d'infestation de cette partie du poisson.
|
||||||
|
*/
|
||||||
|
private Double infestation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructeur.
|
||||||
|
* Génère une partie complète.
|
||||||
|
*
|
||||||
|
* @param name Le nom de la partie.
|
||||||
|
* @param infestation Le taux d'infestation de la partie du poisson.
|
||||||
|
*/
|
||||||
|
public PartiePoisson(String name, Double infestation) {
|
||||||
|
this.name = name;
|
||||||
|
this.infestation = infestation;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructeur.
|
||||||
|
* Génère une infestation de null comme non communiqué.
|
||||||
|
*
|
||||||
|
* @param name Le nom de la partie.
|
||||||
|
*/
|
||||||
|
public PartiePoisson(String name){
|
||||||
|
this.name = name;
|
||||||
|
this.infestation = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GETTERS / SETTERS
|
||||||
|
*/
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getInfestation() {
|
||||||
|
return infestation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInfestation(Double infestation) {
|
||||||
|
this.infestation = infestation;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import java.util.HashSet;
|
|||||||
*/
|
*/
|
||||||
public class Poisson{
|
public class Poisson{
|
||||||
|
|
||||||
private String specie;
|
private String id;
|
||||||
private Double length;
|
private Double length;
|
||||||
private Double weight;
|
private Double weight;
|
||||||
private Double infestation;
|
private Double infestation;
|
||||||
@@ -16,13 +16,13 @@ public class Poisson{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructeur de l'objet Poisson
|
* Constructeur de l'objet Poisson
|
||||||
* @param specie Une String representant l'espece du poisson
|
* @param id Une String representant l'espece du poisson
|
||||||
* @param length Un Wrapper Double representant la longueur/taille du poisson
|
* @param length Un Wrapper Double representant la longueur/taille du poisson
|
||||||
* @param weight Un Wrapper Double representant le poids du poisson
|
* @param weight Un Wrapper Double representant le poids du poisson
|
||||||
* @param infestation Un Wrapper Double representant le taux de parasite du poisson
|
* @param infestation Un Wrapper Double representant le taux de parasite du poisson
|
||||||
*/
|
*/
|
||||||
public Poisson(String specie, Double length, Double weight, Double infestation){
|
public Poisson(String id, Double length, Double weight, Double infestation){
|
||||||
this.specie = specie;
|
this.id = id;
|
||||||
this.length = length;
|
this.length = length;
|
||||||
this.weight = weight;
|
this.weight = weight;
|
||||||
this.infestation = infestation;
|
this.infestation = infestation;
|
||||||
@@ -30,11 +30,11 @@ public class Poisson{
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Getter de l'attribut specie
|
* Getter de l'attribut Id
|
||||||
* @return La string de l'attribut specie
|
* @return La string de l'attribut Id
|
||||||
*/
|
*/
|
||||||
public String getSpecie() {
|
public String getId() {
|
||||||
return specie;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -61,13 +61,38 @@ public class Poisson{
|
|||||||
return infestation;
|
return infestation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Getter de l'attribut des parties de poisson.
|
||||||
|
* @return Le HashSet des parties de poisson.
|
||||||
|
*/
|
||||||
|
public HashSet<PartiePoisson> getFishParts() {
|
||||||
|
return fishParts;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Setter de l'attribut infestation
|
||||||
|
* @param infestation le Double de la nouvelle valeur de l'infestation
|
||||||
|
*/
|
||||||
|
public void setInfestation(Double infestation) {
|
||||||
|
this.infestation = infestation;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Setter de l'attribut des parties de poisson.
|
||||||
|
* @param fishParts Un hashset de parties de poisson.
|
||||||
|
*/
|
||||||
|
public void setFishParts(HashSet<PartiePoisson> fishParts) {
|
||||||
|
this.fishParts = fishParts;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Permet d'afficher les informations de notre poisson
|
* Permet d'afficher les informations de notre poisson
|
||||||
* @return La string contenant les informations
|
* @return La string contenant les informations
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String toString(){
|
public String toString(){
|
||||||
String result = "[ %5s : %4d mm, %4d g, %4d taux d'infestation ]";
|
String result = "[ %5s : %4f mm, %4f g, %4f taux d'infestation ]";
|
||||||
return String.format(result, this.getClass().getSimpleName(), this.getLength(), this.getWeight(), this.getInfestation());
|
return String.format(result, this.getClass().getSimpleName(), this.getLength(), this.getWeight(), this.getInfestation() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
118
src/ecoparasite/population/Population.java
Normal file
118
src/ecoparasite/population/Population.java
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
package ecoparasite.population;
|
||||||
|
|
||||||
|
import ecoparasite.input.DataParsing;
|
||||||
|
import ecoparasite.input.InvalidParsingException;
|
||||||
|
import ecoparasite.input.RawData;
|
||||||
|
import ecoparasite.input.RawDataOverflow;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet de gérer une population selon les années.
|
||||||
|
*/
|
||||||
|
public class Population implements DataParsing {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Espèce de la population.
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Les informations de la population sur le total.
|
||||||
|
*/
|
||||||
|
private PopulationArgs total;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Les informations de la population par année.
|
||||||
|
* Clé : Année, Valeur : Informations de la population.
|
||||||
|
*/
|
||||||
|
private HashMap<Integer,PopulationArgs> perYear;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructeur.
|
||||||
|
* @param id Espèce
|
||||||
|
* @param total Les informations totales.
|
||||||
|
* @param perYear Les informations par année.
|
||||||
|
*/
|
||||||
|
public Population(String id, PopulationArgs total, HashMap<Integer,PopulationArgs> perYear) {
|
||||||
|
this.id = id;
|
||||||
|
this.total = total;
|
||||||
|
this.perYear = perYear;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructeur.
|
||||||
|
* Pour les informations par année, crée une HashMap vide. Devra être rempli après coup.
|
||||||
|
* @param id Espèce de la population.
|
||||||
|
* @param total Les informations totales.
|
||||||
|
*/
|
||||||
|
public Population(String id, PopulationArgs total) {
|
||||||
|
this.id = id;
|
||||||
|
this.total = total;
|
||||||
|
this.perYear = new HashMap<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructeur.
|
||||||
|
* Pour les informations du total, sont remplacés par null.
|
||||||
|
* Pour les informations par année, crée une HashMap vide. Devra être rempli après coup.
|
||||||
|
* @param id Espèce de la population.
|
||||||
|
*/
|
||||||
|
public Population(String id) {
|
||||||
|
this.id = id;
|
||||||
|
this.total = null;
|
||||||
|
this.perYear = new HashMap<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GETTERS / SETTERS
|
||||||
|
*/
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PopulationArgs getTotal() {
|
||||||
|
return total;
|
||||||
|
}
|
||||||
|
|
||||||
|
public HashMap<Integer,PopulationArgs> getPerYear() {
|
||||||
|
return perYear;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotal(PopulationArgs total) {
|
||||||
|
this.total = total;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPerYear(HashMap<Integer,PopulationArgs> perYear) {
|
||||||
|
this.perYear = perYear;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Raccourci vers les méthodes de DataParsing.
|
||||||
|
* @param data Notre objet RawData.
|
||||||
|
* @param parseTypeId L'ID de parsing.
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static HashSet<Population> parse(RawData data, int parseTypeId ) throws RawDataOverflow, InvalidParsingException {
|
||||||
|
switch (parseTypeId) {
|
||||||
|
case 1:
|
||||||
|
return PopulationParsing.parseParasitesPeru(data);
|
||||||
|
default:
|
||||||
|
throw new InvalidParsingException(parseTypeId, Population.class.getSimpleName() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Raccourci vers les méthodes de DataParsing.
|
||||||
|
* Va par défaut faire ceux des parasites du Perou.
|
||||||
|
*
|
||||||
|
* @param data Notre objet RawData.
|
||||||
|
* @return Notre tableau de populations.
|
||||||
|
*/
|
||||||
|
public static HashSet<Population> parse(RawData data){
|
||||||
|
return PopulationParsing.parseParasitesPeru(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
101
src/ecoparasite/population/PopulationArgInterval.java
Normal file
101
src/ecoparasite/population/PopulationArgInterval.java
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
package ecoparasite.population;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Classe qui permet de gérer un intervalle de données issues d'un CSV.
|
||||||
|
*
|
||||||
|
* Trois données : minimum, maximum et moyenne entre minimum et maximum.
|
||||||
|
*/
|
||||||
|
public class PopulationArgInterval {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Valeur minimale.
|
||||||
|
*/
|
||||||
|
private Double min;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Valeur maximale.
|
||||||
|
*/
|
||||||
|
private Double max;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Moyenne entre la valeur minimale et maximale.
|
||||||
|
*/
|
||||||
|
private Double mean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructeur. La moyenne doit être précisée.
|
||||||
|
* @param min Valeur minimale
|
||||||
|
* @param max Valeur maximale
|
||||||
|
* @param mean Moyenne
|
||||||
|
*/
|
||||||
|
public PopulationArgInterval(Double min, Double max, Double mean) {
|
||||||
|
this.min = min;
|
||||||
|
this.max = max;
|
||||||
|
this.mean = mean;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructeur. La moyenne est calculé automatiquement.
|
||||||
|
* @param min Valeur minimale
|
||||||
|
* @param max Valeur maximale.
|
||||||
|
*/
|
||||||
|
public PopulationArgInterval(Double min, Double max) {
|
||||||
|
this.min = min;
|
||||||
|
this.max = max;
|
||||||
|
this.mean = ( this.max + this.min ) / 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getMin() {
|
||||||
|
return this.min;
|
||||||
|
}
|
||||||
|
public Double getMax() {
|
||||||
|
return this.max;
|
||||||
|
}
|
||||||
|
public Double getMean() {
|
||||||
|
return this.mean;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet de transformer un intervalle en double.
|
||||||
|
* Si le minimum est égal au maximum, cette valeur est retourné.
|
||||||
|
* Sinon la moyenne est retourné.
|
||||||
|
*
|
||||||
|
* @return La valeur transformée en Double.
|
||||||
|
*/
|
||||||
|
public Double transformToDouble(){
|
||||||
|
if( this.min == this.max )
|
||||||
|
return this.min;
|
||||||
|
return this.mean;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet de transformer une String (Extraite d'un fichier CSV) et de la transformer en Intervalle.
|
||||||
|
* Gère les séparateurs +/- ainsi que l'entre deux. Sinon, elle sera juste convertie avec minimum = maximum.
|
||||||
|
*
|
||||||
|
* @param rawValue La valeur brute.
|
||||||
|
* @return La valeur en tant qu'intervalle.
|
||||||
|
*/
|
||||||
|
public static PopulationArgInterval fromString( String rawValue ){
|
||||||
|
|
||||||
|
if( rawValue.contains( "±" ) ){ // Plus ou moins.
|
||||||
|
|
||||||
|
String[] numbers = rawValue.split("±");
|
||||||
|
Double mean = Double.parseDouble(numbers[0].trim());
|
||||||
|
Double interval = Double.parseDouble(numbers[1].trim());
|
||||||
|
return new PopulationArgInterval(mean - interval, mean + interval, mean);
|
||||||
|
|
||||||
|
} else if( rawValue.contains( "-" ) ){ // Entre.
|
||||||
|
|
||||||
|
String[] numbers = rawValue.split("-");
|
||||||
|
Double min = Double.parseDouble(numbers[0].trim());
|
||||||
|
Double max = Double.parseDouble(numbers[1].trim());
|
||||||
|
return new PopulationArgInterval(min, max);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Double number = Double.parseDouble(rawValue);
|
||||||
|
return new PopulationArgInterval(number, number);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
174
src/ecoparasite/population/PopulationArgs.java
Normal file
174
src/ecoparasite/population/PopulationArgs.java
Normal file
@@ -0,0 +1,174 @@
|
|||||||
|
package ecoparasite.population;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet de stocker les paramètres d'une population pour une année spécifique.
|
||||||
|
* Par convention, si on est sur le total, on mettra comme année 0.
|
||||||
|
*/
|
||||||
|
public class PopulationArgs {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Année de référence pour ces paramètres.
|
||||||
|
*/
|
||||||
|
private int year;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Le nombre d'individus analysés.
|
||||||
|
*/
|
||||||
|
private int number;
|
||||||
|
private PopulationArgInterval length;
|
||||||
|
private PopulationArgInterval width;
|
||||||
|
private PopulationArgInterval prevalence;
|
||||||
|
private PopulationArgInterval ic;
|
||||||
|
private Double intensity;
|
||||||
|
private Double abondance;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructeur.
|
||||||
|
* Toutes les données peuvent être préremplis dans ce constructeur sauf l'année.
|
||||||
|
* L'année sera par défaut à zéro.
|
||||||
|
*
|
||||||
|
* @param N
|
||||||
|
* @param length
|
||||||
|
* @param width
|
||||||
|
* @param prevalence
|
||||||
|
* @param ic
|
||||||
|
* @param intensity
|
||||||
|
* @param abondance
|
||||||
|
*/
|
||||||
|
public PopulationArgs(
|
||||||
|
int N,
|
||||||
|
PopulationArgInterval length,
|
||||||
|
PopulationArgInterval width,
|
||||||
|
PopulationArgInterval prevalence,
|
||||||
|
PopulationArgInterval ic,
|
||||||
|
Double intensity,
|
||||||
|
Double abondance
|
||||||
|
){
|
||||||
|
this.year = 0;
|
||||||
|
this.number = N;
|
||||||
|
this.length = length;
|
||||||
|
this.width = width;
|
||||||
|
this.prevalence = prevalence;
|
||||||
|
this.ic = ic;
|
||||||
|
this.intensity = intensity;
|
||||||
|
this.abondance = abondance;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructeur.
|
||||||
|
* Toutes les données ainsi que l'année peuvent être préremplis.
|
||||||
|
*
|
||||||
|
* @param year
|
||||||
|
* @param N
|
||||||
|
* @param length
|
||||||
|
* @param width
|
||||||
|
* @param prevalence
|
||||||
|
* @param ic
|
||||||
|
* @param intensity
|
||||||
|
* @param abondance
|
||||||
|
*/
|
||||||
|
public PopulationArgs(
|
||||||
|
int year,
|
||||||
|
int N,
|
||||||
|
PopulationArgInterval length,
|
||||||
|
PopulationArgInterval width,
|
||||||
|
PopulationArgInterval prevalence,
|
||||||
|
PopulationArgInterval ic,
|
||||||
|
Double intensity,
|
||||||
|
Double abondance
|
||||||
|
){
|
||||||
|
this.year = year;
|
||||||
|
this.number = N;
|
||||||
|
this.length = length;
|
||||||
|
this.width = width;
|
||||||
|
this.prevalence = prevalence;
|
||||||
|
this.ic = ic;
|
||||||
|
this.intensity = intensity;
|
||||||
|
this.abondance = abondance;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructeur.
|
||||||
|
* Permet de remplir tout d'abord l'année, les autres paramètres seront remplis par les setters.
|
||||||
|
*
|
||||||
|
* @param year
|
||||||
|
*/
|
||||||
|
public PopulationArgs(
|
||||||
|
int year
|
||||||
|
){
|
||||||
|
this.year = year;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructeur.
|
||||||
|
* Initialise l'objet avec une année par défaut (0).
|
||||||
|
*/
|
||||||
|
public PopulationArgs(){
|
||||||
|
this.year = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GETTERS / SETTERS
|
||||||
|
*/
|
||||||
|
|
||||||
|
public int getYear() {
|
||||||
|
return year;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getNumber() {
|
||||||
|
return number;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PopulationArgInterval getLength() {
|
||||||
|
return length;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PopulationArgInterval getWidth() {
|
||||||
|
return width;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PopulationArgInterval getPrevalence() {
|
||||||
|
return prevalence;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PopulationArgInterval getIc() {
|
||||||
|
return ic;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getIntensity() {
|
||||||
|
return intensity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getAbondance() {
|
||||||
|
return abondance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumber(int number) {
|
||||||
|
this.number = number;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLength(PopulationArgInterval length) {
|
||||||
|
this.length = length;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWidth(PopulationArgInterval width) {
|
||||||
|
this.width = width;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrevalence(PopulationArgInterval prevalence) {
|
||||||
|
this.prevalence = prevalence;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIc(PopulationArgInterval ic) {
|
||||||
|
this.ic = ic;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIntensity(Double intensity) {
|
||||||
|
this.intensity = intensity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAbondance(Double abondance) {
|
||||||
|
this.abondance = abondance;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
113
src/ecoparasite/population/PopulationParsing.java
Normal file
113
src/ecoparasite/population/PopulationParsing.java
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
package ecoparasite.population;
|
||||||
|
|
||||||
|
import ecoparasite.input.RawData;
|
||||||
|
import ecoparasite.input.RawDataOverflow;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet de parser une population spécifique via les schémas fournis.
|
||||||
|
*/
|
||||||
|
public class PopulationParsing {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet, à partir d'un objet RawData, de parse les données tel que le fichier parasitesPeru est structuré.
|
||||||
|
*
|
||||||
|
* @param peruRawData
|
||||||
|
* @return Une liste des populations incluses.
|
||||||
|
*/
|
||||||
|
public static HashSet<Population> parseParasitesPeru(RawData peruRawData ){
|
||||||
|
|
||||||
|
HashMap<String,Population> response = new HashMap<>();
|
||||||
|
|
||||||
|
int index = 1;
|
||||||
|
try {
|
||||||
|
while(true){ // Tant que l'on ne fait pas de débordements d'entrées.
|
||||||
|
|
||||||
|
HashMap<String,String> fields = peruRawData.getEntry(index);
|
||||||
|
|
||||||
|
String espece = fields.get("Espèce");
|
||||||
|
String parametre = fields.get("Paramètre");
|
||||||
|
|
||||||
|
// Récupère la population si elle existe déjà.
|
||||||
|
Population population = null;
|
||||||
|
if( response.containsKey( espece ) ){
|
||||||
|
population = response.get(espece);
|
||||||
|
} else {
|
||||||
|
population = new Population(espece);
|
||||||
|
response.put(espece, population);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Traiter le total
|
||||||
|
if( fields.containsKey( "Total" ) ){
|
||||||
|
if( population.getTotal() == null ){
|
||||||
|
population.setTotal( new PopulationArgs() );
|
||||||
|
}
|
||||||
|
PopulationParsing.applyValueForParasitesPeru( population.getTotal(), parametre, fields.get("Total") );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Traiter les années.
|
||||||
|
for( String k: fields.keySet() ){
|
||||||
|
if( k.equals( "Total" ) || k.equals("Paramètre") || k.equals("Espèce") ) // Déjà traité. Pas des années.
|
||||||
|
continue;
|
||||||
|
|
||||||
|
Integer year = Integer.parseInt(k);
|
||||||
|
|
||||||
|
PopulationArgs popArgsYear = null;
|
||||||
|
if( !population.getPerYear().containsKey(year) ){
|
||||||
|
popArgsYear = new PopulationArgs( year );
|
||||||
|
population.getPerYear().put(year, popArgsYear);
|
||||||
|
} else {
|
||||||
|
popArgsYear = population.getPerYear().get(year);
|
||||||
|
}
|
||||||
|
|
||||||
|
PopulationParsing.applyValueForParasitesPeru( popArgsYear, parametre, fields.get(k) );
|
||||||
|
}
|
||||||
|
|
||||||
|
response.put( espece, population );
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
} catch (RawDataOverflow e){ // Débordement, on a atteint la fin de l'objet RawData.
|
||||||
|
// Stop.
|
||||||
|
}
|
||||||
|
|
||||||
|
return new HashSet<Population>( response.values() );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet d'appliquer la valeur au paramètre respectif en se basant sur le nom de la colonne.
|
||||||
|
*
|
||||||
|
* @param populationArgs Les paramètres de la population actuelle.
|
||||||
|
* @param column Le nom de la colonne dans le fichier CSV
|
||||||
|
* @param value La valeur a affecter
|
||||||
|
*/
|
||||||
|
private static void applyValueForParasitesPeru( PopulationArgs populationArgs, String column, String value ){
|
||||||
|
switch( column ){
|
||||||
|
case "N":
|
||||||
|
populationArgs.setNumber(Integer.parseInt(value));
|
||||||
|
break;
|
||||||
|
case "Longueur moyenne ± SD (cm)":
|
||||||
|
populationArgs.setLength( PopulationArgInterval.fromString( value ) );
|
||||||
|
break;
|
||||||
|
case "Poids moyen ± SD (g)":
|
||||||
|
populationArgs.setWidth( PopulationArgInterval.fromString( value ) );
|
||||||
|
break;
|
||||||
|
case "Prévalence (%)":
|
||||||
|
populationArgs.setPrevalence( PopulationArgInterval.fromString( value ) );
|
||||||
|
break;
|
||||||
|
case "IC 95%":
|
||||||
|
populationArgs.setIc( PopulationArgInterval.fromString( value ) );
|
||||||
|
break;
|
||||||
|
case "Intensité moyenne (étendue)":
|
||||||
|
populationArgs.setIntensity( Double.parseDouble( value.split( " " )[0] ) );
|
||||||
|
break;
|
||||||
|
case "Abondance moyenne":
|
||||||
|
populationArgs.setAbondance( Double.parseDouble( value ) );
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
30
tests/ecoparasite/completion/CompletionTest.java
Normal file
30
tests/ecoparasite/completion/CompletionTest.java
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
package ecoparasite.completion;
|
||||||
|
|
||||||
|
import ecoparasite.input.InputFactory;
|
||||||
|
import ecoparasite.input.InputFileException;
|
||||||
|
import ecoparasite.input.RawData;
|
||||||
|
import ecoparasite.input.RawDataOverflow;
|
||||||
|
import ecoparasite.poisson.Mackerel;
|
||||||
|
import ecoparasite.poisson.Poisson;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
|
class CompletionTest {
|
||||||
|
|
||||||
|
@org.junit.jupiter.api.Test
|
||||||
|
void completePoissonMean() throws InputFileException, RawDataOverflow {
|
||||||
|
|
||||||
|
RawData test = InputFactory.readData("testComplete.csv");
|
||||||
|
|
||||||
|
HashSet<Poisson> testp = Mackerel.parse(test);
|
||||||
|
|
||||||
|
System.out.println(testp);
|
||||||
|
|
||||||
|
testp = Completion.completePoissonMean(testp);
|
||||||
|
|
||||||
|
System.out.println(testp);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,21 +1,36 @@
|
|||||||
package ecoparasite.input;
|
package ecoparasite.input;
|
||||||
|
|
||||||
|
import static ecoparasite.input.InputFactory.*;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
|
||||||
|
|
||||||
|
import ecoparasite.input.InputFactory;
|
||||||
|
import ecoparasite.input.InputFileException;
|
||||||
|
import ecoparasite.input.RawData;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
|
||||||
|
|
||||||
class InputFactoryTest {
|
class InputFactoryTest {
|
||||||
|
|
||||||
// TODO : Test a être effectué par Sébastien.
|
@org.junit.jupiter.api.Test
|
||||||
@Test
|
void buildDataPath() {
|
||||||
void readFile() throws InputFileException, RawDataOverflow {
|
|
||||||
RawData r = InputFactory.readData( InputFactory.DATA_MACKEREL );
|
String d = "data/Campagne/mackerel.97442.csv";
|
||||||
System.out.println( r );
|
String e = "data/Campagne/merlu2018_75164.csv";
|
||||||
System.out.println( r.getColumnsNames() );
|
|
||||||
System.out.println( r.getDataFromColumn( "Sample_codE" ) );
|
assertArrayEquals(d.toCharArray(), InputFactory.buildDataPath("Campagne/mackerel.97442.csv").toCharArray());
|
||||||
System.out.println( r.getEntry( 2 ) );
|
assertArrayEquals(e.toCharArray(), InputFactory.buildDataPath("Campagne/merlu2018_75164.csv").toCharArray());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@org.junit.jupiter.api.Test
|
||||||
|
void readData() throws InputFileException {
|
||||||
|
RawData test = InputFactory.readData("testComplete.csv");
|
||||||
|
|
||||||
|
System.out.println(test.getData());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@org.junit.jupiter.api.Test
|
||||||
|
void testReadData() {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
42
tests/ecoparasite/input/RawDataTest.java
Normal file
42
tests/ecoparasite/input/RawDataTest.java
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
package ecoparasite.input;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
|
||||||
|
class RawDataTest {
|
||||||
|
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void getColumnsNames() throws InputFileException {
|
||||||
|
RawData test = InputFactory.readData("testComplete.csv");
|
||||||
|
|
||||||
|
HashSet<String> d = new HashSet<>();
|
||||||
|
|
||||||
|
for (int i = 0; i < test.getData().size(); i++){
|
||||||
|
d.add(test.getData().get(i).getFirst());
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println(test.getColumnsNames());
|
||||||
|
System.out.println(d);
|
||||||
|
|
||||||
|
assertIterableEquals(test.getColumnsNames(),d);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void getDataFromColumn() throws InputFileException {
|
||||||
|
RawData test = InputFactory.readData("testComplete.csv");
|
||||||
|
|
||||||
|
System.out.println(test.getDataFromColumn("Sample_code"));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void getEntry() throws InputFileException, RawDataOverflow {
|
||||||
|
RawData test = InputFactory.readData("testComplete.csv");
|
||||||
|
|
||||||
|
System.out.println(test.getEntry(2));
|
||||||
|
}
|
||||||
|
}
|
||||||
30
tests/ecoparasite/nettoyage/NettoyageTest.java
Normal file
30
tests/ecoparasite/nettoyage/NettoyageTest.java
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
package ecoparasite.nettoyage;
|
||||||
|
|
||||||
|
import ecoparasite.completion.Completion;
|
||||||
|
import ecoparasite.input.InputFactory;
|
||||||
|
import ecoparasite.input.InputFileException;
|
||||||
|
import ecoparasite.input.RawData;
|
||||||
|
import ecoparasite.input.RawDataOverflow;
|
||||||
|
import ecoparasite.poisson.Mackerel;
|
||||||
|
import ecoparasite.poisson.Poisson;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
|
||||||
|
class NettoyageTest {
|
||||||
|
|
||||||
|
@org.junit.jupiter.api.Test
|
||||||
|
void nettoiePoissonMean() throws InputFileException, RawDataOverflow {
|
||||||
|
|
||||||
|
RawData test = InputFactory.readData("testNettoie.csv");
|
||||||
|
|
||||||
|
HashSet<Poisson> testp = Mackerel.parse(test);
|
||||||
|
|
||||||
|
System.out.println(testp);
|
||||||
|
|
||||||
|
testp = Nettoyage.nettoiePoissonMean(testp);
|
||||||
|
|
||||||
|
System.out.println(testp);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
24
tests/ecoparasite/poisson/MackerelTest.java
Normal file
24
tests/ecoparasite/poisson/MackerelTest.java
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
package ecoparasite.poisson;
|
||||||
|
|
||||||
|
import ecoparasite.input.InputFactory;
|
||||||
|
import ecoparasite.input.InputFileException;
|
||||||
|
import ecoparasite.input.RawData;
|
||||||
|
import ecoparasite.input.RawDataOverflow;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
|
||||||
|
class MackerelTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void parse() throws InputFileException, RawDataOverflow {
|
||||||
|
|
||||||
|
RawData test = InputFactory.readData( InputFactory.DATA_MACKEREL );
|
||||||
|
HashSet<Poisson> fishs = Mackerel.parse( test );
|
||||||
|
|
||||||
|
for( Poisson poisson : fishs){
|
||||||
|
System.out.println(poisson);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
26
tests/ecoparasite/poisson/MerluTest.java
Normal file
26
tests/ecoparasite/poisson/MerluTest.java
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
package ecoparasite.poisson;
|
||||||
|
|
||||||
|
import ecoparasite.input.InputFactory;
|
||||||
|
import ecoparasite.input.InputFileException;
|
||||||
|
import ecoparasite.input.RawData;
|
||||||
|
import ecoparasite.input.RawDataOverflow;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
|
class MerluTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void parse() throws InputFileException, RawDataOverflow {
|
||||||
|
|
||||||
|
RawData test = InputFactory.readData( InputFactory.DATA_MERLU );
|
||||||
|
HashSet<Poisson> fishs = Merlu.parse( test );
|
||||||
|
|
||||||
|
for( Poisson poisson : fishs){
|
||||||
|
System.out.println(poisson);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
23
tests/ecoparasite/population/PopulationParsingTest.java
Normal file
23
tests/ecoparasite/population/PopulationParsingTest.java
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
package ecoparasite.population;
|
||||||
|
|
||||||
|
import ecoparasite.input.InputFactory;
|
||||||
|
import ecoparasite.input.InputFileException;
|
||||||
|
import ecoparasite.input.RawData;
|
||||||
|
import ecoparasite.input.RawDataOverflow;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
|
class PopulationParsingTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void parseParasitesPeru() throws InputFileException, RawDataOverflow {
|
||||||
|
|
||||||
|
RawData parasitesPeru = InputFactory.readData( InputFactory.DATA_PARASITES_PERU, "," );
|
||||||
|
HashSet<Population> populations = Population.parse( parasitesPeru );
|
||||||
|
System.out.println( populations);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user