Commit fddefdd2 authored by patrick.lambert's avatar patrick.lambert
Browse files

new process to kill old fish

parent c123a98b
......@@ -202,8 +202,8 @@
<lengthAtHatching>2.8</lengthAtHatching>
<linfVonBertForFemale>76.0</linfVonBertForFemale>
<linfVonBertForMale>76.0</linfVonBertForMale>
<lFirstMaturityForFemale>44.8</lFirstMaturityForFemale>
<lFirstMaturityForMale>40.2</lFirstMaturityForMale>
<lFirstMaturityForFemale>47.26</lFirstMaturityForFemale>
<lFirstMaturityForMale>40.6</lFirstMaturityForMale>
<processes>
<processesAtBegin>
......@@ -237,10 +237,10 @@
<synchronisationMode>ASYNCHRONOUS</synchronisationMode>
<tempMinGrow>1.7</tempMinGrow>
<tempMaxGrow>27.9</tempMaxGrow>
<tempOptGrow>4.5</tempOptGrow>
<kOptForFemale>0.57</kOptForFemale>
<kOptForMale>0.61</kOptForMale>
<sigmaDeltaLVonBert>0.4</sigmaDeltaLVonBert>
<tempOptGrow>6.2</tempOptGrow>
<kOptForFemale>0.25</kOptForFemale>
<kOptForMale>0.23</kOptForMale>
<sigmaDeltaLVonBert>0.2</sigmaDeltaLVonBert>
</species.Grow>
<species.MigrateFromOffshoreToInshore>
......@@ -278,6 +278,12 @@
<mortalityRateInOffshore>0.4</mortalityRateInOffshore>
</species.Survive>
<species.SurviveWhenBecomeOld>
<synchronisationMode>ASYNCHRONOUS</synchronisationMode>
<ageMax>12.0</ageMax>
<verbose>true</verbose>
</species.SurviveWhenBecomeOld>
<!--<species.WriteEffectiveAndBiomassImportFluxes> <synchronisationMode>ASYNCHRONOUS</synchronisationMode> <exportSeason>SPRING</exportSeason>
<fileNameOutput>effectiveBiomassFluxesBeforeReproduction</fileNameOutput> </species.WriteEffectiveAndBiomassImportFluxes> -->
......@@ -319,13 +325,14 @@
<synchronisationMode>ASYNCHRONOUS</synchronisationMode>
<afterReproductionSeason>SUMMER</afterReproductionSeason>
<maximalSurvivalRate>0.18</maximalSurvivalRate>
<temperatureEffectSurvivalAfterReproduction class="temperatureEffect.LogitEffect">
<Tref>19.9</Tref>
<alpha>-0.58</alpha>
<temperatureEffectSurvivalAfterReproduction
class="temperatureEffect.LogitEffect">
<Tref>19.9</Tref>
<alpha>-0.58</alpha>
</temperatureEffectSurvivalAfterReproduction>
<!-- <temperatureEffectSurvivalAfterReproduction -->
<!-- class="temperatureEffect.NoEffect"> -->
<!-- </temperatureEffectSurvivalAfterReproduction> -->
<!-- <temperatureEffectSurvivalAfterReproduction -->
<!-- class="temperatureEffect.NoEffect"> -->
<!-- </temperatureEffectSurvivalAfterReproduction> -->
</species.SurviveAfterReproduction>
<species.MigrateFromRiverToInshore>
......
package species;
import java.util.ListIterator;
import org.openide.util.lookup.ServiceProvider;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;
import environment.Basin;
import environment.Time.Season;
import fr.cemagref.simaqualife.kernel.processes.AquaNismsGroupProcess;
import fr.cemagref.simaqualife.pilot.Pilot;
@ServiceProvider(service = AquaNismsGroupProcess.class)
public class SurviveWhenBecomeOld extends AquaNismsGroupProcess<DiadromousFish, DiadromousFishGroup> {
/**
* fish older than or equal to ageMax are killed
*
* @unit: year
*/
private double ageMax = 12;
private boolean verbose = false;
/**
* the random numbers generator for binomial draws
*
* @unit --
*/
// private transient BinomialForSuperIndividualGen aleaGen;
public static void main(String[] args) {
System.out.println((new XStream(new DomDriver())).toXML(new SurviveWhenBecomeOld()));
}
@Override
public void initTransientParameters(Pilot pilot) {
super.initTransientParameters(pilot);
// aleaGen = new BinomialForSuperIndividualGen(pilot.getRandomStream());
}
@Override
public void doProcess(DiadromousFishGroup group) {
if (group.getEnvironment().getTime().getSeason(group.getPilot()) == Season.SPRING) {
Long nbKill = 0L;
for (Basin basin : group.getEnvironment().getBasins()) {
// System.out.print(basin.getName());
if (basin.getFishs(group) != null) {
// System.out.println(" y a des poissons");
ListIterator<DiadromousFish> fishIterator = basin.getFishs(group).listIterator();
while (fishIterator.hasNext()) {
DiadromousFish fish = fishIterator.next();
if (fish.getAge() >= ageMax) {
nbKill += fish.getAmount();
fishIterator.remove();
}
} // end on loop of fish
}
} // end loop on basin
if (verbose & nbKill > 0L)
System.out.println(" number of old fish killed: " + nbKill);
}
}// end of doprocess
}// end of class
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment