Commit 2e0e2439 authored by Poulet Camille's avatar Poulet Camille
Browse files

Add conditions for fish to move from offshore to inshore basin at maturity

parent 18606dc9
......@@ -10,6 +10,7 @@ import environment.Time;
import environment.OffshoreBasin.OffshoreBasinFunction;
import environment.Time.Season;
import fr.cemagref.simaqualife.kernel.processes.AquaNismsGroupProcess;
import species.DiadromousFish.Stage;
import java.util.List;
import java.util.ListIterator;
......@@ -85,7 +86,7 @@ public class MigrateBetweenOffshores extends AquaNismsGroupProcess<DiadromousFis
fish.setPosition(destination);
destination.addFish(fish, group);
// remove fish from the present basin (with the listIterator to speed up !)
fishIterator.remove();;
fishIterator.remove();
}
}
}
......
......@@ -52,13 +52,17 @@ public class MigrateFromOffshoreToInshore extends AquaNismsGroupProcess<Diadromo
DiadromousFish fish = fishIterator.next();
destination = ((RiverBasin) fish.getMemorisedBasin()).getConnectedInshoreBasin();
if (fish.getStage()== Stage.MATURE) {
destination = ((RiverBasin) fish.getMemorisedBasin()).getConnectedInshoreBasin();
// add fish with its new position to destination basin
fish.setPosition(destination);
destination.addFish(fish, group);
// remove fish from the present basin (with the listIterator to speed up !)
fishIterator.remove();
}
// add fish with its new position to destination basin
fish.setPosition(destination);
destination.addFish(fish, group);
// remove fish from the present basin (with the listIterator to speed up !)
fishIterator.remove();
}
}
......
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