Optimal Operation of Smart Grids Including Distributed Generation Units and Plug in Vehicles