diff --git a/exploration/nutrients/nutrientFlux.R b/exploration/nutrients/nutrientFlux.R new file mode 100644 index 0000000000000000000000000000000000000000..48e01a96e480f1b2a32fabb63f5cc1d98908ac43 --- /dev/null +++ b/exploration/nutrients/nutrientFlux.R @@ -0,0 +1,81 @@ +age=3:8 + +fecundity = function(age){ + 871.72*age +50916 +} +cbind(age, fecundity(age), fecundity(age) -mean(fecundity(age))) +# + + +#=================================================== +# masse des gonades, RGS +# =================================================== +# Taverny 1991 +Wt=seq(1000, 3000, 200) # masse totale (g) +Gn = - 85.5634 + (Wt )*0.166 # masse de la gonade (g) +plot(Wt,Gn) +plot(Wt, Gn/Wt) + +# ================================================== +# relation taille poinds +# ================================================= +LtJuv=30:150 # mm +LtGen=400:800 #mm +Minho = function(Lt){ + # formule avec Lt en cm + return(0.0221 * (Lt/10)^2.8147) +} + + +GirondeJuvenile = function(Lt){ + # pour année 1985 + exp(-11.571) * Lt^2.9467 +} + +GirondeMale = function(Lt){ + # Lt en mm + # pour l'année 1988 (livre p44) + 2.4386e-6*Lt^3.2252 +} + +GirondeFemale = function(Lt){ + # Lt en mm + # pour l'année 1988 (livre p44) + 1.2102e-6*Lt^3.3429 +} +# ========================================= PB +LoireMale = function(Lf){ + # longueur fourche + 5.5070e-3*Lf^3.114 +} +LoireFemale = function(Lf){ + # longueur fourche + 7.2980e-3* Lf^3.019 +} + +SebouMale = function(Lt){ + 2.0705e-6*Lt^3.2587 +} +SebouFemale = function(Lt){ + 8.2056e-7*Lt^3.4105 +} + + +plot(LtJuv, GirondeJuvenile(LtJuv), type='l') + + +plot(LtGen, Minho(LtGen), type='l', col='black', ylim=c(0,5000), xlab ='total length (mm)', ylab = 'weight (g)') +lines(LtGen, GirondeMale(LtGen), col='green') +lines(LtGen, GirondeFemale(LtGen), col='green', lty=2) +lines(LtGen, SebouMale(LtGen), col='red') +lines(LtGen, SebouFemale(LtGen), col='red', lty=2) +lines(LtGen, LoireMale(LtGen), col='blue') +lines(LtGen, LoireFemale(LtGen), col='blue', lty=2) +legend('topleft', legend=c('Minho', 'Gironde Male', 'Gironde Female', 'Sebou Male', 'Sebou Female', 'Loire Male', 'Loire Female'), + lty=c(1,1,2, 1,2,1,2, 1,2), + col=c('black', 'green', 'green', 'red', 'red', 'blue', 'blue')) + +plot(LtGen, LoireMale(LtGen), col='blue', type='l',xlab ='total length (mm)', ylab = 'weight (g)') + +lines(LtGen, LoireFemale(LtGen), col='blue', lty=2) +points(506, LoireFemale(506), col='blue') diff --git a/src/main/java/species/DiadromousFish.java b/src/main/java/species/DiadromousFish.java index f880fabe99e15645882c6a60f8cbb95efe680106..bec490f285042bce16328d16acfcc692d37f9269 100644 --- a/src/main/java/species/DiadromousFish.java +++ b/src/main/java/species/DiadromousFish.java @@ -101,6 +101,13 @@ public class DiadromousFish extends AquaNism<Basin, BasinNetwork> { return birthBasin; } + /** + * @return the gender + */ + public Gender getGender() { + return gender; + } + @Override public <ANG extends AquaNismsGroup<?, BasinNetwork>> void moveTo( Pilot pilot, Basin destination, ANG group) { diff --git a/src/main/java/species/DiadromousFishGroup.java b/src/main/java/species/DiadromousFishGroup.java index d503f9bbe25a276ed71b136bc9e72fead95f6f57..b84dbb45c9f52904b942bafe1a7e3d48517e1af7 100644 --- a/src/main/java/species/DiadromousFishGroup.java +++ b/src/main/java/species/DiadromousFishGroup.java @@ -39,8 +39,6 @@ public class DiadromousFishGroup extends AquaNismsGroup< DiadromousFish, BasinNe public double linfVonBert = 60.; public double dMaxDisp = 300.; public double lFirstMaturity = 40.; - public double aLW = 0.02; // param�tre "a" de la relation taille/poids - public double bLW = 3.; // param�tre "b" de la relation taille/poids public String fileNameInputForInitialObservation = "data/input/reality/Obs1900.csv"; public double centileForRange = 0.95; @@ -139,7 +137,7 @@ public class DiadromousFishGroup extends AquaNismsGroup< DiadromousFish, BasinNe } // charge kopt et temMinRep depuis le fichier de parametre. Sinon (parameterSetLine<=0), ce sont les - // valeur dasn le procoessus de reroduction qui sont utilisé + // valeur dasn le procoessus de reroduction qui sont utilis� kOpt=Double.NaN; tempMinRep =Double.NaN; if (parameterSetLine>0){ @@ -269,14 +267,6 @@ public class DiadromousFishGroup extends AquaNismsGroup< DiadromousFish, BasinNe this.lFirstMaturity = lFirstMaturity; } - public double getaLW() { - return aLW; - } - - public double getbLW() { - return bLW; - } - @Observable(description="Higher Populated Latitude") public double getHigherPopulatedLatitude() { diff --git a/src/main/java/species/FishNutrient.java b/src/main/java/species/FishNutrient.java new file mode 100644 index 0000000000000000000000000000000000000000..23b7d94604254e0872044841b602a009d63d0325 --- /dev/null +++ b/src/main/java/species/FishNutrient.java @@ -0,0 +1,89 @@ +/** + * patrick.lambert + * @author Patrick Lambert + * @copyright Copyright (c) 2018, Irstea + * + * 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 <http://www.gnu.org/licenses/>. + + */ +package species; + +import species.DiadromousFish.Gender; +import species.DiadromousFish.Stage; + +/** + * + */ +public class FishNutrient { + + private double aLWfemalePre = 0.0221; // param�tre "a" de la relation taille/poids avec Lt en cm + private double bLWfemalePre = 2.8147; // param�tre "b" de la relation taille/poids + private double GSIfemalePre =.15; + private double aLWmalePre = 0.0221; // param�tre "a" de la relation taille/poids avec Lt en cm + private double bLWmalePre = 2.8147; // param�tre "b" de la relation taille/poids + private double GSImalePre =.07; + + // Si on ne possède pas wT post reproduction + + private double aLWfemalePost = 0.; // param�tre "a" de la relation taille/poids avec Lt en cm + private double bLWfemalePost = 0.; // param�tre "b" de la relation taille/poids + private double GSIfemalePost=0.; + private double aLWmalePost = 0.; // param�tre "a" de la relation taille/poids avec Lt en cm + private double bLWmalePost = 0.; // param�tre "b" de la relation taille/poids + private double GSImalePost =.07; + + + + //Valeurs de Haskell pour A. sapidissima -- A rechercher pour Alosa alosa + + private double compoNpreMale = 2.921; + private double compoPpreMale = 0.662; + private double compoNpreFemale = 2.917; + private double compoPpreFemale = 0.725; + + private double compoNpostMale = 2.790 ; + private double compoPpostMale = 0.961; + private double compoNpostFemale = 3.216 ; + private double compoPpostFemale = 0.997; + + + /** + * + */ + public FishNutrient() { + // TODO Auto-generated constructor stub + } + + public void computeNP(DiadromousFish fish) { + double totalWeightPre, totalWeightPost; + + if (fish.getStage() == Stage.MATURE) { + if (fish.getGender() == Gender.FEMALE ) { + totalWeightPre = aLWfemalePre * Math.pow(fish.getLength(), bLWfemalePre); + totalWeightPost = aLWfemalePost * Math.pow(fish.getLength(), bLWfemalePost); + // totalWeightPost = totalWeightPre * GSIfemalePre; + } + else if (fish.getGender() == Gender.MALE) { + totalWeightPre = aLWmalePre * Math.pow(fish.getLength(), bLWmalePre); + totalWeightPost = aLWmalePost * Math.pow(fish.getLength(), bLWmalePost); + // totalWeightPost = totalWeightPre * GSImalePre; + } + else { + totalWeightPre = Double.NaN; + totalWeightPost = 0.; + } + + } + } +} \ No newline at end of file