This paper studies the effect of different penetration rates of plug-in hybrid electric vehicles (PHEVs) and electric vehicles (EV) in the Spanish electrical system. A stochastic model for the average trip evaluation and for the arriving and departure times is used to determine the availability of the vehicles for charging. A novel advanced charging algorithm is proposed, which avoids any communication among all agents. Its performance is determined through different charging scenarios.