ContinuousMicrogridEnv.set_forecaster#

ContinuousMicrogridEnv.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 forecaster to apply the same forecasting logic to all timeseries modules, or pass key-value pairs in a dict to set the forecaster for specific modules. In the latter case, you may also set different forecasters for each named module. See get_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), where

    • val_c is 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 future

    • n 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 inputs val_c and val_{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 form module_name: forecaster. Will set the forecaster of the module corresponding to module_name using 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.