package ru.ulstu.method.exponential.addtrendnoseason; import ru.ulstu.datamodel.Model; import ru.ulstu.datamodel.ts.TimeSeries; import ru.ulstu.method.MethodParamValue; import ru.ulstu.method.MethodParameter; import ru.ulstu.method.exponential.parameter.Alpha; import ru.ulstu.method.exponential.parameter.Beta; import ru.ulstu.method.exponential.parameter.ExponentialMethodParamValue; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class AddTrendNoSeasonModel extends Model { private final ExponentialMethodParamValue alpha = new ExponentialMethodParamValue<>(Alpha.getInstance(), 0.5); private final ExponentialMethodParamValue beta = new ExponentialMethodParamValue<>(Beta.getInstance(), 0.5); private final List smoothedComponent = new ArrayList<>(); private final List trendComponent = new ArrayList<>(); public AddTrendNoSeasonModel(TimeSeries ts, List parameters) { super(ts); for (MethodParamValue parameter : parameters) { if (parameter.getParameter() instanceof Alpha) { alpha.setValue(parameter.getValue()); } if (parameter.getParameter() instanceof Beta) { beta.setValue(parameter.getValue()); } } } public List getSmoothedComponent() { return smoothedComponent; } public List getTrendComponent() { return trendComponent; } public ExponentialMethodParamValue getAlpha() { return alpha; } public ExponentialMethodParamValue getBeta() { return beta; } public static List getAvailableParameters() { return Arrays.asList(Alpha.getInstance(), Beta.getInstance()); } }