A non-transitory computer readable storage medium tangibly storing instructions that are executable by at least one processor of a complex event processing (CEP) system, the stored instructions comprising instruction that are configured to cause the complex event processing (CEP) system to:
- accept an event stream including a plurality of events upon which a forecast is to be based;
- and
- for each received event in the event stream:
- update a reference window indicative of a predefined temporal range during which the forecast is to be computed so that the reference window ends with the received event, the reference window moving with the event stream;
- determine, by consulting a forecasting update policy that is stored on a memory device of the CEP system, whether the forecast is to be triggered;
- in response to determination that the forecast is to be generated, generate a forecasting window indicative of a temporal range in which events are to be forecasted;
- for the updated forecasting window and while the time period of the forecasting window is not exceeded, (a) generate a plurality of forecasted events based on the updated reference window and (b) insert the plurality of forecasted events into the forecast window;
- and
- publish the forecast window that includes the inserted plurality of forecasted events,
- wherein the forecasting update policy indicates that the forecasting window is updated only after multiple updates to the reference window have occurred.