Reconstruction of the parameters of Debye and Lorentzian dispersive media using a genetic algorithm