Skip to content
Snippets Groups Projects

Master

Closed Tor-Einar Skog requested to merge master into develop
1 file
+ 1
2
Compare changes
  • Side-by-side
  • Inline
@@ -240,11 +240,10 @@ public class NegativePrognosisModel extends I18nImpl implements Model{
@@ -240,11 +240,10 @@ public class NegativePrognosisModel extends I18nImpl implements Model{
@Override
@Override
public void setConfiguration(ModelConfiguration config) throws ConfigValidationException {
public void setConfiguration(ModelConfiguration config) throws ConfigValidationException {
ObjectMapper mapper = new ObjectMapper();
// Setting timezone
// Setting timezone
this.timeZone = TimeZone.getTimeZone((String) config.getConfigParameter("timeZone"));
this.timeZone = TimeZone.getTimeZone((String) config.getConfigParameter("timeZone"));
// Getting weather data
// Getting weather data
List<WeatherObservation> observations = mapper.convertValue(config.getConfigParameter("observations"), new TypeReference<List<WeatherObservation>>(){});
List<WeatherObservation> observations = this.modelUtil.extractWeatherObservationList(config.getConfigParameter("observations"));
for(WeatherObservation o:observations)
for(WeatherObservation o:observations)
{
{
this.dataMatrix.setParamDoubleValueForDate(o.getTimeMeasured(), o.getElementMeasurementTypeId(), o.getValue());
this.dataMatrix.setParamDoubleValueForDate(o.getTimeMeasured(), o.getElementMeasurementTypeId(), o.getValue());
Loading