A computer-implemented method for controlling a reconfigurable energy system, the method comprising determining a plurality of operating scenarios of the energy system by: - obtaining a plurality of performance measures of the energy system as a function of time corresponding to a plurality of sets of values of input variables comprising configuration parameters for configurable topology elements of the energy system, - clustering the plurality of sets of values of the input variables and the performance measures associated therewith into groups, wherein the group includes a set of values of input variables as coordinates forming a polytope in a region of a multidimensional space; - defining a descriptor for each of said groups wherein the descriptor comprises the vertices of a polytope, and storing the descriptor in a memory, the method further comprising - outputting said descriptors of said groups for use in an online prediction or offline estimation of the energy system, wherein said clustering comprises, for each of the plurality of sets of values of the input variables and the performance measures associated therewith, determining summary statistics for said values and/or said performance measure and defining a point in the multidimensional space in which the clustering is performed, where this coordinate in said multidimensional space of said point comprises said summary statistics, and determining a similarity metric between points in said multidimensional space and determining said groups based on this similarity metric, said similarity metric comprising a hyper-distance measure in said multidimensional space, with dividing the groups performed in accordance with a balancing function adapted to ensure that all groups have near-equal probability to occur at run-time, for avoiding storage of rare system scenarios thereby reducing storage cost, - using said descriptors of the clusters in an online prediction and/or offline estimation of said performance measure of said energy system by identifying, from the descriptors of groups stored in the memory, the group to which a current set of values of the input variables under evaluation are assigned and using the corresponding performance measure as indicative of the performance of the energy system, and - controlling controllable configuration parameters for topology elements of said energy system in accordance with controllable parameters that are associated with the determined group to which the current set of values of the input variables are assigned. - obtaining a plurality of performance measures of the energy system as a function of time corresponding to a plurality of sets of values of input variables comprising configuration parameters for configurable topology elements of the energy system, - clustering the plurality of sets of values of the input variables and the performance measures associated therewith into groups, wherein the group includes a set of values of input variables as coordinates forming a polytope in a region of a multidimensional space; - defining a descriptor for each of said groups wherein the descriptor comprises the vertices of a polytope, and storing the descriptor in a memory, the method further comprising - outputting said descriptors of said groups for use in an online prediction or offline estimation of the energy system, wherein said clustering comprises, for each of the plurality of sets of values of the input variables and the performance measures associated therewith, determining summary statistics for said values and/or said performance measure and defining a point in the multidimensional space in which the clustering is performed, where this coordinate in said multidimensional space of said point comprises said summary statistics, and determining a similarity metric between points in said multidimensional space and determining said groups based on this similarity metric, said similarity metric comprising a hyper-distance measure in said multidimensional space, with dividing the groups performed in accordance with a balancing function adapted to ensure that all groups have near-equal probability to occur at run-time, for avoiding storage of rare system scenarios thereby reducing storage cost, - using said descriptors of the clusters in an online prediction and/or offline estimation of said performance measure of said energy system by identifying, from the descriptors of groups stored in the memory, the group to which a current set of values of the input variables under evaluation are assigned and using the corresponding performance measure as indicative of the performance of the energy system, and - controlling controllable configuration parameters for topology elements of said energy system in accordance with controllable parameters that are associated with the determined group to which the current set of values of the input variables are assigned.