Microgrid.set_forecaster#
- Microgrid.set_forecaster(forecaster, forecast_horizon=23, forecaster_increase_uncertainty=False, forecaster_relative_noise=False)[source]#
Set the forecaster for timeseries modules in the microgrid.
You may either pass in a single value for
forecasterto apply the same forecasting logic to all timeseries modules, or pass key-value pairs in adictto set the forecaster for specific modules. In the latter case, you may also set different forecasters for each named module. Seeget_forecaster()for additional details on setting forecasters.- forecastercallable, float, “oracle”, None, or dict.
Function that gives a forecast n-steps ahead.
If
callable, must take as arguments(val_c: float, val_{c+n}: float, n: int), whereval_cis the current value in the time series:self.time_series[self.current_step]val_{c+n}is the value in the time series n steps in the futuren is the number of steps in the future at which we are forecasting.
The output
forecast = forecaster(val_c, val_{c+n}, n)must have the same sign as the inputsval_candval_{c+n}.If
float, serves as a standard deviation for a mean-zero gaussian noise function that is added to the true value.If
"oracle", gives a perfect forecast.If
None, no forecast.If
dict, must contain key-value pairs of the formmodule_name: forecaster. Will set the forecaster of the module corresponding tomodule_nameusing the logic above.
- forecast_horizonint
Number of steps in the future to forecast. If forecaster is None, this parameter is ignored and the resultant horizon will be zero.
- forecaster_increase_uncertaintybool, default False
Whether to increase uncertainty for farther-out dates if using a GaussianNoiseForecaster. Ignored otherwise.
- forecaster_relative_noisebool, default False
Whether to define noise standard deviation relative to mean of time series if using
GaussianNoiseForecaster. Ignored otherwise.