46 lines
2.3 KiB
Java
46 lines
2.3 KiB
Java
package ru.ulstu.service;
|
|
|
|
import org.springframework.context.ApplicationContext;
|
|
import org.springframework.stereotype.Service;
|
|
import ru.ulstu.datamodel.ModelingResult;
|
|
import ru.ulstu.datamodel.exception.ModelingException;
|
|
import ru.ulstu.datamodel.ts.TimeSeries;
|
|
import ru.ulstu.method.Method;
|
|
|
|
import java.lang.reflect.InvocationTargetException;
|
|
import java.util.List;
|
|
import java.util.concurrent.ExecutionException;
|
|
|
|
|
|
@Service
|
|
public class TimeSeriesService {
|
|
private final MethodParamBruteForce methodParamBruteForce;
|
|
private final ApplicationContext applicationContext;
|
|
|
|
public TimeSeriesService(MethodParamBruteForce methodParamBruteForce,
|
|
ApplicationContext applicationContext) {
|
|
this.methodParamBruteForce = methodParamBruteForce;
|
|
this.applicationContext = applicationContext;
|
|
}
|
|
|
|
public ModelingResult getForecast(TimeSeries timeSeries, int countPoints) throws ExecutionException, InterruptedException, InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException, ModelingException {
|
|
return methodParamBruteForce.getForecast(timeSeries, countPoints);
|
|
}
|
|
|
|
public ModelingResult getForecast(TimeSeries timeSeries, String methodClassName, int countPoints) throws ExecutionException, InterruptedException, InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException, ModelingException {
|
|
return methodParamBruteForce.getForecast(timeSeries, methodClassName, countPoints);
|
|
}
|
|
|
|
public ModelingResult smoothTimeSeries(TimeSeries timeSeries) throws ExecutionException, InterruptedException, InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {
|
|
return methodParamBruteForce.getSmoothedTimeSeries(timeSeries);
|
|
}
|
|
|
|
public ModelingResult smoothTimeSeries(TimeSeries timeSeries, String methodClassName) throws ExecutionException, InterruptedException, InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException, ModelingException {
|
|
return methodParamBruteForce.getSmoothedTimeSeries(timeSeries, methodClassName);
|
|
}
|
|
|
|
public List<Method> getAvailableMethods() {
|
|
return methodParamBruteForce.getAvailableMethods();
|
|
}
|
|
}
|