  Stochastic models in which agents interact with their neighborhood according
to a network topology are a powerful modeling framework to study the emergence
of complex dynamic patterns in real-world systems. Stochastic simulations are
often the preferred - sometimes the only feasible - way to investigate such
systems. Previous research focused primarily on Markovian models where the
random time until an interaction happens follows an exponential distribution.
In this work, we study a general framework to model systems where each agent is
in one of several states. Agents can change their state at random, influenced
by their complete neighborhood, while the time to the next event can follow an
arbitrary probability distribution. Classically, these simulations are hindered
by high computational costs of updating the rates of interconnected agents and
sampling the random residence times from arbitrary distributions. We propose a
rejection-based, event-driven simulation algorithm to overcome these
limitations. Our method over-approximates the instantaneous rates corresponding
to inter-event times while rejection events counterbalance these
over-approximations. We demonstrate the effectiveness of our approach on models
of epidemic and information spreading.
