Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/Calculation3.java @ 1190:f514894ec2fd
merged flys-artifacts/2.5
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 28 Sep 2012 12:14:17 +0200 |
parents | 3b7e9ddf6bb1 |
children | 0296684a5553 |
comparison
equal
deleted
inserted
replaced
917:b48c36076e17 | 1190:f514894ec2fd |
---|---|
1 package de.intevation.flys.artifacts.model; | |
2 | |
3 import org.apache.log4j.Logger; | |
4 | |
5 public class Calculation3 | |
6 extends Calculation | |
7 { | |
8 private static Logger logger = Logger.getLogger(Calculation3.class); | |
9 | |
10 protected double km; | |
11 protected int [] days; | |
12 protected double [] qs; | |
13 | |
14 public Calculation3() { | |
15 } | |
16 | |
17 public Calculation3(double km, int [] days, double [] qs) { | |
18 this.km = km; | |
19 this.days = days; | |
20 this.qs = qs; | |
21 } | |
22 | |
23 public CalculationResult calculate(WstValueTable wst) { | |
24 | |
25 double [] ws = wst.interpolateW(km, qs, new double[qs.length], this); | |
26 | |
27 WQDay wqday = new WQDay(days, ws, qs); | |
28 | |
29 if (hasProblems()) { | |
30 logger.debug("calculation caused "+numProblems()+" problem(s)."); | |
31 wqday.removeNaNs(); | |
32 } | |
33 | |
34 return new CalculationResult(wqday, this); | |
35 } | |
36 } | |
37 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |