Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WQ.java @ 748:30be4b71c36c
WQ: Guessing increaing w is not based on direct neighbors any more.
flys-artifacts/trunk@2254 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 27 Jun 2011 14:06:16 +0000 |
parents | b385577bcaca |
children | 0cb1a70b8b92 |
comparison
equal
deleted
inserted
replaced
747:65dcb5891206 | 748:30be4b71c36c |
---|---|
118 int up = 0; | 118 int up = 0; |
119 | 119 |
120 Random rand = new Random(); | 120 Random rand = new Random(); |
121 | 121 |
122 for (int i = 0; i < samples; ++i) { | 122 for (int i = 0; i < samples; ++i) { |
123 int pos = rand.nextInt(N-1) + 1; | 123 int pos2 = rand.nextInt(N-1) + 1; |
124 double w1 = w.getQuick(pos-1); | 124 int pos1 = rand.nextInt(pos2); |
125 double w2 = w.getQuick(pos); | 125 double w1 = w.getQuick(pos1); |
126 double w2 = w.getQuick(pos2); | |
126 if (w2 > w1) ++up; | 127 if (w2 > w1) ++up; |
127 } | 128 } |
128 | 129 |
129 return up > samples/2; | 130 return up > samples/2; |
130 } | 131 } |