A computer-implemented method of generating a controller for a continuous process, comprising: receiving from a storage memory, off-line stored values of one or more controlled variables and one or more manipulated variables of the continuous process over a plurality of time points, wherein the controlled variables are variables of the continuous process which the controller attempts to steer, and the manipulated variables are variables that affect the values of the controlled variables, and which the controller can manipulate in order to achieve desired goals defined for the controlled variables; training a first neural network to operate as a predictor having an output of future values of controlled variables of the continuous process, for inputs of present and/or past values of controlled variables and/or manipulated variables of the continuous process, wherein the training is responsive to the received stored values; training a second neural network to operate as a controller of the continuous process, whose output comprises values to assign to manipulated variables and whose input comprises present and/or past values of controlled variables and/or manipulated variables, the training performed using the first neural network after it was trained to operate as the predictor of controlled variables of the continuous process, by performing a plurality of training episodes, each training episode including determining manipulated variables for a plurality of time points using a current state of the second neural network, and determining resulting controlled variables for the plurality of time points using the predictor, and adjusting the second neural network according to an evaluation of the values of the controlled variables generated using the predictor during the training episode. receiving from a storage memory, off-line stored values of one or more controlled variables and one or more manipulated variables of the continuous process over a plurality of time points, wherein the controlled variables are variables of the continuous process which the controller attempts to steer, and the manipulated variables are variables that affect the values of the controlled variables, and which the controller can manipulate in order to achieve desired goals defined for the controlled variables; training a first neural network to operate as a predictor having an output of future values of controlled variables of the continuous process, for inputs of present and/or past values of controlled variables and/or manipulated variables of the continuous process, wherein the training is responsive to the received stored values; training a second neural network to operate as a controller of the continuous process, whose output comprises values to assign to manipulated variables and whose input comprises present and/or past values of controlled variables and/or manipulated variables, the training performed using the first neural network after it was trained to operate as the predictor of controlled variables of the continuous process, by performing a plurality of training episodes, each training episode including determining manipulated variables for a plurality of time points using a current state of the second neural network, and determining resulting controlled variables for the plurality of time points using the predictor, and adjusting the second neural network according to an evaluation of the values of the controlled variables generated using the predictor during the training episode.