Optimal Dynamic Scheduling of Electric Vehicles in a Parking Lot Using Particle Swarm Optimization and Shuffled Frog Leaping Algorithm

In this paper, the optimal dynamic scheduling of electric vehicles (EVs) in a parking lot (PL) is proposed to minimize the charging cost. In static scheduling, the PL operator can make the optimal scheduling if the demand, arrival, and departure time of EVs are known well in advance. If not, a static charging scheme is not feasible. Therefore, dynamic charging is preferred. A dynamic scheduling scheme means the EVs may come and go at any time, i.e., EVs’ arrival is dynamic in nature. The EVs may come to the PL with prior appointments or not. Therefore, a PL operator requires a mechanism to charge the EVs that arrive with or without reservation, and the demand for EVs is unknown to the PL operator. In general, the PL uses the first-in-first serve (FIFS) method for charging the EVs. The well-known optimization techniques such as particle swarm optimization and shuffled frog leaping algorithms are used for the EVs’ dynamic scheduling scheme to minimize the grid’s charging cost. Moreover, a microgrid is also considered to reduce the charging cost further. The results obtained show the effectiveness of the proposed solution methods.


Introduction
Many research works have been presented in the literature to overcome the issues related to the electric vehicles' (EVs) scheduling at parking lots (PLs), such as the number of charging points, time-varying electricity price, the capacity of chargers, and charging limit. However, few works addressed advanced technologies for online booking and location finding [1]. In this regard, the research works presented in the literature are broadly focused on three major categories: (i) EV battery charging technology, (ii) charging scheduling schemes, and (iii) charging station (CS) recommendation methods. In global environmental pollution, the transport sector has a significant role due to fossil fuel usage. Nowadays, a non-fuel or a partial fuel-based vehicle is emerging due to low fuel consumption, The EV charger is one of the main components in determining the recharging time of the battery. In general, the commonly used EV chargers are classified into four types:


Based on the location in which this type of charger is available in the EV itself.  Based on the power level, the charger is not equipped with the EV and is available separately. The onboard chargers available are fitted with the EVs, but the charger increases the EV's weight due to the additional circuit. The off-board charger requires a dedicated CS to facilitate charging [6]. In general, the off-board chargers are advantageous compared to the onboard chargers in terms of being placed in public-accessing areas like a parking lot, bus stop, etc. They can also be classified into slow, medium, and fast charging based on the power ratings. However, the fast-charging facility is used to complete the charging in a short time [7,8] compared to the other two types. Four different charging levels are classified by international standards such as the Society of Automotive Engineers (SAE), Electric Power Research Institute (EPRI), and International Electrotechnical Commission (IEC) [9]. The different types of EV chargers can be found in Ref. [9].  Charges based on the source is classified as (i) constant current, in which the input current is constant, (ii) constant voltage, in which the input current is variable through the charging, and (iii) hybrid constant current and voltage to allow fast charging without risk of over-charging.  Wireless-charging schemes avoid the usage of cables, but they have low-efficiency. However, ongoing research works are under development to improve the efficiency of these wireless charging schemes.
The EV charging loads can double the average household electricity consumption and makes the user pay more. On the other hand, it worsens the distribution network during peak time. Hence, controlled EV charging is a prominent solution to minimize grid disturbances [10]. Most plug-in hybrid EV (PHEVs)/EV charging is predicted to occur in public CS. During the peak load period, the controlled EV charging is used to minimize the grid disturbances and charging costs [11,12]. Figure  2 shows an EV charging at a parking lot. The EV charger is one of the main components in determining the recharging time of the battery. In general, the commonly used EV chargers are classified into four types: • Based on the location in which this type of charger is available in the EV itself.

•
Based on the power level, the charger is not equipped with the EV and is available separately. The onboard chargers available are fitted with the EVs, but the charger increases the EV's weight due to the additional circuit. The off-board charger requires a dedicated CS to facilitate charging [6]. In general, the off-board chargers are advantageous compared to the onboard chargers in terms of being placed in public-accessing areas like a parking lot, bus stop, etc. They can also be classified into slow, medium, and fast charging based on the power ratings. However, the fast-charging facility is used to complete the charging in a short time [7,8] compared to the other two types. Four different charging levels are classified by international standards such as the Society of Automotive Engineers (SAE), Electric Power Research Institute (EPRI), and International Electro-technical Commission (IEC) [9]. The different types of EV chargers can be found in Ref. [9]. • Charges based on the source is classified as (i) constant current, in which the input current is constant, (ii) constant voltage, in which the input current is variable through the charging, and (iii) hybrid constant current and voltage to allow fast charging without risk of over-charging.

•
Wireless-charging schemes avoid the usage of cables, but they have low-efficiency. However, ongoing research works are under development to improve the efficiency of these wireless charging schemes. Controlled EV charging is classified as centralized charging and decentralized charging. The aggregator or a standard operator [13] will control individual PHEVs and make a universal control for cost reduction in the centralized coordination scheme. However, this scheme is not advisable for the customers who do not want any third party to control their EV usage and electric power consumption. Under the decentralized charging scheme, there is no restriction on using the charging point. The EVs can occupy the charging point directly until the battery is charged sufficiently. A PL with 2 to 6 chargers is highly recommended due to space and cost constraints [14]. Some demand response (DR) programs are considered for a smart grid to control the peak demand and minimize EV charging costs. A new intelligent load management scheme is proposed to reduce the charging cost. This coordinated charging scheme is implemented by controlling several EVs charging and taking load profiles of the residential area into account. This is investigated in multiple residential distribution systems with EVs. The charging time is shifted to midnight to minimize the charging cost and peak load without using a storage device. However, the proposed scheme does not discuss the charging infrastructure, uncertain arrival, and EVs [15]. A real-time power management program is recommended, and optimal scheduling is implemented using a genetic algorithm (GA). However, the uncertain arrival of EVs and real-time pricing are not considered [16,17]. A distributed DR program is proposed to manage EV charging demand and minimize the charging cost in a smart grid [18]. In this method, the forecasted electricity price is shared with the customer. Besides, several DR programs are presented in the energy and reserve market for optimal EVs schedule [18,19]. By deciding the charging and discharging time from each battery optimally, the PL's profit is maximized [20,21]. The suggested approach is compared with the time of use (TOU), critical demand price, and emergency DR programs. The choice of charging and discharging of EVs is completed at a particular time sequence with an unvarying rate. An aggregator supported centralized EV charging is proposed to minimize the overall purchasing cost of electricity. However, the provided solution requires a high-level communication infrastructure. Also, it is assumed that CSs have unlimited electric power to charge a considerable number of EVs together, which is not easy to implement in a real-time scenario. The charging cost variation in the CSs provides the EV users to choose between charging time. Considering this, a charging model is proposed for a PL equipped with a solar and energy storage system (ESS) [22]. This model also includes the PL's profit maximization, the capacity of distributed generation (DG) and ESS, PL's investment choices, and cost to charge the EVs. However, the basic first-in-first serve (FIFS) method is used for charging the EVs.
The EV charging scheduling is presented in [23] with ESS from a power market perspective. The aggregator considered the day ahead and actual market price and involves the energy trade. The optimal charging improves the aggregator's revenue, and it can be further enhanced with ES's support. However, it is assumed that the EV charging demand is known. A charging scheme considering a real-time scenario to minimize the EV charging cost is presented [24]. This scheme includes EV demand, which varies with power tariff and load reduction requests from service providers. The proposed system operates with a dynamic tariff provided by the operator. The EV Controlled EV charging is classified as centralized charging and decentralized charging. The aggregator or a standard operator [13] will control individual PHEVs and make a universal control for cost reduction in the centralized coordination scheme. However, this scheme is not advisable for the customers who do not want any third party to control their EV usage and electric power consumption. Under the decentralized charging scheme, there is no restriction on using the charging point. The EVs can occupy the charging point directly until the battery is charged sufficiently. A PL with 2 to 6 chargers is highly recommended due to space and cost constraints [14]. Some demand response (DR) programs are considered for a smart grid to control the peak demand and minimize EV charging costs. A new intelligent load management scheme is proposed to reduce the charging cost. This coordinated charging scheme is implemented by controlling several EVs charging and taking load profiles of the residential area into account. This is investigated in multiple residential distribution systems with EVs. The charging time is shifted to midnight to minimize the charging cost and peak load without using a storage device. However, the proposed scheme does not discuss the charging infrastructure, uncertain arrival, and EVs [15]. A real-time power management program is recommended, and optimal scheduling is implemented using a genetic algorithm (GA). However, the uncertain arrival of EVs and real-time pricing are not considered [16,17]. A distributed DR program is proposed to manage EV charging demand and minimize the charging cost in a smart grid [18]. In this method, the forecasted electricity price is shared with the customer. Besides, several DR programs are presented in the energy and reserve market for optimal EVs schedule [18,19]. By deciding the charging and discharging time from each battery optimally, the PL's profit is maximized [20,21]. The suggested approach is compared with the time of use (TOU), critical demand price, and emergency DR programs. The choice of charging and discharging of EVs is completed at a particular time sequence with an unvarying rate. An aggregator supported centralized EV charging is proposed to minimize the overall purchasing cost of electricity. However, the provided solution requires a high-level communication infrastructure. Also, it is assumed that CSs have unlimited electric power to charge a considerable number of EVs together, which is not easy to implement in a real-time scenario. The charging cost variation in the CSs provides the EV users to choose between charging time. Considering this, a charging model is proposed for a PL equipped with a solar and energy storage system (ESS) [22]. This model also includes the PL's profit maximization, the capacity of distributed generation (DG) and ESS, PL's investment choices, and cost to charge the EVs. However, the basic first-in-first serve (FIFS) method is used for charging the EVs.
The EV charging scheduling is presented in [23] with ESS from a power market perspective. The aggregator considered the day ahead and actual market price and involves the energy trade. The optimal charging improves the aggregator's revenue, and it can be further enhanced with ES's support. However, it is assumed that the EV charging demand is known. A charging scheme considering a real-time scenario to minimize the EV charging cost is presented [24]. This scheme includes EV demand, which varies with power tariff and load reduction requests from service providers. The proposed system operates with a dynamic tariff provided by the operator. The EV charging schedule is determined by turning on/off each charger available in the PL. An optimal charging scheduling scheme in an office PL is proposed in [25] using a two-stage relative dynamic program. The EV arrival pattern is modeled using the Poisson process. The Poisson process is a model for a series of discrete events where the average time between events is known, but the exact timing of events is random. The primary goal of optimal scheduling is to reduce the cost of EV charging. A penalty cost is also considered if the PL does not provide the requested power. A game-theoretic approach is used to schedule the EV charging [26]. The proposed method considers the variation of hourly energy costs to minimize the charging cost. However, the vehicle charging demand of EVs is very low. Optimal resource sharing to minimize the charging cost is proposed for the municipal PL [27]. A large number of EVs are scheduled in a PL by using a distribution algorithm. The available state of charge (SOC), the time required to reach full battery capacity, and the utility cost are considered to minimize the charging cost. The charging rate is regarded as a continuous variable. A two-layered parking lot for the EV recharging scheme is proposed in [28] to minimize the EV charging cost. The proposed system is compared with the basic charging scheduling scheme, such as FIFS and early deadline first (EDF). However, the recommended procedures require high-level communication network support between the users and aggregators for making optimal scheduling to minimize the charging cost.
Also, optimal scheduling for EVs with random arrival time is proposed in [29]. The battery's capacity, available SOC, charging interval, arrival and departure time, and charging cost are considered for the charging cost minimization. The price is kept constant throughout the charging locations. The EVs are grouped and managed by a local controller. The predicted demands are sent from the central controller to a local controller-the local controller schedules the EV based on the optimization algorithm to charge or discharge the EV. A smart charging method using a third-party agent is presented in [30]. The required power to charge the EV is shared with the aggregator. The aggregator considers the power allocated by the distribution system operator (DSO) and transmission system operator (TSO) to make optimal scheduling. However, this method only finds a monotype of charging. However, implementing this scheme in real-time is not economical due to technical challenges. In [31], smart charging is proposed to enable optimal EV charging. Two algorithms are developed to minimize the charging cost. By analyzing the predicted electricity cost, dynamic programming is designed to obtain the charging cost. However, the forecasted driving profile and power requirements are not always accurate. In [32], an agreement-based approach is proposed to minimize the charging cost. The EV user needs to sign an agreement with the aggregators for charging the EV. The drawback of this method is that the users are forced to charge the EV for a particular time every day. A flexible EV scheduling scheme is developed to minimize the charging cost [33]. In this scheme, the customer details are shared with several operators such as charging service provider (CSP), DSO, and a retailer. The system operator forecasts the EV charging load to find an optimal schedule. However, predicting the EV load is not always accurate. Furthermore, the privacy of the customer is affected. In [34], a price-response based EV scheduling method is proposed using modern communication infrastructure. A base-level aggregator and a central aggregator are involved in the EV scheduling for charging cost minimization. In this scheme, it is assumed that the demand for EVs, plug-in time, and charging time of EVs are known to the base level aggregator. In [35], a charging scheduling scheme is proposed by considering vehicle uncertainty. Bidirectional communication is used for monitoring and controlling the data exchange between aggregators and users. The global aggregator decides the charging management of EVs in the CSs. In [36], a model is developed for the PL operator to charge EVs in a deregulated power market. The objectives are to increase the service provider's revenue and the revenue from renewable resources. In this model, the service provider utilizes the EVs by discharging the power left at the battery. Because of battery power discharging, the expected SOC of the EV may not be reached when the EV customer wants to depart from the PL. A charging scheduling scheme is developed to minimize the EV charging cost in a PL. A bi-level approach to bid the electricity price is introduced between the aggregator and DSO. This method considers the generation limit with the uncertainty of wind power and charging demand [37]. An optimal charging scheduled is proposed in [38] to minimize the charging cost of PL. The proposed scheme avoids grid disturbance at the distribution level.
An optimal energy management scheme is proposed in a commercial PL [39]. The energy management scheme reduces the cost of the PL operator with respect to the TOU tariff. However, it is assumed that the arrival time of EV and demand of EV is already known to the PL operator. Smart charging management for EVs in a PL is carried out to reduce the charging cost [40]. The PL is equipped with a photovoltaic system and an ESS. The proposed method minimizes the charging cost of the PL. However, the charging scheduling for the un-appointed EVs is not considered. A smart scheduling approach is proposed for the EVs to minimize the cost by reducing the waiting time with a limited charging infrastructure [41]. A simulation is carried out for the EVs to find the CS location on a highway. However, it focused only on travel time and did not consider the EV's energy consumption, varying with the EV speed. An optimal charging schedule for EVs is proposed in [42]. The charging cost variation was calculated by considering the uncertain arrival and departure of EVs. An aggregator controlled dynamic scheduling scheme is proposed in [43] to minimize the charging cost. The objective is derived from the total cost and a penalty cost to the operator if the charging is not completed before the user's timeline. An optimal centralized EV charging scheduling is developed in [44] for minimizing the overall charging cost. But it is assumed that the CS is having an unlimited number of charging points to avoid queuing. Also, if the EV is plugged in for charging, it cannot be plugged out until the battery is fully charged. However, in a dynamic tariff, the energy cost is variable, and hence the scheduling cannot be shifted when the energy price is low. In [45], a cost-effective charging scheme is proposed by considering the output power from a photovoltaic (PV) system. The user preferences, such as charging time, required demand, parking time, etc., are included in this scheme to minimize the charging cost. An optimal day ahead charging schedule is proposed in [46] to reduce the charging cost. The aggregator considers the demand for EVs and the energy price for the optimal scheduling of EVs. A transactive control method [47] proposed two-stage optimal scheduling of EVs for charging cost minimization. An aggregator collects the day-ahead electricity price and the real-time electricity price for the charging. It is assumed that the users give their exact travel patterns for the next day and reserves a charging slot. The customers with flexibility in EV charging time obtain benefits, whereas the other EV users do not benefit. An optimal charging schedule to minimize the charging cost through vehicle-to-grid (V2G) technology is proposed in [48].
The aggregator considers the charging and discharging of multiple EVs in the CSs and minimizes the overall cost. However, frequent charging and discharging will affect the battery's life. A risk-aware day ahead EV charging scheduling scheme is proposed in [49]. This scheme reduces the difference between the actual and forecasted EV load and allocates the power to optimize the cost. The change in forecasted EV load varies with the unexpected arrival of EV. However, the uncertain arrival of more EVs makes the computation more complex. In [50], a charging schedule for EVs is proposed by considering EV users' behavior and output from a PV system. The objective was to minimize the overall charging cost. The proposed scheme estimates the EVs demand as very low. An optimal scheduling scheme was proposed in [51] for EV charging in a CS to minimize charging costs. The service provider calculates the expected scheduling demand and actual scheduling demand. If the actual demand is more than the expected demand, then the service provider cannot meet some EVs' demands. In [52], optimal scheduling is used to minimize the charging cost of the CS operator. A central operator controls the CSs, in which the central operator receives the demand requests for every hour from the CSs. This may create computational complexity in the method.
An optimal scheduling scheme is proposed for EV charging in the CSs [53] to minimize the charging cost. Various renewable energy sources such as wind, solar, and local energy storage devices are used to charge the EVs. The basic FIFS scheme is used for the EV charging. Optimal cost-based scheduling is proposed in [54] by considering renewable energy. This scheme optimizes the EV charging cost by considering the energy price, renewable energy, the arrival, and departure time of EVs. An agent-based decentralized optimal charging scheme is proposed for minimizing the cost [55]. A two-way communication scheme is introduced between the customers and the operators for sharing information such as demand, energy price, etc. A dynamic stochastic optimization method is proposed in [56] to minimize the charging cost. The users have to request the aggregator in advance by using a communication network. The aggregator allocates electric power based on the energy price. A two-stage economic operation of a PL equipped with a microgrid is proposed in [57] to reduce the charging cost. The forecasted electricity price determines the PL operation for the next 24 h. A dynamic algorithm is proposed for a coordinated charging between the EV user and the aggregator in [58]. The proposed algorithm generates the next day's EV schedule based on an EV's previous days driving pattern. The charging schedule suggested by this scheme minimizes the charging cost. However, the actual driving pattern differs from the expected driving pattern. The profit maximization of CS is developed by using an admission control program [59]. The EV demand is modeled from past historical data, and the EVs are suggested to charge in any of the CS located nearby. An optimal cooperative charging strategy is developed for the smart CS to minimize the overall charging cost of the CS [60]. The available battery power and the demand is shared with the aggregator for optimal scheduling.
The literature discussed above shows various EV charging scheduling schemes that can benefit the CS owners. Many researchers solve the charging scheduling for PL cost minimization. However, many of the researchers focus on the fixed power range of chargers and vehicles. Besides, the charging limit of the PL is also not considered. Accordingly, in this paper, the EV charging schedule to minimize the charging cost of the PL is investigated considering controlled and uncontrolled EV charging. The nature of EV charging in the PL is different. In some cases, the charging time is fixed and flexible, whereas in some cases, the charging time is variable; an EV may come with and without appointments. This different nature of PL charging methods motivated the authors to work on an economical charging schedule to minimize the PL's charging cost.
The scheme proposed in this work is more suitable for the PLs with a limited number of charging points. The PL can accommodate more EVs for charging without enhancing the PL infrastructure. The advanced booking may help the customers to avoid unwanted waiting time at the PLs. Finally, the potential of renewable energy sources in the PL is considered to reduce the charging cost. The PL operator suffers from many uncertainties in terms of EVs' energy demand, uncertainties in electricity cost, different arrival and departure time of EVs, and resources available at the PL. Hence, a dynamic charging scheme is considered the main objective of this work to minimize the PL's electricity purchase cost. In general, the arrival and departure of EVs in a PL are unpredictable. The customer has their optional preference to charge the EVs either with a prior booking or without booking. By considering the uncertain arrival of EVs, the dynamic scheduling scheme is analyzed based on the FIFS method, particle swarm optimization (PSO), and shuffled frog leaping algorithm (SFLA).
The rest of the paper is organized into five sections. The configuration of the system studied is introduced in Section 2. The problem formulation for the scheduling is given in Section 3, in which the objective function, constraints, and the three solution methods used in this work are presented in detail. The results obtained are presented and discussed in Section 4, and conclusions are presented in Section 5. Possible future works are presented in Section 6.

System Studied
Most of the people living in apartments are used to charge the EVs at PL located in the office or shopping complex, etc. [61]. The EV user tries to charge their vehicle in the PL during the parking time. So, the EVs are recharged when the user is engaged with other work. This work assumes that the EV's demand is to charge the battery to its full capacity. With the available information, the PL operator can utilize the developed charging scheme to develop an optimal scheduling to minimize the charging cost. So, based on the charger limits, the number of EV charging requests can be accepted. The charging limit is set to 61.5 kWh (a 30 kWh, 20 kWh, and 11.5 kWh charger). The primary constraint that limits the number of EVs charging in a PL is the charging capacity. Furthermore, 20 EVs with different capacities and demand levels are considered for the scheduling, as shown in Table 1. The parking time of EVs is given in Table 2. The grid cost considered from the European Power Exchange (EPEX) spot is given in Table 3 [62].
In Out -- In this work, a PL equipped with a microgrid (MG) is considered, as in [63]. A microturbine, five PV units, and a wind turbine are considered in the MG. The power generation limits of the renewable sources are shown in Table 4, and the cost coefficients are given in Table 5. The charging of EVs from the grid or the MG depends on the electricity price. The 24 h microgrid power price is calculated from the renewable sources' cost coefficients given in Table 5, and the microgrid price shown in Table 6. The MG power price is lower than the grid power price for all 8 slots. However, the EV discharging scheme such as vehicle-to-grid (V2G) is not considered in this work. In many research works, common types of EV with the same battery capacity are considered. Also, the demand for EVs is minimum. In this work, EVs' different capacities with different EV demand and multiple charging slots are considered. The problem formulation for the scheduling is given in Section 3. Cost (€ct/kW) 6.1 5.7 5.7 5.5 5.9 5.9 7.9 7.3

Problem Formulation
The optimal scheduling problem is formulated to minimize the charging cost by considering the variation in electricity price and the allocation of chargers to various EVs and the charging limit of the PL. In this dynamic scheme, the scheduling is undertaken for every time slot because EVs may come randomly. Each timeslot is considered 60 min due to the hourly change in the electricity price.

Objective Function
The objective function is to reduce the electricity purchase cost from the grid, keeping in mind that it will be more useful for the economic operation of the PL if the operator assigns the EVs to the chargers in an optimal manner considering the electricity price and charging limit. The objective function is to minimize the charging cost as given in Equation (1).
Energies 2020, 13, 6384 9 of 26 where C(t) is the total purchase cost of electricity to charge all the EVs. NF is the number of fast chargers, NM is the number of medium chargers, and NS is the number of slow chargers. T is the total time to charge all EVs, which is calculated using Equation (2).
where N is the total number of vehicles, V n c is the rated power capacity of the EV, SOC(n) is the power left in the nth vehicle, P i f c , P jmc and P ksc are the rated charging power capacity of the fast, medium, and slow chargers.
The required power R P to charge the EV is calculated as follows: The charging time (R) to reach 100% SOC level is given in Equation (4).
where P c is the charger rated output power. The charging cost of each EV is calculated using Equation (5).
where E c (t) is the electricity price at time t.

Constraints
The various constraints considered in the problem are given below. The battery of any EV that departs the PL should be charged to 100%, which is given in Equation (6).
The proportion of the allocated power at any timeslot to an EV should be between 0.1 and 1 as given in Equation (7). Furthermore, to ensure that all the EVs are charged to 100% of the battery capacity, the sum of all proportion should be equal to 1. The allocated power should be within the limit of all the chargers' rated output as represented in Equation (8).
The dynamic charging scheduling is first examined by the conventional FIFS method, and then the optimization techniques, PSO and SFLA, are used for minimizing the electricity purchase cost of the PL.
The non-booked EV can be allowed based on the two following conditions: • If the charging can be completed before the arrival of EVs with reservation.

•
If the CS limit is not violated.
However, it should be noted that if these conditions are not satisfied, it will be considered an unwanted charging request for the PL operator. In such a case, the user has to decide whether to reduce the demand or extend the departure time.

Solution Methodology
The FIFS is generally used in PLs as it allows the EVs to start charging whenever they arrived. If the number EVs arrived at the CS is more than the available charging points, it creates complications in allotting the EVs to the suitable charger for proper scheduling. Time-varying electricity price impacts charging costs, and hence the operator has to consider the electricity price at each hour. So, optimal charging scheduling requires an optimization method to minimize the charging cost. Thus, PSO and SFLA techniques are used to obtain the optimal scheduling.

Electric Vehicle (EV) Charging Based on First-In-First Serve (FIFS) Algorithm
The FIFS scheme permits the EVs to charge if a charging point is available to use. If all the PL's charging points are occupied, then the other EVs have to wait until a charging point is available to use. In the FIFS scheduling, the EVs have to charge with the available charging point even though a better solution is available.

EV Charging Based on Particle Swarm Optimization (PSO)
The PSO algorithm is inspired by birds' swarm behavior flocking and fish schooling for guiding the particles to find the optimal global solution [64]. Generally, in PSO, the population particles are spread randomly and assumed to be flying in the search space. The information exchange between the particles influences the position and velocity of each particle iteratively. Based on the personal experience, each particle possesses the best solution achieved so far. A global best solution is found from the social experience of the swarm. The impact of personal best and global best is balanced by using a randomized correction factor.
In general, X i represents the existing position of the ith particle, V i is the velocity of the ith particle with a distance in a unit time, Pbest denotes the individual best position of the ith particle (local best), and Gbest represents the global best value obtained. Mathematically, the velocity and position of each particle are updated respectively, as follows: where V i (k) and X i (k) are the velocity and position of the ith particle at iteration k. So that: Also, c 1 and c 2 are the coefficients of cognitive and social acceleration, which exchange the impact of the top solutions on the particle's velocity. Further, rand 1 and rand 2 are random numbers range between 0 and 1. inertia weight ω is linearly reduced from ω max to ω min with the iteration as given in Equation (13). Finally, the cost function, or the global best, is calculated further as shown in Equation (14).
The step by step procedure of implementing the PSO algorithm is given as follows: Step 1: Initialize the number of EVs, number of chargers, capacity of EVs, and capacity of charger, and the population size. Each EV is assigned to different chargers randomly in the population, and the charging scheduling is generated.
Step 2: Assign the number of iterations as 100.
Step 3: For every random scheduling generated, calculate the charging cost, and find the Pbest. Assign Pbest as Gbest for the first iteration.
Step 4: For the second iteration, Equations (11) and (12) are used to provide the updated random scheduling by assigning EVs to the different chargers. Then, calculate the charging cost of each schedule. Find Pbest in the second iteration.
Step 5: Compare Pbest of the second iteration with Gbest of the previous iteration. If the second iteration's charging cost is lower than the previous iteration, go to Step 7.
Step 6: If the second iteration charging cost is not lower than its value in the last iteration, go to Step 4.
Step 8: Repeat the procedure until the number of iterations is completed.

EV Charging Based on Shuffled Frog Leaping Algorithm (SFLA)
The SFLA is a meta-heuristic or, precisely, a memetic approach motivated from frog jumping. This algorithm considers a frog group's observed behavior while finding a location with a maximum amount of food. A population of frogs is randomly assigned in the search space. The memeplexes are generated by dividing the population into several groups. The memeplexes are evolved separately in different directions within the search space. In every memeplex, the frogs are influenced by each other. This influence makes the frogs experience a memetic evolution. Hence, the memetic evolution helps the memeplexes enhance every frog's performance to achieve the goal. During the evolution, an individual frog can change the direction based on the best frog's information in a memeplex or from the population's best frog. After an individual frog has improved its position, the frog's information can be enhanced further. The memeplexes are shuffled with each other after a particular number of memetic evolution, and then the new memeplexes are generated. This improves the ability of the frogs to find the best solution within the search space.
The position of the worst frog is updated, following the expressions given in Equations (15)- (17).
so that; Si min < Si < Si max (17) where the variation of the frog's location in a single jump is Si. r is a random uniformly distributed number ranging between 0 and 1. The most and least permissible variation of the frog's location is Si min and Si max . The number of memeplexes is 10, the number of frogs in a memeplex is 10, the number of frogs in a sub memeplex is 10, and the population size is 100. Si min and Si max vary from 0.9 to 0.4, the tolerance is 0.1, and the random value ranges from 0 to 1. The step by step procedure of implementing the SFLA is given as follows: Step 1: Initialize the number of EVs, number of chargers, capacity of EVs, demand, the capacity of chargers, etc.
Step 2: Generate the population P by randomly assigning the EVs to the different chargers. Divide the population into M number of memeplexes.
Step 3: Calculate the charging cost of each schedule, and the costs are arranged in descending order, and then the memeplexes are generated.
Step 4: Within each memeplex, calculate each scheduling's charging cost to find out the minimum charging cost and the maximum charging cost. Assign the minimum charging cost (X b ) and the highest cost as X current w . For the first iteration, assign (X b ) as the global best solution.
Energies 2020, 13, 6384 12 of 26 Step 5: For the next iteration, update the scheduling with the most increased cost using Equations (15) and (16). With the updated scheduling, shuffle the population and generate the new memeplex. Calculate the charging cost of each scheduling find out the minimum charging cost (X b ) and the maximum charging cost X new w .
Step 6: If the maximum charging cost X new w is less than X current w , calculate the charging cost of each schedule. If not, go to Step 5.
Step 7: Sort the population P in descending order according to their charging cost.
Step 8: When the number of iterations is completed, then stop the process.
Step 9: The charging schedule problem is solved by the FIFS, PSO, and SFLA algorithms, as presented in Section 4.

Results and Discussion
The optimal scheduling is performed for minimizing the electricity purchase cost from the PL. In Table 3, the electricity price at the 7th and 8th timeslots is high, and the low prices are at the 4th, 5th, 3rd, and 6th slots. Therefore, the PL operator can use the time slots optimally to minimize the charging cost. The charging scheduling is presented for EVs with prior reservations and for EVs arrived without a reservation. Three cases are compared, the first case represents the 20 EVs that come with an appointment (base case), the second case represents 5 EVs (such as EVs 16,17,18,19,and 20) arriving without an appointment, and the third case represents 10 EVs (11, 12, 13, 14, 15, 16, 17, 18, 19, and 20) arriving without an appointment. The PL is also provided with a microgrid, i.e., the power generated from the DGs is used in the MG case whenever the MG price is less than the grid price. Furthermore, the dynamic scheduling by FIFS, PSO, and SFLA is investigated, and the results are presented and discussed with and without the microgrid scenario considered.

The Schedule Using FIFS
In general, most of the PLs use the FIFS. Apart from its simplicity (easy to be applied without optimization or decision-making framework), the main advantage of the FIFS method is that it avoids the charger being in idle mode. Table 7

Dynamic Schedule Using PSO
The PSO technique is used to perform optimal scheduling for minimizing the total electricity purchase cost. At the beginning of each timeslot, the charging schedule for the particular timeslot is executed to achieve the minimum electricity cost. The algorithm also determines the plan for the next timeslots. However, the schedule is revised for the upcoming timeslot depending upon the arrival of EVs in the next timeslot. The average time taken to complete the charging in each time slot is 33.40, 59.99, 59.95, 59.99,59.98, 54.30 min. The convergence curve of the PSO algorithm is shown in Figure 3. PSO's dynamic scheduling is given in Table 8, and the optimal allocation of power and resources is given in Table 9.
The EV demand is allocated to each time slot to achieve the minimum cost. The PSO's minimum cost is 2432.0 €ct, which is cheaper than the FIFS scheduling cost. As the grid's electricity cost in timeslots 7 and 8 is relatively high, PSO schedules the EVs in the first six timeslots to achieve the minimum charging cost.  Figure  3. PSO's dynamic scheduling is given in Table 8, and the optimal allocation of power and resources is given in Table 9.   The EV demand is allocated to each time slot to achieve the minimum cost. The PSO's minimum cost is 2432.0 €ct, which is cheaper than the FIFS scheduling cost. As the grid's electricity cost in timeslots 7 and 8 is relatively high, PSO schedules the EVs in the first six timeslots to achieve the minimum charging cost.

Dynamic Schedule Using Shuffled Frog Leaping Algorithm (SFLA)
The SFLA is used for the optimal scheduling of EVs to reduce the electricity purchase cost. For each slot the electricity cost is 226.1, 461.0, 444.5, 424.5, 424.5, 447.5 €ct. The total electricity purchase cost is 2428.47 €ct. The optimization techniques effectively utilize the low electricity price time slots for scheduling of EVs. Also, this shows that if the number of EVs arrives with prior booking, better scheduling is obtained to minimize the grid's charging cost. The convergence curve of the SFLA is shown in Figure 4. The convergence speed of SFLA is faster than the PSO. The scheduling results obtained by SFLA is given in Table 10. The optimal power and resource allocation are given in Table 11.   cost is 2428.47 €ct. The optimization techniques effectively utilize the low electricity price time slots for scheduling of EVs. Also, this shows that if the number of EVs arrives with prior booking, better scheduling is obtained to minimize the grid's charging cost. The convergence curve of the SFLA is shown in Figure 4. The convergence speed of SFLA is faster than the PSO. The scheduling results obtained by SFLA is given in Table 10. The optimal power and resource allocation are given in Table  11.     However, the charging cost of the PL is calculated without considering the microgrid (MG) scenario available with the PL. The microgrid power can be used to minimize the electricity purchase cost of the PL. The renewable energy sources provide significant potential that can benefit the CSs. When the microgrid power is supplied to the CS, the cost is reduced significantly. Compared to the grid cost, the MG cost in all the slots is cheaper, and hence it is utilized effectively [65,66].
The optimal use of renewable energy is not only beneficial for cost reduction but also supports the grid. By using the microgrid available in the PL, the cost savings are given in Table 12. Furthermore, the charging cost of EVs with uncertain arrival is examined in the next subsection and compared with the charging cost of EVs arriving with a prior booking. The arrival and departure times are randomly assigned within the eight timeslots. The users with prior booking need to provide the expected arrival time, departure time, and charging demand. For EVs without booking, the EVs' expected departure time and charging demand are provided when they reach the CS. To keep the same total demand in the three cases, only the arrival and departure times are randomly generated. In each case, the results are obtained using the SFLA and then However, the charging cost of the PL is calculated without considering the microgrid (MG) scenario available with the PL. The microgrid power can be used to minimize the electricity purchase cost of the PL. The renewable energy sources provide significant potential that can benefit the CSs. When the microgrid power is supplied to the CS, the cost is reduced significantly. Compared to the grid cost, the MG cost in all the slots is cheaper, and hence it is utilized effectively [65,66].
The optimal use of renewable energy is not only beneficial for cost reduction but also supports the grid. By using the microgrid available in the PL, the cost savings are given in Table 12. Furthermore, the charging cost of EVs with uncertain arrival is examined in the next subsection and compared with the charging cost of EVs arriving with a prior booking. The arrival and departure times are randomly assigned within the eight timeslots. The users with prior booking need to provide the expected arrival time, departure time, and charging demand. For EVs without booking, the EVs' expected departure time and charging demand are provided when they reach the CS. To keep the same total demand in the three cases, only the arrival and departure times are randomly generated. In each case, the results are obtained using the SFLA and then compared with the PSO and FIFS scheduling algorithms. The dynamic system can determine a charging schedule at the beginning of each timeslot using all the EVs with and without booking, and then the PL can charge arrived vehicles with the use of the schedule for the immediate timeslot. At the beginning of each timeslot, the computational process has to be executed.
It can be seen that the electricity purchasing cost of the PL is reduced when the EVs arrived with reservation. Using FIFS, the charging price for cases 2 and 3 is increased by 3.26% and 3.11%, respectively, compared to the base case. Using SFLA, the charging price for cases 2 and 3 increased by 2.06% and 3.03%, respectively, compared to the base case (case 1). Also, using PSO, the charging price for cases 2 and 3 is increased by 2.70% and 2.89%, respectively, compared with case 1. The cost comparison with and without prior booking is given in Table 13, in which the MG case is not considered. Unexpected arrival and departure are considered for unappointed vehicles, as shown in Tables 14  and 15. Table 16 shows the scheduling when 5/20 vehicles have arrived without a booking, and Table 17 shows the scheduling of 10/20 vehicles have arrived without booking. These two cases are performed to minimize the electricity purchase cost, and the results show that the charging demands can be fulfilled in the three scenarios. Also, the needs are the same for the three cases; hence the cost can be compared. In Out 3 In Out 4 In Out Out 5 In Out  6 In Out 7 In Out 8 In Out 9 In Out 10 In Out 11 In Out 12 In Out 13 In Out 14 In Out 15 In Out 16 In Out 17 In Out 18 In Out 19 In Out 20 In Out In Out 4 In Out 5 In Out  6 In Out 7 In Out 8 In Out 9 In Out 10 In Out 11 In Out 12 In Out 13 In Out 14 In Out 15 In Out 16 In Out 17 In Out  18  In  Out  19 Out 20 In Out In Table 13, the comparison shows that the electricity cost is less than that obtained using the FIFS scheme. Furthermore, when the MG supplies the PL, the charging costs are reduced, as presented in Table 18. A comparison of the three algorithms' values obtained in the three cases without and with MG consideration are shown in Figures 6 and 7, respectively. In Table 13, the comparison shows that the electricity cost is less than that obtained using the FIFS scheme.
Furthermore, when the MG supplies the PL, the charging costs are reduced, as presented in Table 18. A comparison of the three algorithms' values obtained in the three cases without and with MG consideration are shown in Figures 6 and 7, respectively.

Conclusions
A dynamic charging scheduling scheme for charging EVs in a PL is proposed for minimizing the charging costs. First, a conventional FIFS scheduling scheme is performed for the EV charging. Economic scheduling is found using PSO and SFLA. In this regard, the dynamic charging scheme allocates the optimal electric power in each slot for the vehicles that have arrived. Scheduling is undertaken for the vehicles that have arrived at the PL with and without prior booking. This scheme considers the electricity price at each hour and the charging limit of the PL every hour for all the three methods considered. When the electricity price is low, the entire timeslot is fully utilized to charge the EVs effectively. Also, the PL operator provides 100% of the EV user's power within the available time. The results showed that more significant savings could be reached if the EV arrives with a prior reservation.

Conclusions
A dynamic charging scheduling scheme for charging EVs in a PL is proposed for minimizing the charging costs. First, a conventional FIFS scheduling scheme is performed for the EV charging. Economic scheduling is found using PSO and SFLA. In this regard, the dynamic charging scheme allocates the optimal electric power in each slot for the vehicles that have arrived. Scheduling is Energies 2020, 13, 6384 22 of 26 undertaken for the vehicles that have arrived at the PL with and without prior booking. This scheme considers the electricity price at each hour and the charging limit of the PL every hour for all the three methods considered. When the electricity price is low, the entire timeslot is fully utilized to charge the EVs effectively. Also, the PL operator provides 100% of the EV user's power within the available time. The results showed that more significant savings could be reached if the EV arrives with a prior reservation.

Future Works
In this work, the charging demand of each EV is considered as 100%, but this limit can vary, and random charging demand can be considered. Service delay can be regarded to benefit both the user and CS operator. Reserve charging points can be taken into account, and the charging can be undertaken for users with a special tariff based on the CS operator's decision. This kind of option available at the CS may help floating customers who want quick charging.

Conflicts of Interest:
The authors declare no conflict of interest. Best position of frog in a memeplex Xg

Abbreviations
Global best position Xi Existing position of the ith particle X W Worst position of frog in a memeplex V n c Rated power capacity of the EV ω Inertia weight