A Charge/Discharge Plan for Electric Vehicles in an Intelligent Parking Lot Considering Destructive Random Decisions, and V2G and V2V Energy Transfer Modes

: The random decisions of electric vehicle (EV) drivers, together with the vehicle-to-vehicle (V2V) and vehicle-to-grid (V2G) energy transfer modes, make scheduling for an intelligent parking lot (IPL) more complex; thus, they have not been considered simultaneously during IPL planning in other studies. To fill this gap, this paper presents a complete optimal schedule for an IPL in which all the above-mentioned items are considered simultaneously. Additionally, using a complete objective function — including charging/discharging rates and prices, together with penalties, discounts, and reward sets — increases the profits of IPL and EV owners. In addition, during peak times, the demand for energy from the distribution system is decreased. The performance of the proposed schedule is validated by comparing three different scenarios during numerical simulations. The results confirm that the proposed algorithm c an improve the IPL’s benefits up to USD 1000 and USD 2500 compared to the cases that do not consider the V2V and V2G energy transfer modes, respec-tively.


Introduction
Nowadays, increasing air pollution and the cost of fossil fuels have made people and the transportation industry's focus move toward renewable energies, and electric and hybrid vehicles [1,2]. The unplanned presence of electric vehicles in parking lots causes unfavorable results such as overload, increases in power loss, power fluctuations, increases in EV drivers' costs, increases in parking losses, etc. [3][4][5]. So, EVs can be considered flexible loads for the grid, and using an optimal schedule for their entrance, exit, charging, and discharging not only prevents the above-mentioned disadvantages, but also increases the profits of the drivers, the IPL, and the grid [6][7][8][9]. In this regard, several vital aspects, such as energy savings, economic subjects for vehicle and IPL drivers, peak shaving, etc., should be realized using a proper schedule for the charging/discharging of vehicles. In addition, energy savings reduce the use of fossil fuels in power plants, which is quite effective in reducing air pollution [10][11][12]. Therefore, the charging/discharging schedule of EVs in an IPL is a multi-objective problem requiring an optimal solution based on a trade-off between different aspects and yielding acceptable practical performance [13][14][15]. During IPL planning, vehicle-to-grid (V2G) and vehicle-to-vehicle (V2V) discharging modes are two imperative considerations that have undeniable effects on power demand [16][17][18][19]. On the other hand, the random actions of EV drivers affect the IPL schedule and cause a reduction in its performance. So, while the majority of researchers do not consider this subject, their random actions should be added to the concerns of IPL planning.
The principle of converting electricity to hydrogen and vice versa leads several researchers to use the hydrogen storage systems in IPLs [20,21]. In [20], Razipour et al. present a new model for an IPL and introduce optimal planning of EVs in an IPL considering the hydrogen storage system. Marzoghi et al., in [21], use an electrolyzer and a fuel cell as hydrogen storage systems and investigate optimized management for an IPL. As gas hydrogen storage requires high-pressure values to compress it, nanosystems with a high capacity for electrochemical discharge are needed to store hydrogen. Moreover, considering hydrogen storage systems in IPLs makes their scheduling and operation more complex and costly. So, using the optimization method with consideration of the V2G and V2V modes can enhance the performance of the schedule.
Optimization methods for the charging/discharging of EVs in IPLs have been the topic of several pieces of research in recent years [22,23]. References [24][25][26] present scheduling procedures for several vehicles in an IPL, but they do not consider the V2G or V2V modes. Using Game Theory, the optimized management of EVs is presented in [27]. Kuran et al. present an optimal discharging schedule for EVs in private parking, considering EVs' movements and their parking patterns [28]. Reference [29] uses the genetic (GA) and the particle swarm optimization (PSO) algorithms to find the optimal allocation of EVs in an IPL. Honarmand et al. present a charging/discharging plan for an IPL considering the local generators and photovoltaic systems [30]. Multi-objective optimization methods are also used to yield the best size and place for installing an IPL [31,32]. A quadratic programming technique is presented in [33] to reduce the voltage deviations and power losses. Therein [33], the billing cost of energy purchase is reduced by shifting EV charging from peak times to off-peak times. References [34][35][36] consider the demand response, IPL, renewable energy resources, and energy storage systems together and present a management strategy for EVs in an IPL. However, these papers do not consider the V2V mode and random actions of the EV drivers. Rahbari et al., in [37], consider EVs as an energy storage part of a smart grid and solve the issue of the size and site of IPLs. The main disadvantage of the previous works is that the random decisions of EV drivers in the IPLs are dismissed. In other words, the drivers' random decisions and actions make them break their promises regarding their use of the IPL, such as their entrance and exit times, initial and requested final SOC, battery capacity [38][39][40][41], and demanded hourly charge rate. So, they bring losses for the IPL, EV drivers, and the distributed system, and the penalties for faulty vehicles are missed. To tackle such problems, reference [42] presents an optimal schedule for the charging/discharging of EVs considering EV drivers' random actions. Additionally, the model defines a set of penalties for faulty vehicles and provides rewards for non-faulty EV drivers who do not obtain their rights to the requested charging level. Moreover, regarding the profit of the IPL, the paper defines some transaction costs and registration fees that could increase the satisfaction of the IPL and EV drivers. The main disadvantage of this work is that the V2V mode is not considered, and the penalties and rewards are more comprehensive considering the discharge mode.
This paper extends reference [42] and presents a complete and optimized charging/discharging schedule for EVs in an IPL, including the V2G and V2V discharging modes. Unlike reference [42], this paper embraces the V2V discharging mode, the V2G energy transfer, and EV driver's random actions in the model. Adding the V2V mode makes the systems model more comprehensive than the one described in [42]. In this regard, a complete model of the problem, including the two above-mentioned discharging modes, is introduced, which differs from the model in [42]. Then, a complete set of penalties for the faulty vehicles caused by their driver's random actions is defined. In other words, changing the model causes modifications in the penalty and rewards and needs a completed penalty set. In addition to the benefits to the IPL and EV drivers, the decrease in power demand, especially during peak times, is an essential benefit for the distributed system. In the V2V energy transfer mode, the distribution system benefits the most; on the other hand, the IPL and EVs play leading roles in energy transfer and provide the instaurations and requirements. For the IPLs' and Evs' satisfaction and to attract investment, a complementary set of rewards for vehicles and IPLs are introduced in this paper while adding the V2V discharging mode. This complementary set has not been reported in the literature. The main contribution of this paper can be explained in detail as follows: • As the discharging power is not delivered to the grid in this paper and the powerrequesting vehicles are charged directly, the distribution system is exempt from energy intermediation, and so, its transaction payment to the IPL. Thus, for the first time, this payment is considered as a reward for the IPL to increase the profit of the IPL and encourage investors in this area.

•
For the V2V discharging mode, the distribution system provides a discount for EV drivers that is related to the amount of discharging power. This reward is defined for the first time for in IPL scheduling, increasing the satisfaction of EV drivers and encouraging them to decrease their power demand during peak times by shifting the charging of their EVs to off-peak times using the V2V mode.

•
The profits of the EV drivers, IPL, and distribution system are maximized using the proposed schedule, which has not been performed in this way in the literature before.
In other words, increasing the rewards for the IPL and EV drivers while decreasing the demand during peak times means maximizing their profits.

•
The majority of the reward for non-faulty vehicles that are eligible through incomplete SOC is provided by the fines issued for faulty vehicles.
The rest of the paper can be categorized as follows: The modeling of the problem, including objective functions and penalties, is described in Section 2; Section 3 defines the constraints during planning for EVs in the IPL; numerical analysis and discussions for the three scenarios are carried out in Section 4; and the conclusions are presented in Section 5.

Modeling and Formulation of the Problem
The random actions of EV drivers are a vital aspect of IPL planning that has been missed in previous papers. EV drivers already define their parameters, such as their entrance/exit times, EV's initial/final SOC, battery capacity, and hourly demand charge rate in the days prior to arriving at the IPL. However, their random decisions or actions affect these parameters and the performance of IPL planning. To prevent the losses caused by these actions, they should be considered during scheduling, and several preparations should be made in advance. EV drivers' random actions are explained in [42]. Herein, this section refers to this reference to avoid wasting time.
To increase IPLs' profit, reduce EV drivers' costs, and reduce power demand during peak times, a complete schedule for the charging/discharging of EVs in an IPL considering the V2G and V2V discharging modes and random actions of EV drivers is presented. The main objective of the proposed schedule includes the costs of the G2V, V2G, and V2V modes, as well as the IPL transaction costs. To maximize the profits of EV drivers, a subobjective function is defined, which shows the expected payment for EV drivers in the IPL. In addition, a complete set of penalties for faulty EVs and rewards for non-faulty EVs that are eligible through incomplete charging are imposed in the objective function. Furthermore, a set of discounts for EV drivers for V2V discharging and rewards for the IPL are defined; these are provided by the distribution system to increase the satisfaction of EV drivers and the IPL's investors. For this problem, there are three primary beneficiaries: EV drivers, the IPL, and the distribution system. The allocation of these beneficiaries and their relationship to the proposed schedule's implementation are described in Figure 1.

Main Objective Function
The IPL is an interface between the distribution system and EVs for G2V, V2G, and V2V charging and discharging operations, and measures the transaction costs for each power exchange. In other words, to provide benefits for the IPL for these transactions, proper coefficients should be defined for each power exchange to indicate the amount of payment to the IPL. In this regard, the objective function is defined as follows: where the total number of periods and the total number of EVs are defined by and , respectively. During the period ℎ , 2 indicates the price of power purchased from the distributed system, ℎ , is the power charged by the ℎ vehicle, and B is the coefficient of the IPL's profit from the purchasing power from the distributed system. For the V2G discharging operation, 2 defines the price of power sold to the grid, and ℎ , is the power discharged from ℎ EV to the grid during the ℎ period. The coefficient of the IPL profit from the V2G transaction is described by a. Similarly, are used to define the price and the amount of power purchased by the jth EV from the ith vehicle. Note that as the discharging and charging powers are negative and positive, respectively, they are located in the absolute. In the last two terms, the penalties for loss of opportunity, final SOC failure, initial SOC failure, and arrival time failure are imposed in the main objective function.

Penalties
Because of the random actions of some EV drivers, there are differences between the announced parameters and their realized values. So, some EVs are faulty, and others are non-faulty. To compensate for the effects of these faults, some penalties and rewards should be imposed in advance. The IPL usually sets the plan for charging/discharging EVs for the next day based on the announced information from the EV owners; this includes information such as the entrance and leaving time of EVs, the price of the power at different times, the required power for each of EV at different times, the level of the SOC of EVs at their entering and leaving times, etc. So, breaking these promises causes irregularities in the IPL's plan. For example, if the actual initial SOC value is greater than the initial SOC value announced the previous day, this causes a kind of irregularity in the IPL's plan. In other words, when the actual initial SOC value is greater than the initial SOC value, the IPL may consider an additional unnecessary amount of energy for the EV. This may cause more pressure on grid generation or reduce the charge quotas of other EVs, and in this way, the optimal schedule for all EVs may be unrealized. In this regard, the IPL must consider a penalty for EV owners who break their promises.
The proposed penalties and rewards are explained based on the following concepts: • Because of the mistakes made by the faulty vehicles, the performance of the schedule would decrease, and non-faulty vehicles would not obtain the rights to their charging levels, power trading, or charging times. In this regard, some of the penalties are paid by faulty EVs to the IPL, and the IPL pays some to non-faulty EVs as a reward to reinstate their rights.

•
The proposed schedule considers some flexibility for EV drivers and the IPL. The IPL considers some flexibility in entrance/exit times, the initial SOC of discharging EVs for the V2G and V2V modes, battery capacity, and the hourly demand charge rate. Moreover, for more fairness, the proposed schedule considers some flexibility in the final SOC of EVs. To explain further, the schedule considers some flexible intervals for the values mentioned above, such that if a mistake occurred within the mentioned intervals, the EV would not be considered faulty.

•
The IPL takes a registration fee from EVs when the vehicle drivers define their parameters. If the EVs are present in the IPL on the announced date, the IPL gives it back to the EV drivers, and if the EVs are absent on the announced date, the IPL blocks the registration payment as a penalty for the absent vehicle. • Suppose a faulty vehicle does not obtain its right to charging. In that case, the IPL does not pay the corresponding reward for its charging level eligibility and considers it a secondary penalty for the faulty vehicle.

•
To increase the satisfaction of EV drivers and the IPL investor, the distribution system considers some rewards for them. The distribution system considers discounts for EV drivers who use the V2V discharging mode, which helps to shave the power demand during peak times. In addition, the distribution system pays a reward to the IPL as a result of the money saved. In other words, in the absence of the V2V mode, the IPL is an interface between discharging EVs and the grid to inject the power to the grid and use it to recharge other EVs. As seen from Equation (1), for these transactions, the distribution system pays a fee to the IPL. However, in the presence of the V2V mode, the mentioned power is delivered directly from the discharging EV to the charging EV. So, the above-mentioned transaction payment is prevented, and the distribution system pays it to the IPL as a reward for attracting investors to the area.

Loss of Opportunity Penalty
Each EV can trade power between peak and off-peak times in the proposed plan. If EV drivers cannot have this right because of the random actions of other EVs or non-optimized planning, the schedule considers a fine for this loss of opportunity (LOC). The cost of LOC for the ℎ vehicle is extracted as follows [37]: where the expected payment of the ℎ EV to the IPL is defined by . Additionally, is the actual payment that the IPL receives from the ℎ vehicle and is derived as follows [37]: where and are the entrance and exit times of the ℎ vehicle, and in the period ℎ , , ℎ , and , ℎ , indicate the actual charge and discharge power of the ℎ vehicle, respectively.

Final SOC Failure Penalty (FSOCFP)
This fine is defined to compensate for the lost rights of EV drivers regarding their EV's final charge level. In other words, when the final SOC of each EV is less than the required value announced to the IPL the previous day, this penalty is considered for the IPL to compensate for the dissatisfaction of the EV drivers. The following equation describes the formulation of this penalty.
where the expected and the actual charge of the ℎ vehicle that departs from the IPL are shown by , and , , respectively. , is the difference between the two above-mentioned charge levels and indicates the dissatisfaction of the EV drivers. If , is greater than the charge rate in one hour, its cost should be calculated by the maximum price ( 2 , ) for which the ℎ vehicle can purchase the power from the distribution system presented in the IPL. Moreover, a flexible interval of as much as 1 kWh is considered for the IPL so that if , is less than 1 kWh, the IPL is exempt from the penalty.

Initial SOC Failure Penalty (ISOCFP)
Unlike the previous case, if there is a difference between the announced initial SOC by the EV driver and its actual value, the faulty EV driver would be fined according to the following equation: This penalty is defined for faulty EVs that intend to discharge the power to the grid. So, ( 2 , ) shows the maximum price of power that an EV can sell to the distribution system, and it is accounted for when the difference between the actual ( , ) and expected ( , ) SOC of the arriving EV is more than the maximum charge rate. , describes this difference.

Parking Time Failure Penalty (PTFP)
The times of entering the IPL and exiting from it are among the declared parameters that are affected by the random actions of EV drivers. In this case, the following equation describes the penalty for faulty EVs: In this equation, the actual arriving and departure times for the ℎ vehicle are , and , , respectively. Moreover, the expected times for this vehicle when entering or exiting the IPL are , and , , respectively.

Sub-Objective Function
To maximize the profits of EV drivers, their expected payment to the IPL should be minimized. The following equation indicates the expected payment, which is calculated by the summation of payment for charging and discharging power, where, for the ℎ vehicle, show the expected charge and discharge power during the ℎ period.

Random Decisions
The problems related to random decisions here are: deciding how to impose the consequences of EV owners breaking their promises on the announced parameters to the IPL and deciding what rules, including rewards and penalties, must be defined for EVs in order to prevent messing up the optimal schedule. There are two categories of mistakes for EV owners: 1. In the first case, the EV will enter the IPL during the day while the driver is breaking the parameters announced the previous day. In this case, a penalty will be considered for this EV. The announced parameters that the EV owners send to the IPL the previous day are the entrance time to the IPL, the leaving time, the duration of their stay in the IPL, the initial SOC of the EV, and the final SOC when leaving the IPL. So, if an EV driver breaks the defined parameters, the EV will be considered a faulty vehicle and will not be satisfied by the fulfillment of its requests, such as final SOC. In other words, the faulty EV disrupts the schedule of the IPL and other vehicles. 2. In the other case, the EV does not enter the IPL at all, while the previous day, it was registered to attend the IPL. Such EVs are considered completely faulty vehicles. In this paper, the IPL's schedule considers a registration fee that the EV owners pay the previous day when they are defining their required quantities. If an EV does not enter the IPL, due to messing up the plan of the IPL and causing missed opportunities for other EVs, this payment will be kept by the IPL as a penalty. On the other hand, this payment will be paid back to EVs that enter the IPL as planned.

Constraints
To solve the problem, the following limitations are imposed: 1. It is impossible to charge and discharge the EV's battery pack simultaneously.
where the charging or discharging modes of the ℎ vehicle are binary.
2. For the ℎ vehicle, the charging and discharging rates per hour are limited to their maximum values.
where 2 , and 2 , are the maximum charging and discharging powers.
3. The exchange of power between the IPL and the distribution system per hour is limited.
where 2 , is the maximum power that the grid sells to EVs and 2 , is the maximum discharging power from an EV to the grid. 4. For battery life and health considerations, the following constraints are described for the battery SOC.
In which is the minimum SOC, is the maximum SOC, , is the SOC of the ℎ vehicle during the t m period, 2 is the charge efficiency, 2 is the discharge efficiency, and Δ is the length of each period.
In Table 1, a summary of this section has been collected to highlight the possible advantages of IPL planning. In addition, some of the advantages of existing studies have been considered to show a full comparison of the proposed method with the existing studies.

Results and Discussion
To verify the performance of the proposed schedule, a set of simulations are performed in three different scenarios. The scenarios are designed in three steps. In the first scenario, the charging/discharging schedule considering the V2G discharging mode and random actions of the EV drivers is investigated. In this step, a set of penalties, including FSOCFP, ISOCFP, PTFP, a registration fee, a secondary penalty, and flexibility for the IPL and EV drivers, are defined, and the performance of the schedule is investigated. The main contributions of the paper are analyzed in the second and third scenarios. Scenario 2 investigates the effect of imposing the V2V discharging mode in the previous scenario. So, a schedule considering the V2V and V2G discharging modes, the random actions of EV drivers, and the set of penalties and rewards are considered concurrently. In the third scenario, a complementary set of rewards for the V2V mode are imposed on the last schedule in scenario 2, and its effects are investigated. In other words, scenario 3 is defined to check the effect of the rewards imposed on scenario 2. Overall, in the third scenario, the complete form of the charging/discharging schedule considering the V2V mode, the V2G mode, the random actions of EV drivers, the set of penalties with flexibility, and the complementary set of rewards and discounts for the V2V mode is simulated and analyzed.
Herein, we presume that 200 EVs enter or leave the IPL during different hours of the day, and the total capacity of the IPL is presumed to be 150. The number of EVs in the IPL per hour is recorded in Figure 2. To consider a more complex situation for validating the performance of the proposed schedule, this paper imposes some limitations on the IPL and grid. In this regard, this paper considers two limitations: 1. More than 150 vehicles cannot be in the parking lot. 2. The amount of power exchanged per hour between the IPL and the distribution system for each EV is limited to +10 kWh and −10 kWh for charging and discharging, respectively.
The main objective of the optimization method is to find the best exchangeable power rate to maximize the profits of EVs and the parking lot. Details of the process of the proposed charging/discharging schedule for EVs and the optimization algorithm are shown in Figure 3a  According to Figure 3, first, the initialization of the optimization algorithm for the target variables ( ℎ , ℎ ) is performed. Next, the main objective function according to Equation (1), including penalties and the total profit of the IPL as the fitness function, is calculated. Then, the fitness value is evaluated, and the iteration number is checked. If the end of the iterations has not arrived, the velocity and position are updated and rearranged. Then, the next iteration starts using new values of the target variables. Finally, the optimal values for the target variables are extracted. Using optimal variables, the problem is solved, and the final values of the penalties, rewards, and profits are recorded.
This research considers the defined limits for the battery SOC to be between 10 kWh and 50 kWh. The coefficients a and B, which are the IPL's profit from power transactions for different modes, are presumed to be 0.05 in all cases. The power prices during different hours in the electricity market are shown in Figure 4, and charging/discharging is considered 0.9.

Scenario 1
The performance of the proposed method, considering penalties defined in Section 2, V2G energy transfer, and random decisions of the EV drivers, is investigated in this scenario. Additionally, the faulty vehicles are classified as completely faulty or faulty. The completely faulty EVs are registered the previous day but are absent on the announced date. In this scenario, 5% of EVs, i.e., 10 EVs, are completely faulty and 20% are faulty. Moreover, 20% of the total EVs are faulty vehicles but within flexible intervals, so they are considered non-faulty EVs. The remaining 55% act exactly according their expected parameters.
In this scenario, the flexible intervals considered for the time spent in the IPL and the initial and final SOC are as much as 2 h and 2 kWh, respectively. In other words, if an EV has a total mismatch with the announced quantity of fewer than 2 h for entry and exit, it would be subject to forgiveness. In addition, if an EV driver makes a mistake in announcing their initial SOC as less than 2 kWh, or if the IPL makes an error of less than this amount for the final charge of the EV, it would be forgiven. Moreover, the registration fee for each EV is USD 100. To clarify, completely faulty vehicles are penalized as much as USD 100 for their absence, and the fee is given to other present EVs. The total profit of the IPL and penalties are recorded in Table 2.
According to the table, faulty EVs are not rewarded due to secondary fines, so the LOC and FSOCFP are reduced. Additionally, a few faulty vehicles are forgiven due to the flexibility consideration. Thus, the EV fines for PTFP and ISOCFP are reduced. In this scenario, it is clear that EVs are fined according to some penalty categories, and the IPL is fined less. In this scenario, some of the faulty vehicles are completely faulty, and they only pay the registration fee as their absence fine. In contrast, if all EVs were present in the IPL, the faulty vehicles may have been penalized for their faults and paid more than the absence fine. Note that because of the absent EVs, there are 10 vacant positions in the IPL. Thus, scheduling for EVs in the IPL is more accessible than when there is no absent vehicle and has much more maneuverability. According to Table 2, the total cost of penalties with the transaction profit equals the total IPL's profit, indicating accurate calculations. In addition, the optimization method causes an increase in the profits of the vehicle drivers and the IPL while increasing the power trading opportunity so that the majority of chargerequesting EV owners charge their car at off-peak times instead peak times. For each EV, the purchased and sold power are shown in Figure 5. According to this figure, due to absent vehicles, the values are reduced, and the values for the last 10 vehicles are zero. Figure 6 indicates different fines in this scenario. Because of the flexibility and secondary penalty, fines are reduced, and they are zero for absent EVs as a result of paying the registration fee. Note that as the LOC has small values compared to other penalties, its value is not visible in this figure. The total profit of each vehicle is shown in Figure 7. Based on the figure, the total cost of EV drivers is reduced due to increasing the V2G discharging mode, defined penalties, and considered flexibilities. In other words, as EVs can sell their charge to the distribution system, the number of charging EVs during off-peak times with lower electricity prices is increased, and during the peak times, their number is decreased. This act helps to increase the IPL's transaction profits. Moreover, due to the power trading opportunity, some EVs can purchase power at a lower price and sell it at a higher price to EVs with emergency charge demand. In addition, due to the defined penalties and rewards, EV drivers show more adherence to their announced parameters and prevent destructive changes in IPL planning. Moreover, the defined flexibility helps to increase EV owners' profits.    In addition, the charging, discharging, and total requested power supplied by the grid are shown in Figure 8. As evident from this figure, the total power required from the grid during peak times is decreased. The main reason is that the V2G mode can shift the charging operation from peak to off-peak times and create a trading opportunity for EV drivers, which is confirmed by the LOC fine being close to zero.

Scenario 2
The main goals of this paper are investigated in scenarios 2 and 3. In scenario 2, V2V energy transfer is considered in addition to the assumptions in the previous scenario. In other words, the random actions of EV drivers and presumed penalties and rewards are considered during IPL planning in the V2V and V2G modes. Herein, a novel optimization algorithm based on the PSO method is used to enhance the performance of the proposed schedule. Table 3 records the results of the fines and profits in this scenario.
Comparing the results of scenario 2 to the previous scenario, the transaction costs and the profits resulting from the optimization slightly decrease due to the V2V energy transfer compared to the previous scenario. In contrast, the amount of FSOCFP that the IPL should pay to EVs is dramatically reduced due to the satisfaction of each vehicle with its charge level per hour, leading to greater customer satisfaction. Thus, parking profits increase considerably when compared to the scenario with the absence of V2V capability. 8067.5 Figure 9 shows the purchased and sold power in this scenario, confirming the increase in power trading between EVs. In this scenario, the values are reduced compared to the previous scenario. In other words, in the previous scenario, some EVs sell their charge to the grid, and some purchase that charge from the grid. Thus, the traded power between the grid and EVs is considerable. Nonetheless, the discharging EVs sell the power to the charging EVs directly in this scenario. It denotes that selling the power to the grid by discharging EVs (V2G mode) and purchasing it from other EVs results in impressive reductions and removes the need for grid involvement as an interface. Figure 9. The cost of power that each EV sells to the distribution system or purchases from it in scenario 2.
The main difference between this scenario and scenario 1 is the V2V energy transfer. In other words, the EVs trade the charge directly without needing the distribution system. Thus, as is indicated in Figure 10, the LOC is close to zero like in the previous scenario because of increased trading opportunities. Moreover, because of the V2V mode, the satisfaction of the EV drivers regarding the final charge level increases, and the FSOCFP is reduced. As the V2V mode has no effects on the EVs' initial SOC or arrival/departure times, the other fines have no notable changes from scenario 1. Figure 11 indicates the total profit of the EVs. As shown by the summation of the above figures is in this figure, the total profits of the EVs are increased due to the EV's fine reductions. Herein, the exchanged power between the distribution system and EVs and the charged/discharged powers and their payments remain unchanged compared to previous scenarios. However, as can be seen, impressively, the need for grid involvement as an interface is eliminated.  Like scenario 1, the charging and discharging costs for the grid and its profit are indicated in Figure 12. According to this figure, the profit of the grid is increased. As there is not a V2V mode in scenario 1, the grid plays the role of the interface and purchases the power from some of the EVs, and sells it to the others. In this case, a transaction cost for the IPL, which is an operator, should be paid by the grid as it purchases the power of discharging EVs. In this scenario because of the V2V mode, the grid is exempt from these transaction costs. In the other words, the power sold to the grid is reduced because of the V2V energy transfer. As the majority of EVs discharge their power to other vehicles directly, the transaction cost should be paid by the charging EVs, and this acts causes an increase in the profit of the distribution system. Moreover, because of the trading opportunity for EVs, the number of charging EVs during peak times is reduced and it is increased during off-peak times. So, in addition to being exempt from transaction costs, the peak shaving of power demand is another source of profit for the grid. In this scenario, purchasing and selling to the grid at the same time, at any time, is not considered; however, if the amount of discharging power per hour of parking is more than the amount of required charging power, the rest is sold to the grid, and if the amount of power required to charge is more than the discharging EV's power, the difference is purchased from the grid. As is clear from Figure 12, in the current day's plan, at all hours, the amount of charging power is more than the discharging power, and the difference is purchased from the grid. However, this value is much lower than in the previous case, in which, as can be seen from the figure, the amount of exchange with the grid has been significantly reduced and the network conditions have improved.

Scenario 3
The second innovation of the paper is analyzed in this scenario. In order to increase the effectiveness of the charging/discharging schedule in the previous scenario, a complementary set of rewards is imposed. In this scenario, the distribution system considers discounts for EVs participating in V2V energy transfer so as to increase the satisfaction of the EV drivers and encourage them to charge their vehicles during off-peak times, and decrease the power demand during peak times. In addition, to increase the satisfaction of IPL investors and attract the capital market to this area, the distribution system pays the transaction cost detailed in the previous scenario that the IPL was exempt from as a reward. Table 4 defines the discounts for different amounts of discharging power in the V2V mode, and Table 5 details the fines and profits of this scenario.
According to Table 4, the reason the authors created the column titled "Discharging Power (kWh)" is to highlight the accumulated discharged power by an EV on different days. For example, an EV may discharge an amount of energy of 100 or 200kWh or more in three days. In this case, the IPL records the discharging power for this EV. According to Table 4, based on the request of the EV owner, the IPL considers a discount for this EV owner. Please note that the EV owner may refuse the discount of 100 kWh and may wait for a further discharging discount. In the numerical simulations, different discounts are considered for different EVs to simulate the effect of these discounts. The grid reward to the IPL 1793.3 The parking lot's total profit 6500.4 In this scenario, as the power price decreases after grid discounts, the profits of the EV drivers increase, and the transaction cost of the IPL decreases. Thus, the distribution system pays a reward to the IPL to compensate for the IPL's profit reduction and to elevate the investors' satisfaction. As a result of the trading opportunity, the LOC is the same as in the previous scenarios, close to zero. Additionally, the FSOCFP is increased in this scenario. The price of energy and the benefits of energy trading are also decreased because of the imposed discounts. This means the energy trading is decreased; thus, the satisfaction of some of the charge-requesting EVs may decrease. Despite this situation, the profits of EV drivers caused by the considered discounts is more prominent, and the overall satisfaction of the EV drivers is much more enhanced than the case without the V2V mode consideration. Moreover, the V2G discharging mode is not considered in scenario 2, and this is far from reality. By defining the complementary reward set, the schedule is closer to reality, and both the V2G and V2V modes are applied. In addition, the satisfaction of the grid, the IPL, and EV drivers is much higher than in scenario 1. As the new considerations have no effects on the initial SOC and entrance/exit times of EVs, the other fines have the same values as in the previous scenario. Figure 13 illustrates the power transaction of EVs with the grid. This scenario investigates the profits of the EV drivers, the grid, and the IPL. Likewise, the amount of the exchanged power is like in the previous scenario. It is important to note that the trading power of EVs in scenario 3 is less than in scenario 1 because of the V2V mode consideration. Figure 14 shows EV fines per hour and confirms the analysis of Table 5. According to Figure 15, EVs' total profits are increased for two reasons. First, because of the discounts defined by the distribution system for V2V energy transfers, the power price is decreased, and the cost of EVs is reduced. Second, because of the increment of charging EVs during off-peak times, EV drivers charge their vehicles at a lower price so as to gain discounts. According to Figure 16, the total profit of the grid is also increased compared to scenario 2. In this scenario, the grid pays the savings from the transactions from which the IPL is exempt. However, as is evident from the figure, the total power demand during off-peak times increases as a result of increasing the EV drivers' and the IPLs' satisfaction, making a substantial profit for the distribution system. According to the figure, the grid's profit is less than the charging costs taken by the grid employing the V2G mode. This stems from the performance of the schedule in this scenario, which is much closer to reality than scenario 2 without employing the V2G mode in the IPL.     Table 6 summarizes the results of the scenarios to provide some detailed comparisons.

Conclusions
In this paper, V2V energy transfer was considered while planning for the charging/discharging of EVs in an IPL, in addition to the random actions of EV drivers. In [42], the effect of these random actions on an IPL's scheduling considering the V2G mode was investigated, and a set of penalties and rewards were imposed on the schedule to increase the profit of the IPL, EV drivers, and distribution system. However, the lack of V2V energy transfer was the main weakness of the schedule. In this regard, to complete the prescribed schedule, V2V energy transfer was investigated in this study in the presence of random actions of EV drivers and a set of fines. The IPL and EVs provided the main requirements of the proposed novel energy transfer mode, while the grid benefited more than the others. Additionally, a complementary set of rewards and discounts was imposed on the schedule to increase the satisfaction of the IPL investors and EV drivers. A set of simulations for three scenarios was performed and analyzed to validate the proposed schedule's effectiveness. According to the simulation results, the V2V energy transfer mode significantly affected peak shaving and impressively decreased the number of charging EVs' peaks. Thus, EV drivers were encouraged to charge their vehicles during off-peak times with offers of a lower energy price. Moreover, the proposed schedule increased the profit of the grid and EV drivers. Employing the proposed complementary reward set, the IPL and EVs earned additional rewards and discounts, making them more satisfied. The optimization performed in this paper is based on particle swarm optimization, but the designed model for the proposed optimization algorithm is the main novelty. In other words, the novel proposed model is solved within the frame of the PSO algorithm. The proposed algorithm can improve the IPL's profits by up to USD 1000 compared to the case without considering the V2V energy transfer mode. It is worth mentioning that the discharging of power to the grid would not be realized with a lack of discount. Thus, the performance of the schedule would move toward a realistic status with the employment of complimentary rewards. Overall, the total profit and satisfaction of the grid, IPL, and EV drivers were increased using the proposed completed schedule.