A Flexible Distributed Infrastructure for Real-Time Co-Simulations in Smart Grids