Distributed Charging Prioritization Methodology Based on Evolutionary Computation and Virtual Power Plants to Integrate Electric Vehicle Fleets on Smart Grids

Electric vehicle fleets and smart grids are two growing technologies. These technologies have provided new possibilities to reduce pollution and increase energy efficiency. In this sense, electric vehicles are used as mobile loads in the power grid. A distributed charging prioritization methodology is proposed in this paper. The solution is based on the concept of virtual power plants and the usage of evolutionary computation algorithms. Additionally, a comparison of several evolutionary algorithms—namely genetic algorithm, genetic algorithm with evolution control, particle swarm optimization, and hybrid solution—is shown, in order to evaluate the proposed architecture. The proposed solution is presented as a means to prevent overload of the power grid.


Introduction
The electric vehicle (EV) represents a new research field in smart grid (SG) ecosystems. Currently, the new generation of EVs provides different technologies which can be integrated in SGs. However, these new technologies make difficult the distribution of grid management. In particular, EVs and the infrastructure needed to charge them have resulted in a great quantity of new standards and technologies. Currently, there are several research lines related to EVs: fast charging networks, battery performance modeling, parasitic energy consumption, EV promotional policies, increasing the range of the battery in EV, etc.; and other research lines related to EV energy management: contract models for consumption vehicle, market model to adopt EVs, distributed energy resources management systems (DERMS), distributed energy resources (DER) standards, faster charging technologies, demand response management systems (DRMS), the role of aggregators in V2G (vehicle-to-grid), energy efficiency, customer support, driver support, etc. Additionally, all these lines are influenced by the current regulation and may different greatly between countries (for example, the regulation between United States and Europe is very different regarding energy management). The charging infrastructure affects SG on several levels. These levels concern the transportation, distribution, and retailer levels. The main affected frameworks inside these levels are energy management, distribution management, and demand response. The energy management systems include several functions, one of which is the control of energy flows. The charging of an EV can be made at any point on the grid which has a charging unit. If the system has information about the expected use of the charging unit, the energy flow will be easier to manage. The distribution management is related with distribution system

Architecture View
The viewpoint of the proposed solution treats vehicles as a mobile load. In this manner, the system must have data about these loads and the charging prioritization. Thus, the system will have information about the expected consumption or the expected generation of the resource (in the case of a fault in the grid), such as a battery.
The proposed system works like a service for large companies with EV fleets. Knowledge about the state and prioritization of vehicles may minimize the impact of charging loads. These services provide new tariffs for retailers and new policies for energy price management.
The conceptual architecture of the proposed solution is shown in Figure 1. Several VPPs are included. The information is aggregated on the lower level. Then, the aggregated information is sent by each lower VPP to a higher level. In this manner, each VPP aggregates the data and services from lower VPPs to higher VPPs. Each level may have one or more VPPs depending on the needs at each level and the power grid.
The information representation at different levels was based on an extension of the common information model (CIM) from IEC 61870, 61968, and 62325. The interface information is based on the component interface specification (CIS) from the IEC. The information representation and interface description are beyond the scope of this paper.
Each higher VPP can perform evolutionary algorithms to generate commands or instructions to modify the queues from lower VPPs. Additionally, lower VPPs can perform the same evolutionary

145
The evolutionary algorithms are based on genetic algorithms and swarm intelligence. Each level 146 runs the evolutionary algorithms depending on the available computational resources or option 147 configured in the corresponding VPP. The level at which the VPP is performed determines the 148 availability of services and data. In this paper, several levels are proposed:

149
• Smart business VPP (SBVPP). This is the lowest level. At this level, all information about 150 vehicles, routes, and drivers from the same company is available. Thus, the charging 151 prioritization of the charging stations of the company is treated at this level. The state of charge 152 (SoC) is also calculated at this level. Some routes may be very long, which may cause a vehicle 153 to use a charging station that is located outside of the company. This charging station may be 154 administered by another company or the corresponding power distribution company. In this 155 case, the algorithm sends the restrictions to higher VPP levels to obtain a solution for the 156 charging needs.

157
• Distribution VPP (DVPP). At this level, information is aggregated from lower levels, and 158 information about retailers and the presence of charging stations is stored. This information is 159 sent to higher levels, such as an energy VPP (EVPP). Additionally, the restrictions from an 160 EVPP to the corresponding retailer and SBVPP are addressed at this level.

161
• Retailer VPP (RVPP). At this level, a retailer needs to know when vehicles require charging at

165
• Energy VPP (EVPP). In this paper, the vehicles represent mobile loads. Thus, if an energy

172
The prioritization process is performed in several stages to aggregate information for the upper 173 layers, as shown in Figure 2. The lowest levels implement functions that are related to consumers.

174
The medium levels implement functions that are related to energy distribution and The evolutionary algorithms are based on genetic algorithms and swarm intelligence. Each level runs the evolutionary algorithms depending on the available computational resources or option configured in the corresponding VPP. The level at which the VPP is performed determines the availability of services and data. In this paper, several levels are proposed: • Smart business VPP (SBVPP). This is the lowest level. At this level, all information about vehicles, routes, and drivers from the same company is available. Thus, the charging prioritization of the charging stations of the company is treated at this level. The state of charge (SoC) is also calculated at this level. Some routes may be very long, which may cause a vehicle to use a charging station that is located outside of the company. This charging station may be administered by another company or the corresponding power distribution company. In this case, the algorithm sends the restrictions to higher VPP levels to obtain a solution for the charging needs.

•
Distribution VPP (DVPP). At this level, information is aggregated from lower levels, and information about retailers and the presence of charging stations is stored. This information is sent to higher levels, such as an energy VPP (EVPP). Additionally, the restrictions from an EVPP to the corresponding retailer and SBVPP are addressed at this level.

•
Retailer VPP (RVPP). At this level, a retailer needs to know when vehicles require charging at any point outside of the company points. The retailer can use this information to offer different tariffs to a company. This level acts as an intermediate between the charging stations of different companies.

•
Energy VPP (EVPP). In this paper, the vehicles represent mobile loads. Thus, if an energy management system has information about the expected charging stations, it may take advantage of this information to improve the load flow forecasting algorithms. Load flow forecasting algorithm is not an objective of this paper. This paper proposes a distributed prioritization algorithm based on the VPP concept for SGs. The prioritization algorithm that is performed at this level treats the total load and establishes possible restrictions at any point of the grid.
The prioritization process is performed in several stages to aggregate information for the upper layers, as shown in Figure 2. The lowest levels implement functions that are related to consumers. The medium levels implement functions that are related to energy distribution and commercialization. The higher levels implement functions to guarantee the quality and continuity of a power supply. This architecture is highly scalable, increasing the interoperability between different enterprises and integration of heterogeneous ecosystems. The VPPs include evolutionary algorithms and some capabilities which makes the interoperability and integration possible: The evolutionary algorithm in an SBVPP. This algorithm sorts the vehicles with their drivers according to the SoC and expected route. If the algorithm cannot include any vehicle, the algorithm classifies the vehicle as an external charge and sends the request to higher VPPs. The SBVPP can receive commands and warnings from the DVPP and RVPP. The higher VPP commands and warnings are considered to be external restrictions. Additionally, the RVPP commands and warnings can take effect over different elements of customer power facilities when the customer that implements a SBVPP has contracted additional services from a retailer to manage the customer power facilities.

2.
The evolutionary algorithm in a DVPP. The DVPP gathers all requests from all SBVPPs. This information is employed in an evolutionary algorithm to prioritize charging in available charging stations. The prioritization of different vehicles is sent to the corresponding RVPP.
The prioritization of all vehicles is aggregated and sent to the EVPP. 3.
The EVPP gathers all information about the charging processes to provide information to the energy flow algorithm. The EVPP can send commands or warnings to the DVPP to notify changes in the prioritization.

4.
The RVPP gathers all information about vehicles that may have contractual relationships with a retailer. The retailer can use this information to offer new services to clients. If any problems arise in the client contract, the retailer can send a command or alarm to change the prioritization for one or more vehicles and/or charging stations.

5.
If any command or warning exists, the prioritization is re-calculated, which adds new restrictions. If no command or warning exists, the charging prioritization in the external charging stations is notified to the SBVPP.

187
The higher VPP commands and warnings are considered to be external restrictions.  Any evolutionary algorithm for the SBVPP and DVPP is possible because the algorithm works independently of other layers. Thus, several algorithms were tested in this paper, and a final configuration is proposed based on the results of the tests. However, the algorithms can be configured according to the resources of each level.

The Distributed Evolutionary Prioritization Framework
The distributed evolutionary prioritization framework (DEPF) is implemented in each VPP. The architecture of this framework is shown in Figure 3. The modules are shown in Figure 3. Each module has specific functions: • Asset Management System. The asset management system is based on the predictive maintenance of vehicles and charging stations. These modules establish the maintenance periods and register the usage of all equipment (vehicles and charging stations). • Driver Modeling. This module executes a modeling process of driver behavior. This module provides a driver pattern which is used to schedule the routes. • Energy Efficiency. This module applies different techniques to optimize the energy consumption and reduce the maintenance periods and economic impact.

230
The blue modules included in Figure 3 are not the objective of this paper. The information 231 required from these modules is specified in order to establish the constraints and requirements of

239
The asset management system is in development and will not be described in this paper. The blue modules included in Figure 3 are not the objective of this paper. The information required from these modules is specified in order to establish the constraints and requirements of prioritization algorithm. The external coordination is provided by the interoperability with higher VPP layers.
Some modules, such as external coordination, prioritization algorithm, and the SoC module, are available for all VPPs. The other modules depend on the available information in the VPPs. For example, the SBVPP has all information about the EV fleet (refer to Section 4.1); however, the SBVPP The asset management system is in development and will not be described in this paper.

Available Information for SBVPP
At the SBVPP level, information about different entities is available. This information is used to calculate the SoC, the best driver for each router, and the prioritization at the charging stations of the company. When the route needs an external charging station (out of company supply), the final prioritization is assigned by higher VPP levels.
The available information for the SBVPP is stored in a relational database management system (RDBMS) that is based on the IEC CIM. This information includes the data in Table 1. Table 1. Available information.

Entity Description
Vehicle Technical information about vehicles and their batteries.

Driver
Information about driver patterns.

Asset
Information about asset management.
Charging station Technical information about charging stations.

Routes
Information about pending and assigned routes.
Charging configuration Current configuration for prioritization algorithm.
Connection types Parametric information about technical characteristics of different connection types for vehicles and charging stations.

Periods
Establishes the expected periods of availability and non-availability for each vehicle and charging station.

Measurement
Different measures gathered from charging stations and power register.
External contingencies Information about traffic, roadwork, and topology.
Additionally, the algorithm stores the historical information described in Table 2. Table 2. Historical information stored by algorithm.

Additional Entities Description
Historical vehicles Historical information about vehicles: mechanical problems and statistics.

Historical charging prioritization
Historical information about calculated charging prioritization and real information about charging stations. This information is stored to determine the difference between the expected charging process and the real charging process. This information will be useful to improve models for charging prioritization.

Historical routes
Historical information about different routes stored in the system, and statistical information.
Historical drivers Historical information about drivers will be used in the driver pattern modeling.

Historical charging stations
Historical information about usage of charging stations.

Historical configurations
Historical information about configuration of prioritization.
Historical periods Historical information about periods configured in the system.

Driver Patterns
Driver behavior is stored in driver patterns. The driver pattern is a model that takes effect over the consumption of a vehicle in route scheduling. The driver pattern affects the calculated SoC calculated for each section of a route; it depends on the terrain topology and traffic data. Driver behavior is calculated according to the historical data of a driver. If historical information about a driver is not available, this pattern cannot be calculated.
The driver pattern consists of the deviation from the original predicted SoC. This pattern considers information about traffic and weather to explain the variation from the original predicted SoC.
Although a default driver pattern can be defined, information about driver patterns is currently unavailable. A default "average" driver pattern can be created when a system has adequate information. Currently, this pattern does not include the utility factor [39] because the EV fleets are treated as mobile loads and they do not include PHEVs. The analysis of utility factor in the proposed scenario is beyond the scope of this paper.

Real-Time Route Scheduling
This module controls several conditions that can modify the current prioritization charging queues. This module notifies any change in the following conditions: • Driver and EV availability. On a route, a driver (or EV) may have an accident or a driver (or EV) may notify temporary unavailability. In this case, the module updates the calendar for the driver (or EV). This new condition takes effect in the prioritization process by a fitness function of evolutionary algorithms. Sometimes, the temporal unavailability of an EV can be notified by the asset management module. • Traffic and roadwork. The traffic and work road modeling are translated into a penalty coefficient for different sections of a route. In this case, the route scheduling algorithm may provide the route with lesser penalties. These penalties take effect on the calculated SoC and the driver selection. The penalty coefficient is stored for each geographical zone and is associated with driver information. If a driver has a very high deviation from the original predicted value, the penalty is increased. This pattern did not consider any information about the origin of the traffic load. The pattern only assigns a penalty coefficient according to the fluidity of traffic.

•
Weather conditions. The weather conditions would take effect over the SoC module, prioritization algorithm, and asset management module. • Charging station availability. If the higher VPPs can send commands or instructions to limit the consumption or availability of the power supply. In this case, this module updates the unavailability periods of the corresponding charging stations.

SoC Module: Estimation of EV Consumption
The proposed solution is based on the instantaneous SoC value of each EV. These algorithms require an estimation of some consumption according to its planned route and alternative routes to reach different recharging spots. This consumption estimation is supported by a route planning tool. However, these estimations are not trivial and are related to the distance or time of the trip [40,41]. Other factors (e.g., road [42] and vehicle characteristics, traffic [43], driving style [44], and weather conditions) are essential for this estimation. Typical approaches to estimating route consumptions must be reviewed and briefly explain the architecture that supports the main algorithm in this paper. The two approaches can be easily distinguished in the literature: • Knowledge-based models are the most common approach. This type of model performs a consumption characterization based on records of vehicle operations using computational intelligence techniques, such as artificial neural networks (ANNs) [45] and fuzzy neural networks (FNNs) [46]. However, these techniques have the disadvantage of requiring a large amount of data which must contain different conditions to model realistic vehicle behaviors in as many situations as possible.

•
There are analytical models (also known as longitudinal models) that study the necessary energy to move a vehicle by analyzing the losses along its different mechanical and electronic elements [47,48]. Thus, these models are typically more complex than knowledge-based models. However, analytical models do not require as much information as knowledge-based models because their parameters can be characterized based on information provided by a manufacturer (i.e., New European Driving Cycle (NEDC) standards test [49]).
Based on these philosophies and due to the lack of availability of necessary sets of registered data (especially in the initial phases of the project), an analytical model was chosen to estimate the consumption of this system. It provides the different SoCs that are associated with each route stage. This estimation is based on a model that can be divided into two blocks (refer to Figure 4): First block-the µStep driving model (µSDM)-is responsible for estimating the driving profile. This estimation consists of the velocity and elevation profiles accomplished by the analyzed EV. The velocity profile is constructed from the averaged inferred patterns for different situations which are characterized by the different input parameters. The elevation profile is directly estimated from the route information (in each µStep). A complete list of parameters in the model is shown in Table 3.
The second block of the model-the longitudinal consumption model (LCM)-is responsible for estimating the consumptions and SoC variations associated with the velocity and elevation profiles for each µStep. This consumption is obtained by adding the different losses and consumptions that are required to generate these profiles which are associated with the trip. This analysis also considers the vehicle configuration, as listed in Table 3.
The combination of this model (µSDM + LCM) and the initial SoC value makes it possible to estimate of the SoC at the end of a trip or part thereof. Figure 5 shows an example of this process, in which by using the path, car, driver, and meteorology data, the SoC after this route is estimated. Additionally, in this figure, the velocity and elevation values are also shown (intermediate data estimated by the µSDM). • There are analytical models (also known as longitudinal models) that study the necessary 306 energy to move a vehicle by analyzing the losses along its different mechanical and electronic 307 elements [47,48]. Thus, these models are typically more complex than knowledge-based 308 models. However, analytical models do not require as much information as knowledge-based 309 models because their parameters can be characterized based on information provided by a 310 manufacturer (i.e., New European Driving Cycle (NEDC) standards test [49]).

311
Based on these philosophies and due to the lack of availability of necessary sets of registered  Table 3.      Table 3.

329
The combination of this model (μSDM + LCM) and the initial SoC value makes it possible to 330 estimate of the SoC at the end of a trip or part thereof. Figure 5 shows an example of this process, in 331 which by using the path, car, driver, and meteorology data, the SoC after this route is estimated.

Prioritization Algorithm
Three algorithms are proposed to prioritize the charging queues: • Genetic algorithm (GA).

•
Genetic algorithm with evolution control (GAEC) based on fitness evolution curve. • Swarm intelligence based on particle swarm optimization (PSO).
These algorithms were applied in the same scenario and different layers to determine the best combination of algorithms.
The application of these algorithms is performed after a preprocessing stage after the following steps: 1.
The routes are sorted by starting timestamp, route distance, and ending timestamp.

2.
The vehicles are sorted by range or battery capacity. 3.
The drivers are sorted according to the difference between the real and expected routes, in ascending order. The new drivers or drivers without historical information are positioned in first place.

4.
The charging stations are ordered by connector type according to the estimated charging period.

Genetic Algorithm (GA)
The genetic algorithm (GA) [50,51] is a bioinspired algorithm. This algorithm is based on the evolution of populations in which only the best individuals survive. Everyone from a population is a possible solution to a problem, and a fitness value is assigned according to an indicator that determines the distance from the final solution. In each evolution, a new generation from the previous population is created based on cross, mutation, and selection processes. After some evolutions (iterations), the algorithm converges to a best solution or a solution that complies with the threshold. Algorithm 1. Genetic Algorithm (GA): size p of population (P(t)), rate q of elitism, rate c of crossover (default 0, 9), and rate m of mutation (default 0,1).
Save them in the population P(t), 3.
Evaluation of the population P(t); thus, the fitness of each solution of the population P(t) are determined. 4. Repeat a. Select parents from the population P(t), number of elitism n e = p*q. b.
Perform the crossover on parents by creating the new population P(t+1) with the probability c. c.
Perform mutation of the population P(t+1) with the probability m. d.
Evaluation the population P(t+1); thus, the fitness of each solution of the population P(t+1) are determined. e.
If the stopping criteria are true, then return to step 4.a; otherwise, proceed to step 5.

5.
If the threshold is active then obtain all solutions for which the fitness value complies with the threshold; otherwise, obtain the best solution (the best evaluation value).
The stopping criteria is specified in the configuration of the prioritization algorithm.

Genetic Algorithm with Evolution Control (GAEC) Based on Fitness Evolution Curve
The GAEC is a genetic algorithm with additional restrictions that influence the probability of mutate and cross operators according to the fitness evolution curve. The fitness evolution curve is created in each evolution and stores the best fitness value of each evolution. The angle of the tangent line in each point of the fitness evolution curve determines the probability of the operators.

Algorithm 2. Genetic Algorithm with Evolution Control (GAEC):
size p of the population (P(t)), rate q of elitism.
Save them in the population P(t), 3.
Evaluation of the population P(t); thus, the fitness of each solution of the population P(t) are determined. 4. Repeat a. Select parents from the population P(t), number of elitism n e = p*q. b.
Perform the crossover on parents by creating the new population P(t+1). with the probability based on the absolute value of the sine of the angle of the tangent line to the fitness evolution curve. c.
Perform a mutation of the population P(t+1) with the probability based on the absolute value of the cosine of the angle of the tangent line to the fitness evolution curve. d.
Evaluation the population P(t+1); thus, the fitness of each solution of the population P(t) are determined. e.
If the stopping criteria are true, then return to 4.a; otherwise, proceed to 5.

5.
If the threshold is active, then obtain all solutions for which the fitness value complies with the threshold; otherwise, obtain the best solution (the best evaluation value).

Particle Swarm Optimization (PSO) Algorithm
The prioritization algorithm works as a swarm intelligence algorithm. The application of the algorithm is performed after a preprocessing of information.
The prioritization algorithm is based on the parametric optimization until a solution is obtained. This optimization is executed depending on the capabilities of a system. The algorithm employs a PSO to establish the initial prioritization for the charging stations in the company area. The canonical PSO model consists of a swarm of particles, which are initialized with a population of random candidate solutions. They iteratively move through the d-dimension problem space to search the new solutions, where the fitness f can be calculated as the certain qualities measure. Each particle has a position that is represented by the position-vector x id (i is the index of the particle, and d is the dimension)) and a velocity represented by the velocity-vector v id . Each particle remembers its best position in the vector x i# and its j-th dimensional value is x #ij . The best position-vector among the swarm is stored in the vector x * , and its j-th dimensional value is x *j . At the iteration time t, the update of the velocity from the previous velocity to the new velocity is determined by Equation (1). The new position is determined by the sum of the previous position, and the new velocity is determined by Equation (2).
where c 1 and c 2 are constant weight factors, p i is the best position achieved by particle i, p g is the best position obtained by the neighbors of particle i, ψ 1 and ψ 2 are random factors in the [0,1] interval, and w is the inertia weight. Some references denote c 1 and c 2 as the self-recognition component and the coefficient of the social component, respectively. Different constraints can be applied to ensure convergence of the algorithm. In the cases proposed in this paper, the stopping criteria are based on a fitness threshold.
Calculate the fitness values for each particle. b.
Is the current fitness value better than p i ? i.
Yes. Assign the current fitness as the new p i . ii.
No. Keep the previous p i . c.
Assign the best particle's p i value to p g . d.
Use each particle's velocity value to update its data values.

Configuration of Prioritization Algorithms
The system enables different restrictions to be specified for the prioritization algorithm: • Time interval to prioritize (one day by default).

•
External charging. The system may accept a charging request from the DVPP. • External charging priority. The system will assign the first available slot in the queues to the external vehicles; however, the system moves the vehicles of the SBVPP (if possible). • Partial charging. The prioritization algorithm may accept the queue calculation based on the energy needs of a route. This option takes effect over the asset management system and the predictive maintenance of vehicles.

•
Possibility of reuse drivers. A driver may be assigned to one or more routes and vehicles on the same day. The routes must be separated by time.

•
Possibility of specifying periods of unavailability of charging stations. Time periods at the charging stations may be established or reserved. This option is employed by the predictive maintenance of the charging stations of the asset management system to establish non-periodical maintenance.

•
Possibility of specifying periods of unavailability of vehicles. Time periods of the vehicles may be established or reserved. This option is employed by the predictive maintenance of the vehicles of the asset management system to establish non-periodical maintenance.

•
Possibility of specifying periods of unavailability of drivers. Time periods for drivers may be established in case of time off for sick or medical leave. • Driver rest periods along a route. Driver rest periods along routes are set to two hours by default. • Driver rest periods between different routes. This period is dependent on the reuse driver parameter and the driver rest periods along a route. Thus, this time considers the last rest period for a driver along a route.

•
Rest periods between vehicles that charge at charging stations. This time is configured in the system to establish the time invested in disconnecting a vehicle and connect the next vehicle.

•
Maintenance periods for charging stations. The periods specified for this parameter are periodically performed.

•
Maintenance periods for vehicles. The periods specified for this parameter are periodically performed. These parameters can be modified while the algorithm is running. These parameters take effect over the convergence of evolutionary algorithms because the parameters can modify the fitness function.
The evolutionary algorithms are based on an iterative algorithm. In this case, the proposed algorithms have several similarities. These algorithms have stopping criteria to control the iterative part of the algorithm. In the proposed algorithms, the end criteria can be configured by the user by specifying one or more parameters: • Maximum number of iterations: the optimization process is terminated after a fixed number of iterations.

•
Number of iterations without improvements: the optimization process is terminated after a fixed number of interactions without any iterations without any improvement.

•
Minimum objective function error: the error between the obtained objective function value and the best fitness value is less than a prefixed anticipated threshold.
The value of these parameters is dependent on the size of the search space and the complexity of the problem. These values are established by the default value according to the number of vehicles, number of drivers, number of routes, and number of charging stations, as well as the system characteristics in the installation stage. Other parameters in the PSO algorithm are dependent on the same parameters: • Maximum number of particles (swarm size or number of neighbors). This parameter establishes the maximum number of particles that are generated in the prioritization algorithm based on the particle swarm optimization (PSO) algorithm.

•
Maximum velocity (v max ) for the PSO algorithm [52] to ensure convergence. If this parameter is set to 0, a maximum velocity will not be obtained.

•
Maximum particle position (x i,max ) for the PSO algorithm [52] to retain the value of the particle position between [−x i,max , x i,max ]. If this parameter is set to 0, a maximum position will not be obtained.

•
Inertia weight (w) for PSO algorithm. A large inertia weight favors a global search, whereas a small inertia weigh favors a local search. If inertia is applied, it is sometimes linearly decreased during the iteration of the algorithm, beginning at an initial value that is close to 1.

•
Modifiers for random number generation. A GA and GAEC have similar parameters: Only in a GA, the operator probabilities (mutation and crossover). These operators have a default value (0,1 for mutation and 0,9 for crossover); different values can be set.
These factors are employed in the algorithm to fix the evolution of each particle and dimension, in the case of PSO, or everyone in a population, in the case of a GA and GAEC. The previously defined parameters and the parameters defined in this section can modify the convergence of an algorithm. These parameters are automatically adjusted in each evolution and running.

Fitness Function
The fitness function is calculated to test the validity of a particle. The fitness function is based on the following items: • The number of routes that have been assigned a vehicle and driver for the time requirements to perform the route. The first routes in time will have greater weight than the other routes.

•
The number of routes that are assigned a vehicle and driver but exceed the time requirements to perform the route are significantly penalized.
Additionally, the parameters that are configured in the system can modify the final fitness value that is calculated for each solution: • Queue balancing of a charging station. Standard deviation but with the total number of vehicles assigned to a route divided by the total number of charging stations. • External charging. If external charging is configured, the system multiplies the fitness value by the total number of vehicles with external charging divided by the total number of vehicles assigned to a route. Several of these configurations can change at any time. Thus, the fitness value can change for each generation of evolutionary algorithm.
The proposed fitness function is performed in the proposed evolutionary algorithms. Thus, the fitness value is normalized in the interval [−1,1]. This fact simplifies the comparison of different options.

Experimental Results
The proposed algorithm was tested in different scenarios. These scenarios were simulated using a computer. Several entities are created: • Two smart business parks (A and B) with separate EV fleets. Company A is a company in the logistics sector, and company B is a company in the transport sector.

•
Three public charging stations. • Five private EVs.
From the point of view of the power market: • Two power retail companies. The first retailer has a contract for supply to company A. The second retailer has a contract for supply to company B. The retailer has three contracts for supply to private consumers.

•
One power distribution company.

•
An EMS is simulated. This system is configured to randomly generate a power consumption command in the EVPP. This power consumption command takes effect on 343 routes: 137 routes from company A and 206 routes from company B. This power consumption will be generated after a solution is obtained to assess the algorithm and address any changes in conditions. • Companies A and B have an SBVPP. The characteristics of these companies are listed in Table 4. For each driver, EV, and charging station, some periods of unavailability are defined to check the capability of the algorithms to manage these contingencies.

•
In this case, the private consumers are managed by the RVPP. In future research (refer to Section 8), the system will attempt to include a consumer VPP. The proposed solution is evaluated by checking two aspects; both aspects are evaluated in the general best fitness curve: • Convergence time (t c ). Time to reach a solution. The convergence time is measured in number of generations.

528
The proposed solution is evaluated by checking two aspects; both aspects are evaluated in the 529 general best fitness curve:      The general best fitness curve for each scenario is shown in Figure 6. The first part (until generation 20) of the curve is the search of the best solution to schedule the routes (1000 routes). The corresponding number of scheduled routes is shown in Figure 7. After the best solution is obtained, the simulated EMS randomly generates several commands in each scenario. In the case of the GA scenario, the command was fired in generation 22 ( Figure 6) with 515 scheduled routes ( Figure 7); in the GAEC scenario, the command was fired in generation 23 with 675 scheduled routes; in the PSO scenario, the command was fired in generation 28 with 855 scheduled routes; and in the hybrid scenario, the command was fired in generation 42 with 755 scheduled routes. Although the command takes effect in the same 343 routes in all scenarios, the results did not agree with the fitness value ( Figure 6) and the number of scheduled routes (Figure 7) between different scenarios. When the command is fired, the fitness is updated with the new restrictions. This updating changed the value of the best solution by converting it into another solution with lower fitness. In the population (in the case of GA and GAEC) or swarm (in the case of PSO), several solutions were re-assessed. Although some solutions were not the best solutions in the initial scenario, after the command was fired, the new fitness value improved, and the solutions were sorted according to this new assessed fitness.
In the same manner, the transient time is less than the initial part of the algorithm because the current solutions are disseminated in the space of possible solutions. Thus, the solution is obtained at a faster rate.
According to the results, some conclusions are formed: • GA and PSO exhibit the best trend. • GAEC performs better in transient situations.

•
The hybrid solution obtains better results because it takes advantage of all evolutionary algorithms.
One of the most interesting effects is shown in Figure 6 in GAEC (fitness GAEC) scenario. This algorithm has several steps. In these steps, the mutation probability is increased, and the crossover is decreased. This fact disseminates the solutions in the space of possible solutions, which increases the probability of obtaining better solutions. In Figures 6 and 7, the convergence of the fitness GAEC is better than the others. Although, the hybrid solution shows the best results, as shown in Table 5, this algorithm includes GAEC and others. The usage of GAEC or the same algorithm in all VPPs will simplify the deployment of proposed architecture. Table 5. Evaluation parameters for each scenario. GA, genetic algorithm; GAEC, genetic algorithm with evolution control; PSO, particle swarm optimization.

Test Scenarios t c (Number of Generations) t t (Number of Generations)
Only

Conclusions
A novel solution for the distributed prioritization of charging station queues is presented in this paper. This novel solution provides several contributions to the state of art: • A model for the implementation of VPP, based on the interaction between different roles in the power supply: transportation, distribution, commercialization, and consumption (especially in the case of companies with EV fleets).

•
Organizational chart functionality according to the level of VPP.

•
Several distributed prioritization algorithms to manage the queues for private and public charging stations.
A comparison of several evolutionary algorithms with the same fitness function. The proposed solution provides additional results: • A scalable framework to manage the EV fleet, to improve the efficiency in its management. • A model of mobile load inside a power grid. The algorithm provides a load forecasting of mobile loads (storage or resources) and it calculate again in real time in case of unexpected incident or an additional EV is added.

•
The reductions of emissions by vehicle fleet are about 75.2% compared with the conventional vehicles with fossil combustible. Additionally, the forecasting of mobile loads provided to the energy management systems could reduce the peaks in demand curve, decreasing the emissions by using cycled combined (which usually are based in fossil combustibles).

•
The comparison between different energy management scenarios showing the Hybrid solution as the best solution to different scenarios.

•
The aggregation in different levels decrease the response time of system at different levels, allowing to respond in real time. On the consumer side, the EV is charging with minimized waiting periods. On the retailer side, the retailer can offer different rates and services according to the demand forecasting. In the distribution and energy side, the asset management, the energy flow, and the demand peak shaving are simplified based on demand forecasting.

•
The reduction of waiting time to charge the EV. The prioritization considers the minimization of the waiting time.
Although the usage of EVs can be an excellent solution for decreasing pollution, it may cause serious problems in the power grid. Several solutions can be applied to solve this problem. In this paper, the proposed solution is to establish prioritization queues that enable control of the mobile loads or EV charging by taking advantage of the fact that this EV can only be plugged into charging stations. This type of knowledge can help energy management systems and other participants of power distribution to maintain a high quality of service and supply. Additionally, this knowledge provides information for distributed energy resource management system in the case of an alarm or emergency; in this case, the battery of EV (V2G) can serve as energy storage and support the needs of the power grid.

Future Research
Future research is based on the evolution of the solution and focuses on several topics:

•
Develop an asset management system.

•
Test the solution for personal EV vehicles in the prioritization process. The consumer VPP for an EV is in development.

•
Update the fitness function to provide additional functionality in the emergency mode of the power grid.

•
Develop a new algorithm to provide the best configuration options for the corresponding VPP.

•
Develop a demand response management system to integrate an energy and capacity market based on blockchain and big data technologies.

Conflicts of Interest:
The authors declare no conflict of interest.