Forked from HYCAR-Hydro / airGR
Source project has a limited visibility.
FishNutrient.java 20.06 KiB
/**
 * 
 * @author Camille Poulet, Patrick Lambert
 * @copyright Copyright (c) 2019, 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 environment.SeaBasin;
import environment.Time.Season;
import fr.cemagref.simaqualife.pilot.Pilot;
import species.DiadromousFish.Gender;
import species.DiadromousFish.Stage;
import species.ReproduceAndSurviveAfterReproduction;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;
/**
 * @author camille.poulet
public class FishNutrient {
	private static enum SpawningPosition  {PRE,POST}; // on crer un static pour rserver une mme classe mmoire pour toutes les instances 
	private ArrayList<String> nutrientsOfInterest;
	private double residenceTime;
	private Map<String, Double> excretionRate; 
	/**
	 * Main feature for weight (g) computation before spawning i.e. gametes expelling according to gender, for a given length (cm) 
	 * //Voir pour un retour  la ligne lors du commentaire 
	 * key gender
	 * value
	 * 		key feature
	 * 		value value
	private Map <Gender,Map<String, Double>> fishFeaturesPreSpawning;
	private Map <Gender, Map<String, Double>> fishFeaturesPostSpawning;
	private Map <String, Double> juvenileFeatures;
	/**
	 *  Weight  of gametes spawned for both males and females 
7172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
* key gender * value g * usually computed as the difference between unspawned gonad (inbound) and spawned gonad (outbound; "spent gonad") */ private Map <Gender, Double> spawnedGametesWeight; /** * chemical composition of carcass before gametes expelling (before spawning) i.e. soma + gonads + gametes * <key> gender * <value> * <key> chemical element * <value> value ratio element / (total wet weight) g/g */ private Map<DiadromousFish.Gender,Map<String,Double>> compoCarcassPreSpawning; //package permettant la cration d'une table de hachage ie fonctionnant en cl -valeur. Cl unique, mais valeur peut tre associe plusieurs cls; //La class d'objet Map a pour point faible la taille des donnes stocker. Plus on a de valeur dans la table, plus c'est lourd et lent! Donc, trouver un compromis entre temps de calcul et espace. //N'accepte pas la valeur nulle et thread safe i.e. utilisable simultanment par plusieurs lments du programme. /** * chemical composition of carcass after spawning i.e. soma + spent gonad (without gametes) * <value> * <key> chemical element * <value> value */ private Map<DiadromousFish.Gender, Map<String, Double>> compoCarcassPostSpawning; /** * chemical composition of gametes estimated from the MIGADO dataset (BDalosesBruch) * <key> gender * <value> * <key> chemical element * <value> value */ private Map<DiadromousFish.Gender, Map<String,Double>> compoGametes; // For juveniles - Based on Taverny (1991) /** * chemical composition of juveniles * <key> stage * <value> * <key> chemical element * <value> value */ private Map<String,Double> compoJuvenile; /** * */ public FishNutrient() { // TODO Auto-generated constructor stub } /** * Constructor based on the 5 Map of fish composition * @param fishFeaturesPreSpawning * @param compoCarcassPreSpawning * @param compoCarcassPostSpawning * @param compoGametes * @param compoJuvenile */ public FishNutrient(ArrayList<String> nutrientsOfInterest, double residenceTime, Map <String, Double> excretionRate,