A main computing system maintains and optimizes a predictive control model for an energy system, wherein the main computing system receives state information for the energy system, optimizes the predictive control model, and generates control rules for control of the energy system. The one or more local computing systems, each have a local memory for storing control rules for controlling the associated local state. The main computing system receives local state information and updates control rules, wherein the updated control rules comprise a subset of the control rules generated by the main computing system selected to be appropriate to the local state information received at the main computing system.