Optimal adaptive race strategy for a Formula-E car