A Multiagent Framework for Electric Vehicles Charging Power Forecast and Smart Planning of Urban Parking Lots

This article proposes a novel stochastic agent-based framework to predict the day-ahead charging demand of electric vehicles (EVs) considering key factors including the initial and final state-of-charge (SOC), the type of day, traffic conditions, and weather conditions. The accurate forecast of EVs charging demand enables the proposed model to optimally determine the location of common prime urban parking lots (PLs) including residential, offices, food centers, shopping malls, and public parks. By incorporating both macro- and micro-level parameters, the agents used in this framework provide significant benefits to all stakeholders, including EV owners, PL operators, PL aggregators, and distribution network operators. Furthermore, the path tracing algorithm is employed to find the nearest PL for the EVs and the probabilistic method is applied to evaluate the uncertainties of driving patterns of EV drivers and the weather conditions. The simulation has been carried out in an agent-based modeling (ABM) software called NETLOGO with the traffic and weather data of the city of Newcastle Upon Tyne, while the IEEE 33 bus system is mapped on the traffic map of the city. The findings reveal that the total charging demand of EVs is significantly higher on a sunny weekday than on a rainy weekday during peak hours, with an increase of over 150 kW. Furthermore, on weekdays higher load demand could be seen during the nighttime as opposed to weekends where the load demand usually increases during the daytime.

is significantly higher on a sunny weekday than on a rainy weekday during peak hours, with an increase of over 150 kW.Furthermore, on weekdays higher load demand could be seen during the nighttime as opposed to weekends where the load demand usually increases during the daytime.

A. Motivation and Aim
A T present, EVs contribute a significant amount in reduc- ing CO 2 emissions and decreasing climate change, while renewable energy sources (RESs) such as wind and solar power decrease the risk of rising price in fossil fuel and dramatic coal depletion [1], [2].The escalating interest in RESs over fossil fuel has influenced revolutionized changes in EVs, which could mitigate the renewable sources' intermittency and benefit the environment in terms of CO 2 emission and air quality.In 2020, around three million new EVs were registered where 1.4 million new registrations were found in Europe, followed by China with 1.2 million registrations [3].According to the U.K. government, the transportation sector is the highest greenhouse gas emitting source which is 22% of total greenhouse gas emissions.Therefore, a greater number of leading vehicle manufacturers have been focused on EV technologies and their improvements to satisfy the EVs demand in the near future.For example, the U.K. government has announced to fully convert light-duty vehicles from fossil fuel to battery-EVs by 2030 and heavy-duty vehicles by 2050 [4], [5].However, the trending demand for EV usage could result in significant stress on the local power distribution system and increase EV congestion and charging prices, because of inadequate EV PLs [6].Moreover, a high concentration of EVs charging during peak hours can destabilize the grid system.To address these issues, a peak demand management system can be introduced to encourage EV owners to charge their vehicles during off-peak hours.As per research, more than 95% of a day, EVs are available at parking areas [7].Therefore, more EVs could gain the opportunity to participate in the power management system by reducing the electrical charge during on-peak hours.
With the increasing demand for EVs, the insufficiency of the PL infrastructure is beyond the breaking point.For instance, 2020 has presented a 40% rise in EVs demand in the U.K. while the PLs have only increased by 24% compared to the previous year.Therefore, the lack of PLs availability would result in bottlenecks when recharging, increase the range anxiety and demotivate the EV drivers, while limiting EV growth.Accordingly, 50%-80% of PLs in the world are installed in residential areas, 15%-25% PLs are installed in office areas, and less than 10% of PL could be found in other public locations [8], [9], [10].As the energy requirement accelerates with EVs charging demand employed, the necessity of a reliable and adequate power distribution system is essential to accomplish the peak power demand, prevent power failures, and control EV charging costs.Therefore, the optimal planning of EVs charging infrastructure could optimize the amount of supply and demand to solve the energy dilemma.It is essential to consider the charging behaviors of EV drivers when implementing EV charging infrastructure.In this regard, the factors which enhance the efficient usage of PL infrastructures are important to recognize.In addition, the properly planned PL infrastructure in a city is important to supply the required power demand for EVs in the city.Hence, the U.K. government has funded a B#2.5 billion in grants to implement charging infrastructure near residential areas, streets, and commercial areas [5], [11].Therefore, properly planned adequate PL infrastructure has become a global utmost requirement.

B. Literature Review
Many studies have been conducted to analyze the grid performance over the EVs charging patterns under several parameters.In [12], a probabilistic modeling Queuing theory was introduced to evaluate the EV charging load behavior in residential areas.This study focused on the mobility behavior of EVs from historical data with respect to peak time, vehicle type, type of day, and average daily mileage.The departure time, arrival time, and distance were generated randomly to identify whether the vehicle is parked or moving.However, the study neither considered weather conditions nor elaborated on any method for analyzing EV arrival to PL.In addition, this work is limited to residential areas.Furthermore, a study in [6] has investigated the daily EV charging load profile for demographics and social characteristics (age, gender, and education level), with respect to day type (weekday or weekend), and location by using a spatio-temporal probabilistic model.The additional factors included are power consumption rate and charging preference, using a Monte-Carlo algorithm.Nevertheless, this model ignored key parameters such as SOC while vehicle type, weather conditions, and driving patterns that were limited to homes and offices, charging, as well as other places which are not specified properly.Furthermore, an optimal charging scheduling was presented in [13] with large-scale EV deployment considering transport system information and grid system operation at the same time.Road length, EV type, vehicle speed, and waiting time are taken as transport system information, while load deviation and node voltage are considered as the grid system information.When the battery level is less than 30%, the vehicle is supposed to be scheduled for charging and the schedule is obtained by multiobjective optimization.This is achieved by the weighting of the roads considering four factors such as road length, time for passing the road, the ratio of traffic around the PLs, and traffic around the charging load.However, this model did not examine some essential factors such as type of day (weekday or weekend), weather conditions, and driving patterns with respect to the location.Moreover, this study is a real-time process and did not assess any economic impact on the power distribution network.Khalili et al. [14] proposed a day-ahead EV scheduling strategy to mitigate the system's imbalance by controlling the single-phase charging demand of EVs with vehicle-to-grid option and charging of the EVs as a price-based demand response program.Huang et al. [15] considered the mobility of EVs and the stochastic nature of EV demand and have formulated the charging scheduling of EVs as a Markov decision process to capture the uncertain EV charging demand in the microgrid of buildings.
Many previous studies have considered parameter variables as deterministic or stochastic.The deterministic method uses average parameter values while the stochastic approach mostly utilizes probabilistic distribution [5], [16].A number of each of those methods have been applied to simulate the parameters to find the EV charging demand in previous studies.In [17], a mathematical model with the spatial and temporal approach was presented, to calculate the EVs charging demand, while in [18], a BCMP queueing network model was developed to estimate the PEV charging demands in multiple PLs.Similarly, probabilistic methods have been utilized in several literature.For instance, studies [5], [16], [19], and [20] applied support vector machines and the Monte-Carlo method to obtain the charging demand for EVs.Several other methods have been applied in the literature to determine the optimal path for EVs to reach PLs.For example, EVs find the optimal route by considering the distance to the nearest PL selected [21].However, some studies have considered the minimum time to reach the PL [22], while other considered transport system information (i.e., traffic jam) and grid condition [13].A route mapping approach was used in [23] and [24] to reach the PLs where the vehicle speed is taken as the primary factor, and in [25], road gradient, wind speed, vehicle speed, and ambient temperature were applied to find the best PL for the EVs.In particular, this study applied a novel path-tracing algorithm considering the peak time and the distance to the PL when searching for the optimal PL.In [26], optimal placement of EV charging stations was presented in a radial distribution network considering a road network.Charging demand in different places such as supermarkets and road junctions were accounted for, with the objective to minimize the energy loss, voltage deviation, and land cost.Karimi Madahi et al. [27] and Mansour Saatloo et al. [28] formulated a stochastic mixed integer linear programming model for stand-alone charging stations for EVs using green energy of renewables.The stochastic behavior of EVs and renewables has been considered.A novel carbon-oriented expansion planning model for EV fast-charging stations was proposed in [27], [28] to determine the optimal locations and size of charging stations.Pal et al. [29] proposed a realistic and sustainable framework for optimal planning of the location and capacity of the EVs charging stations and expansion of the electrical distribution system to handle future load growth.
Agent-based models could make individual decisions and interact with other agents.Therefore, in smart traffic control modeling, each vehicle and charging station is considered as separate agents and these agents are accompanied by individual behavior settings which is more realistic than other methods of simulations [5], [16].Agent-based modeling (ABM) has been used in numerous previous power system implementation studies.Ahmadi et al. [5], [16] proposed an agent-based approach to estimate the EV demand considering each EV driver as a different agent with the characteristics of mobility needs, charging requirements, and economic needs.Furthermore, every distributed energy storage (DES) unit was taken as individual agents in [5] and [16] where the dynamic consensus approach was applied to communicate between agents.Moreover, in [30], renewable energy generation and load demand were applied as two different agents to predict energy consumption and production.Nevertheless, in this study, EVs were defined as individual agents with the characteristics of different SOC, battery capacity, and mobility patterns, while the PLs were considered as agents with different charging types and charging locations.A cooperative hierarchical multiagent system was introduced in [31] to propose an optimal EV charging scheduling strategy to minimize the demand and energy charges and meet the EVs' energy requirements.
To the best of our knowledge, there is no model which considers the weather condition, traffic conditions, and the type of day, at the same time to evaluate the EV drivers' behavior and predict the EV load profile.Furthermore, the previous works on optimal planning of the PLs location are not based on the exact EVs load.Most of the previous studies considered EVs load demand only in the residential PLs.Accordingly, several gaps have been observed in the literature, which are listed below.
1) Numerous studies have examined the behavioral patterns of the EV drivers to predict the day-ahead EVs load profile with respect to different parameters.However, none of them has considered weather conditions, type of day, and traffic conditions which leads to less accurate predicted EVs load.Also, they cannot produce a real load of each city.2) Most of the previous works have considered only one or two types of PLs including residential and commercial ones.Therefore, they cannot model the total load of a city.3) Many of the previous studies have not determined the optimal location for PLs by the actual data such as real city transport data and well-predicted load profile of EVs charging patterns.This results in the nonoptimal location of PLs which increases operational expenses, congestion, voltage deviation, and EV drivers' dissatisfaction.

C. Research Contributions
The factors influencing the EVs charging demand are driver behavior, location of PLs, and electricity pricing.However, most of the reviewed literature ignored the factors related to the social characteristics of EV drivers, and some models have not considered the economic elements.Therefore, it is essential to account for the charging behaviors of EV drivers when implementing EV charging infrastructure.In this regard, the factors which enhance the efficient usage of PL infrastructures are important to be recognized.Accordingly, this study presents a stochastic agent-based framework for observing the EVs charging behavior to accurately predict the electricity Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.

TABLE I COMPARISON OF THE LITERATURE AND THIS STUDY
demand in all types of PLs in the presence of different EVs and effective factors.The agents enable the proposed framework to model micro-and macro-level parameters of all stakeholders including EVs, PL aggregators, PL operators, and distribution network operators, considered simultaneously as a community to analyze their mutual impacts.Moreover, this research identifies the optimal location of PLs in the city, while ensuring maximum utilization of the PL infrastructure.With respect to the literature, the following major research contributions (RCs) are highlighted in the proposed framework.
1) RC1: Proposing a novel agent-based framework to predict the EVs charging demand requires consideration of the key effective factors including the type of day, weather conditions, as well as traffic condition which enables the proposed model to evaluate the driving behavior of the EV drivers and predict the EV load demand exactly for the city based on its own climate and traffic data.2) RC2: Considering various PLs including REPL, OFPL, FOPL, SHPL, and PUPL to predict the total EVs load and the individual EV load profile in each of them.Each PL contains one of the charging strategies including fast and slow.The complex interdependence between micro-and macro-level parameters is captured in the process of modeling queuing, PLs path finding, and tracing algorithms for EVs.To do this, a path tracing algorithm is used to find the nearest PL for each EV at each point of the city.3) RC3: Determining the optimal locations for PLs using accurately predicted load profiles of all types of PLs, aimed at a cost reduction for stakeholders and maximum satisfaction for EV drivers.Also, the electricity network of the city is mapped on its traffic map which allows the preliminary power system analysis including an ac power flow.Thus, the optimal locations are also determined in a way that considers the grid operation, identifies the excess loads, and minimizes the voltage deviation and congestion.

D. Comparison
Considering the presented contribution in this study, Table I provides an in-depth comparison between previous studies and the proposed framework.As can be seen, this study has covered the research gap in the reviewed literature such as weather conditions, peak hours, day type, various types of PLs, charging methods, and day-ahead market.It can be seen that this article covers a comprehensive study or the smart planning of urban PLs.

E. Article Structure
The rest of the article is organized as follows.Section II presents the proposed method and describes how the path tracing algorithm finds the nearest PL.Also, the software that is used to implement the proposed multiagent model is introduced.The proposed formulation of each agent and the framework parameters are explained in Section III.In Section IV, the data of a city is used for a series of studies to show the validation of the proposed framework.Section V concludes the article.

II. PROPOSED IDEA A. Structure of the Proposed Framework
The proposed framework for decentralized power management utilizes a multiagent system, where each stakeholder is represented by an agent as shown in Fig. 1.
The distribution network operator (Agent 1) performs as a wholesale day-ahead market where the electricity is generated and sold to the PL aggregator.It includes weather/traffic data of the city and different types of days.Agent 1 also models roads and traffic lights to provide a real-time environment and enhance the accuracy of the end results.PL aggregator (Agent 2) operates as an energy service provider, purchasing electricity from Agent 1 and supplying it to PL operators while proposing energy prices to maximize profits.PL operators (Agent 3) participate in this framework as energy servers to EVs, with the ability to define the energy prices for EVs to maximize their profit.EVs owners (Agent 4) benefit from this framework by reaching the destination via the shortest path while saving time and maximizing the EV efficiency.Agent 4 also enables the modeling of EVs based on their charging characteristics, mobility patterns including private and commercial ones, and type.In fact, a central cloud has been introduced to store, exchange, and process data where each agent has an individual subcloud for its computations.These subclouds exchange data with each other to predict the total loads and the individual loads of each stakeholder  to determine the optimal location of PLs.Agent 2 collects information including the PLs locations, current total load demand, the current number of EVs, and the total number of PLs from Agent 3 (i.e., A3 → A2).On the other hand, weather information (including sunny and rainy) and the type of day (weekday or weekend) is provided by Agent 1 (i.e., A1 → S1).The calculations of the profit of Agent 3 are implemented in Subcloud 3. Furthermore, when an EV driver wants to find a PL to charge the EV, a personalized trip advisor (PTA) receives the traffic data from Agent 1 while obtaining the initial SOC, departure time, current speed, and current location of the EV from EV drivers.Thereafter, PTA determines the availability of the nearest PL for the EV driver (Section II-B).
The EV charging behavior in each PL is varying with several interdependent parameters which belong to stakeholders, as shown in Fig. 2. Three of these parameters are weather conditions, the type of day, and traffic conditions (RC1).The proposed framework models the interactions of these parameters which makes it able to consider the mutual impact of all stakeholders.The micro-level parameters are dedicated to an individual EV, while macro-level parameters are dealing with a group of EVs.Modeling the mutual impact enables the proposed model to predict accurately the charging demand of EVs based on the behavior of EV drivers, PL operators, and PL aggregators.The interdependence system is captured in the process of modeling queuing, PL path finding, and PTA for EVs.
The interactions between agents that allow modeling the connections between macro-and micro-mobility patterns make the proposed framework to be a hybrid modeling system which allows to model EVs charging demand behavior accurately.
Therefore, the proposed framework considers the interactions of weather conditions, traffic conditions, the type of day, and SOC with other parameters as shown in Fig. 3 to analyze how they affect charging demand of individual EVs (micro-level) or total EVs (macro-level).Moreover, their effects at the macro level can lead to a more optimal location of PLs.Modeling micro-and macro-level parameters allows consideration of driver's behaviors/preferences in predicting EVs charging demand, which leads to accurate real results.
The system parameters are the SOC, the type of vehicle (commercial or private), type of the day (weekday or weekend), the mode of charging (fast or slow charging), charging location (residential, offices, public parks, shopping malls, or restaurants), weather condition (rainy or sunny day), and local traffic conditions to define the peak hours throughout the day.These effective parameters allow accurate prediction of the charging demand.

B. Flowchart of the Proposed Framework
The proposed framework contains two nonlinear optimizations, as shown in Fig. 3.The first optimization is carried out using NETLOGO, which predicts the total load demand (i.e., the load of the PL aggregator) and the individual load of each PL over the next 24 h.The optimization process Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.also aims to maximize the profit of all stakeholders, while taking into account the preferences of EV drivers.The second optimization is implemented in MATLAB to determine the optimal location of PLs based on the predicted loads in the first optimization while ensuring maximum utilization of the PL infrastructure.Agent 1 requires weather data and the characteristics of the electricity network of the selected city.It also needs access to local traffic data to find the congestion areas in peak hours and the driving patterns.Agent 3 requires information about the characteristics of fast and slow charging equipment and the type of PLs.Ultimately, Agent 4 needs the characteristics of the types (including private and commercial) of EVs and the EV driver's behavior.
Agent 1 sends the weather data and the type of the day to subcloud 1 and sends the electricity price to the PL aggregator (RC1).PL aggregator offers a price to each PL operator in order to maximize their benefits.Agent 2 models different types of PLs including REPL, OFPL, FOPL, SHPL, and PUPL (RC2), and charging strategies including fast and slow charging for each type of PL.Afterward, each PL operator determines the electricity price for EVs that want to be charged by its chargers.EVs move toward their destinations.When the SOC of an EV becomes less than SOC kn , it starts searching the nearest PL by PTA.If the nearest PL is fully occupied by the time EV is reached, then EV moves to the next nearest available PL.However, if the PL is available, EV can wait in the queue.EVs follow the queuing theory with the first come first out (FIFO) method when waiting in the queue.Therefore, each PL sends information about its power demand, number of EVs, and PL location to the PL aggregator.Thus, the EVs charging load is predicted through the parallel operation of agents in NETLOGO and is sent to MATLAB.Agent 1 maps the traffic map to the electricity network.Afterward, Matpower determines the optimal location of PLs based on a minimum price for EVs, minimum charging load, maximum EV driver's satisfaction, as well as the minimum strain on the power grid.The optimal locations are selected near to main streets, and the ac power flow performed through the planning to identify the excess loads and avoid voltage deviation and congestion in the grid.
The process of PTA applied in Block A of Fig. 3 is shown in Algorithm 1. First, the location, SOC, speed, and departure time of the EV are received from the EV owner.PTA also receives traffic data from Agent 1.Using this information, PTA computes the distance of EV to each PL and sorts PL from the nearest to the farthest.Afterward, it calculates the estimated arrival time of the EV for the nearest PL.Agent 4 uses the estimated arrival time and the initial SOC of EV, as well as the availability status of PLs which is received from Agent 2, and determines whether the PL is available or not.

III. PROBLEM FORMULATION
A. EVs Structure (Agent 4) 1) Mechanical and Electrical Power: The average energy consumption of EVs can be defined by the road loads as shown by (1) [32].FTOT is the total force, FI is the initial force, FR is the rolling resistance, FG is the gradient resistance, and FA is Algorithm 1 Flowchart of PTA (Block A of Fig. 3) Initial force is given by EV mass and its acceleration during minute t, in k type of EV Rolling resistance is the force in the tires when contacting the road.The equation for the rolling resistance is given in (3).Where C π is the coefficient of rolling resistance, α is road slope, m k is EV mass of k type EV, and g is the gravitational acceleration Gradient resistance is applied when the EV is moving upward or downward slope Aerodynamic drag occurred due to the viscous resistance present on the vehicle.This is mainly depending on the shape of the vehicle.The formula for the aerodynamic drag force is expressed as in (5), where ρ is the air density, C dk is the air drag coefficient, and A k is the vehicle frontal area in the k type of EV.V t is the speed of the EV at time t The average total power or mechanical power (Pm ev t ) in Watt could be derived from the product of vehicle speed and the total road resistance.However, in this model, the road slope has been ignored Equation ( 8) is utilized to convert the mechanical power to electrical power.The auxiliary power could be considered as common EV electrical components (auxiliary loads) such as heating and cooling, where η m is the motor efficiency and the P aux is the auxiliary power Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.
2) SOC of EVs: The SOC at a specific time depends on the initial SOC and the battery capacity.According to the Coulomb Counting method [19], the SOC could be expressed in (9).Equation ( 9) could be rewritten as following (10), where η b is the battery efficiency and B k is the battery capacity of the k type of EVs The relationship between the initial SOC (SOC i ) and the final SOC (SOC f ) is given as follows: B. Charging Types (Agent 3) DC charging is faster than the ac charging.Therefore, EV charges in the simulation are dc type along with fast and slow charging functionalities.EV can select the method of charging according to the current SOC, remaining time, and distance.Furthermore, the charging type could affect the EV charging time.

C. Environmental Parameters (Agent 1)
1) Peak Hours: The peak hours change mainly due to three factors including the PL location, the type of day, and the weather condition.In the simulation, charging behavior in five different PLs have been applied to observe the EV load.
2) Type of Day: The EV load profile depends on the type of day including weekdays and weekends.For instance, a higher number of EVs charge the batteries during weekdays at offices, while on weekends more EVs are at public parks and shopping malls during the daytime.
3) Weather Conditions: The EV load demand is directly varying with the weather condition.For example, the U.K. follows four seasons annually, and more sunny days are available during summer and rainy days in winter.The literature explains that people tempt to go outside during sunny days compared to rainy days [7].In the simulation, the weather condition has been introduced in ten levels, where level 10 represents the 100% sunny day and level 1 represents 100% rainy day.The weather level could be changed according to the forecast weather report.For instance, the weather level sets to be 6, when the selected day is 60% sunny and 40% rainy.
In addition, the weather condition fluctuates with respect to the Gaussian normal distribution between 50% and 100% among the total number of EVs in the simulation model as shown in (12).In other words, the model assumes that at least half of the EVs will experience a particular weather condition, and up to all of the EVs may experience that same condition.This allows capturing the range of weather conditions that the majority of the EVs are likely to experience, while still allowing for some variability in the weather conditions across the EVs.

4) Number of EVs:
In this model, two types of EVs are considered such as commercial and private vehicles which have different driving behaviors.The number of EVs mainly depends on the weather condition, type of the day, and the peak hours.For instance, a higher number of EVs are available at the PLs during the peak hours and it could result in queues near the PLs because of the limited number of PLs.Therefore, considering the number of EVs is essential when planning to install the PLs in a specific area.
5) Charging Prices: The charging prices could massively depend on peak hours and the type of day.For example, higher charging prices could be expected on a busy day during peak hours.Consequently, the charging price will affect the charging duration of each EV and the final SOC (SOC f ) as the EVs drivers tend to top-up only the minimum amount required for their journey, if the charging prices are high The simulation model is implemented to select the variance and the mean from 1 to 10 on the graphical user interface (GUI) according to the location data in the selected area.When the weather condition is at level 10, all the vehicles are operating, and it is decreased by 5% when the weather condition steps down by a single level, up to level 1.In this model, the mean value is defined as µ = 8, and variance is applied as σ = 2.
The total number of EVs are divided into two categories commercial and private.In this article, electric taxis are regarded as commercial vehicles and personal vehicles have been considered as private vehicles.The simulation considered 50% as private vehicles and 50% as commercial vehicles.Moreover, the EV category could vary in the EV range, battery capacity, and charging duration.
7) Battery Capacity and Range: The battery capacity of the EV decides the driving range of the EV and the capacities of the EV batteries are changed according to the EV model.Higher battery capacities can drive long distances, which means vehicles with a higher range.
8) Mode of Charging (Fast/Slow): The charging mode of EVs has been categorized as fast and slow charging.In this study, EVs choose the mode of charging according to their preference.For instance, EVs drivers could select fast charging to save charging time during peak hours.Consequently, the mode of charging depends on the type of day and the weather condition.In this study, the slow charging is considered as 6.6 kW and the fast charging (dc fast charging) has been configured as 50 kW capacity.
Agent 3 must be provided with fast and slow charging information and the type of PLs.For instance, rate of charging, ac or dc types, and current and voltage information.
Proposing a novel agent-based framework to predict the EVs charging demand requires consideration of the key effective factors including the type of day, weather conditions, as well as traffic conditions which influence the driving behavior of the EV drivers impacting the EV load demand.To map the city in Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.

TABLE II
SYSTEM PARAMETERS the model.The model of the city was drawn in the simulation platform with roads, traffic lights, and parking areas to provide a real-time environment and optimize the accuracy of the end results.
The EV charging behavior in each location is varying with several interdependent factors such as the percentage of sunny or rainy conditions on a weekday or weekend at peak hours or off-peak hours.
The above-mentioned parameters provide a complex interdependence system, which is captured in the process of modeling queuing, PL pathfinding, and tracing algorithms for EVs.Therefore, the path tracing algorithm is used in the proposed framework to find the nearest PL for EV at each point of the city (different charging strategies including fast and slow charging in each type of PL).
Agent 4 makes it possible to model EVs based on their charging characteristics, mobility patterns, and type.The proposed framework has taken two types of EVs as private and commercial (taxi) vehicles with different behaviors to model real existing behaviors.It is assumed that the driving behavior of conventional vehicles is similar to the driving behavior of EVs.Furthermore, three main types of EVs have been applied in the framework to model characteristics of the most popular existing EVs in real networks.In addition, Agent 4 models the SOC of EVs.
Agent 3 models the different types of PLs including REPL, OFPL, FOPL, SHPL, and PUPL, and different charging strategies (including fast and slow charging) while Agent 1 considers different types of days (including weekday and weekend), different weather conditions (including sunny and rainy), and local traffic condition (to define peak hours).Agent 1 also models roads and traffic lights to provide a real-time environment and enhance the accuracy of the end results.

A. Characteristics of the Network Used for Assessing the Proposed Framework
The values of EV parameters in Agent 4 are presented in Table II.
To define the optimal location of PLs, the proposed model maps the traffic map of the city to the IEEE-33 bus system.Determining the optimal locations for PLs is done using accurately predicted load profiles of all types of PLs.
The maximum number of EVs was set to 500 in the simulation and could be changed according to the selected date in GUI.EVs are categorized into two types such as private and commercial where each type follows individual driving patterns and all the EVs follow the traffic light rules in the  developed model.The peak time of each location is predefined with respect to the Newcastle city's previous data.Level 7 of the driver's experience is taken and it is not changed.
The minimum SOC that EV uses to start finding the nearest PL (SOC kn ) is 20% of its battery capacity.The penetration of private and commercial EVs is 50% each, of all 500 EVs considered in this research.In the simulation, purple vehicles are indicated as private and commercial vehicles represent in orange.It is assumed that the driving behavior of conventional vehicles is similar to the driving behavior of EVs.Furthermore, three main types of EVs have been applied in the framework including Volkswagen ID 3, Hyundai Ioniq 5, and Kia e-Niro.The EV and battery specifications are shown in Table III.Also, the respective charging characteristics of these vehicles are shown in Fig. 4.
The data from Newcastle Upon Tyne in the U.K. is used in this section to verify the proposed model.According to the statistics in Newcastle, the peak time in a typical weekday of each PL is presented in Table IV and the car park availability in presented in Fig. 5.The proposed model runs for 24 h and obtains the results.

B. Simulation Platform of NETLOGO
As stated in Section II-B, the first optimization of the proposed framework is implemented in NETLOGO 5.3.1 Fig. 5. Car park availability percentage, Newcastle [33].

TABLE IV PEAK TIME OF DIFFERENT PLS IN A TYPICAL WEEK DAY
software [34] to predict the day-ahead EV load demand by applying the mentioned parameters in Fig. 2 with EV drivers' behavior.
NETLOGO is a programming language that applies to agent-based models.In this software, it is possible to receive instructions and operate independently for a large number of agents at the same time (i.e., parallel processing).The blocks of the software could be formed as turtles which are moving blocks such as vehicles, patches that are steady blocks such as home and offices, links, and observers [30].
The basic agent-based model used for EVs and PLs in NETLOGO in the proposed framework has been extended from [35].
NETLOGO allows modeling complex interactions of all parameters shown in Fig. 2 that enables to consider the mutual impact of all stakeholders.NETLOGO allows EVs as a single block in the simulation platform to make decisions individually based on their own aims that shows the microscopic interactions.For example, if the SOC of the EV falls below the minimum threshold amount, it starts searching for the nearest PL.But their behavior is also affected by the behavior of other EV drivers which can lead to macroscopic interactions.For example, if PL is occupied, EV must search for another PL or stay in the queue.
The simulation platform makes it possible to model the city with roads, traffic lights, and parking areas in Agent 1 to provide a real environment and increase the accuracy of the end results.Traffic lights are defined as red and green to stop and move the cars, respectively.The city in the simulation is mapped with 36 similar-sized blocks with parking areas in Agent 3 and the blocks can be changed according to the corresponding map of the city.Each of the blocks can be changed as REPL, OFPL, FOPL, SHPL, PUPL, carpark, or none, as shown in Fig. 6.In the model, all the areas are accompanied by eight charging slots except the locations such as carpark and none.It is possible to define the number of EVs  and change the proportion of private vehicles to commercial ones according to the city data in Agent 4. Each type of EV follows individual driving patterns and all of them follow the traffic light rules.The nearest PL which is determined by PTA activated in NETLOGO is selected by minimum distance to the EV when it starts to search for a PL.Initially, the patch where the EV is located is defined.Thereafter, the distance to every available PL is determined individually by counting the number of patches on the roads from the EV location, where each patch (square) in the simulation platform is defined as a kilometer in real life.Finally, all the path distances are sorted in ascending order, where the closest PL will be selected as the first choice.Fig. 7 shows that the type of day could be a weekday or weekend, and the weather level can vary from level 1 to 10. Level 7 of the driver's experience is taken and it is not changed.Moreover, electricity prices can be set at individual PLs.NETLOGO makes it possible to monitor EV characteristics.Fig. 8 shows the characteristics of EVs in PL 3.

C. Grid Mapping
The proposed model was mapped into the standard IEEE-33 bus system to enhance its practical applicability.The IEEE-33 bus system is mapped with the traffic map of Newcastle upon Tyne.
Furthermore, it is assumed that the point of common coupling (PCC) is located in Bus 1 and the maximum amount of real power exchange is 1 MW.In fact, it is assumed that the office PL is located at bus 28, the public park PL located at bus 20, the shopping mall PL at bus 5, the restaurant PL is at bus 9 and the residential PLs at buses 31 and 24, respectively.
Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.To analyze the effect of the proposed model on EVs charging demand and the optimal location of PLs, four case studies (PLs) are considered as follows.
1) CS1: Find the total load demand and individual load demand in all five areas when, type of the day = weekday, type of the weather = sunny day (weather level = 9), (average or typical sunny weekday).2) CS2: Find the total load demand and individual load demand in all five areas when, type of the = weekend, type of the weather = sunny (weather level = 9).3) CS3: Find the total load demand and individual load demand in all five areas when, type of the day = weekday, type of the weather = rainy day (weather level = 4).4) CS4: Find the total load demand and individual load demand in all five areas when, type of the day = weekend, type of the weather = rainy day (weather level = 4).

D. Probabilistic Parameters
Table V shows the probabilistic parameters taken in each case study to show peak hours for PLs.µ is defined as the mean and the variance is presented as σ .depends on the weather conditions, peak hours, and the type of day.

E. Results
The total EV load demand in CS1 in the city is shown in Fig. 10(a).According to the figure, the peak load demand could be expected at night around 20:00-22:00 which is around 400 kW.This is obvious because more people tempt to stay at home and charge their EVs at night compared to the daytime.Furthermore, the daytime peak spread from 10:00 to 16:00, where the EVs load is approximately 290 kW, as peaks in offices, restaurants, public parks, and shopping malls during this time.In addition, a significant rise is observed after 16:00 from around 130 to 400 kW within 2 h, because the EV load demands in offices, shopping malls, public parks, and restaurants are beginning to rise after 16:00 as many EVs gather around these areas by that time.On the other hand, EV total load is reducing rapidly after 22:00 in the nighttime as restaurants, offices, shopping malls, and public parks are closed at that time and many residential prefer to sleep rather than charge their EVs.Fig. 10(b) shows the total EV load in CS2.As per the figure, more EVs are tempted to charge the batteries during daytime compared to nighttime, confirming that many people in the city would prefer to go outside on a sunny weekend.The total EV load demand accelerated notably from 07:00 to 10:00 in the morning, from around 100 to 500 kW as the morning peaks in public parks, and residential could be seen and the EV loads in shopping malls and restaurants begin to increase during this time.The average peak demand is approximately 450 kW which is distributed for 3 h after 12:00 due to the peaks of shopping malls, restaurants, and public parks are spread over these hours.In addition, the nighttime total EV load is around 300 kW, and another peak is presented from 19:00 to 22:00.This is because the night-time peak in residential areas occurs during these hours.Thereafter, a significant downward trend could be seen from 22:00 to 00:00 as all the offices, shopping malls, restaurants, and public parks are closed, and people tend to sleep at that time.The EV total load in CS3 is shown in Fig. 10(c).With respect to the figure, the peak EV demand is expected during the daytime compared to the night hours.It is reasonable to assume that more people tend to stay at home and charge.There are EVs during rainy days rather than going outside.For that, the peak demand is around 350 kW happening from 12:00 to 14:00 in the daytime, while the night-time peak is about 250 kW from 20:00 to 22:00.This is because the day-time peak and the night-time peak in residential areas occur over these hours, and the EV load in offices, shopping malls, restaurants, and public parks is comparatively lower than the residential EV load.However, less EV demand could be seen during the early morning hours, exactly after 00:00-06:00 as shopping malls, restaurants, public parks, and office areas are closed and people in residential are sleeping during this time.Furthermore, an upward trend is illustrated from 07:00 to 11:00 due to the EV load increment in residential and office areas, and a downward trend could be seen after 15:00 including fluctuations because of the EV load depletion at offices, restaurants, and public parks.The EV total demand in CS4 is shown in Fig. 10(d).With regards to the figure, more EV load could be seen during the afternoon and nighttime compared to day hours as more people temp to stay at home or drive back home before evening, because of the rain.Furthermore, the afternoon peak is presented from 14:00 to 17:00 (150 kW) as the EV loads in a shopping malls, offices, and restaurants has been increased compared to the other load values over the day, while the night-time peak is illustrated over 19:00-21:00 (200 kW) which is hugely dependent on the EV load in the residential area.load decreased after 22:00-00:00 from nearly 175 to 0 kW due to the people's sleep time in residences and other areas are not open that time.Another notable reduction could be seen from 13:00 to 14:00 around 200-100 kW because of the significant EV load decline of shopping malls and restaurant areas, as many people prefer to have lunch before 13:00 in the U.K. Nevertheless, an upward trend could be seen from morning to 13:00 as people tend to start their works in the morning and drive back to homes as soon as possible because of the bad weather condition, and thereafter the EV load rise steadily while maintaining the average of around 200 kW from 14:00 to 22:00.
According to Fig. 10, it is confirmed that the peak EV on rainy days is slightly less than the peak EV load demand on sunny days.Furthermore, higher demand could be seen in the daytime during weekends as opposed to the weekdays, where a higher number of EVs are charged at night hours.
2) Individual EV Load Demand: The individual EV demand in CS1 is shown in Fig. 11(a).According to the figure, all five places different peak hours and off-peak hours.In fact, the EV load in residential areas has two peaks in the morning Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.and nighttime, exactly from 06:00 to 08:00 in the morning and from 20:00 to 22:00 at night.The morning peak value is around 120 kW, and the night-time peak value is higher than that, which is approximately 160 kW.Nevertheless, the EV load is less than 20 kW during the daytime in residential areas.This is because, many people drive for their day-to-day work such as schools and offices during weekdays, and only stay at home during early mornings and nights.However, the EV load demand near the public parks has presented a peak of around 115 kW from 19:00 to 21:00 and a significantly lower number of EVs have been charged during the daytime, which is less than 25 kW, as fewer people go for entertaining during weekdays.On the other hand, EV load demand in office areas includes two peaks during the morning and evening, specifically, 09:00-11:00 (120 kW) in the morning and 17:00-19:00 in the evening (140 kW), because office working hours in the selected city is from 09:00 to 17:00.Furthermore, with respect to the trend in a shopping malls, higher number of EVs were charged from 11:00 to 14:00 and from 18:00 to 21:00 throughout the day, where the peak values are about 100 and 120 kW, respectively.A significant reduction (around 80 kW) could be seen in the shopping malls after 14:00-17:00 and increased again by 100 kW within the next 4 h.This is because more people are tend to go to the shopping mall during the lunch break or after work.Finally, the EV peak loads demand in the restaurant are nearly 120 and 140 kW at lunch time (from 11:00 to 14:00) and dinner time (from 17:00 to 19:00).Overall, a small number of EVs charged during the early morning in all five PLs.Individual load in CS2 in the city is shown in Fig. 11(b).With respect to the figure, all the places have two peaks during the daytime and the nighttime.In particular, the residential area EV load contains two peaks around 08:00-10:00 in the morning and 20:00-22:00 the nighttime, which the peak is nearly 160 kW in both peak times.This is because many people tend to stay at home a few more hours in the morning since it is a weekend.Furthermore, the EV load during off-peak time is nearly 40 kW in the residential areas.In addition, since it is a sunny weekend, the public parks demand contains two peaks, approximately 160 kW and 150 kW, from 09:00 to 11:00 and from 16:00 to 18:00, respectively.Here, the trend has decreased significantly after 18:00.However, the office's EV demand is comparatively less than other areas since it is a weekend.In addition, the peak EV demand near shopping malls is 60 kW higher than peaks on weekdays, where the peak load is around 160 kW during daytime (from 11:00 to 15:00).A notable reduction could be seen in shopping mall EV load after 16:00, due to most of the shops closing at 16:00 in the city during the weekend.Ultimately, the EV load near the restaurant includes two peaks from 11:00 to 14:00 and from 18:00 to 20:00, where the peak values are 140 kW and 150 kW, respectively.Furthermore, a significant rise is shown in the restaurant area from 09:00 to 11:00 and the trend decreased from 15:00 to 17:00.However, people do not prefer to charge their EV batteries during early morning and late-night hours in all five places.The individual demand in CS3 in the city is shown in Fig. 11(c).Overall, there is a remarkable difference between the EV load in residential areas and the other four areas.In particular, the residential EV load has two peaks during daytime and nighttime, such as 180 kW from 12:00 to 15:00 and 160 kW from 20:00 to 23:00, respectively, where the average peaks values of a public parks, shopping malls, and restaurants are less than 100 kW.Furthermore, EV load in residential areas jumped by nearly 100 kW from 07:00 to 11:00 and decreased demand from 160 to 40 kW within 4 h after 15:00.However, the off-peak demand maintained an average of 40 kW in the residential areas.Apart from the residential area, only the office area has shown a peak value which is higher than 100 kW such as around 150 kW from 08:00 to 09:00.This is obvious, as most people prefer to stay at home or go for important work (office) and less attention is given to the entertainment when it is raining.The EVs charging demand in CS4 in the city is shown in Fig. 11(d).
As shown in the figure, a higher number of EVs were charged in the residential area compared to other areas.In fact, the peak hours in the residential area were from 20:00 to 23:00, and the average peak value is 120 kW.A significant rise could be seen in the residential EV load demand from 14:00 to 19:00, where the value is charged from 20 to 140 kW Further, none of the areas contain any peak values during the daytime.The EV load in public parks is less than 40 kW, while the office EV demand is fluctuating between 0 and 60 kW throughout the day.Nevertheless, the shopping mall EV load contains two peaks from 10:00 to 13:00 (60 kW) and from 15:00 to 17:00 (80 kW), which confirms that people prefer to stay more hours inside the shopping malls when it is raining.In addition, fewer EVs were charged in the restaurant area during the day, which is less than 60 kW.Overall, it is clear that people tempt to stay at home and do indoor shopping when it is a rainy weekend.
3) PLs Optimal Location: Fig. 12 shows the optimal location determined by the proposed framework for PLs (RC3).These results are obtained from the proposed algorithm shown in Fig. 3.In the proposed method, a stochastic agentbased framework is used using Matpower and NETLOGO for observing the EVs charging behavior to forecast the electricity demand in the PLs.Also, micro-and macro-level parameters of all stakeholders including EVs, PL aggregators, PL operators, and distribution network operators are considered which leads to finding the optimal locations of PLs in the city and guarantee the maximum utilization of the PL infrastructure.In this regard, Matpower software was used to determine the optimal power flow (OPF) and identify the optimal locations, based on a minimum price for EVs, minimum charging load, maximum EV driver's satisfaction, as well as the minimum force given to the power grid for new charging stations.To facilitate power flow calculations and visualize the network, the proposed model mapped the traffic map of the city to the IEEE-33 bus system and determined the optimal locations for PLs using an accurately predicted load profile.

V. CONCLUSION
The uncontrollable EV penetration has led to tremendous excess stress on the current local power grid.In fact, sudden power failures (blackouts) could be expected due to the stress on the grid during peak hours and unnecessary fluctuations.Therefore, it is important to implement a controlled and sustainable power system to supply the growing demand of EV.This study evaluated a reliable day-ahead charging behavior while considering initial and final SOC, day type, local traffic pattern, and weather conditions on a typical day.In addition, five different places have been selected to investigate the driving behavior of the EVs such as residential, offices, shopping malls, restaurants, and public parks.The model was implemented in agent-based software named NETLOGO and the path tracing algorithm has been utilized to identify the nearest PL to the EVs when the battery needs to recharge.The transport data and weather data were based on Newcastle Upon Tyne, The U.K. to evaluate real scenarios for the implemented model.Eventually, the results confirm that EVs are more active during sunny days compared to rainy days, as more people prefer to stay at home during rainy days, whereas the EV peak load on a sunny weekday is nearly 400 kW and EV load on rainy weekday is approximately 325 kW.Therefore, more power is expected on sunny days.Furthermore, during weekdays, a higher number of EVs charge during nighttime, especially in residential areas as opposed to office areas where the peak load can be seen in the daytime.In addition, the fluctuating demand of each area in different conditions could result in unexpected off-peaks and peak demands in the power grid.Therefore, the optimal locations for the PL in the city have been presented in the model to reduce the unnecessary impact on the electrical distribution network.Future works will consider nontechnical concerns such as the feasibility of constructing PL in different locations.Furthermore, the participation of PLs in ancillary services markets to obtain more benefits and also resolve network issues will be explored.

Fig. 2 .
Fig. 2. Interaction of parameters used in the proposed framework.

Fig. 9
Fig.9represents the optimal location of PLs in IEEE 33 bus system.To analyze the effect of the proposed model on EVs charging demand and the optimal location of PLs, four case studies (PLs) are considered as follows.1)CS1: Find the total load demand and individual load demand in all five areas when, type of the day = weekday, type of the weather = sunny day (weather level = 9), (average or typical sunny weekday).2) CS2: Find the total load demand and individual load demand in all five areas when, type of the = weekend, type of the weather = sunny (weather level = 9).3) CS3: Find the total load demand and individual load demand in all five areas when, type of the day = weekday, type of the weather = rainy day (weather level = 4).4) CS4: Find the total load demand and individual load demand in all five areas when, type of the day = weekend, type of the weather = rainy day (weather level = 4).

Assessment 1 )
Total EV Load Demand (Agent 4, Agent 2, or Agent 3): The results verify the EV total charging demand hugely

Fig. 9 .
Fig. 9. Current locations of PLs in IEEE-33 bus system coordinated with traffic map of Newcastle upon Tyne.

Fig. 12 .
Fig. 12. Optimal location of PLs obtained by the proposed framework.
Speed of the EV at t [ms −1 ].

1 :
get initial SOC, EV departure time, EV current location, and EV current speed; ▷ from EV owner 2: get traffic data; ▷ from Agent 1 3: calculate the distance of EV to each PL; 4: sort PLs from the nearest to the farthest; 5: calculate the arrival time of EV for this PL; 6: send the arrival time;

TABLE III EV
AND BATTERY SPECIFICATIONS

TABLE V PROBABILISTIC
PARAMETERS Fig. 8. Available characteristics of EVs charging in PL 3.