Local Electricity Markets for Electric Vehicles: An Application Study Using a Decentralized Iterative Approach

Local electricity markets are emerging solutions to enable local energy trade for the end users and provide grid support services when required. Various models of local electricity markets (LEMs) have been proposed in the literature. The peer-to-peer market model appears as a promising structure among the proposed models. The peer-to-peer market structure enables electricity transactions between the players in a local energy system at a lower cost. It promotes the production from the small low–carbon generation technologies. Energy communities can be the ideal place to implement local electricity markets as they are designed to allow for larger growth of renewable energy and electric vehicles, while benefiting from local transactions. In this context, a LEM model is proposed considering an energy community with high penetration of electric vehicles in which prosumer-to-vehicle (P2V) transactions are possible. Each member of the energy community can buy electricity from the retailer or other members and sell electricity. The problem is modeled as a mixed-integer linear programing (MILP) formulation and solved within a decentralized and iterative process. The decentralized implementation provides acceptable solutions with a reasonable execution time, while the centralized implementation usually gives an optimal solution at the expense of reduced scalability. Preliminary results indicate that there are advantages for EVs as participants of the LEM, and the proposed implementation ensures an optimal solution in an acceptable execution time. Moreover, P2V transactions benefit the local distribution grid and the energy community.


INTRODUCTION
Despite the pandemic that largely affected the automotive industry in 2020, the electric vehicle (EV) and renewable energy industry performed remarkably well (Lieven 2021;Wan et al., 2021). In fact, EV sale numbers in Europe increased to record numbers and all-time highs (up 137% from 2019), while the overall automotive industry was down by 20% year on year (Irle 2021). Most oil energy companies quickly shifted investments toward renewable energy projects and became more ESG 1 -oriented, anticipating an earlier oil use peak (Strauch et al., 2020). The quicker energy transition motivated by the pandemic, the need to foster job creation, and new opportunities in the industry flag the importance to accelerate the conditions to accommodate a large penetration of EVs (Barbier 2020).
Most researchers agree that a large number of EVs in the grid will bring new operational challenges but also new opportunities (Fotouhi Ghazvini et al., 2019;Chung et al., 2019;Das et al., 2020). Challenges may include distribution lines and transformers' capacity limitations, overheating and overvoltage issues, bidirectional power flows (vehicle-to-grid), and market price increases (Gesevičius et al., 2021). Opportunities will include new business models, no-upfront cost grid services, improved renewable energy use, etc.
In this context, local electricity markets (LEMs) have been proposed as an effective tool to mitigate some bottlenecks of renewable and EV penetration in local distribution grids. Local markets are emerging in order to facilitate energy transactions among small producers and consumers in nearby energy communities (Mengelkamp et al., 2017). Their emergence is not targeting the replacement of wholesale markets and the retailing activity, but rather coexistence (Lezama et al., 2019a). Aggregators can participate in a LEM via load and EV aggregation as well (Lezama et al., 2019b;Masood et al., 2020). Among the different LEM models that have been proposed in the literature, the peer-to-peer (P2P) market model appears as a promising structure to reduce costs (Z. Zhang et al., 2020;Faia et al., 2021a).
A previous work proposed a centralized model to solve the optimal energy trading in a LEM between prosumers and EVs (Faia et al., 2021b). However, the scalability of the adopted centralized model is not enough, and the data privacy can be easily compromised. We believe that decentralized models can be a viable alternative to overcome issues previously raised, given the reduced number of resources involved in energy communities compared to region-wide scale problems. Therefore, a decentralized iterative approach is proposed in this study to solve energy management problems, considering the possibility of transactions in a prosumer-to-vehicle (P2V) market, thus enabling the prosumers to sell the surplus electricity production and to charge the EVs at a lower price than the retail market price. The price of electricity in the P2V market is assumed to be the most advantageous for both parties. The proposed model provides the integration of RESs and the empowerment of electricity end users in the power system, namely, by allowing prosumers and EVs to interact within the P2V market. The case study considers 90 players, composed of 50 domestic prosumers and 40 EVs; three different models of domestic battery systems; and seven different models of EVs. Real electricity tariffs from a Portuguese retailer and current feed-in tariff in the country are used in the case study. The main contributions of the study are as follows: • A decentralized and iterative process is developed to determine electricity transactions among prosumers and EVs in a P2V market.
• Considering the reduction of the feed-in tariff, the proposed approach allows prosumers to have another option to sell electricity at higher price. • Development of optimization models (prosumers and EVs) that include realistic constraints, prosumers load and generation profiles, photovoltaic (PV) systems, energy storage systems, and real and updated EV models.
The article is structured in six sections including this introductory section. A literature review is given in Literature Review. Proposed Methodology presents the proposed methodology, namely, formulation and the coordinator decision process. Case Study presents the details of the case study. Finally, Results presents the results and its discussion, while Conclusion and Future Works provides the conclusions of the article.

LITERATURE REVIEW
Different designs of the LEMs and the market analysis of the proposed models have been presented in the literature. Absorbing the output of local generation from renewable sources by the flexible demand has been widely investigated. A P2P local electricity market model is developed in Z. Zhang et al.'s (2020) study which considers local energy trading and the uncertainty of the demand and PV generation. In this model, the load flexibility is characterized by time and power flexibility. The results reveal that this model could be used to enable the local balancing of the PV forecast power and the uncertain demand, while both consumers and PV owners could benefit from the local P2P market.
The P2P energy trading mechanism has also been used to coordinate the distributed energy generation and consumption (Matamoros et al., 2016) and the trading among the peers in a distribution network. C. Zhang et al., (2018) proposed an innovative platform for P2P energy trading using the game theory. The test results in a microgrid show that P2P trading can improve the local balance of consumption and generation. This trading mechanism can promote increased penetration of renewable energy sources in the grid.
A local electricity market model is developed in Saether et al. (2021) to enable P2P electricity trading for a community of industrial buildings. The impact of local flexibility on the usage of DER technologies was investigated in that work; moreover, the contribution of the local market to peak demand management was assessed. The authors showed that the local market approach leads to more local usage of the distributed resources, eliminating the need to curtail DER power and reducing the grid feed-in.
A contract-based framework to enable local energy trading for electricity suppliers in different categories (i.e., small, medium, and large suppliers) is developed in Oprea and Bâra (2021). The model helps the suppliers obtain optimal contracts and trade the surplus power with an aggregator in a hierarchical electricity trading system. The distributed algorithm for electricity trading guarantees the optimal utility of both parties in various trading scenarios.
A day-ahead local energy market model is developed in Elbatawy and Morsi (2021) in which the residential consumers with home battery storage are the main participants. It uses the utility's distributed energy management system and the home energy management system based on the existing intercommunication system. Moreover, the provision of grid services, such as voltage support, transformer management, and phase balancing, as a result of this transactive market model, is investigated. The results show that the proposed market can contribute to grid services, while increasing the profits of the residential consumers.
Different auction mechanisms for the trade of electricity in a local market using blockchain mechanisms were investigated by Oprea and Bâra (2021). Suitable auction mechanisms for blockchain are proposed along with an adjustment of the price for both sellers and buyers after the initial clearing of the market at the classical auction levels. The simulation results show that this approach could improve the trading performance indicators.
The impact of local electricity trade on the operation of the distribution network is investigated in Lüth et al. (2020). It is concluded that exempting local trade and self-consumption from taxes could create distributional effects. That work proposes a novel market design that requires few legal amendments on the ownership and participation of renewable technologies to avoid the distributional effects of local markets, making them more attractive for the prosumers and consumers.
The work of Mustafa, Cleemput, and Abidin (Mustafa et al., 2016) provides security analysis for a proposed model of a local electricity market considering the privacy requirements of the users. Each user in this model buys or sells electricity in the local market via the supplier, and the supplier charges the user only for the electricity supplied to them by the grid and pays to them only for the exported electricity that was not traded in the local market. In this model, the DSO will also access the imported and exported electricity by all the users per supplier for each settlement period.
The aforementioned works indicate the potential of LEMs to benefit producers and consumers in energy communities. Nevertheless, further research on decentralized models is required to overcome scalability limitations when multiple agents are involved. Thus, Proposed Methodology presented the proposed methodology based on optimization models solved in a decentralized way.

PROPOSED METHODOLOGY
In this section, the details of the model used to characterize the transactions among the local prosumers and EVs are presented. The optimization models for prosumers and EVs are presented first and then the iterative process proposed for ensuring the balance in the P2V market is explained. The proposed methodology constitutes two different optimization models: prosumer model and EV model. Both of them are formulated as a MILP problem with the possibility of energy exchange among the retailers, the distribution grid, and the P2V market. It is assumed that EVs are able to buy electricity from a retailer or the P2V market. The models also consider the energy management system properties, using storage systems to obtain the best options for the user. Figure 1 presents the model scheme of the implemented methodology.
As can be seen in Figure 1, in the implemented model, the prosumers can buy electricity from a retailer and sell to the main grid or in the P2V market; on the other hand, the EV can buy electricity from the retailer or directly from prosumers.

Formulation
The formulations are presented for each of the three agents: prosumers, EVs, and the coordinator in the respective subsections.

Prosumers
The prosumer operation is represented by the minimization of its energy costs across a set of time periods. Each agent i belonging to the set {1, . . . , Ni} optimizes its energy costs according to Eq. 1 and subject to Eqs 2-23. Decision-making is done in a decentralized way, which means that each prosumer solves its own optimization process.
where Pro Costs i represents the energy costs for the prosumer, P Retailer buy i,t represents the electricity bought from a retailer, ToU i,t represents the time of use tariff contracted by the prosumer to the retailer, P Grid sell i,t corresponds to the electricity sold in the distribution grid, fit is the feed-in tariff, P P2V sell i,t represents the electricity sold in P2V market, p P2V is the price of electricity in the P2V market, Δt represents the time adjustable parameter, FC i corresponds to the daily fix cost paid by the prosumer, and Nt corresponds to the total number of periods. Indices t and i represent the respective period and prosumer. Eq. 2 presents the power balance for prosumer agent i.
where P Gen i,t represents the electricity generated by the prosumer, P Dch i,t represents the electricity discharged from the prosumer battery, P Load t,i corresponds to the load demanded by the prosumer, and P Ch i,t corresponds to the electricity charged by the prosumer battery. Eqs 3-5 simulate the prosumer's transactions. where P Buy i,t represents the maximum buying limit for the prosumers, X Retailer buy i,t corresponds to the binary variable for the buy action, P Sell i,t represents the maximum limit for the sales actions, X Grid sell i,t is a binary variable for the sale on-grid actions, P Sell P2V i,t represents the maximum limit for the sales on P2V market, and X P2V sell i,t represents the binary variable for the sales on P2V market. Eqs 6, 7 represent the prosumers' restrictions for buying and selling electricity.

P Retailer buy
X Retailer buy where Eq. 6 avoids simultaneous purchase from the retailer and selling to the grid. Eq. 7 also controls simultaneous purchase from the retailers and selling to the P2V market. Sells to the grid and the P2V market can occur at the same time in this model. Eqs 8-10 control charging and discharging decisions of the prosumers.
where P Ch i,t represents the maximum limit for the prosumers charge battery, X Ch i,t represents the binary variable for the charge action, P Dch i,t corresponds to the maximum limit for the battery discharge of the prosumer, and X Dch i,t corresponds to the binary variable for the discharge action. Simultaneously, only one action (charge and discharge) is possible and the binary variables control these actions. Eq. 11, 12 model the state of charge of the storage unit.
where SoC Bat i,t represents the state of charge of the storage unit, SoC Bat Init i represents the battery unit's initial value; ef Ch i and η Dch i represent the efficiency of charge and discharge of the battery unit, respectively. Equations 13-23 present the limits for the optimization variables of prosumer's operations.
where SoC Bat i,t and SoC Bat i,t represent the maximum and minimum capacity of the battery unit, respectively.

Electric Vehicles
This section presents the optimization model for the EV agents, which minimizes the daily operation cost through Eq. 24.  · ToU j,t + P P2V buy where EV Costs j represents the costs for EV, P EV Retailer buy j,t corresponds to the electricity bought from a retailer, ToU j,t is the time of use tariff, P P2V buy j,t represents the electricity bought in the P2V market, p P2V corresponds to the price of electricity in P2V market, FC j represents the fixed costs for EV, and N j represents the total number of EVs. Eq. 25 represents the energy balance for the EVs.
where P EV Ch j,t represents the electricity charged for EV battery. Eqs 26, 27 model the energy balance in EV batteries.
where SoC EV Bat j,t represents the state of charge of the EV battery, SoC EV Bat Init j represents the initial state of EV battery, η EV Ch j represents the efficiency of EV charge action, and P EV Move j,t represents the EV consumption during trips. Eqs 28, 29 limits the EV buying of electricity when they are on trip.
where P EV Buy j,t represents the maximum limit for buying electricity, gives the indication if the EV is travelling (zero) or if is available to charge (one), and P EV P2V Buy j,t represents the maximum limit for buying electricity in P2V market. Eqs 30-33 present the maximum and minimum limits for the EV operation.
SoC EV Bat where P EV Ch j,t represent the maximum limit for EV maximum charge action and SoC EV Bat j,t and SoC EV Bat j,t represent the minimum and maximum level for the EV battery, respectively.

Coordinator
The coordinator is responsible for the process of ensuring the balance in the P2V market. The coordinator process is based on Eqs 34, 35 and applies four sequential rules. The first two rules limit the periods for prosumers' sells (Eq. 36) and EV buys (Eq. 37), respectively. On the other hand, the last two rules limit the amount of buy and sell electricity in periods in which transactions are possible. Eq. 38 limits the maximum amount of electricity that each EV can buy in P2V market, and similarly, Eq. 39 imposes a limit for prosumers' sales.
Eq. 34 presents the energy balance in P2V market.
Balance : To ensure the balance in the P2V market, the aggregator executes four hierarchical rules. Thus, an error is calculated according to Eq. 35 to indicate the difference between the sell and buy energy across all time periods.
The error can be obtained in each iteration of the process and considers the energy sold by the prosumers and bought by the EVs. When the process has been finalized, the value of error should be minimal. Four different rules are created to achieve the minimal error and the convergence of the coordinator process. One algorithm per each rule is presented in order to facilitate the interpretation of the corresponding rule. The first rule is defined in Eq. 36.

Rule1: P
Rule 1 is applied to update the values of EV electricity maximum buy limit in the P2V market for the second iteration. Considering this rule, the EV in the second iteration only can buy electricity in periods when the prosumers are available for sale. Algorithm 1 presents the application process of rule 1.
Algorithm 1. Eq. 37 presents the rule executed for the second iteration.
Rule 2 is applied to the maximum limit of electricity sell in the P2V market for the prosumers side. In this case, in periods where the EVs do not buy electricity in the P2V market, the maximum sales limit for prosumers in this same period is zero. Algorithm 2 presents the application of rule 2.
Algorithm 2. Application of Rule 2 (Eq. 37) Rule 3 in Eq. 38 presents a new update for the maximum buy limit for EV buys in the P2V market.
Using rule 3, the maximum limit for EVs to buy electricity in the P2V market is limited using the quantity available from prosumers. In this case, in each period that there is electricity sold by the prosumers, the maximum limit for the EVs available to buy will be limited. This limitation will be proportional, considering the maximum electricity available from prosumers. Algorithm 3 presents the application of rule 3. Rule 4 limits the maximum electricity sold by prosumers in the P2V market presented in Eq. 39.
In rule 4, the same process of rule 3 is applied, but for the maximum limit for prosumers sells in the P2V market. Algorithm 4 presents the application of rule 4. For i 1: N i 6.
If P P2V sell

Iterative Process
An iterative approach is adopted to solve the coordination process. This is illustrated by the block diagram in Figure 2. The coordinator is responsible for the perfect match between the sales of prosumers and purchases of the EVs in the P2V market. The optimizations of each prosumer and EV are independent, only needing the information of maximum limits for transaction in the P2V market provided by the coordinator.
The coordinator initializes the process, defines the maximum limits for prosumers and EV transactions in P2V market, and passes the information for each prosumer and EV. Both of those agents optimize their energy costs with the provided information of maximum limits for P2V transactions. Those optimizations run in a parallel and decentralized way in which prosumers and EVs receive and send the required data to the coordinator. The latter receives the P2V transaction information and determines the error considering the electricity sold by prosumers and bought from EV. The convergence is tested through two different criteria: the error value obtained by Eq. 35 and the number of iterations. Considering the error, if the value is equal to or less than 0.001 kW, the process converges. On the other hand, when the process is completed, the limit of iterations (five) is reached. When none of the aforementioned conditions is verified, the process proceeds to the next iteration, and the maximum limits for P2V transactions are updated.
The created rules are applied in a sequential mode with respect to the number of respective iterations. During the iterative process, if the error condition is verified, the model converges, and all rules may not be applied. At the maximum, this process has five iterations.

CASE STUDY
To validate the proposed methodology, a case study with a set of 50 residential prosumers and 40 EVs is adopted. 2 In total, the community is constituted by 90 players. All community players have a contract with the retailer to supply the necessary electricity that defines the maximum limit for buying electricity, the maximum limit for injecting electricity into the grid, and the fixed costs. The prosumers and EVs can transact electricity in the P2V market, that is, prosumers' sell and EVs buy electricity, which presents the mean profiles of generation and conventional load.
The profiles presented in Figure 3 are the mean profiles considering the 50 prosumers. The prosumers present a total consumption of 2001.89 kWh and 1,1417.82 kWh of total PV generation, which correspond to a mean of 40.04 kWh of consumption and 28.36 kWh of generation for each prosumer. The prosumer has installed 248.8 kW of produced capacity for PV generation, that is, a mean of 4.98 kW. Table 1 presents the characteristic of batteries used in the prosumers' facilities.
Three different batteries for prosumers are selected in the case study. In total, there are 50 units of batteries, one per each prosumer. The three available battery types are randomly distributed among all prosumers. In total, the prosumers have 715 kWh of storage capacity installed. Table 2 presents the characteristics of EVs used in the case study, while Figure 4 presents the EV profiles. Figure 4A presents the profiles of EV trips; most of the EV trips happen at 8:15 h and 19:45 h (36 trips). In mornings, the EV starts the movements at 6:15 h and stops at 23:30 h at night. Regarding the total number of periods, the EVs make 780 trips, which correspond to a mean of 8.3 trips per period. Figure 4B presents the mean profile of EV consumption. The peaks of consumption are verified in the same peak periods of EV movements.
The seven EV models presented in Table 2 were also randomly distributed within the 40 available EV users. Tesla Model 3 Standard Range + is the most used model. Considering all EVs, they have 1916.60 kWh of capacity. Table 3 presents the tariffs used in the case study. All buy tariffs are obtained in the EDP Comercial Portuguese electricity retailer. Table 3 presents three different tariffs that the prosumers and EVs can contract with the retailer. The users should contract the tariff that best fits their needs. Contracted power corresponds to the maximum power that each user can demand from the distribution grid. Fixed costs are always associated with contracted power value; higher contracted power values are associated with higher values of fixed costs. The price of electricity varies in two different periods in the day. Off-peak period (during 22:15 to 8:00 h) are considered the cheapest periods, while peak time (between 8:15 to 22:00 h) is considered expensive. Regarding the sell tariff, the price is defined as linear and can be found in Ambiente. (2020). The limit for export of electricity to the grid is half of the contracted power. In the set of prosumers, 21 of them selected the tariff with 6.90 kVA contracted power, while in the set of EVs, 16 of them selected the tariff with 13.80 kVA contracted power. Price of the P2V market p P2V is obtained considering the mean between the minimum value of ToU tariffs min ToU j,t and the feed-in tariff. The electricity price of the P2V market is 0.0686 €/kWh, while the minimum EV buy price is 0.0922 €/ kWh and the price of export electricity to the grid (fit) is 0.045 €/kWh.

RESULTS
The results of the proposed methodology applied to the case study are shown in this section. The simulations were performed on a computer with an Intel Xeon(R) E5-2620v2@2.1 GHz processor with 16 GB of RAM running Windows 10. To emulate the optimization problem, a MATLAB 2018a with TOMLAB optimization add-on was used. The CPLEX solver was used to optimize the proposed model. The simulations are carried out for a time horizon of 24 h divided into 96 periods (15 min each). The   load and generation data are obtained through forecasts. Two different scenarios are considered to enable the comparison: scenario A for the possibility of transacting electricity with retailers and the option of exporting to the grid, and scenario B for the possibility of transacting electricity with retailers, the option of exporting to the grid, and transacting electricity in the P2V market. Table 4 presents the optimization results for a centralized approach and the decentralized approach proposed in this work. Table 4 presents the optimization results for the same case study with two different variants (with and without P2V market) and for two different implementations (centralized and decentralized). It was found that the results are the same when the P2V market is not available; however, as expected, the centralized method provides slightly better total costs for the P2V market variant. The only difference is the implementation, which has disadvantages considering the privacy issues. Comparing the two different implementations when the P2V    (Faia, et al., 2021b).
Frontiers in Energy Research | www.frontiersin.org November 2021 | Volume 9 | Article 705066 market is available, the centralized implementation has better results with a minimal difference (0.15% comparing the total costs). Analyzing other indicators' results, different values are presented when considering scenario B in the two different implementations. In the decentralized option, the values of mean prosumer cost decreases (2.04%) and the mean EV costs increase (1.45%). Since each player is trying to make the most advantageous transaction for itself, which leads to a suboptimal cost. On the other hand, in a centralized implementation, the community profit is maximized. In the decentralized implementation, the time presented in each iteration corresponds to the maximum resolution time in the set of all players. Execution times in the decentralized implementation for both scenarios A and B are lower than the times required by the centralized implementation. The big difference and the advantage of the decentralized implementation are verified when the resolution times for scenario B are presented. As can be seen, when the centralized implementation is considered, the resolution time is 144 times greater than the decentralized implementation. Figure 5 shows the convergence of the optimization process. Three different variables are presented in Figure 5, the error (obtained by Eq. 34), the value of prosumers sells in P2V, and the EV buys in P2V. The sales and buys should have the same value. In the first iteration of Figure 5, the EVs are buying more units of electricity than the amount available on the market, corresponding to the prosumers' selling. The electricity sold by the prosumers in the P2V market remains constant in all iterations. However, in the end, the EVs adjust their purchased electricity with what is sold by the prosumers. Throughout the iterations, the amount of purchase of EVs decreases as a result of the application of the rules created, leading the error to zero. In this case, the EVs adapt their actions to the behavior of the prosumers. This is because the amount of electricity available on the part of the prosumers is less than that required by the EVs. Figure 6 presents the electricity transaction of scenario B in centralized and decentralized implementations. The presented results are very similar, although there are differences, mainly in the electricity exported to the grid. Electricity is exported in the centralized implementation, while it is not exported in the decentralized approach. One of the important aspects observed is the value of electricity traded in the P2V market, which is superior to decentralized implementation. Figure 7 presents the transaction on P2V electricity market considering the centralized and decentralized implementation.
As can be seen in Figure 7, the transactions of P2V for the centralized and decentralized solutions have differences. The main difference is related to the period of transaction: in the centralized approach, the transactions occur between 9:00 h and 19:00 h and also between 21:00 and 22.30 h. In the case of decentralized resolution, the transactions occur during 9:00 h to 16:00 h, which corresponds to the PV prosumers' production hours. Figure 8 presents the electricity transaction on grid for the decentralized approach.
Both Figures 8A and B present results for the decentralized resolution, Figure 8A for scenario A, where P2V market is not available, and Figure 8B for scenario B where P2V market is available. The big difference presented in the figures is related to the prosumers' sell to grid values. In the case of scenario A, there are sells to the grid made by prosumers, while in scenario B, all the electricity units available to be sold is sold in the P2V market. Figure 9 presents the mean costs for prosumers and EV of scenario B.
The mean costs for prosumers and EVs regarding the iterations are presented in Figure 9. The mean values for decentralized implementation vary in the case of EV, but in prosumers' case, the value is constant. The mean value of EV increases throughout interactions. In the fifth iteration, the value is higher than the value of the first iteration because they decrease the value of electricity bought in the P2V market, which has a better price for EVs. As the liquidity of electricity is not sufficient for the amount needed by the EVs, they have to buy from the retailer and pay a higher price. Buying at the retailer rates increases the average of electricity costs.

CONCLUSION AND FUTURE WORKS
This study presented a decentralized approach for a prosumer-tovehicle (P2V) market at a local energy community composed of 90  The results using the P2V market mechanism show a reduction in the total energy costs and the average costs of each player's type. Comparing the results of centralized with decentralized implementations, the difference in total costs is minimal, but the optimization time difference is significantly higher. Other issues may arise regarding the centralized implementation, such as data privacy. In the case of decentralized implementation, players perform their optimization and only share the values referring to the P2V market. Cyberattacks can also be an important aspect of decentralized implementation. In the centralized implementation, if a cyberattack occurs, the operation of the system can be stopped, leaving users without service. In the case of decentralized systems, as distributed by the various users, an attack will only affect the targeted user, while others remain safe. The influence of the P2V market depends on the quantity of energy available from the prosumers' side. As can be seen, by using rules created, the EV adapts the electricity bought in the P2V market to the electricity sold to the prosumers in the same market. Most of them have PV installations, and it is possible to assume that enough amount will be available in future. The use of small thermoelectric generation units can be a solution to increase the supply capacity for the P2V market. Still, the higher production costs of those units can be a barrier.
The P2V market allows prosumers to benefit the local distribution grid and the energy community. As a future work, the authors intend to compare this approach with other decentralized methods available in the literature. The authors are considering the possibility to implement the ADMM technique, although the application of this technique involves proof of concepts that sometimes are not possible to obtain and fully prove the convergence of the implementation. Considering dynamic pricing in the P2V market is another relevant aspect worthy to be explored in the future. The inclusion of dynamic pricing in the P2V market can encourage the users to participate in local energy transaction. Participating in such markets could lead to higher benefits for prosumers and the EV owners. In this case, the idea would be to vary the price of electricity in the P2V market with the amount of electricity offered and required. An important aspect that serves as a subject for future work is the study of the vulnerabilities that the system presents in terms of cyber security and the effective mechanisms and measure to protect the users.

DATA AVAILABILITY STATEMENT
The datasets presented in this study can be found in online repositories. The names of the repository/repositories and accession number(s) can be found below: http://doi.org/10. 5281/zenodo.4737293.