Mercurial > dive4elements > river
changeset 3607:e0f54fab55d3
FixA: Generate indices for each analysis periods.
flys-artifacts/trunk@5236 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Wed, 22 Aug 2012 13:38:51 +0000 (2012-08-22) |
parents | 2b308a5d5281 |
children | 53aa395a29e0 |
files | flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisCalculation.java |
diffstat | 2 files changed, 14 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Wed Aug 22 12:25:28 2012 +0000 +++ b/flys-artifacts/ChangeLog Wed Aug 22 13:38:51 2012 +0000 @@ -1,3 +1,8 @@ +2012-08-22 Sascha L. Teichmann <sascha.teichmann@intevation.de> + + * src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisCalculation.java: + Each analysis period has its own index scheme now. + 2012-08-22 Christian Lins <christian.lins@intevation.de> * src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java:
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisCalculation.java Wed Aug 22 12:25:28 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisCalculation.java Wed Aug 22 13:38:51 2012 +0000 @@ -129,8 +129,12 @@ IdsFilter idsFilter = new IdsFilter(events); - HashMap<Integer, Integer> col2index = new HashMap<Integer, Integer>(); + ArrayList<HashMap<Integer, Integer>> col2indices = + new ArrayList<HashMap<Integer, Integer>>(analysisPeriods.length); + for (int i = 0; i < analysisPeriods.length; ++i) { + col2indices.add(new HashMap<Integer, Integer>()); + } for (int row = 0, R = parameters.size(); row < R; ++row) { double km = parameters.get(row, kmIndex); @@ -145,7 +149,10 @@ ArrayList<AnalysisPeriod> periodResults = new ArrayList<AnalysisPeriod>(analysisPeriods.length); - for (DateRange analysisPeriod: analysisPeriods) { + for (int ap = 0; ap < analysisPeriods.length; ++ap) { + DateRange analysisPeriod = analysisPeriods[ap]; + HashMap<Integer, Integer> col2index = col2indices.get(ap); + DateRangeFilter drf = new DateRangeFilter( analysisPeriod.getFrom(), analysisPeriod.getTo());