Sequential Decision Problems

The problem framing behind Rebase models - states, actions, exogenous information, and objectives.

Most energy problems are not one-shot predictions — they are sequential decision problems (SDPs): decisions made repeatedly over time, under uncertainty, where each decision changes the situation the next one faces. Forecasting for the day-ahead market, dispatching a battery, bidding a wind portfolio: all the same shape.

emflow, the modeling framework the toolkit builds on, adopts this framing explicitly — based on Gymnasium and Warren Powell's universal sequential decision framework.

The Loop

Every SDP is the same loop, repeated until the end of the horizon:

state S_t  →  action a_t = policy(S_t)  →  exogenous information W_t+1 arrives
           →  new state S_t+1  →  cost / contribution C(S_t, a_t, W_t+1)
ElementMeaningEnergy example
StateEverything knowable when the decision is madeObserved load history, issued weather forecasts, battery state of charge
ActionThe decision the model takesA 24-hour forecast, a charge/discharge schedule, a bid curve
Exogenous informationWhat the world reveals after the decisionActual load, realized prices, the weather that occurred
TransitionHow state evolves given the action and new informationSettlement, state-of-charge update, new market session
ObjectiveThe cost or contribution accumulated over the horizonPinball loss, imbalance cost, trading revenue

The goal is a policy — a rule mapping states to actions — that maximizes expected contribution (or minimizes cost) over the whole horizon, not on any single decision.

Two details make this framing unforgiving and realistic. The action is chosen before the exogenous information arrives — a model can only use what is knowable at decision time. And the score settles later, once the outcome is revealed — which is why point-in-time data discipline (see Backtesting) is the foundation of trustworthy evaluation.

Forecasting Is an SDP

Forecasting fits the loop as a special case where the action is the forecast: at each forecast origin the state is everything knowable at that moment, the action is the predicted trajectory, the exogenous information is what actually happened, and the objective scores the two against each other. This is exactly how emflow's ForecastEnv evaluates Predictors — and why the same machinery extends to trading (TradingEnv) and dispatch problems, where Optimizers and Agents act in the same loop.

Model First, Then Solve

emflow's method is problem-centric — understand the problem fully before reaching for a solution:

  1. Define the considered energy system;
  2. Define state, action, and exogenous variables;
  3. Create the environment and the transition function;
  4. Define the objective (cost or contribution);
  5. Create the model (predictor, optimizer, agent, and/or simulator) to operate in the environment;
  6. Run the sequential decision loop and evaluate performance.

Steps 1–4 define the problem; steps 5–6 create and evaluate the solution. On Rebase, steps 1–4 are packaged as verifiable targets, step 5 is your model code (or an autonomous search writing it), and step 6 is backtesting.

On this page