Commit 9eba6e7a authored by Lambert Patrick's avatar Lambert Patrick
Browse files

typing correction

parent ceffee55
...@@ -112,8 +112,7 @@ public class DisperseAndMigrateToRiverWithMultiNomDistriAndDeathBasin extends Di ...@@ -112,8 +112,7 @@ public class DisperseAndMigrateToRiverWithMultiNomDistriAndDeathBasin extends Di
public static void main(String[] args) { public static void main(String[] args) {
System.out.println( System.out.println((new XStream(new DomDriver())).toXML(new DisperseAndMigrateToRiverWithMultiNomDistriAndDeathBasin()));
(new XStream(new DomDriver())).toXML(new DisperseAndMigrateToRiverWithMultiNomDistriAndDeathBasin()));
} }
...@@ -166,7 +165,7 @@ public class DisperseAndMigrateToRiverWithMultiNomDistriAndDeathBasin extends Di ...@@ -166,7 +165,7 @@ public class DisperseAndMigrateToRiverWithMultiNomDistriAndDeathBasin extends Di
// influence of the fish length on the probability to disperse // influence of the fish length on the probability to disperse
if (strayedAmount != 0) { if (strayedAmount != 0) {
// calcula the weight associated with the fish length in the probabaility to disperse // calculate the weight associated with the fish length in the probabaility to disperse
double weightFishLength = -(alpha2Rep * ((fish.getLength() - meanSpawnersLengthAtRepro) double weightFishLength = -(alpha2Rep * ((fish.getLength() - meanSpawnersLengthAtRepro)
/ standardDeviationOfSpawnersLengthAtRepro)); / standardDeviationOfSpawnersLengthAtRepro));
...@@ -176,8 +175,7 @@ public class DisperseAndMigrateToRiverWithMultiNomDistriAndDeathBasin extends Di ...@@ -176,8 +175,7 @@ public class DisperseAndMigrateToRiverWithMultiNomDistriAndDeathBasin extends Di
long amountToGo = 0; long amountToGo = 0;
Map<RiverBasin, Double> basinWeightsFromDeparture = new HashMap<RiverBasin, Double>(); Map<RiverBasin, Double> basinWeightsFromDeparture = new HashMap<RiverBasin, Double>();
for (Entry<RiverBasin, Double> entry : basinWeightsPerBasin.get(departure).entrySet()) { for (Entry<RiverBasin, Double> entry : basinWeightsPerBasin.get(departure).entrySet()) {
double accBasinWeight = 1. double accBasinWeight = 1. / (1. + Math.exp(-(entry.getValue() + weightFishLength)));
/ (1. + Math.exp(-(entry.getValue() + weightFishLength)));
// put weight to 0 for unused basins // put weight to 0 for unused basins
if (group.isThereBasinToUpdate()) { if (group.isThereBasinToUpdate()) {
...@@ -195,14 +193,16 @@ public class DisperseAndMigrateToRiverWithMultiNomDistriAndDeathBasin extends Di ...@@ -195,14 +193,16 @@ public class DisperseAndMigrateToRiverWithMultiNomDistriAndDeathBasin extends Di
totalWeight = totalWeight + weightOfDeathBasin; totalWeight = totalWeight + weightOfDeathBasin;
// Afficher le contenu du MAP // Afficher le contenu du MAP
System.out.println(departure.getName() + ": " + totalWeight);
System.out.println("strayedAmount before: " + strayedAmount);
Iterator<RiverBasin> iterateur = basinWeightsFromDeparture.keySet().iterator(); Iterator<RiverBasin> iterateur = basinWeightsFromDeparture.keySet().iterator();
// Parcourir les clés et afficher les entrées de chaque clé; // Parcourir les clés et afficher les entrées de chaque clé;
while (iterateur.hasNext()) { while (iterateur.hasNext()) {
RiverBasin key = iterateur.next(); RiverBasin key = iterateur.next();
System.out.println(key.getName() + "=>" + basinWeightsFromDeparture.get(key)); System.out.println(key.getName() + " dist = " + departure.getNeighboursDistances().get(key)
+ "=>" + (basinWeightsFromDeparture.get(key)));
} }
System.out.println();
// compute sequentially the prob to go into a basin // compute sequentially the prob to go into a basin
for (Entry<RiverBasin, Double> entry : basinWeightsPerBasin.get(departure).entrySet()) { for (Entry<RiverBasin, Double> entry : basinWeightsPerBasin.get(departure).entrySet()) {
RiverBasin strayerDestination = entry.getKey(); RiverBasin strayerDestination = entry.getKey();
...@@ -212,8 +212,8 @@ public class DisperseAndMigrateToRiverWithMultiNomDistriAndDeathBasin extends Di ...@@ -212,8 +212,8 @@ public class DisperseAndMigrateToRiverWithMultiNomDistriAndDeathBasin extends Di
// strayedAmount, probToGo); // strayedAmount, probToGo);
amountToGo = aleaGen.getSuccessNumber(strayedAmount, probToGo); amountToGo = aleaGen.getSuccessNumber(strayedAmount, probToGo);
if (amountToGo > 0) { if (amountToGo > 0) {
strayerDestination.addFish(fish.duplicateWithNewPositionAndAmount( strayerDestination.addFish(fish.duplicateWithNewPositionAndAmount(group.getPilot(),
group.getPilot(), strayerDestination, amountToGo), group); strayerDestination, amountToGo), group);
} }
totalWeight -= weight; totalWeight -= weight;
...@@ -226,6 +226,9 @@ public class DisperseAndMigrateToRiverWithMultiNomDistriAndDeathBasin extends Di ...@@ -226,6 +226,9 @@ public class DisperseAndMigrateToRiverWithMultiNomDistriAndDeathBasin extends Di
} }
} }
System.out.println("strayedAmount after: " + strayedAmount);
System.out.println();
// update fish with homing // update fish with homing
if (homingAmount > 0) { if (homingAmount > 0) {
fish.setAmount(homingAmount); fish.setAmount(homingAmount);
......
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