The invention provides an assembly comprising:a recording assembly for recording a time-based brain-related signal;a stimulus generator for providing a stimulus, anda computer assembly, functionally coupled to said recording assembly and to said stimulus generator, said computer assembly comprising:a memory for storing at least a data segment of said time-based brain-related signal during recording of said time-based brain-related signal, anda computer program which, when running on said computer assembly, functionally real-time performs:retrieving a most-recent data segment of said stored data segment of said time-based brain-related signal;fitting at least one curve to said retrieved most-recent data segment;predicting a future continuation of said most-recent data segment using said at least one curve fitted to said most-recent data segment;detecting a predefined pattern in said predicted future continuation for predicting occurrence of said predefined pattern, and defining a predicted event time of said predefined pattern, said predicted event time being in the future with respect to said most-recent data segment, andactuating said stimulus generator for providing a stimulus within a predefined event time window of said predicted event time.