A predictive discrete event approach for the optimal charging of electric vehicles in microgrids. (May 2019)