To forecast the time dynamics of an epidemic, we propose a discrete stochastic model that unifies and generalizes previous approaches to the subject. Viewing a given population of individuals or groups of individuals with given health state attributes as living in and moving between the nodes of a graph, we use Monte-Carlo Markov Chain techniques to simulate the movements and health state changes of the individuals according to given probabilities of stay that have been preassigned to each of the nodes. We utilize this model to either capture and predict the future geographic evolution of an epidemic in time, or the evolution of an epidemic inside a heterogeneous population which is divided into homogeneous sub-populations, or, more generally, its evolution in a combination or superposition of the previous two contexts. We also prove that when the size of the population increases and a natural hypothesis is satisfied, the stochastic process associated to our model converges to a deterministic process. Indeed, when the length of the time step used in the discrete model converges to zero, in the limit this deterministic process is driven by a differential equation yielding the evolution of the expectation value of the number of infected as a function of time. In the second part of the paper, we apply our model to study the evolution of the Covid-19 epidemic. We deduce a decomposition of the function yielding the number of infectious individuals into wavelets, which allows to trace in time the expectation value for the number of infections inside each sub-population. Within this framework, we also discuss possible causes for the occurrence of multiple epidemiological waves.