A regional scheduling method for shared cars based on PSO-DE
The PSO-DE algorithm is used to schedule shared car areas, which solves the scheduling problem caused by too many parking points, reduces operating costs, improves scheduling efficiency, and achieves optimal scheduling of vehicles in each area.
Patent Information
- Application Number
- CN202210625779.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-02
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2042-06-02
AI Technical Summary
The operating costs of shared cars are high and the scale is difficult to increase. Existing technology cannot effectively solve the scheduling problem caused by the excessive number of parking spots.
The shared car area scheduling method based on PSO-DE is used to divide the parking point area through the Kmeans algorithm, build a state indicator function to set the reward mechanism, and combine the particle swarm differential evolution algorithm to optimize vehicle scheduling to achieve the optimal scheduling of vehicles in each area.
It reduces manual scheduling costs, improves scheduling efficiency, and improves the optimization effect of the PSO-DE algorithm. It shows obvious advantages over using the DE algorithm alone.
Smart Images

Figure CN114971328B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of shared car regional scheduling, and in particular to a shared car regional scheduling method based on PSO-DE. Background Art
[0002] Since 2015, car-sharing has been attracting people's attention as a new way of travel. Although it is recognized as one of the effective ways to solve traffic congestion, parking difficulties and air pollution, its model is too heavy, the operating costs are too high, and the problems of enterprises being unable to make profits have not been solved, and the scale of car-sharing has been difficult to increase.
[0003] In order to solve the problems existing in shared cars and make shared cars enter people's lives to reduce traffic congestion and air pollution, many scholars have conducted relevant research on it. Among them, Balac Milos et al. studied the impact of car price policies on car sharing; Jorge and Correia studied the relationship between price and demand at each station; Zhou proposed a dynamic incentive mechanism and used Vienna taxi data to verify that the method can effectively maintain the fleet in a balanced state; Min Xu et al. solved the layout, pricing strategy and scheduling problems of shared electric vehicle stations with the goal of maximizing profits; Jorge used a hybrid nonlinear programming model to solve the vehicle pricing problem with the goal of maximizing profits; Wang Zhe used a dynamic price incentive mechanism to construct a dynamic random model with rolling cycle optimization characteristics; Zhou Pengfei et al. conducted research on the intelligent scheduling expert system of shared cars, the site selection of electric car sharing stations, the supervision mechanism of time-sharing rental cars and the layout of charging stations; Wang Ning et al. conducted research on the manual scheduling strategy of vehicles between shared car stations; Wang Ning et al. conducted research on the adaptive scheduling strategy of shared cars with dynamic pricing; Wang Ning et al. conducted research on the scheduling cost optimization of shared electric vehicles based on user incentives; Gao Junjie et al. conducted research on the one-way shared electric vehicle scheduling method based on demand forecasting; Tang Jie and Cao Jinxin conducted research on the joint scheduling optimization scheme of shared cars.
[0004] Whether it is the allocation of shared cars or the selection of parking areas, it is an optimization scheduling problem, and the optimal solution is obtained through optimization methods. A better solution to the optimization problem is to use the PSO-DE optimization algorithm, which has been widely used. Including economic scheduling problems with generator constraints, dynamic economic scheduling problems with safety constraints, solar distributed generation optimization, multi-period wind optimization scheduling, supermarket resource scheduling and allocation problems, etc. Summary of the invention
[0005] In view of the deficiencies in the above-mentioned background technology, the present invention proposes a shared car regional scheduling method based on PSO-DE, which solves the problem of shared car scheduling when there are too many parking spots in reality.
[0006] The technical solution of the present invention is achieved in this way:
[0007] A shared car regional scheduling method based on PSO-DE, the steps are as follows:
[0008] Step 1: Use the Kmeans algorithm to divide the parking spots into regions and count the number of parking spots in each region;
[0009] Step 2: Construct a status indicator function based on the number of parking spaces in each area, and set a reward mechanism for remotely operated vehicles based on the status indicator function;
[0010] Step 3: Analyze the probability of users operating vehicles in different locations, and calculate the cost of each user's operation based on the number of parking lots in each area and the reward mechanism;
[0011] Step 4: Establish the objective function based on the cost of each user operation;
[0012] Step 5: Use the particle swarm differential evolution algorithm to optimize and solve the objective function, and achieve the optimal scheduling of vehicles in each area.
[0013] Preferably, the method of using Kmeans algorithm to divide parking spots into regions is:
[0014] S1.1. Randomly select k parking points from all parking points as the center points of k areas, and use the k center points as the initial mean vector;
[0015] S1.2, calculating the distance between each center point and each parking point, and determining the cluster of each parking point according to the mean vector with the closest distance;
[0016] S1.3. Calculate a new mean vector. If the new mean vector is the same as the initial mean vector, the classification is completed and the area of the parking point is obtained; otherwise, the new mean vector is used as the new center point and returns to step S1.2.
[0017] Preferably, the calculation formula for the number of parking spaces in each area is:
[0018] X tn =X (t-1)n +R (t-1)n -D (t-1)n ;
[0019] Among them, X tn represents the number of parking spaces in area n at time t, X (t-1)nrepresents the number of parking spaces in area n at time t-1, R (t-1)n represents the number of cars returned in area n from time t-1 to time t, D (t-1)n Represents the number of borrowed cars in area n from time t-1 to time t.
[0020] Preferably, the state indication function is:
[0021]
[0022] Among them, s tn represents the state of area n at time t, p represents the maximum number of parking spaces in the parking area, s fn represents the upper threshold of region n, s bn represents the lower threshold of region n;
[0023] When the target value s tn If it is equal to 1, it means that there are too many vehicles in the parking area, and the vehicle pickup reward mechanism is activated; when the target value s tn = -1, indicating that there are few vehicles in the parking area, and the return reward mechanism is activated; when the target value s tn If it is equal to 0, it means that the parking area can be used for returning and picking up cars.
[0024] Preferably, the calculation formula for the probability of the user operating the vehicle remotely is:
[0025]
[0026] Among them, α represents the probability that the user operates the vehicle in a different location.
[0027] Preferably, the user's remote vehicle operation includes remote vehicle return and remote vehicle pickup;
[0028] The steps for returning the car to another location are:
[0029] a1) Determine whether the vehicle to be assigned Xan is greater than 0. If so, calculate the user reward probability and jump to step b1. Otherwise, complete the vehicle dispatch and jump to step e1.
[0030] b1) Determine whether the user returns the car in a different place. If so, calculate the cost of returning the car in a different place and jump to step d1; otherwise, jump to step c1;
[0031] c1) Determine whether there is a remaining parking space. If so, store the car in the parking space and jump to step d1; otherwise, calculate the manual scheduling cost and jump to step d1;
[0032] d1) Let Xan=Xan-1, and return to step a1;
[0033] e1) jump out of the loop;
[0034] The steps for picking up a car at a different location are:
[0035] a2) Determine whether the vehicle to be assigned Xan is greater than 0. If so, calculate the user reward probability and jump to step b2. Otherwise, complete the vehicle dispatch and jump to step e2.
[0036] b2) Determine whether the user is picking up the car in a different place. If so, calculate the cost of picking up the car in a different place and jump to step d2; otherwise, jump to step c2;
[0037] c2) Determine whether there are any remaining parking spaces. If so, take the car away and jump to step d2; otherwise, calculate the customer dissatisfaction cost and jump to step d2;
[0038] d2) Let Xan=Xan-1, and return to step a2;
[0039] e2) Break out of the loop.
[0040] Preferably, the objective function is:
[0041]
[0042] Among them, Z represents the final dispatch cost, t represents the time node, T represents the last time node, e represents the reward amount for returning the car to a different location, and x tij represents the number of out-of-town returns from area i to area j at time t, g represents the reward amount for out-of-town pickup, and y tij represents the number of off-site pickups from area i to area j at time t, h represents the cost of manual dispatch, and q i represents the number of vehicles that need to be manually dispatched in area i, k represents the cost incurred by users who fail to pick up the vehicle, and w i represents the number of rejected users in region i;
[0043] The constraints are:
[0044]
[0045] Where S represents the total number of vehicles.
[0046] Preferably, the method of optimizing and solving the objective function using the particle swarm differential evolution algorithm is:
[0047] S5.1: Set the maximum number of iterations of the differential evolution algorithm and initialize the population;
[0048] S5.2: Set the maximum number of iterations of the particle swarm algorithm, the number of populations, the number of independent variables of the objective function and the maximum speed of the particles, and initialize the particle position and speed;
[0049] S5.3: Calculate the fitness of each particle through the fitness function, find the individual extreme value of each particle as the individual optimal solution, and find a global optimal solution from the individual optimal solution, and compare it with the historical global optimal solution to update the global optimal solution of the population;
[0050] S5.4: Determine whether the number of iterations reaches the maximum number of iterations of the particle swarm algorithm. If so, output the global optimal solution of the population as the optimal value and execute step S5.5. Otherwise, update the speed and position of each particle and return to step S5.3; wherein the update formula of the speed and position of each particle is:
[0051] V id =ωV id +C1random(0,1)(P id -X id )+C2random(0,1)(P gd -X id );
[0052] Among them, ω is called the inertia factor, C1 is the individual learning factor of each particle, C2 is the social learning factor of each particle, random(0,1) represents a random number in the interval [0,1], P id represents the dth dimension of the individual extreme value of the ith variable, P gd represents the dth dimension of the global optimal solution, V id represents the velocity of the ith particle, X id represents the position of the i-th particle;
[0053] S5.5: Determine whether the number of iterations reaches the maximum number of iterations of the differential evolution algorithm. If so, output the optimal solution. Otherwise, execute step S5.6;
[0054] S5.6: Perform mutation, crossover and selection operations on individuals in sequence to obtain new individuals;
[0055] S5.7: Increase the number of iterations by 1 and return to step S5.2.
[0056] Preferably, the method for initializing the population is:
[0057]
[0058] Where, i′=1,2,…,NP; j=1,2,…,D,X i′ (0) is the i′th individual, j represents the dimension;
[0059]
[0060] in, is the lower bound of the j-th dimension, is the upper bound of the j-th dimension, and rand(0,1) represents a random number in the interval [0,1].
[0061] Preferably, the method of sequentially performing mutation, crossover and selection operations on individuals to obtain new individuals is:
[0062] Mutation operation: Randomly select two different individuals in the population, scale their vector difference and synthesize the vector with the individual to be mutated:
[0063] V i′ (g+1)=X r1 (g)+F(X r2 (g)-X r3 (g));
[0064] Among them, r1, r2 and r3 are three random numbers in the interval [1, NP], F is called the scaling factor, g represents the gth generation, V i ′(g+1) represents the population after mutation, X r1 (g), X r2 (g), X r3 (g) represents the i-th individual in the g-th generation population;
[0065] Crossover operation: Randomly select individuals:
[0066]
[0067] Among them, CR is called the crossover probability, U i′,j (g+1) represents the population after crossover, V i′,j (g+1) represents a variant intermediate, x i′,j (g+1) indicates the gene selected for crossover;
[0068] Selection operation: Use the greedy selection strategy to select the better individual as the new individual:
[0069]
[0070] Among them, X i′ (g+1) represents the next generation of individuals, U i′ (g+1) represents the crossover individual, X i′ (g) represents the current population individuals.
[0071] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention uses the Kmeans algorithm to divide parking spots into regions, and based on the differential evolution algorithm (DE) theory, establishes a regional scheduling model, then sets a reasonable reward and punishment mechanism for vehicle parking according to historical usage, and finally uses the particle swarm-differential evolution (PSO-DE) hybrid optimization algorithm to optimize the model; the optimization effect of using the PSO-DE algorithm is significantly improved compared with using the DE algorithm alone. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0073] Figure 1 A flow chart is constructed for the regional model of the present invention.
[0074] Figure 2 This is a flow chart of the Kmeans algorithm of the present invention.
[0075] Figure 3 This is a flowchart for returning a vehicle to a different location when the number of vehicles to be allocated in the area is greater than the upper threshold of the parking area.
[0076] Figure 4 This is a flowchart for picking up vehicles from a different location when the number of vehicles to be allocated in the area is less than the lower threshold of the parking area.
[0077] Figure 5 It is a vehicle dispatching flow chart of the present invention.
[0078] Figure 6 This is a distribution map of shared car parking areas.
[0079] Figure 7 This is the actual distribution of shared cars on the map.
[0080] Figure 8 The distribution map of shared car parking areas after removing discrete points.
[0081] Fig. 9 Zoning results for parking spots.
[0082] Fig.10 This is the flow chart of PSO-DE algorithm. DETAILED DESCRIPTION
[0083] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0084] like Figure 1 As shown in FIG, a shared car regional scheduling method based on PSO-DE has the following steps:
[0085] Step 1: Use the Kmeans algorithm to divide the parking spots into regions and count the number of parking spots in each region; since the Kmeans algorithm is an unsupervised learning clustering algorithm, its principle is relatively simple and easy to implement, and it has the advantages of fast convergence speed and good clustering effect. The algorithm flow chart is as follows Figure 2 As shown, the operation steps are as follows:
[0086] S1.1. Randomly select k parking points from all parking points as the center points of k areas, and use the k center points as the initial mean vector;
[0087] S1.2, calculating the distance between each center point and each parking point, and determining the cluster of each parking point according to the mean vector with the closest distance;
[0088] S1.3. Calculate a new mean vector. If the new mean vector is the same as the initial mean vector, the classification is completed and the area of the parking point is obtained; otherwise, the new mean vector is used as the new center point and returns to step S1.2.
[0089] The calculation formula for the number of parking lots in each area is:
[0090] X tn =X (t-1)n +R (t-1)n -D (t-1)n ;
[0091] Among them, X tn represents the number of parking spaces in area n at time t, X (t-1)n represents the number of parking spaces in area n at time t-1, R (t-1)n represents the number of cars returned in area n from time t-1 to time t, D (t-1)n Represents the number of borrowed cars in area n from time t-1 to time t.
[0092] Step 2: Construct a status indicator function based on the number of parking spaces in each area, and set a reward mechanism for remotely operated vehicles based on the status indicator function;
[0093] The state of each parking area is qualitatively described through a state indicator function. When the target value is equal to 1, it means that there are too many vehicles in the parking area, and the pick-up reward mechanism is activated (users from other areas pick up their cars in this area); when the target value is equal to -1, it means that there are too few vehicles in the parking area, and the return reward mechanism is activated (users from other areas return their cars in this area); when the target value is equal to 0, it means that the parking area can be returned and picked up normally.
[0094] The state indication function is:
[0095]
[0096] Among them, s tn represents the state of area n at time t, p represents the maximum number of parking spaces in the parking area, s fn represents the upper threshold of region n, s bn Indicates the lower threshold of region n.
[0097] Step 3: Analyze the probability of users operating vehicles in different locations, and calculate the cost of each user's operation based on the number of parking lots in each area and the reward mechanism;
[0098] The state of each parking spot is obtained through the state indicator function. When the state is too many or too few vehicles, the user reward mechanism will guide users to return or pick up the car in other parking areas. A certain proportion of users will agree to go to other parking areas with good conditions to return or pick up the car. The calculation formula for the probability of the user operating the vehicle in a different location is:
[0099]
[0100] Among them, α represents the probability that the user operates the vehicle in a different location.
[0101] When the number of vehicles to be allocated in the area is greater than the upper threshold of the parking area, it is encouraged to return the vehicle to another place, such as Figure 3 As shown, the steps for returning the car at a different location are:
[0102] a1) Determine whether the vehicle to be assigned Xan is greater than 0. If so, calculate the user reward probability and jump to step b1. Otherwise, complete the vehicle dispatch and jump to step e1.
[0103] b1) Determine whether the user returns the car in a different place. If so, calculate the cost of returning the car in a different place and jump to step d1; otherwise, jump to step c1;
[0104] c1) Determine whether there is a remaining parking space. If so, store the car in the parking space and jump to step d1; otherwise, calculate the manual scheduling cost and jump to step d1;
[0105] d1) Let Xan=Xan-1, and return to step a1;
[0106] e1) Break out of the loop.
[0107] When the number of vehicles to be allocated in the area is less than the lower threshold of the parking area, it is encouraged to pick up vehicles from other places, such as Figure 4 As shown, the steps for picking up a car at a different location are:
[0108] a2) Determine whether the vehicle to be assigned Xan is greater than 0. If so, calculate the user reward probability and jump to step b2. Otherwise, complete the vehicle dispatch and jump to step e2.
[0109] b2) Determine whether the user is picking up the car in a different place. If so, calculate the cost of picking up the car in a different place and jump to step d2; otherwise, jump to step c2;
[0110] c2) Determine whether there are any remaining parking spaces. If so, take the car away and jump to step d2; otherwise, calculate the customer dissatisfaction cost and jump to step d2;
[0111] d2) Let Xan=Xan-1, and return to step a2;
[0112] e2) Break out of the loop.
[0113] If the user refuses to park in other parking areas, the manual dispatch cost of the vehicle will be recorded in the enterprise cost. In the vehicle allocation process, the vehicles are first allocated based on the parking volume that meets the lower threshold of each area. If there are still vehicles left, the vehicles are allocated based on the parking volume that meets the upper threshold of each area. Since the vehicles are allocated based on the maximum allocation amount above the threshold, there will be no remaining vehicles, and all the vehicles to be allocated will be allocated when the cycle is completed. The flow chart is as follows Figure 5 shown.
[0114] Step 4: Establish an objective function based on the cost of each user operation; the objective function is:
[0115]
[0116] Among them, Z represents the final dispatch cost, t represents the time node, T represents the last time node, e represents the reward amount for returning the car to a different location, and x tij represents the number of out-of-town returns from area i to area j at time t, g represents the reward amount for out-of-town pickup, and y tij represents the number of off-site pickups from area i to area j at time t, h represents the cost of manual dispatch, and q i represents the number of vehicles that need to be manually dispatched in area i, k represents the cost incurred by users who fail to pick up the vehicle, and w i represents the number of rejected users in area i.
[0117] The constraints are:
[0118]
[0119] Where S represents the total number of vehicles.
[0120] Step 5: Use the particle swarm differential evolution algorithm to optimize and solve the objective function, and achieve the optimal scheduling of vehicles in each area.
[0121] like Fig.10 As shown in the figure, the method of optimizing and solving the objective function using the particle swarm differential evolution algorithm is:
[0122] S5.1: Set the maximum number of iterations of the differential evolution algorithm and initialize the population;
[0123]
[0124] Where, i′=1,2,…,NP; j=1,2,…,D,X i′ (0) is the i′th individual, j represents the dimension;
[0125]
[0126] in, is the lower bound of the j-th dimension, is the upper bound of the j-th dimension, and rand(0,1) represents a random number in the interval [0,1].
[0127] S5.2: Set the maximum number of iterations of the particle swarm algorithm, the number of populations, the number of independent variables of the objective function to 2, and the maximum speed of the particles C1 = C2 = 0.5, and initialize the particle position and speed;
[0128] S5.3: Calculate the fitness of each particle through the fitness function, find the individual extreme value of each particle as the individual optimal solution, and find a global optimal solution from the individual optimal solution, and compare it with the historical global optimal solution to update the global optimal solution of the population;
[0129] S5.4: Determine whether the number of iterations reaches the maximum number of iterations of the particle swarm algorithm. If so, output the global optimal solution of the population as the optimal value and execute step S5.5. Otherwise, update the speed and position of each particle and return to step S5.3; wherein the update formula of the speed and position of each particle is:
[0130] V id =ωV id +C1random(0,1)(P id -X id )+C2random(0,1)(P gd -X id);
[0131] Among them, ω is called the inertia factor, and its value is non-negative. When it is larger, the global optimization ability is strong and the local optimization ability is strong. When it is smaller, the global optimization ability is weak. C1 and C2 are called acceleration constants. C1 is the individual learning factor of each particle, and C2 is the social learning factor of each particle. Suganthan's experiment shows that when C1 and C2 are constants, a better solution can be obtained. Usually, C1=C2=∈[0,4]. Random(0,1) represents a random number in the interval [0,1]. P id represents the dth dimension of the individual extreme value of the ith variable, P gd represents the dth dimension of the global optimal solution, V id represents the velocity of the ith particle, X id represents the position of the ith particle.
[0132] S5.5: Determine whether the number of iterations reaches the maximum number of iterations of the differential evolution algorithm. If so, output the optimal solution. Otherwise, execute step S5.6;
[0133] S5.6: Perform mutation, crossover and selection operations on individuals in sequence to obtain new individuals;
[0134] Mutation operation: DE algorithm realizes individual mutation through differential strategy. The common differential strategy is to randomly select two different individuals in the population, scale their vector difference and synthesize the vector with the individual to be mutated:
[0135] V i′ (g+1)=X r1 (g)+F(X r2 (g)-X r3 (g));
[0136] Among them, r1, r2 and r3 are three random numbers in the interval [1, NP], F is called the scaling factor, g represents the gth generation, V i ′(g+1) represents the population after mutation, X r1 (g), X r2 (g), X r3 (g) represents the i-th individual in the g-th generation population;
[0137] Crossover operation: The purpose of the crossover operation is to randomly select individuals, because differential evolution is also a random algorithm. The method of the crossover operation is:
[0138]
[0139] Among them, CR is called the crossover probability, U i′,j (g+1) represents the population after crossover, V i′,j (g+1) represents a variant intermediate, xi′,j (g+1) indicates the gene selected for crossover;
[0140] Selection operation: In DE, a greedy selection strategy is used to select the better individuals as new individuals:
[0141]
[0142] Among them, X i′ (g+1) represents the next generation of individuals, U i′ (g+1) represents the crossover individual, X i′ (g) represents the current population individuals.
[0143] S5.7: Increase the number of iterations by 1 and return to step S5.2.
[0144] Example Analysis
[0145] This example uses the data of Tel Aviv Jaffa in Israel from 2018-12-11 15:48:53.592141 UTC to 2019-01-10 12:58:50.134717 UTC as the research content, with a total of 1,048,575 data items and a sampling frequency of about once every two minutes.
[0146] According to the data statistics, the number of parking spots that vehicles pass through is 27604. Using longitude as the horizontal coordinate and latitude as the vertical coordinate, draw the discrete areas where parking is available in the city. Figure 6 shown.
[0147] Mark each parking spot on the map, such as Figure 7 As shown in the figure, it can be found from the markings that the shared car parking areas are roughly distributed along the urban area and completely cover the main urban area.
[0148] There are several discrete parking areas that are too far away from the main parking spots in the city, so the number is not representative and is ignored when dividing the parking areas. Figure 8 shown.
[0149] The parking areas for shared cars are further divided according to their geographical locations, and the parking areas are divided into 10 areas using the Kmeans algorithm. Fig. 9 shown.
[0150] By counting the vehicle numbers in the data, we can find that the total number of vehicles is 260, that is, S = 260. When a user refuses to return or pick up a vehicle at a different location, the company's manual dispatch cost (the amount of money spent on transferring a vehicle from one station to another) is set to 50 yuan. When a customer wants to pick up a vehicle from a certain station, but there is no vehicle at this station, the cost of refusing the user to pick up the vehicle from this station is 100 yuan. When the number of vehicles at a certain station is greater than the upper threshold, the incentive amount generated is When the number of vehicles at a station is less than the threshold, the incentive amount for encouraging users to pick up vehicles at other locations is 25 yuan, and the probability β of users picking up vehicles at other locations is set to 0.5. In actual operation, the company can set parameters according to actual conditions.
[0151] The design of DE and PSO-DE algorithms was implemented in python (3.7.0), sko (0.5.9), geatpy (2.6.0), pandas (1.0.1), skalearn (0.0), and numpy (1.18.1) environments.
[0152] The difference algorithm (DE) is an evolutionary algorithm with a similar evolutionary process to the genetic algorithm. Its main application scope is the optimization problem of real numbers. The initial population size and the number of iterations are selected as (10, 20), (20, 20), (50, 50), (50, 100), (100, 100) respectively. Let the mutation probability F = 0.5 and the crossover probability be 0.7. The results are shown in Table 1 below.
[0153] Table 1 Calculation results
[0154]
[0155] According to the results in Table 1, the operation effect of the differential evolution algorithm is generally related to time. That is, the longer the operation time, the better the optimal value obtained, but there is also the possibility that the operation time is long and the effect is not good.
[0156] Considering that the parameter selection of the differential evolution algorithm may have a great impact on the results, and the differential evolution algorithm has strong scalability and is easy to combine with other algorithms, the present invention considers using the particle swarm algorithm (PSO) to optimize the differential evolution algorithm and names it PSO-GA. The algorithm flow chart of the particle swarm-differential evolution hybrid algorithm (PSO-DE) is as follows Fig.10 shown.
[0157] The maximum velocity of the PSO algorithm particles is set to C1 = C2 = 0.5. At the same time, the population size of the PSO algorithm, the maximum number of iterations of the PSO algorithm, the population size of the DE algorithm, and the number of iterations of the DE algorithm are selected as (2, 2, 5, 5), (5, 5, 5, 5), (5, 5, 10, 10), and (3, 5, 20, 20). The results are shown in Table 2 below.
[0158] Table 2 Calculation results
[0159]
[0160] According to the results in Table 2, when the number of evaluations is small, the operation results of the PSO-DE algorithm have no obvious effect; but as the number of evaluations increases, the PSO-DE algorithm achieves better results.
[0161] By comparing and analyzing Table 1 and Table 2, it can be clearly seen that: when the number of evaluations is small, the optimal value of the DE algorithm alone is smaller, that is, the optimization effect is better; as the number of evaluations increases, the PSO-DE algorithm gradually achieves better results. The optimization effect achieved when the number of evaluations of the DE algorithm reaches 10,000 times is not as good as the optimization effect when the number of evaluations of the PSO-DE algorithm reaches 6,000 times. It is easy to conclude that when the problem is more complex, the use of the PSO-DE algorithm is better. This method has a certain improvement effect on the problem that the DE algorithm relies more on parameter selection.
[0162] Aiming at the problem of shared car scheduling when there are too many parking spots in reality, this paper proposes a shared car regional scheduling method based on PSO-DE. Many parking spots are partitioned by Kmeans, and vehicles in each area are scheduled, thereby reducing the cost of manual scheduling and the complexity of the model; then, by comparing the optimization results of the PSO-DE algorithm and the DE algorithm under this optimization problem, the superiority and shortcomings of the PSO-DE algorithm are proved.
[0163] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A shared car regional scheduling method based on PSO-DE, characterized in that: The steps are as follows: Step 1: Use the Kmeans algorithm to divide the parking spots into regions and count the number of parking spots in each region; Step 2: Construct a status indicator function based on the number of parking spaces in each area, and set a reward mechanism for remotely operated vehicles based on the status indicator function; The state indication function is: Among them, s tn represents the state of area n at time t, p represents the maximum number of parking spaces in the parking area, s fn represents the upper threshold of region n, s bn represents the lower threshold of region n; X tn represents the number of parking lots in area n at time t; When the target value s tn If it is equal to 1, it means that there are too many vehicles in the parking area, and the vehicle pickup reward mechanism is activated; when the target value s tn = -1, indicating that there are few vehicles in the parking area, and the return reward mechanism is activated; when the target value s tn If it is equal to 0, it means that the parking area can be returned and picked up normally; Step 3: Analyze the probability of users operating vehicles in different locations, and calculate the cost of each user's operation based on the number of parking lots in each area and the reward mechanism; The calculation formula for the probability of the user operating the vehicle in a different location is: Among them, α represents the probability that the user operates the vehicle in a different location; The user's remote vehicle operation includes remote vehicle return and remote vehicle pickup; The steps for returning the car to another location are: a1) Determine whether the vehicle to be assigned Xan is greater than 0. If so, calculate the user reward probability and jump to step b1. Otherwise, complete the vehicle dispatch and jump to step e1. b1) Determine whether the user returns the car in a different place. If so, calculate the cost of returning the car in a different place and jump to step d1; otherwise, jump to step c1; c1) Determine whether there is a remaining parking space. If so, store the car in the parking space and jump to step d1; otherwise, calculate the manual scheduling cost and jump to step d1; d1) Let Xan=Xan-1, and return to step a1; e1) jump out of the loop; The steps for picking up a car at a different location are: a2) Determine whether the vehicle to be assigned Xan is greater than 0. If so, calculate the user reward probability and jump to step b2. Otherwise, complete the vehicle dispatch and jump to step e2. b2) Determine whether the user is picking up the car in a different place. If so, calculate the cost of picking up the car in a different place and jump to step d2; otherwise, jump to step c2; c2) Determine whether there are any remaining parking spaces. If so, take the car away and jump to step d2; otherwise, calculate the customer dissatisfaction cost and jump to step d2; d2) Let Xan=Xan-1, and return to step a2; e2) jump out of the loop; Step 4: Establish the objective function based on the cost of each user operation; The objective function is: Among them, Z represents the final dispatch cost, t represents the time node, T represents the last time node, e represents the reward amount for returning the car to a different location, and x tij represents the number of out-of-town returns from area i to area j at time t, g represents the reward amount for out-of-town pickup, and y tij represents the number of off-site pickups from area i to area j at time t, h represents the cost of manual dispatch, and q i represents the number of vehicles that need to be manually dispatched in area i, k represents the cost incurred by users who fail to pick up the vehicle, and w i represents the number of rejected users in region i; The constraints are: Where S represents the total number of vehicles; Step 5: Use the particle swarm differential evolution algorithm to optimize and solve the objective function, and achieve the optimal scheduling of vehicles in each area; The method for optimizing and solving the objective function using the particle swarm differential evolution algorithm is: S5.1: Set the maximum number of iterations of the differential evolution algorithm and initialize the population; S5.2: Set the maximum number of iterations of the particle swarm algorithm, the number of populations, the number of independent variables of the objective function and the maximum speed of the particles, and initialize the particle position and speed; S5.3: Calculate the fitness of each particle through the fitness function, find the individual extreme value of each particle as the individual optimal solution, and find a global optimal solution from the individual optimal solution, and compare it with the historical global optimal solution to update the global optimal solution of the population; S5.4: Determine whether the number of iterations reaches the maximum number of iterations of the particle swarm algorithm. If so, output the global optimal solution of the population as the optimal value and execute step S5.
5. Otherwise, update the speed and position of each particle and return to step S5.3; wherein the update formula of the speed and position of each particle is: V id =ωV id +C1random(0,1)(P id -X id )+C2random(0,1)(P gd -X id ); Among them, ω is called the inertia factor, C1 is the individual learning factor of each particle, C2 is the social learning factor of each particle, random(0,1) represents a random number in the interval [0,1], P id represents the dth dimension of the individual extreme value of the ith variable, P gd represents the dth dimension of the global optimal solution, V id represents the velocity of the ith particle, X id represents the position of the i-th particle; S5.5: Determine whether the number of iterations reaches the maximum number of iterations of the differential evolution algorithm. If so, output the optimal solution. Otherwise, execute step S5.6; S5.6: Perform mutation, crossover and selection operations on individuals in sequence to obtain new individuals; S5.7: Increase the number of iterations by 1 and return to step S5.
2.
2. The shared car regional scheduling method based on PSO-DE according to claim 1 is characterized in that: The method of using Kmeans algorithm to divide parking spots into regions: S1.
1. Randomly select k parking points from all parking points as the center points of k areas, and use the k center points as the initial mean vector; S1.2, calculating the distance between each center point and each parking point, and determining the cluster of each parking point according to the mean vector with the closest distance; S1.
3. Calculate a new mean vector. If the new mean vector is the same as the initial mean vector, the classification is completed and the area of the parking point is obtained; otherwise, the new mean vector is used as the new center point and returns to step S1.
2.
3. The shared car regional scheduling method based on PSO-DE according to claim 1 is characterized in that: The calculation formula for the number of parking lots in each area is: X tn =X (t-1)n +R (t-1)n -D (t-1)n ; Among them, X tn represents the number of parking spaces in area n at time t, X (t-1)n represents the number of parking spaces in area n at time t-1, R (t-1)n represents the number of cars returned in area n from time t-1 to time t, D (t-1)n Represents the number of borrowed cars in area n from time t-1 to time t.
4. The shared car regional scheduling method based on PSO-DE according to claim 1 is characterized in that: The method for initializing the population is: Where, i′=1,2,…,NP; j=1,2,…,D,X i′ (0) is the i′th individual, j represents the dimension; in, is the lower bound of the j-th dimension, is the upper bound of the j-th dimension, and rand(0,1) represents a random number in the interval [0,1].
5. The shared car regional scheduling method based on PSO-DE according to claim 4 is characterized in that: The method of performing mutation, crossover and selection operations on individuals in sequence to obtain new individuals is: Mutation operation: Randomly select two different individuals in the population, scale their vector difference and synthesize the vector with the individual to be mutated: V i′ (g+1)=X r1 (g)+F(X r2 (g)-X r3 (g)); Among them, r1, r2 and r3 are three random numbers in the interval [1, NP], F is called the scaling factor, g represents the gth generation, V i ′(g+1) represents the population after mutation, X r1 (g), X r2 (g), X r3 (g) represents the i-th individual in the g-th generation population; Crossover operation: Randomly select individuals: Among them, CR is called the crossover probability, U i′,j (g+1) represents the population after crossover, V i′,j (g+1) represents a variant intermediate, x i′,j (g+1) indicates the gene selected for crossover; Selection operation: Use greedy selection strategy to select better individuals as new individuals: Among them, X i′ (g+1) represents the next generation of individuals, U i′ (g+1) represents the crossover individual, X i′ (g) represents the current population individuals.
