# HG changeset patch # User Sascha L. Teichmann # Date 1309183576 0 # Node ID 30be4b71c36c1ef62cd600dfcb6b0ff4adfdeb14 # Parent 65dcb5891206a7d87e79020caa008fbdf344ae81 WQ: Guessing increaing w is not based on direct neighbors any more. flys-artifacts/trunk@2254 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 65dcb5891206 -r 30be4b71c36c flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Mon Jun 27 13:58:03 2011 +0000 +++ b/flys-artifacts/ChangeLog Mon Jun 27 14:06:16 2011 +0000 @@ -1,3 +1,11 @@ +2011-06-27 Sascha L. Teichmann + + * src/main/java/de/intevation/flys/artifacts/model/WQ.java: + Guessing increaing w is not based on direct neighbors any more. + The second to be compared with is choosen by random of + the values before the first one. This makes the guessing + more robust against 'plateaus' of equal w values. + 2011-06-27 Sascha L. Teichmann * src/main/java/de/intevation/flys/exports/ATWriter.java: Array diff -r 65dcb5891206 -r 30be4b71c36c flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WQ.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WQ.java Mon Jun 27 13:58:03 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WQ.java Mon Jun 27 14:06:16 2011 +0000 @@ -120,9 +120,10 @@ Random rand = new Random(); for (int i = 0; i < samples; ++i) { - int pos = rand.nextInt(N-1) + 1; - double w1 = w.getQuick(pos-1); - double w2 = w.getQuick(pos); + int pos2 = rand.nextInt(N-1) + 1; + int pos1 = rand.nextInt(pos2); + double w1 = w.getQuick(pos1); + double w2 = w.getQuick(pos2); if (w2 > w1) ++up; }