1. A controller for controlling operation of a machine operating in an operating environment, the machine being responsive to control signals to perform a plurality of actions, the controller receiving signals indicative of parameters relating to the operating environment and sufficient to determine an outcome of operation of the machine, the controller comprising: (a) at least one output for providing control signals to the machine to perform selected actions; (b) at least one input for receiving signals indicative of parameters relating to the operating environment; (c) a data storage device containing a historical database including at least one sequence of parameters relating to the operating environment, corresponding actions taken, and corresponding outcomes of operation of the machine; and (d) a processing system including at least one processor, said processing system being in data communication with said data storage device, said at least one output and said at least one input, said processing system being configured to: (i) search within said historical database for similar episodes within said at least one sequence of parameters which satisfy relevance criteria relative to a current sequence of parameters; (ii) perform a randomized selection between a plurality of options, at least one of said options being derived from one of said similar episodes that had a favorable outcome of operation of the machine; and (iii) outputting at least one control signal to the machine via said output to perform a selected action, said control signal being determined as a function of a selected one of said options.