Method for controlling and/or regulating a technical system, in particular an energy generation installation, in a computer-assisted manner, in which the dynamic behavior of the technical system is respectively characterized for a plurality of times by a state (s) of the technical system and an action (a) carried out on the technical system in this state, a respective action (a) at a respective time resulting in a new state (s) of the technical system at the next time, and an action sequence being one or more actions (a) to be successively carried out on the technical system, in which: a) an action selection rule, which was determined by learning a data-driven model on the basis of training data comprising data records comprising known states (s) and actions (a) at a plurality of times, is used to determine a first action sequence for the state (s) of the technical system at a current time (t), which first action sequence comprises an initial action at the current time, the first action sequence being based on an optimization criterion for operating the technical system, which is taken into account when learning the data-driven model, and having a measure of quality with respect to the optimization criterion; b) a numerical optimization method is used to search for those second action sequences which have a measure of quality higher than the measure of quality of the first action sequence, which second action sequences comprise an initial action (a) at the current time, the search starting with a number of starting action sequences which are determined by varying a number of initially provided action sequences comprising the first action sequence, preference being given to starting action sequences having a slight variation on the basis of a priority criterion; c) if one or more second action sequences are found in step b), at least some of the successive actions (a) in the second action sequence having the highest measure of quality are carried out on the technical system and otherwise at least some of the successive actions (a) in the first action sequence are carried out. a) an action selection rule, which was determined by learning a data-driven model on the basis of training data comprising data records comprising known states (s) and actions (a) at a plurality of times, is used to determine a first action sequence for the state (s) of the technical system at a current time (t), which first action sequence comprises an initial action at the current time, the first action sequence being based on an optimization criterion for operating the technical system, which is taken into account when learning the data-driven model, and having a measure of quality with respect to the optimization criterion; b) a numerical optimization method is used to search for those second action sequences which have a measure of quality higher than the measure of quality of the first action sequence, which second action sequences comprise an initial action (a) at the current time, the search starting with a number of starting action sequences which are determined by varying a number of initially provided action sequences comprising the first action sequence, preference being given to starting action sequences having a slight variation on the basis of a priority criterion; c) if one or more second action sequences are found in step b), at least some of the successive actions (a) in the second action sequence having the highest measure of quality are carried out on the technical system and otherwise at least some of the successive actions (a) in the first action sequence are carried out.