comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadData.java @ 8750:69b0a71b4845

(issue1448) Make sq time intervals distinct only for non epoch loads Previously it was random if the loads choosen to be part of the distinct sq time interval loads set were epoch loads or not. This led to wrong results beeing removed in the isEpoch check afterwards.
author Andre Heinecke <andre.heinecke@intevation.de>
date Fri, 19 Jun 2015 16:35:13 +0200
parents 301a32bd7045
children d0f2250b5521
comparison
equal deleted inserted replaced
8749:c4654863108d 8750:69b0a71b4845
230 } 230 }
231 } 231 }
232 } 232 }
233 } 233 }
234 234
235 public void allNonEpochLoads(Collection<Load> loads) {
236 for (List<Value> values: grainFractions) {
237 if (values != null) {
238 for (Value value: values) {
239 Load load = value.getLoad();
240 if (load.isEpoch()) {
241 continue;
242 }
243 loads.add(value.getLoad());
244 }
245 }
246 }
247 }
248
235 public void allOfficialLoads(Collection<Load> loads) { 249 public void allOfficialLoads(Collection<Load> loads) {
236 for (List<Value> values: grainFractions) { 250 for (List<Value> values: grainFractions) {
237 if (values != null) { 251 if (values != null) {
238 for (Value value: values) { 252 for (Value value: values) {
239 Load load = value.getLoad(); 253 Load load = value.getLoad();
534 548
535 /** Get a list of loads with unique sq_time_intervals. 549 /** Get a list of loads with unique sq_time_intervals.
536 * 550 *
537 * This is mainly a convenience function for the SedimentLoadInfoService. 551 * This is mainly a convenience function for the SedimentLoadInfoService.
538 */ 552 */
539 public Collection<Load> findUniqueTimeIntervalLoads(double a, double b) { 553 public Collection<Load> findDistinctSQTimeIntervalNonEpochLoads(double a, double b) {
540 final TreeSet<Load> loads = new TreeSet<Load>(LOAD_SQ_TI_CMP); 554 final TreeSet<Load> loads = new TreeSet<Load>(LOAD_SQ_TI_CMP);
541 555
542 findStations(a, b, new Visitor() { 556 findStations(a, b, new Visitor() {
543 @Override 557 @Override
544 public void visit(Station station) { 558 public void visit(Station station) {
545 station.allLoads(loads); 559 station.allNonEpochLoads(loads);
546 } 560 }
547 }); 561 });
548 562
549 return loads; 563 return loads;
550 } 564 }

http://dive4elements.wald.intevation.org