@Override public void setCurrentConfiguration(final Configuration config, final boolean update) { this.setFieldsByConfiguration(config, update); }
/** * Represents the input port for measurements. * * @param input * Incoming measurements */ @InputPort(eventTypes = { NamedDoubleTimeSeriesPoint.class }, name = ForecastingFilter.INPUT_PORT_NAME_TSPOINT) public void inputEvent(final NamedDoubleTimeSeriesPoint input) { if (this.checkInitialization(input.getName())) { this.processInput(input, input.getTime(), input.getName()); } else { // Initialization of the forecasting variables for a new application this.applicationForecastingWindow.put(input.getName(), new TimeSeries<Double>(input.getTime(), super.recordsTimeUnitFromProjectContext, this.deltat.get(), this.timeSeriesWindowCapacity.get())); this.processInput(input, input.getTime(), input.getName()); } }
private void setFieldsByConfiguration(final Configuration config, final boolean update) { if (!update || this.isPropertyUpdateable(CONFIG_PROPERTY_NAME_DELTA_TIME)) { this.deltat = new AtomicLong(config.getLongProperty(CONFIG_PROPERTY_NAME_DELTA_TIME)); } if (!update || this.isPropertyUpdateable(CONFIG_PROPERTY_NAME_DELTA_UNIT)) { this.tunit = TimeUnit.valueOf(config.getStringProperty(CONFIG_PROPERTY_NAME_DELTA_UNIT)); } if (!update || this.isPropertyUpdateable(CONFIG_PROPERTY_NAME_FC_METHOD)) { this.forecastMethod.set(ForecastMethod.valueOf(config.getStringProperty(CONFIG_PROPERTY_NAME_FC_METHOD))); } if (!update || this.isPropertyUpdateable(CONFIG_PROPERTY_NAME_TS_WINDOW_CAPACITY)) { this.timeSeriesWindowCapacity = new AtomicInteger(config.getIntProperty(CONFIG_PROPERTY_NAME_TS_WINDOW_CAPACITY)); } if (!update || this.isPropertyUpdateable(CONFIG_PROPERTY_NAME_FC_CONFIDENCE)) { this.forecastConfidence = new AtomicInteger(config.getIntProperty(CONFIG_PROPERTY_NAME_FC_CONFIDENCE)); } }
"MILLISECONDS"); forecastConfiguration.setProperty(ForecastingFilter.CONFIG_PROPERTY_NAME_FC_METHOD, "MEANJAVA"); final ForecastingFilter forecasting = new ForecastingFilter(forecastConfiguration, this.controller);
/** * Represents the input port for measurements. * * @param input * Incoming measurements */ @InputPort(eventTypes = { NamedDoubleTimeSeriesPoint.class }, name = ForecastingFilter.INPUT_PORT_NAME_TSPOINT) public void inputEvent(final NamedDoubleTimeSeriesPoint input) { if (this.checkInitialization(input.getName())) { this.processInput(input, input.getTime(), input.getName()); } else { // Initialization of the forecasting variables for a new application this.applicationForecastingWindow.put(input.getName(), new TimeSeries<Double>(input.getTime(), super.recordsTimeUnitFromProjectContext, this.deltat.get(), this.timeSeriesWindowCapacity.get())); this.processInput(input, input.getTime(), input.getName()); } }
private void setFieldsByConfiguration(final Configuration config, final boolean update) { if (!update || this.isPropertyUpdateable(CONFIG_PROPERTY_NAME_DELTA_TIME)) { this.deltat = new AtomicLong(config.getLongProperty(CONFIG_PROPERTY_NAME_DELTA_TIME)); } if (!update || this.isPropertyUpdateable(CONFIG_PROPERTY_NAME_DELTA_UNIT)) { this.tunit = TimeUnit.valueOf(config.getStringProperty(CONFIG_PROPERTY_NAME_DELTA_UNIT)); } if (!update || this.isPropertyUpdateable(CONFIG_PROPERTY_NAME_FC_METHOD)) { this.forecastMethod.set(ForecastMethod.valueOf(config.getStringProperty(CONFIG_PROPERTY_NAME_FC_METHOD))); } if (!update || this.isPropertyUpdateable(CONFIG_PROPERTY_NAME_TS_WINDOW_CAPACITY)) { this.timeSeriesWindowCapacity = new AtomicInteger(config.getIntProperty(CONFIG_PROPERTY_NAME_TS_WINDOW_CAPACITY)); } if (!update || this.isPropertyUpdateable(CONFIG_PROPERTY_NAME_FC_CONFIDENCE)) { this.forecastConfidence = new AtomicInteger(config.getIntProperty(CONFIG_PROPERTY_NAME_FC_CONFIDENCE)); } }
forecastConfiguration.setProperty(ForecastingFilter.CONFIG_PROPERTY_NAME_DELTA_UNIT, "MILLISECONDS"); forecastConfiguration.setProperty(ForecastingFilter.CONFIG_PROPERTY_NAME_FC_METHOD, "MEANJAVA"); final ForecastingFilter forecasting = new ForecastingFilter(forecastConfiguration, this.controller);
@Override public void setCurrentConfiguration(final Configuration config, final boolean update) { this.setFieldsByConfiguration(config, update); }
/** * Creates a new instance of this class. * * @param configuration * Configuration of this component * @param projectContext * ProjectContext of this component */ public ForecastingFilter(final Configuration configuration, final IProjectContext projectContext) { super(configuration, projectContext); this.applicationForecastingWindow = new ConcurrentHashMap<String, ITimeSeries<Double>>(); this.previousFCPair = new ConcurrentHashMap<String, ForecastMeasurementPair>(); this.setFieldsByConfiguration(configuration, false); }
/** * Creates a new instance of this class. * * @param configuration * Configuration of this component * @param projectContext * ProjectContext of this component */ public ForecastingFilter(final Configuration configuration, final IProjectContext projectContext) { super(configuration, projectContext); this.applicationForecastingWindow = new ConcurrentHashMap<>(); this.previousFCPair = new ConcurrentHashMap<>(); this.setFieldsByConfiguration(configuration, false); }