annotate artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixResult.java @ 6877:2d96d8240e3e

FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
author Sascha L. Teichmann <teichmann@intevation.de>
date Wed, 21 Aug 2013 01:09:25 +0200
parents af13ceeba52a
children 8efef772a488
rev   line source
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
2 * Software engineering by Intevation GmbH
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
3 *
5994
af13ceeba52a Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
5994
af13ceeba52a Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
6 * documentation coming with Dive4Elements River for details.
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
7 */
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
8
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 3729
diff changeset
9 package org.dive4elements.river.artifacts.model.fixings;
3450
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
10
6877
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
11 import org.apache.log4j.Logger;
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 3729
diff changeset
12 import org.dive4elements.river.artifacts.model.Parameters;
3450
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
13
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 3729
diff changeset
14 import org.dive4elements.river.utils.KMIndex;
3450
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
15
6877
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
16 import gnu.trove.TIntIntHashMap;
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
17
3450
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
18 import java.io.Serializable;
6877
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
19 import java.util.Collection;
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
20 import java.util.Date;
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
21 import java.util.TreeMap;
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
22 import java.util.TreeSet;
3450
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
23
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
24 public class FixResult
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
25 implements Serializable
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
26 {
6877
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
27 private static Logger log =
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
28 Logger.getLogger(FixResult.class);
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
29
3450
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
30 protected Parameters parameters;
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
31 protected KMIndex<QWD []> referenced;
3729
e727e3ebdf85 Factored out a pure QW model to be more reusable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3450
diff changeset
32 protected KMIndex<QWI []> outliers;
3450
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
33
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
34 public FixResult() {
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
35 }
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
36
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
37 public FixResult(
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
38 Parameters parameters,
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
39 KMIndex<QWD []> referenced,
3729
e727e3ebdf85 Factored out a pure QW model to be more reusable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3450
diff changeset
40 KMIndex<QWI []> outliers
3450
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
41 ) {
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
42 this.parameters = parameters;
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
43 this.referenced = referenced;
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
44 this.outliers = outliers;
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
45 }
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
46
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
47 public KMIndex<QWD []> getReferenced() {
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
48 return referenced;
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
49 }
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
50
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
51 public void setReferenced(KMIndex<QWD []> referenced) {
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
52 this.referenced = referenced;
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
53 }
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
54
6877
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
55 public void makeReferenceEventsDatesUnique() {
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
56 DateUniqueMaker dum = new DateUniqueMaker();
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
57 for (KMIndex.Entry<QWD []> entry: referenced) {
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
58 for (QWD ref: entry.getValue()) {
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
59 dum.makeUnique(ref);
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
60 }
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
61 }
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
62 }
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
63
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
64 public Collection<Integer> getReferenceEventsIndices() {
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
65 TreeMap<Date, Integer> dates = new TreeMap<Date, Integer>();
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
66 for (KMIndex.Entry<QWD []> entry: referenced) {
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
67 for (QWD value: entry.getValue()) {
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
68 dates.put(value.date, value.index);
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
69 }
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
70 }
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
71 return dates.values();
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
72 }
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
73
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
74 public void remapReferenceIndicesToRank() {
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
75 Collection<Integer> referenceIndices = getReferenceEventsIndices();
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
76 int index = 0;
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
77 TIntIntHashMap map = new TIntIntHashMap();
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
78 boolean debug = log.isDebugEnabled();
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
79 for (Integer refId: referenceIndices) {
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
80 if (debug) {
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
81 log.debug("map " + refId + " -> " + index);
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
82 }
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
83 map.put(refId, index);
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
84 ++index;
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
85 }
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
86
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
87 // Two passes: If there are shared references do not
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
88 // remap them twice. In the first pass all indices are
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
89 // mapped to negative values (assuming the original data
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
90 // is all positive). If a negative value is found ignore
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
91 // it because it was remapped before.
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
92
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
93 for (KMIndex.Entry<QWD []> entry: referenced) {
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
94 for (QWD value: entry.getValue()) {
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
95 if (value.index >= 0) {
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
96 if (map.containsKey(value.index)) {
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
97 value.index = -(map.get(value.index) + 1);
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
98 }
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
99 else {
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
100 log.warn("Could not remap index: " + value.index);
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
101 }
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
102 }
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
103 }
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
104 }
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
105
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
106 // In the second pass all indices are turned to positive
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
107 // values again.
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
108 for (KMIndex.Entry<QWD []> entry: referenced) {
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
109 for (QWD value: entry.getValue()) {
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
110 if (value.index < 0) {
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
111 value.index = -(value.index + 1);
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
112 }
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
113 }
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
114 }
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
115 }
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
116
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
117 public Collection<Date> getReferenceEventsDates() {
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
118 TreeSet<Date> dates = new TreeSet<Date>();
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
119 for (KMIndex.Entry<QWD []> entry: referenced) {
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
120 for (QWD qwd: entry.getValue()) {
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
121 dates.add(qwd.date);
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
122 }
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
123 }
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
124 return dates;
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
125 }
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
126
2d96d8240e3e FixA: Make dates of analysis periods unique, too. TODO: Remap the indices like the reference interval.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
127
3729
e727e3ebdf85 Factored out a pure QW model to be more reusable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3450
diff changeset
128 public KMIndex<QWI []> getOutliers() {
3450
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
129 return outliers;
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
130 }
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
131
3729
e727e3ebdf85 Factored out a pure QW model to be more reusable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3450
diff changeset
132 public void setOutliers(KMIndex<QWI []> outliers) {
3450
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
133 this.outliers = outliers;
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
134 }
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
135
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
136 public Parameters getParameters() {
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
137 return parameters;
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
138 }
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
139
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
140 public void setParameters(Parameters parameters) {
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
141 this.parameters = parameters;
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
142 }
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
143 }
22790758b132 FixA/Vollmer: return the result now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
144 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org