diff --git a/src/main/java/ru/ulstu/service/MethodParamBruteForce.java b/src/main/java/ru/ulstu/service/MethodParamBruteForce.java index 753a7cc..1a4b8ec 100644 --- a/src/main/java/ru/ulstu/service/MethodParamBruteForce.java +++ b/src/main/java/ru/ulstu/service/MethodParamBruteForce.java @@ -68,9 +68,13 @@ public class MethodParamBruteForce { ModelingResult bestResult = results2.stream() .min(Comparator.comparing(modelingResult -> modelingResult.getScore().getDoubleValue())) .orElse(null); - return new ModelingResult(bestResult.getTimeSeriesMethod().getForecast(timeSeries, + + TimeSeries forecast = bestResult.getTimeSeriesMethod().getForecast(timeSeries, bestResult.getParamValues(), - countPoints), + countPoints); + forecast.getValue(0).setValue(timeSeries.getNumericValue(timeSeries.getLength() - 1)); + + return new ModelingResult(forecast, bestResult.getParamValues(), bestResult.getScore(), bestResult.getTimeSeriesMethod());