Optimal schedule for electric vehicle charging at parking lots and battery swapping stations