Path planning method and device
By using ant colony optimization and pheromone update mechanism in path planning, the problem of insufficient dynamic adaptability in existing path planning technologies is solved, enabling more flexible and accurate path selection that adapts to real-time changes in the traffic network.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 富盛科技股份有限公司
- Filing Date
- 2025-11-13
- Publication Date
- 2026-04-10
AI Technical Summary
In existing technologies, path planning algorithms have difficulty dynamically adapting to real-time passenger flow fluctuations in transportation networks, and they suffer from insufficient dynamic adaptability and limitations in multi-objective optimization in rail transit scenarios, making it difficult to perform path planning in conjunction with actual traffic conditions.
By receiving the initial parameters and optimization objectives of the traffic network model and ant colony algorithm, multiple ant colonies are initialized. The ants are controlled to start from the starting station, select the stations to pass through based on multi-objective cost value and pheromone, and dynamically update the pheromone. By combining the roulette wheel strategy and multi-objective cost function, path planning is achieved.
It significantly improves the dynamic adaptability and accuracy of route planning, better aligns with the real-time scheduling of traffic networks, provides route selection with multiple optimization objectives, and enhances the flexibility and practicality of route planning.
Smart Images

Figure CN121119342B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of traffic planning, in particular to a path planning method and device. BACKGROUND
[0002] With the rapid expansion of the scale of urban rail transit network, the demand of users for path planning is increasingly diversified, which may involve factors such as shortest time, least transfer, comfort, and economic cost.
[0003] In the prior art, Dijkstra algorithm, A algorithm or ant colony algorithm can be used to plan a path for a user according to the start point and end point input by the user, however, Dijkstra algorithm and A algorithm are difficult to dynamically adapt to real-time passenger flow fluctuations in the traffic network, and the ant colony algorithm also has the problems of insufficient dynamic adaptability, multi-objective optimization limitation, and difficulty in local convergence in the rail transit scenario. SUMMARY
[0004] To solve the problems in the prior art, the present application provides a path planning method and device, which can effectively solve the problems of insufficient dynamic adaptability of traditional path planning, difficulty in combining actual traffic conditions for path planning, and significantly improve the dynamic adaptability of path planning, and better meet the real-time scheduling of the traffic network.
[0005] To solve at least one of the above problems, the present application provides the following technical solutions:
[0006] In a first aspect, the present application provides a path planning method, comprising:
[0007] receiving a traffic network model, initial parameters of an ant colony algorithm, ant colony optimization objectives, a start station and an end station, initializing a plurality of ant colonies and the traffic network model according to the initial parameters to obtain initial ant colonies, wherein the traffic network model comprises station topological relationships, train timetable information and real-time passenger flow data, the ant colony optimization objectives comprise at least two of travel time, economic cost and transfer cost, and each ant colony optimization objective corresponds to an initial ant colony;
[0008] for each initial ant colony, controlling each ant in the initial ant colony to start from the start station, determining a next passing station in a candidate station based on a multi-objective value and pheromone, until reaching the end station, to obtain an initial path corresponding to the current ant, wherein the multi-objective value is determined based on travel time, economic cost and transfer penalty coefficient between the current station and the candidate station;
[0009] determine the total multi-objective cost value corresponding to each initial path, determine the initial optimal path of the current initial ant colony based on the total multi-objective cost value, and locally update the pheromone in the traffic network model based on the initial optimal path of the ant colony, in the case that all initial ant colonies complete one iteration, cross-update the pheromone according to the initial optimal path of each ant colony, and obtain the updated pheromone;
[0010] repeat the step of obtaining the initial path corresponding to the current ant until the termination condition is met, obtain a plurality of ant colony updated optimal paths, and display each ant colony updated optimal path to a terminal device, wherein the termination condition includes that the current iteration number reaches a preset maximum iteration number, or the ant colony updated optimal path corresponding to each initial ant colony does not change in a preset continuous iteration number.
[0011] Further, it also includes determining the candidate sites allowed to be reached from the current site based on the site topological relationship in the traffic network model, and determining the pheromone of the current site reaching each candidate site corresponding to the current time period;
[0012] determine the multi-objective cost value of the current site reaching each candidate site in the current time period based on the preset multi-objective cost function, and determine the candidate probability of each candidate site becoming the next passing site based on the multi-objective cost value and the pheromone;
[0013] select the candidate probability through a roulette strategy to obtain a selection result, determine the candidate site corresponding to the selection result as the next passing site, and repeat the steps of determining the candidate sites allowed to be reached from the current site based on the site topological relationship in the traffic network model, and determining the pheromone of the current site reaching each candidate site corresponding to the current time period until the terminal site is reached.
[0014] Further, the initial parameters include the importance of the pheromone and the heuristic factor, and further include determining the candidate probability of each candidate site becoming the next passing site based on the multi-objective cost value and the pheromone corresponding to the current site to each candidate site through a preset probability calculation rule, wherein the preset probability calculation rule is represented as:
[0015] wherein P represents the candidate probability, i represents the current site, j represents the passing site, k represents the number of the current ant, represents the pheromone from the current time period i to j, represents the pheromone from the current time period i to l, represents the multi-objective cost value, l represents any one of all candidate next nodes that the ant can select at the current node i, a represents the importance of the pheromone, and β represents the heuristic factor.
[0016] Further, the method further comprises: obtaining the maximum carrying capacity of the current station to the next station in the current period during the travel of the ant on the initial path, and obtaining the initial pheromone between the adjacent stations in the traffic network model;
[0017] Based on the maximum carrying capacity, the real-time passenger flow data of the current station to the next station, and the initial path, the initial pheromone between the adjacent stations in the initial path is updated by a preset pheromone concentration adjustment rule to obtain updated pheromone;
[0018] Based on the total multi-objective generation value, the ant colony initial optimal path corresponding to the current initial ant colony in the iteration round is determined, and based on the maximum carrying capacity corresponding to the ant colony initial optimal path, the real-time passenger flow data between the stations in the ant colony initial optimal path, and the ant colony initial optimal path, the pheromone is updated to obtain the strengthened pheromone.
[0019] Further, the initial parameters include a pheromone intensity constant, and the method further comprises: based on the initial path, the number of stations included in the initial path is determined as the total path length of the initial path;
[0020] Based on the maximum carrying capacity, the real-time passenger flow data of the current station to the next station, and the total path length, the initial pheromone between the adjacent stations in the initial path is updated by a preset pheromone concentration adjustment rule to obtain updated pheromone;
[0021] The preset pheromone concentration adjustment rule is represented as:
[0022] ;
[0023] Wherein, i represents the current station, j represents the station, k represents the number of the current ant, represents the pheromone of the current period i to j, p represents the pheromone evaporation coefficient, represents the real-time passenger flow data in the current period, represents the maximum carrying capacity, represents the total path length, and Q represents the pheromone intensity coefficient.
[0024] Further, the method further comprises: in the case that each initial ant colony reaches the iteration number corresponding to the preset cooperation period, the pheromone is updated according to the ant colony initial optimal path to obtain updated pheromone;
[0025] In the case that there is at least one initial ant colony that does not reach the iteration number corresponding to the preset cooperation period, the ant colony initial optimal path corresponding to the initial ant colony that reaches the iteration number corresponding to the preset cooperation period is saved and the iteration is stopped until the updated pheromone is obtained.
[0026] Further, the method further comprises: receiving a user preference target, the user preference target being one of the ant colony optimization targets;
[0027] The ant colony updated optimal path that meets the user preference target is determined as a planning path, and other ant colony updated optimal paths are displayed to the terminal device as alternative paths.
[0028] In a second aspect, the present application provides a path planning device, comprising:
[0029] The receiving module is configured to receive a traffic network model, initial parameters of an ant colony algorithm, ant colony optimization targets, a starting station and a terminal station, initialize a plurality of ant colonies and the traffic network model according to the initial parameters, and obtain initial ant colonies, wherein the traffic network model comprises station topological relations, train timetable information and real-time passenger flow data, the ant colony optimization targets comprise at least two of travel time, economic cost and transfer cost, and each ant colony optimization target corresponds to an initial ant colony;
[0030] The exploration module is configured to, for each initial ant colony, control each ant in the initial ant colony to start from the starting station, determine a next passing station in a candidate station based on a multi-objective value and pheromone, and obtain an initial path corresponding to the current ant until the terminal station is reached, wherein the multi-objective value is determined based on travel time, economic cost and a transfer penalty coefficient between a current station and the candidate station;
[0031] The updating module is configured to determine a total multi-objective value corresponding to each initial path, determine an ant colony initial optimal path corresponding to the current initial ant colony based on the total multi-objective value, locally update the pheromone in the traffic network model based on the ant colony initial optimal path, cross-update the pheromone according to the ant colony initial optimal paths of all initial ant colonies in the case that all initial ant colonies complete one iteration, and obtain updated pheromone;
[0032] The decision module is configured to repeatedly perform the step of obtaining the initial path corresponding to the current ant until a termination condition is met, obtain a plurality of ant colony updated optimal paths, and display the ant colony updated optimal paths to a terminal device, wherein the termination condition comprises that a current iteration number reaches a preset maximum iteration number, or the ant colony updated optimal paths corresponding to the initial ant colonies have no change in a preset continuous iteration number.
[0033] In a third aspect, the present application provides an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the path planning method.
[0034] In a fourth aspect, the present application provides a computer readable storage medium, which stores a computer program, wherein the computer program is executed by a processor to implement the steps of the path planning method.
[0035] In a fifth aspect, the present application provides a computer program product comprising computer programs / instructions which, when executed by a processor, implement the steps of the path planning method.
[0036] According to the technical solution described above, the present application provides a path planning method and device, which receives a traffic network model, initial parameters of an ant colony algorithm, ant colony optimization objectives, a starting station and a terminal station, initializes a plurality of ant colonies and the traffic network model according to the initial parameters, and obtains initial ant colonies. The traffic network model includes station topological relations, train timetable information and real-time passenger flow data. The ant colony optimization objectives include at least two of travel time, economic cost and transfer penalty. Each ant colony optimization objective corresponds to an initial ant colony. For each initial ant colony, each ant in the initial ant colony is controlled to start from the starting station, and the next station is determined according to a multi-objective value and pheromone in candidate stations until the terminal station is reached, so as to obtain an initial path corresponding to the current ant. The multi-objective value is determined according to travel time, economic cost and a transfer penalty coefficient between the current station and the candidate station. A total multi-objective value corresponding to each initial path is determined, and an ant colony initial optimal path corresponding to the current initial ant colony is determined according to the total multi-objective value. The pheromone in the traffic network model is locally updated according to the ant colony initial optimal path. In the case that all initial ant colonies complete an iteration, the pheromone is cross-updated according to the ant colony initial optimal paths, so as to obtain updated pheromone. The step of obtaining an initial path corresponding to the current ant is repeatedly executed until a termination condition is met, so as to obtain a plurality of ant colony updated optimal paths. The ant colony updated optimal paths are displayed to a terminal device. The termination condition includes that a current iteration number reaches a preset maximum iteration number, or the ant colony updated optimal paths corresponding to the initial ant colonies have no change in a preset continuous iteration number. By setting a plurality of ant colonies and each ant colony corresponding to an ant colony optimization objective, a plurality of optimization objectives can be considered at the same time, the flexibility of path planning is improved, and the traffic network model can be dynamically adapted to changes in the traffic network model according to the pheromone of the traffic network model, so as to provide more accurate and actual traffic condition-compliant path planning. The method effectively solves the deficiencies of traditional technologies in terms of insufficient dynamic adaptability of path planning and difficulty in combining actual traffic conditions for path planning, significantly improves the dynamic adaptability of path planning, and is more in line with real-time scheduling of the traffic network. BRIEF DESCRIPTION OF DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiments or prior art description will be briefly introduced below. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0038] Figure 1 A flowchart of a path planning method in the embodiments of the present application is shown in the figure.
[0039] Figure 2 A structural diagram of a path planning device in the embodiments of the present application is shown in the figure.
[0040] Figure 3 A structural diagram of an electronic device in the embodiments of the present application is shown in the figure.
[0041] Reference signs:
[0042] Electronic device 9600, central processor 9100, memory 9140, communication module 9110, input unit 9120, audio processor 9130, display 9160, power supply 9170, buffer memory 9141, application / function storage unit 9142, data storage unit 9143, driver program storage unit 9144, antenna 9111, speaker 9131, microphone 9132. DETAILED DESCRIPTION
[0043] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described below in connection with the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.
[0044] The acquisition, storage, use, and processing of data in the technical solutions of the present application all comply with relevant provisions of national laws and regulations.
[0045] In the prior art, the path planning of the multi-ant colony algorithm can optimize the path through clustering time windows, but cannot realize the adaptation to the transfer constraints of rail transit and dynamic passenger flow, or cannot cover the transfer costs specific to rail transit and cannot be constrained according to train timetables.
[0046] In view of the problems in the prior art, the present application provides a path planning method and device, which solves the dynamic adaptability and multi-objective trade-off problem of rail transit path planning through dynamic pheromone updating, multi-objective heuristic function (i.e., multi-objective cost function), and multi-ant colony cooperation, and can combine real-time scheduling of a traffic network model to plan a path.
[0047] In order to effectively solve the problems of the traditional technology, such as the poor dynamic adaptability of path planning, the difficulty in combining the actual traffic conditions for path planning, and the like, and significantly improve the dynamic adaptability of path planning, which is more in line with the real-time scheduling conditions of the traffic network, an embodiment of a path planning method is provided, as shown in Figure 1 The path planning method specifically includes the following contents:
[0048] Step S101: receiving a traffic network model, initial parameters of an ant colony algorithm, ant colony optimization objectives, a starting station and a terminal station, initializing a plurality of ant colonies and the traffic network model according to the initial parameters, and obtaining initial ant colonies.
[0049] The traffic network model includes station topological relations, train timetable information and real-time passenger flow data, and the ant colony optimization objectives include at least two of travel time, economic cost and transfer cost. Each ant colony optimization objective corresponds to an initial ant colony.
[0050] Optionally, the embodiment receives a traffic network model, initial parameters of an ant colony algorithm, ant colony optimization objectives, a starting station and a terminal station, initializes a plurality of ant colonies and the traffic network model, and obtains initial ant colonies. The traffic network model describes the topological relations of stations, train timetable information and real-time passenger flow data, so that path planning can be performed according to the traffic network model.
[0051] The number of ants included in each initial ant colony can be set to twice the number of stations included in the current traffic network model.
[0052] For example, the station topological relations can enable the ants to determine the selectable next passing station, i.e., the candidate station, the train timetable information can consider the actual running time of the train, i.e., the time from the current station to the next passing station, during the path planning process, especially when transferring, the waiting time for the next train can be considered, so that the travel time is clear, and the real-time passenger flow data can be used to avoid congested stations, thereby improving the practicability of the path.
[0053] The embodiment realizes the setting of a plurality of ant colonies, each of which corresponds to an optimization objective, realizes multi-objective optimization, enables the path planning to consider multiple factors, and meets the needs of different users. For example, for users who are more sensitive to time, the shortest time path can be optimized, and for users who are more sensitive to cost, the lowest cost path can be optimized. The multi-objective optimization improves the flexibility and practicability of the path planning.
[0054] Step S102: for each initial ant colony, each ant in the initial ant colony is controlled to start from the starting station, the next passing station is determined in the candidate station based on the multi-objective value and the pheromone, until the terminal station is reached, and the initial path corresponding to the current ant is obtained.
[0055] The multi-objective generation value is determined based on travel time, economic cost and transfer penalty coefficient between the current station and the candidate station.
[0056] Optionally, after the initialization is completed, the initial ant groups are obtained, and each ant in each initial ant group is controlled to start from the starting station. When selecting the next passing station, the ant can make a decision according to the multi-objective generation value and the pheromone, so that the ant determines the next station as the passing station by comprehensively considering multiple factors among the candidate stations, until the terminal station is reached, and an initial path corresponding to the current ant is obtained.
[0057] The multi-objective generation value is determined based on travel time, economic cost and transfer penalty coefficient between the current station and the candidate station. The pheromone can simulate the pheromone released by ants in nature, and is used to guide the selection of other ants. The concentration of the pheromone reflects the advantages and disadvantages of the path, and the ant tends to select the path with higher concentration of the pheromone.
[0058] Further, the multi-objective generation value can use an adaptive weight adjustment method to dynamically adjust the weight of each target according to real-time traffic conditions and user preferences, thereby improving the flexibility and accuracy of path planning.
[0059] The embodiment realizes the determination of the initial path of the current ant by the multi-objective generation value and the pheromone, so that multiple initial paths are obtained for each initial ant group, which facilitates the determination of the initial optimal path of the ant group from the multiple initial paths, and improves the globality.
[0060] Step S103: determining a total multi-objective generation value corresponding to each initial path, determining an initial optimal path of the ant group corresponding to the current initial ant group based on the total multi-objective generation value, locally updating the pheromone in the traffic network model based on the initial optimal path of the ant group, and cross-updating the pheromone according to the initial optimal path of the ant group in the case that all initial ant groups complete one iteration, to obtain an updated pheromone.
[0061] Optionally, the embodiment determines the total multi-objective generation value corresponding to each initial path, and determines the initial optimal path of the ant group corresponding to the current ant group according to the total multi-objective generation value. The pheromone in the traffic network model is locally updated according to the initial optimal path of the ant group. The update of the pheromone is an important part of the ant colony algorithm, and can reflect the advantages and disadvantages of the path, thereby providing a reference for the selection of subsequent ants.
[0062] In addition, after all initial ant groups complete one iteration, the pheromone is cross-updated according to the initial optimal path of the ant group, to obtain an updated pheromone, thereby enhancing the global search ability of the algorithm and enabling the information between different ant groups to be shared and fused.
[0063] Wherein, all initial ants completing one iteration can be understood as that each initial ant has determined a preset number of initial paths, and then the pheromone is updated according to the initial optimal path of each ant colony. Each iteration can be understood as that a preset number of initial paths are added to the number of initial paths that have been determined, and then the pheromone is updated according to the initial optimal path of each ant colony.
[0064] The embodiment realizes real-time updating of pheromone, makes path planning more accurate, can reflect the real-time state of the traffic network model, and at the same time, through multi-ant colony cooperative optimization and cross updating of pheromone, can avoid local optimal solution, improve global search ability, and make path planning more comprehensive.
[0065] Step S104: The step of obtaining the initial path corresponding to the current ant is repeatedly executed until a termination condition is met, and a plurality of ant colony updated optimal paths are obtained, and the ant colony updated optimal paths of each ant colony are displayed to the terminal device.
[0066] Wherein, the termination condition includes that the current iteration number reaches a preset maximum iteration number, or the ant colony updated optimal path corresponding to each initial ant colony has no change in a preset continuous iteration number.
[0067] Optionally, the embodiment repeatedly executes the above steps of path selection and pheromone updating until a termination condition is met, wherein the termination condition includes that the current iteration number reaches a preset maximum iteration number, or the ant colony updated optimal path corresponding to each initial ant colony has no change in a preset continuous iteration number.
[0068] In addition, displaying the ant colony updated optimal path obtained by each initial ant colony to the terminal device can enable the user to obtain multiple path planning modes for different optimization targets at the same time, and select the most suitable travel scheme according to actual needs.
[0069] The embodiment realizes that the iteration can be stopped in time after a stable optimal solution is found, avoids unnecessary waste of computing resources, and displays the ant colony updated optimal path to the terminal device, so as to provide the user with an optimized and reliable travel path.
[0070] In some embodiments, each ant in the initial ant colony is controlled to start from a starting station, determine a next passing station in a candidate station based on a multi-objective generation value and pheromone, and reach a terminal station, including:
[0071] Based on the topological relationship of the stations in the traffic network model, the candidate stations allowed to be reached from the current station are determined, and the pheromone of the current station reaching each candidate station in the current time period is determined.
[0072] determine a multi-objective value of the current station to each candidate station in the current period based on the preset multi-objective cost function, and determine a candidate probability of each candidate station becoming a next station based on the multi-objective value and the pheromone;
[0073] select the candidate probability through a roulette strategy to obtain a selection result, determine the candidate station corresponding to the selection result as the next station, and repeat the steps of determining the candidate station allowed to be reached from the current station based on the station topological relationship in the traffic network model, and determining the pheromone of the current station to each candidate station corresponding to the current period, until the terminal station is reached.
[0074] Optionally, the embodiment can determine the candidate station allowed to be reached from the current station based on the station topological relationship in the traffic network model. For example, the traffic network model shows that the current station is A, and the station topological relationship shows that the stations B, C and D adjacent to A can be reached from A, and then the stations B, C and D are all called candidate stations, wherein the candidate station refers to a station adjacent to the current station and reachable.
[0075] In addition, the pheromone of the current station to each candidate station corresponding to the current period is determined, wherein the pheromone reflects the advantages and disadvantages of the path and provides a reference for the selection of the current ant.
[0076] In addition, the multi-objective value of the current station to each candidate station in the current period is determined based on the preset multi-objective cost function, and the candidate probability of each candidate station becoming a next station is determined in combination with the multi-objective value and the pheromone, wherein the multi-objective value comprehensively considers multiple factors such as travel time, economic cost and transfer cost, so that the path planning is more comprehensive and practical.
[0077] In addition, the candidate probability can be selected through a roulette strategy, so that the next station can be randomly determined in the candidate station according to the candidate probability, ensuring the randomness, diversity and rationality of the selection, which can avoid the situation that the stations selected by each ant in the same initial ant colony are all the same, that is, avoid the local optimal solution, retain a certain random exploration space, provide multiple selectable paths for the user, and enhance the flexibility of path planning.
[0078] In addition, the steps of determining the candidate station allowed to be reached from the current station based on the station topological relationship in the traffic network model, and determining the pheromone of the current station to each candidate station corresponding to the current period are repeated until the terminal station is reached, so that each ant in each initial ant colony can find at least one complete path from the starting station to the terminal station.
[0079] The embodiment realizes the selection of the passing station through the roulette strategy by comprehensively considering the station topological relationship, the pheromone and the multi-objective generation value, and dynamically updating the pheromone and the multi-objective generation value, thereby improving the comprehensiveness, flexibility and dynamics of the path planning of the rail transit, and the path planning can be more scientific and reasonable according to the real-time situation of the traffic network model.
[0080] In some embodiments, the initial parameters include the pheromone importance and the heuristic factor.
[0081] The candidate probability of each candidate station becoming the next passing station is determined based on the multi-objective generation value and the pheromone, and includes:
[0082] The candidate probability of each candidate station becoming the next passing station is determined based on the multi-objective generation value and the pheromone corresponding to the current station to each candidate station through a preset probability calculation rule, wherein the preset probability calculation rule is represented as:
[0083] wherein P represents the candidate probability, i represents the current station, j represents the passing station, k represents the number of the current ant, represents the pheromone from the current period i to j, represents the multi-objective generation value, l represents the set of candidate stations, a represents the pheromone importance, and b represents the heuristic factor.
[0084] Optionally, the initial parameters of the ant colony algorithm in the embodiment include the pheromone importance and the heuristic factor, wherein the pheromone importance determines the influence of the pheromone on the path selection of the ant, and the heuristic factor reflects the importance of the heuristic information. The exploration and utilization can be balanced, and the ant colony algorithm can be prevented from falling into a local optimal solution through the reasonable setting of the initial parameters.
[0085] In addition, the candidate probability of each candidate station becoming the next passing station is determined based on the multi-objective generation value and the pheromone between the current station and each candidate station, and can be realized through a preset probability calculation rule, wherein the preset probability calculation rule can be represented as:
[0086] wherein P represents the candidate probability, i represents the current station, j represents the passing station, k represents the number of the current ant, represents the pheromone from the current period i to j, represents the pheromone from the current period i to l, represents the multi-objective generation value, l represents any one of all candidate next nodes that can be selected by the ant at the current node i, l is a temporary variable used to represent the current node iThe next node that can go to, alpha represents the importance of pheromone, and beta represents the heuristic factor.
[0087] The importance of pheromone determines the influence of pheromone on the selection of path by ants, and is a real number greater than 0, a higher importance of pheromone indicates that ants are more inclined to select a path with high pheromone concentration, however, too high importance of pheromone may lead to premature convergence of the ant colony algorithm and fall into local optimal solution, therefore, it is necessary to reasonably set the importance of pheromone;
[0088] The heuristic factor reflects the importance of heuristic information in path selection, and is a real number greater than 0, which can be determined based on the specific knowledge of the problem, such as the straight-line distance or cost between two points, a higher heuristic factor makes ants more inclined to select a path with better heuristic information, however, too high heuristic factor may lead the ant colony algorithm to rely too much on heuristic information and ignore the role of pheromone, thereby reducing the global search ability of the ant colony algorithm;
[0089] The multi-objective generation value comprehensively considers multiple factors such as travel time, economic cost and transfer cost, and is used to evaluate the pros and cons of the path from station i to station j, and can generate more comprehensive and practical path planning by considering multiple objectives through the multi-objective generation value;
[0090] The candidate probability is obtained based on the multi-objective generation value and pheromone, and the value range is 0 to 1, which represents the selection probability from the current station i to the candidate station j, and by calculating the candidate probability, a scientific selection basis can be provided for ants, so that they can consider multiple factors when selecting the next station.
[0091] The multi-objective generation value can be determined by a multi-objective cost function, and the multi-objective cost function can be expressed as:
[0092] ;
[0093] Wherein, i represents the current station, j represents the station, represents the multi-objective generation value, represents the running time, represents the economic cost, represents the transfer penalty coefficient, and w1, w2 and w3 represent the weight coefficients.
[0094] The weight coefficients can be determined according to the ant colony optimization target. For example, when the ant colony optimization target of the initial ant colony is to minimize the time, the weight coefficients can be set as w1=0.8, w2=0.1, and w3=0.1. When the ant colony optimization target of the initial ant colony is to minimize the economic cost, the weight coefficients can be set as w1=0.1, w2=0.8, and w3=0.1. When the ant colony optimization target of the initial ant colony is to minimize the number of changes, the weight coefficients can be set as w1=0.2, w2=0.7, and w3=0.1.
[0095] Further, in addition to the site topology relationship and the pheromone obtaining the candidate probability of each candidate site and determining the next passing site according to the candidate probability, real-time weather data and emergency information can also be fused to determine the next passing site. For example, if heavy rain occurs in a certain area, the pheromone can be adjusted to guide the ants to select a path without water, thereby improving the practicality and reliability of the path planning.
[0096] The embodiment realizes comprehensive consideration of multi-objective generation value and pheromone, improves the comprehensiveness, flexibility and dynamics of the path planning through the selection mechanism according to the candidate probability, dynamically adjusts the importance of the pheromone and the heuristic factor, provides more scientific, reasonable and personalized path planning for the user, and enables the user to more efficiently and conveniently reach the terminal site, thereby improving the user experience.
[0097] In some embodiments, the ant colony initial optimal path corresponding to the current initial ant colony is determined based on the total multi-objective generation value in each iteration round, and the pheromone in the traffic network model is locally updated based on the ant colony initial optimal path, including:
[0098] The maximum carrying capacity of the current site to the next passing site in the current period in the travel process of the ant in the initial path is obtained, and the initial pheromone between each adjacent site in the traffic network model is obtained.
[0099] The initial pheromone between each adjacent site in the initial path is updated based on the maximum carrying capacity, the real-time passenger flow data of the current site to the next passing site, and the initial path through a preset pheromone concentration adjustment rule, to obtain the updated pheromone.
[0100] The ant colony initial optimal path corresponding to the current initial ant colony is determined based on the total multi-objective generation value in each iteration round, and the pheromone is updated based on the maximum carrying capacity corresponding to the ant colony initial optimal path, the real-time passenger flow data between each site in the ant colony initial optimal path, and the ant colony initial optimal path, to obtain the reinforced pheromone.
[0101] Optionally, the embodiment obtains the maximum carrying capacity of the current station to the next station in the current period during the running of the ant on the initial path and the initial pheromone between the adjacent stations in the traffic network model, wherein the maximum carrying capacity reflects the carrying capacity of the traffic network model between the current station and the next station.
[0102] In addition, according to the maximum carrying capacity, the real-time passenger flow data of the current station to the next station and the initial path, the initial pheromone between the adjacent stations in the initial path is updated by a preset pheromone concentration adjustment rule to obtain updated pheromone, so that the pheromone in the ant colony algorithm can dynamically reflect the real-time state of the path, and other ants in the current initial ant colony can determine the initial path according to the real-time state.
[0103] In addition, the ant colony initial optimal path corresponding to the current initial ant colony in the current iteration round is determined according to the total multi-objective generation value, and the reinforced pheromone in the ant colony initial optimal path is obtained according to the maximum carrying capacity corresponding to the ant colony initial optimal path, the real-time passenger flow data between the stations in the ant colony initial optimal path and the ant colony initial optimal path.
[0104] The real-time passenger flow data is dynamically updated and can reflect the carrying capacity of the traffic network model in real time. By obtaining the maximum carrying capacity, the path planning can not exceed the carrying capacity of the traffic network model, and the practicability and reliability of the path are improved.
[0105] The reinforced pheromone is the pheromone updated according to the maximum carrying capacity, the real-time passenger flow data and the path state on the basis of the ant colony initial optimal path, which further improves the guiding effect of the pheromone and improves the global search ability of the path planning to avoid falling into a local optimal solution.
[0106] The maximum carrying capacity corresponding to the ant colony initial optimal path, the real-time passenger flow data between the stations in the ant colony initial optimal path and the ant colony initial optimal path can be implemented by a preset reinforcement pheromone calculation rule, and the preset reinforcement pheromone calculation rule can be expressed as:
[0107] ;
[0108] Wherein, i represents the current station, j represents the station, p represents the pheromone evaporation coefficient, specifically, p represents: pheromone evaporation coefficient (p (0< p <1 ), which represents the proportion of natural “volatilization” of pheromone with time; (1-p) is the proportion of pheromone remaining after volatilization, k represents the number of the current ant, represents the pheromone from the current period i to j, represents the real-time passenger flow data in the current period, represents the maximum carrying capacity, denoted by , where represents the total path length of the initial optimal path of the ant colony, and Q represents the pheromone intensity coefficient.
[0109] Furthermore, an adaptive adjustment mechanism can be implemented through the pheromone evaporation coefficient, dynamically adjusting the evaporation rate according to the load status of the current initial path. For initial paths with consistently high loads, a fast evaporation strategy is adopted to accelerate the reduction of their pheromone concentration, while for paths with moderate loads, a slow evaporation strategy is adopted to maintain the stability of their pheromone concentration. Additionally, a passenger flow prediction model can be introduced to incorporate predicted passenger flow data for future periods into the pheromone update considerations, enabling path planning to have a forward-looking adjustment capability.
[0110] This embodiment improves the comprehensiveness, flexibility, and dynamism of route planning by comprehensively considering the multi-objective cost and pheromone, and dynamically adjusting the importance of pheromone and heuristic factors. It avoids unrealistic planning schemes, and real-time passenger flow data can accurately reflect the current operating status, ensuring the timeliness and practicality of route planning. It also takes into account the actual constraints of rail transit operation, making the resulting planned route practically feasible.
[0111] In some embodiments, the initial parameters include a pheromone intensity constant;
[0112] Based on the maximum carrying capacity, real-time passenger flow data from the current station to the next transit station, and the initial path, the initial pheromones between adjacent stations along the initial path are updated using a preset pheromone concentration adjustment rule to obtain the updated pheromones, including:
[0113] Based on the initial path, the number of stations included in the initial path is determined as the total path length of the initial path;
[0114] Based on the maximum carrying capacity, real-time passenger flow data from the current station to the next transit station, and the total path length, the initial pheromones between adjacent stations in the initial path are updated using preset pheromone concentration adjustment rules to obtain the updated pheromones.
[0115] The preset pheromone concentration adjustment rule is expressed as follows:
[0116] ;
[0117] Where i represents the current station, j represents the stations along the way, and k represents the current ant's ID. This represents the pheromone levels from time i to j. This represents real-time passenger flow data for the current time period. Indicates the maximum load capacity. Let Q represent the total path length and Q represent the pheromone intensity coefficient.
[0118] Optionally, in the process of initializing the ant colony algorithm and the traffic network model by the initial parameters, the initial parameters include a pheromone intensity constant, which is used to represent the reference intensity of the pheromone increment and can directly affect the deposition rate of the pheromone on the path. A larger pheromone intensity constant can make the high-quality path accumulate pheromone faster, accelerating the convergence of the algorithm, and a smaller pheromone intensity constant can maintain a longer exploration ability.
[0119] In addition, according to the initial path, the number of stations included in the initial path is determined as the path total length of the initial path, where the path total length is an index for determining the quality of the path, reflecting the length and complexity of the path.
[0120] In addition, according to the maximum carrying capacity, the real-time passenger flow data of the current station to the next station, and the path total length, the initial pheromone between each adjacent station in the initial path is updated by a preset pheromone concentration adjustment rule to obtain updated pheromone, so that the pheromone can dynamically reflect the real-time state of the path.
[0121] The preset pheromone concentration adjustment rule can be expressed as:
[0122] ;
[0123] Where i represents the current station, j represents the station, and k represents the number of the current ant, represents the pheromone from the current period i to j, represents the real-time passenger flow data in the current period, represents the maximum carrying capacity, represents the path total length, and Q represents the pheromone intensity coefficient.
[0124] Further, the pheromone intensity can also be adjusted according to real-time traffic conditions and historical data. For example, if it is determined through historical data that a certain line is often congested, the pheromone intensity of the line can be reduced to guide the ants to select other paths, improving the adaptability and accuracy of path planning.
[0125] The embodiment realizes the fusion of the static characteristics of the traffic network model and the dynamic operation data, so that the result of the planned path is more in line with the actual operation situation. The maximum carrying capacity is used to make the planned path not exceed the physical carrying capacity range of the line, avoiding unrealistic path planning. The planned path can consider the actual constraints of rail transit operation while combining the basic principles of the ant colony algorithm, so that the output planned path has both theoretical optimality and practical feasibility.
[0126] In some embodiments, in the case where all initial ants complete one iteration, the pheromone is cross-updated according to the initial optimal path of each ant colony to obtain updated pheromone, including:
[0127] In the case where each initial ant group reaches the iteration number corresponding to the preset cooperation period, the pheromone is cross-updated according to the initial optimal path of each ant group, to obtain updated pheromone.
[0128] In the case where at least one initial ant group does not reach the iteration number corresponding to the preset cooperation period, the initial optimal path of the initial ant group reaching the iteration number corresponding to the preset cooperation period is saved, and the iteration is stopped until the updated pheromone is obtained.
[0129] In the case where each initial ant group reaches the iteration number corresponding to the preset cooperation period, the pheromone is cross-updated according to the initial optimal path of each ant group, to obtain updated pheromone, wherein the preset cooperation period can be understood as a set iteration number, and in the case where each initial ant group reaches the iteration number, the cross-updating of the pheromone is performed, so that the updating of the pheromone can comprehensively consider the optimal paths of all ant groups, and the global search ability of path planning is improved.
[0130] In addition, in the case where at least one initial ant group does not reach the iteration number corresponding to the preset cooperation period, the initial optimal path of the initial ant group reaching the iteration number corresponding to the preset cooperation period of the current round is saved, and the iteration is stopped until the updated pheromone is obtained, so as to avoid wasting computing resources.
[0131] For example, in the case where the preset cooperation period is 50 iterations and the preset maximum iteration number is 500, the cross-updating of the pheromone can be started after the 50th iteration of each initial ant group ends, the cross-updating of the pheromone can be started after the 100th iteration of each initial ant group ends, and so on. The cross-updating of the pheromone is performed after the 150th iteration and the 200th iteration end, until the termination condition is met.
[0132] The cross-updating indicates that the initial ant groups focusing on different ant group optimization objectives exchange pheromones to update the pheromones, which is a cross-population cross-updating pheromone method, thereby allowing the initial ant groups focusing on different ant group optimization objectives to exchange search experience.
[0133] The calculation rule of the cross-updating can be represented as:
[0134] ;
[0135] wherein, represents the updated pheromone between the site i and the next passing site j adjacent to the site i, represents the current pheromone from i to j, k represents the number of the current ant in the current initial ant group, best represents the initial optimal path of the ant group in the current ant group, and Q represents a pheromone intensity coefficient, represents the length of the optimal path found by the ant k in the current iteration, where "best" embodies the "optimality" constraint - only the optimal path found by the ant will make a significant contribution to the pheromone, thus preferentially reinforcing those paths that have been repeatedly verified as "short, optimal", avoiding the algorithm falling into local optimum.
[0136] Further, the preset cooperation period can be dynamically adjusted according to real-time traffic conditions and user demand, for example, in the case of real-time passenger flow data indicating congestion on a certain line, the preset cooperation period can be appropriately shortened to speed up the update frequency of the pheromone and improve the adaptability of path planning.
[0137] The embodiment provides an orderly way for multi-ant colony collaborative optimization, avoids search confusion caused by unordered information exchange, periodic pheromone update ensures independent exploration time of each initial ant colony, and high-quality search experience can be shared in time, the information barrier of single target search is broken through cross update, initial ant colonies of different ant colony optimization targets can learn from each other, calculation resources are effectively utilized, and the professional search ability of each initial ant colony is maintained, thereby improving the performance of overall path planning.
[0138] In some embodiments, the method further comprises:
[0139] receiving a user preference target, the user preference target being one of the ant colony optimization targets;
[0140] determining an ant colony updated optimal path that meets the user preference target from the ant colony updated optimal paths as a planning path, and displaying other ant colony updated optimal paths to the terminal device as candidate paths.
[0141] Optionally, the embodiment receives a user preference target, the user preference target can be any one of the ant colony optimization targets, the user preference target can be received through the terminal device, and after all initial ant colonies complete iteration and update pheromone, a path meeting the user preference target is screened from the ant colony updated optimal paths, and the path is determined as a planning path.
[0142] The planning path is sent and displayed to the terminal device, and other ant colony updated optimal paths are sent and displayed to the terminal device as candidate paths, so that the planning path is optimal in the dimensions of planning and user preference, and the user can also be provided with diversified choices through the candidate paths.
[0143] Further, the path corresponding to the user preference target can be determined as the planning path, and the detailed location of the planning path is highlighted, and the information of the planning path is labeled in detail, and other ant colony updated optimal paths are candidate paths, so that the main planning path is highlighted, and the diversity of selection is maintained.
[0144] Further, a user preference memory model can be established to record the historical selection mode of different users, and a planning path conforming to the user's habitual preference is preferentially recommended when a similar scenario occurs.
[0145] The embodiment realizes the determination of a planning path through a user preference target, accurately connects the planning path with the actual use demand of the user, avoids the problem that the optimization result is inconsistent with the actual demand of the user, simultaneously plays an advantage in multi-target optimization through an alternative path, and improves the user use experience and the practical value of path planning.
[0146] In order to effectively solve the problems of the traditional technology, such as insufficient dynamic adaptability of path planning, difficulty in combining the actual traffic condition to perform path planning, and the like, significantly improve the dynamic adaptability of path planning, and be more consistent with the real-time scheduling condition of a traffic network, an embodiment of a path planning device for implementing all or part of the contents of the path planning is provided, which is shown in Figure 2 , and the path planning device specifically includes the following contents:
[0147] The receiving module 10 is configured to receive a traffic network model, initial parameters of an ant colony algorithm, ant colony optimization targets, a starting station and a terminal station, initialize a plurality of ant colonies and the traffic network model according to the initial parameters, and obtain initial ant colonies, wherein the traffic network model includes station topological relations, train timetable information and real-time passenger flow data, the ant colony optimization targets include at least two of travel time, economic cost and transfer cost, and each ant colony optimization target corresponds to an initial ant colony;
[0148] The exploration module 20 is configured to control each ant in each initial ant colony to start from the starting station, determine a next passing station in a candidate station based on a multi-target value and pheromone, and obtain an initial path corresponding to the current ant until the terminal station is reached, wherein the multi-target value is determined based on travel time, economic cost and a transfer penalty coefficient between a current station and the candidate station.
[0149] The updating module 30 is configured to determine a total multi-target value corresponding to each initial path, determine an initial optimal path of an ant colony corresponding to the current initial ant colony based on the total multi-target value, locally update the pheromone in the traffic network model based on the initial optimal path of the ant colony, cross-update the pheromone according to the initial optimal path of each ant colony in the case that all the initial ant colonies complete one iteration, and obtain an updated pheromone.
[0150] The decision module 40 is configured to repeatedly perform the step of obtaining the initial path corresponding to the current ant until a termination condition is met, to obtain multiple ant colony updated optimal paths, and to display the ant colony updated optimal paths to the terminal device. The termination condition includes that the current iteration number reaches a preset maximum iteration number, or that the ant colony updated optimal paths corresponding to the initial ants do not change in a preset continuous iteration number.
[0151] As can be seen from the above description, the path planning device provided by the embodiments of the present application can receive the traffic network model, the initial parameters of the ant colony algorithm, the ant colony optimization target, the starting station and the terminal station innovatively, initialize the multiple ant colonies and the traffic network model according to the initial parameters, and obtain the initial ants. The traffic network model includes the station topological relationship, the train timetable information and the real-time passenger flow data. The ant colony optimization target includes at least two of the travel time, the economic cost and the transfer penalty coefficient. Each ant colony optimization target corresponds to an initial ant. For each initial ant, each ant in the initial ant is controlled to start from the starting station, to determine the next passing station in the candidate station according to the multi-objective value and the pheromone, and to reach the terminal station until the initial path corresponding to the current ant is obtained. The multi-objective value is determined according to the travel time, the economic cost and the transfer penalty coefficient between the current station and the candidate station. The total multi-objective value corresponding to each initial path is determined. The ant colony initial optimal path corresponding to the current initial ant is determined according to the total multi-objective value. The pheromone in the traffic network model is locally updated according to the ant colony initial optimal path. In the case that all the initial ants complete one iteration, the pheromone is cross-updated according to the ant colony initial optimal path to obtain the updated pheromone. The step of obtaining the initial path corresponding to the current ant is repeatedly performed until the termination condition is met, to obtain multiple ant colony updated optimal paths. The ant colony updated optimal paths are displayed to the terminal device. The termination condition includes that the current iteration number reaches a preset maximum iteration number, or that the ant colony updated optimal paths corresponding to the initial ants do not change in a preset continuous iteration number. By setting multiple ants and each ant corresponding to an ant colony optimization target, multiple optimization targets can be considered at the same time, the flexibility of path planning is improved, the changes of the traffic network model can be dynamically adapted according to the pheromone of the traffic network model, and more accurate and actual traffic condition-compliant path planning is provided. The method effectively solves the deficiencies of the traditional technology, such as insufficient dynamic adaptability of path planning, difficulty in combining actual traffic conditions for path planning, and significantly improves the dynamic adaptability of path planning, which is more in line with the real-time scheduling of the traffic network.
[0152] From the hardware level, in order to effectively solve the dynamic adaptability of the path planning of the traditional technology, it is difficult to combine the actual traffic situation to plan the path, and other aspects of the deficiency, significantly improve the dynamic adaptability of path planning, more in line with the real-time scheduling of the traffic network, the present application provides an embodiment of an electronic device for implementing all or part of the contents of the path planning method, the electronic device specifically contains the following contents:
[0153] The processor, the memory, the communications interface and the bus; wherein the processor, the memory, the communications interface complete the communication between each other through the bus; the communications interface is used for realizing the information transmission between the path planning device and the core business system, the user terminal and the related database and other related devices; the logic controller can be a desktop computer, a tablet computer and a mobile terminal, etc., and the embodiment is not limited thereto. In the embodiment, the logic controller can be implemented with reference to the embodiments of the path planning method and the embodiments of the path planning device, the contents of which are incorporated herein, and the repeated parts will not be described again.
[0154] It can be understood that the user terminal can include a smart phone, a tablet electronic device, a network set-top box, a portable computer, a desktop computer, a personal digital assistant (PDA), a vehicle-mounted device, a smart wearable device, etc. The smart wearable device can include smart glasses, a smart watch, a smart bracelet, etc.
[0155] In practical applications, part of the path planning method can be executed on the electronic device as described above, or all operations can be completed in the client device. Specifically, the processing capacity of the client device and the use scene of the user can be selected. The present application does not limit this. If all operations are completed in the client device, the client device can also include a processor.
[0156] The above-mentioned client device can have a communication module (i.e. a communication unit) and can be connected to a remote server to realize data transmission with the server. The server can include a server of the task scheduling center side, and other implementation scenarios can also include a server of an intermediate platform, such as a server of a third-party server platform that is communicatively linked to the server of the task scheduling center. The server can include a single computer device, a server cluster composed of multiple servers, or a distributed server structure.
[0157] Figure 3 The schematic block diagram of the system structure of the electronic device 9600 of the embodiment of the present application is shown in FIG. 9. As shown in FIG. 9, the electronic device 9600 includes a processor 9601, a memory 9602, a communications interface 9603 and a bus 9604; wherein the processor 9601, the memory 9602, the communications interface 9603 complete the communication between each other through the bus 9604; the communications interface 9603 is used for realizing the information transmission between the path planning device and the core business system, the user terminal and the related database and other related devices; the logic controller can be a desktop computer, a tablet computer and a mobile terminal, etc., and the embodiment is not limited thereto. In the embodiment, the logic controller can be implemented with reference to the embodiments of the path planning method and the embodiments of the path planning device, the contents of which are incorporated herein, and the repeated parts will not be described again. Figure 3As shown, the electronic device 9600 can include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. Notably, the Figure 3 are exemplary; other types of structures can also be used, in addition to or instead of this structure, to implement telecommunication functions or other functions.
[0158] In an embodiment, the path planning method function can be integrated into the central processor 9100. Among them, the central processor 9100 can be configured to control as follows:
[0159] Step S101: Receive a traffic network model, initial parameters of an ant colony algorithm, an ant colony optimization target, a starting station and a terminal station, initialize a plurality of ant colonies and the traffic network model according to the initial parameters, and obtain initial ant colonies, wherein the traffic network model includes station topological relationship, train timetable information and real-time passenger flow data, the ant colony optimization target includes at least two of travel time, economic cost and transfer cost, and each ant colony optimization target corresponds to an initial ant colony;
[0160] Step S102: For each initial ant colony, control each ant in the initial ant colony to start from the starting station, determine the next passing station in the candidate station based on the multi-objective value and pheromone, until the terminal station is reached, and obtain the initial path corresponding to the current ant, wherein the multi-objective value is determined based on the travel time, economic cost and transfer penalty coefficient between the current station and the candidate station;
[0161] Step S103: Determine the total multi-objective value corresponding to each initial path, determine the ant colony initial optimal path corresponding to the current initial ant colony based on the total multi-objective value, and locally update the pheromone in the traffic network model based on the ant colony initial optimal path, and in the case that all initial ant colonies complete an iteration, cross update the pheromone according to the ant colony initial optimal path of each ant colony, to obtain the updated pheromone;
[0162] Step S104: Repeat the step of obtaining the initial path corresponding to the current ant until the termination condition is met, to obtain a plurality of ant colony updated optimal paths, and display each ant colony updated optimal path to a terminal device, wherein the termination condition includes that the current iteration number reaches a preset maximum iteration number, or the ant colony updated optimal path corresponding to each initial ant colony has no change in a preset continuous iteration number.
[0163] As described above, the electronic device provided in this application innovatively receives a traffic network model, initial parameters of the ant colony algorithm, ant colony optimization objectives, a starting station, and a termination station. It initializes multiple ant colonies and the traffic network model according to the initial parameters to obtain an initial ant colony. The traffic network model includes station topology relationships, train timetable information, and real-time passenger flow data. The ant colony optimization objectives include at least two of travel time, economic cost, and transfer cost. Each ant colony optimization objective corresponds to an initial ant colony. For each initial ant colony, each ant is controlled to start from the starting station and determine the next transit station from candidate stations based on multi-objective cost and pheromone, until the termination station is reached, thus obtaining the initial path corresponding to the current ant. The multi-objective cost is determined based on the current station and the pheromone level. The process involves determining the travel time, economic cost, and transfer penalty coefficient between selected stations, establishing the total multi-objective cost value for each initial path, determining the initial optimal path for the current ant colony based on this total multi-objective cost value, and locally updating the pheromone in the traffic network model according to the initial optimal path. After all initial ant colonies have completed one iteration, the pheromone is cross-updated based on the initial optimal paths of each ant colony to obtain the updated pheromone. This process is repeated to obtain the initial path for the current ant colony until a termination condition is met, resulting in multiple updated optimal paths for each ant colony. These updated optimal paths are then displayed on the terminal device. The termination condition includes reaching a preset maximum number of iterations or no change in the updated optimal paths for each initial ant colony within a preset number of consecutive iterations. By setting multiple ant colonies, each corresponding to a specific ant colony optimization objective, multiple optimization objectives can be considered simultaneously, improving the flexibility of path planning. Furthermore, the system can dynamically adapt to changes in the traffic network model based on the pheromone, providing more accurate path planning that reflects actual traffic conditions. This method effectively addresses the shortcomings of traditional technologies, such as insufficient dynamic adaptability of path planning and difficulty in combining path planning with actual traffic conditions. It significantly improves the dynamic adaptability of path planning and is more in line with the real-time scheduling of traffic networks.
[0164] In another embodiment, the path planning device can be configured separately from the central processing unit 9100. For example, the path planning device can be configured as a chip connected to the central processing unit 9100, and the path planning method function can be implemented through the control of the central processing unit.
[0165] like Figure 3 As shown, the electronic device 9600 may further include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is worth noting that the electronic device 9600 does not necessarily need to include these components. Figure 3 All components shown; in addition, the electronic device 9600 may also include Figure 3For components not shown, please refer to existing technologies.
[0166] like Figure 3 As shown, the central processing unit 9100, sometimes also referred to as a controller or operating control, may include a microprocessor or other processor device and / or logic device, which receives inputs and controls the operation of various components of the electronic device 9600.
[0167] The memory 9140 may be, for example, one or more of a cache, flash memory, hard drive, removable media, volatile memory, non-volatile memory, or other suitable devices. It may store the aforementioned failure-related information, and also store a program for executing that information. The central processing unit 9100 may execute the program stored in the memory 9140 to perform information storage or processing, etc.
[0168] Input unit 9120 provides input to central processing unit 9100. Input unit 9120 may be, for example, a keypad or touch input device. Power supply 9170 provides power to electronic device 9600. Display 9160 displays images and text. Display may be, for example, an LCD display, but is not limited thereto.
[0169] The memory 9140 can be a solid-state memory, such as a read-only memory (ROM), random access memory (RAM), a SIM card, etc. It can also be a memory that retains information even when power is off, can be selectively erased, and contains more data; examples of this type of memory are sometimes referred to as EPROMs. The memory 9140 can also be some other type of device. The memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application / function storage unit 9142 for storing application programs and function programs or processes for executing the operation of the electronic device 9600 via the central processing unit 9100.
[0170] The memory 9140 may also include a data storage unit 9143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 9144 of the memory 9140 may include various drivers for the electronic device for communication functions and / or for performing other functions of the electronic device (such as messaging applications, address book applications, etc.).
[0171] The communication module 9110 is a transmitter / receiver that transmits and receives signals via the antenna 9111. The communication module 9110 (transmitter / receiver) is coupled to the central processor 9100 to provide input signals and receive output signals, as in the case of a conventional mobile communication terminal.
[0172] Based on different communication technologies, a plurality of communication modules 9110, such as a cellular network module, a Bluetooth module, and / or a wireless local area network module, can be provided in the same electronic device. The communication module 9110 (transmitter / receiver) is also coupled to the speaker 9131 and the microphone 9132 via the audio processor 9130 to provide audio output via the speaker 9131 and receive audio input from the microphone 9132, thereby implementing a conventional telecommunication function. The audio processor 9130 can include any suitable buffer, decoder, amplifier, etc. In addition, the audio processor 9130 is also coupled to the central processor 9100, thereby enabling recording on the local device via the microphone 9132 and playing stored sound on the local device via the speaker 9131.
[0173] The embodiment of the present application further provides a computer readable storage medium capable of implementing all steps of the path planning method in which the execution subject is the server or the client in the above-mentioned embodiment. The computer readable storage medium stores a computer program. When the processor executes the computer program, all steps of the path planning method in which the execution subject is the server or the client in the above-mentioned embodiment are implemented. For example, when the processor executes the computer program, the following steps are implemented:
[0174] Step S101: receiving a traffic network model, initial parameters of an ant colony algorithm, an ant colony optimization target, a starting station and a terminal station, initializing a plurality of ant colonies and the traffic network model according to the initial parameters to obtain initial ant colonies, wherein the traffic network model comprises station topological relations, train timetable information and real-time passenger flow data, the ant colony optimization target comprises at least two of travel time, economic cost and transfer penalty, and each ant colony optimization target corresponds to an initial ant colony;
[0175] Step S102: for each initial ant colony, controlling each ant in the initial ant colony to start from the starting station, determining a next passing station in a candidate station based on a multi-objective value and pheromone, until reaching the terminal station, to obtain an initial path corresponding to the current ant, wherein the multi-objective value is determined based on travel time, economic cost and a transfer penalty coefficient between a current station and the candidate station;
[0176] Step S103: determine the total multi-objective generation value corresponding to each initial path, determine the initial optimal path of the current initial ant group based on the total multi-objective generation value, and locally update the pheromone in the traffic network model based on the initial optimal path of the ant group, in the case that all initial ant groups complete one iteration, cross update the pheromone according to the initial optimal path of each ant group, and obtain the updated pheromone;
[0177] Step S104: repeat the step of obtaining the initial path corresponding to the current ant to obtain the ant group updated optimal path, and display each ant group updated optimal path to the terminal device, wherein the termination condition includes that the current iteration number reaches the preset maximum iteration number, or the ant group updated optimal path corresponding to each initial ant group has no change in the preset continuous iteration number.
[0178] From the above description, the computer readable storage medium provided by the embodiment of the application can be known, by innovatively receiving a traffic network model, initial parameters of an ant colony algorithm, an ant colony optimization target, a starting station and a terminal station, initializing a plurality of ant colonies and the traffic network model according to the initial parameters to obtain initial ant colonies, wherein the traffic network model includes station topological relations, train timetable information and real-time passenger flow data, the ant colony optimization target includes at least two of travel time, economic cost and transfer cost, each ant colony optimization target corresponds to an initial ant colony, for each initial ant colony, each ant in the initial ant colony is controlled to start from the starting station, the next passing station is determined in a candidate station according to a multi-objective value and pheromone, until the terminal station is reached, to obtain an initial path corresponding to the current ant, wherein the multi-objective value is determined according to travel time, economic cost and transfer penalty coefficient between the current station and the candidate station, a total multi-objective value corresponding to each initial path is determined, an ant colony initial optimal path corresponding to the current initial ant colony is determined according to the total multi-objective value, and the pheromone in the traffic network model is locally updated according to the ant colony initial optimal path, in the case that all initial ant colonies complete one iteration, the pheromone is cross-updated according to the ant colony initial optimal path of each ant colony, to obtain updated pheromone, the step of obtaining the initial path corresponding to the current ant is repeatedly executed until a termination condition is met, to obtain a plurality of ant colony updated optimal paths, and each ant colony updated optimal path is displayed to a terminal device, wherein the termination condition includes that a current iteration number reaches a preset maximum iteration number, or the ant colony updated optimal path corresponding to each initial ant colony has no change in a preset continuous iteration number. By setting a plurality of ant colonies and each ant colony corresponding to an ant colony optimization target, a plurality of optimization targets can be considered at the same time, the flexibility of path planning is improved, and the change of the traffic network model can be dynamically adapted according to the pheromone of the traffic network model, to provide more accurate and actual traffic condition conforming path planning. The method effectively solves the deficiencies of the traditional technology, such as insufficient dynamic adaptability of path planning, difficulty in combining actual traffic conditions for path planning and the like, significantly improves the dynamic adaptability of path planning, and is more consistent with real-time scheduling of the traffic network.
[0179] The embodiment of the application also provides a computer program product capable of implementing all steps of the path planning method in which the execution subject in the above embodiment is a server or a client. The computer program / instruction is executed by a processor to implement the steps of the path planning method, for example, the computer program / instruction implements the following steps:
[0180] Step S101: receiving a traffic network model, initial parameters of an ant colony algorithm, an ant colony optimization objective, a starting station and a terminal station, initializing a plurality of ant colonies and the traffic network model according to the initial parameters to obtain initial ant colonies, wherein the traffic network model comprises station topological relations, train timetable information and real-time passenger flow data, the ant colony optimization objective comprises at least two of travel time, economic cost and transfer cost, and each ant colony optimization objective corresponds to an initial ant colony;
[0181] Step S102: for each initial ant colony, controlling each ant in the initial ant colony to start from the starting station, determining a next passing station in a candidate station based on a multi-objective value and pheromone, until reaching the terminal station, to obtain an initial path corresponding to the current ant, wherein the multi-objective value is determined based on travel time, economic cost and a transfer penalty coefficient between a current station and the candidate station;
[0182] Step S103: determining a total multi-objective value corresponding to each initial path, determining an initial optimal ant colony path corresponding to the current initial ant colony based on the total multi-objective value, and locally updating pheromone in the traffic network model based on the initial optimal ant colony path, in the case that all initial ant colonies complete an iteration, cross updating the pheromone according to the initial optimal ant colony path of each ant colony to obtain updated pheromone;
[0183] Step S104: repeatedly performing the step of obtaining the initial path corresponding to the current ant until a termination condition is met, to obtain a plurality of updated optimal ant colony paths, and displaying the updated optimal ant colony paths to a terminal device, wherein the termination condition comprises that a current iteration number reaches a preset maximum iteration number, or the updated optimal ant colony path corresponding to each initial ant colony has no change in a preset continuous iteration number.
[0184] From the above description, the computer program product provided by the embodiment of the application receives the traffic network model, the initial parameters of the ant colony algorithm, the ant colony optimization target, the starting station and the ending station innovatively, initializes the plurality of ant colonies and the traffic network model according to the initial parameters, and obtains the initial ant colonies. The traffic network model includes the station topological relationship, the train timetable information and the real-time passenger flow data. The ant colony optimization target includes at least two of the travel time, the economic cost and the transfer cost. Each ant colony optimization target corresponds to an initial ant colony. For each initial ant colony, each ant in the initial ant colony is controlled to start from the starting station, the next passing station is determined in the candidate station according to the multi-objective value and the pheromone, until the ending station is reached, and the initial path corresponding to the current ant is obtained. The multi-objective value is determined according to the travel time, the economic cost and the transfer penalty coefficient between the current station and the candidate station. The total multi-objective value corresponding to each initial path is determined. The ant colony initial optimal path corresponding to the current initial ant colony is determined according to the total multi-objective value. The pheromone in the traffic network model is locally updated according to the ant colony initial optimal path. In the case that all the initial ant colonies complete one iteration, the pheromone is cross-updated according to the ant colony initial optimal path, the updated pheromone is obtained, the step of obtaining the initial path corresponding to the current ant is repeatedly executed until the termination condition is met, a plurality of ant colony updated optimal paths are obtained, and the ant colony updated optimal paths are displayed to the terminal device. The termination condition includes that the current iteration number reaches the preset maximum iteration number, or the ant colony updated optimal path corresponding to each initial ant colony has no change in the preset continuous iteration number. By setting the plurality of ant colonies and each ant colony corresponding to one ant colony optimization target, the plurality of optimization targets can be considered at the same time, the flexibility of path planning is improved, the change of the traffic network model can be dynamically adapted according to the pheromone of the traffic network model, and more accurate and actual traffic condition conforming path planning is provided. The method effectively solves the problems of the traditional technology, such as the insufficient dynamic adaptability of path planning, the difficulty in combining the actual traffic condition for path planning, and the like, significantly improves the dynamic adaptability of path planning, and is more in line with the real-time scheduling of the traffic network.
[0185] Those skilled in the art will understand that the embodiments of the present application can be provided as a method, device, or computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0186] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 one or more flowcharts and / or blocks
[0187] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 one or more flowcharts and / or blocks
[0188] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 one or more flowcharts and / or blocks
[0189] The principles and implementations of the present application are described in the specific embodiments of the present application, the above examples are only used to help understand the method of the present application and its core idea; at the same time, for those skilled in the art, according to the idea of the present application, the specific implementation and application range will be changed, and the above description should not be understood as the limitation of the present application.
Claims
1. A path planning method characterized by, The method comprises: receiving a traffic network model, initial parameters of an ant colony algorithm, ant colony optimization objectives, a starting station and a terminal station, initializing a plurality of ant colonies and the traffic network model according to the initial parameters to obtain initial ant colonies, wherein the traffic network model comprises station topological relations, train timetable information and real-time passenger flow data, the ant colony optimization objectives comprise at least two of travel time, economic cost and transfer cost, and each of the ant colony optimization objectives corresponds to an initial ant colony; for each of the initial ant colonies, controlling each ant in the initial ant colony to start from the starting station, determining a next passing station in a candidate station based on a multi-objective value and pheromone, until reaching the terminal station, to obtain an initial path corresponding to the current ant, wherein the multi-objective value is determined based on travel time, economic cost and transfer penalty coefficient between a current station and the candidate station; determining a total multi-objective value corresponding to each of the initial paths, determining an initial optimal ant colony path corresponding to the current initial ant colony based on the total multi-objective value, and locally updating pheromone in the traffic network model based on the initial optimal ant colony path, in the case that all the initial ant colonies complete an iteration, cross updating pheromone according to each of the initial optimal ant colony paths to obtain updated pheromone; in the case that all the initial ant colonies complete an iteration, cross updating pheromone according to each of the initial optimal ant colony paths to obtain updated pheromone, comprises: in the case that each of the initial ant colonies reaches an iteration number corresponding to a preset cooperation period, cross updating pheromone according to each of the initial optimal ant colony paths to obtain updated pheromone; in the case that there is at least one initial ant colony that does not reach the iteration number corresponding to the preset cooperation period, saving the initial optimal ant colony path corresponding to the initial ant colony that reaches the iteration number corresponding to the preset cooperation period and stopping iteration until the updated pheromone is obtained; repeating the step of obtaining the initial path corresponding to the current ant until a termination condition is met, to obtain a plurality of updated optimal ant colony paths, and displaying each of the updated optimal ant colony paths to a terminal device, wherein the termination condition comprises that a current iteration number reaches a preset maximum iteration number, or the updated optimal ant colony path corresponding to each of the initial ant colonies has no change in a preset continuous iteration number.
2. The method of claim 1, wherein, The control of each ant in the initial ant colony to start from the starting station, determine a next passing station in a candidate station based on a multi-objective value and pheromone, until reaching the terminal station, comprises: determining candidate stations allowed to be reached from a current station based on the station topological relations in the traffic network model, and determining pheromone of the current station reaching each of the candidate stations corresponding to a current time period; determine a multi-objective value of the current station to each of the candidate stations in the current period based on a preset multi-objective cost function, and determine a candidate probability of each of the candidate stations becoming a next station based on the multi-objective value and the pheromone; select the candidate probability through a roulette strategy to obtain a selection result, determine the candidate station corresponding to the selection result as a next station, and repeat the steps of determining the candidate stations allowed to be reached from the current station and determining the pheromone of the current station to each of the candidate stations in the current period based on the station topological relationship in the traffic network model until the terminal station is reached.
3. The method of claim 2, wherein, The initial parameters include pheromone importance and heuristic factor. The step of determining the candidate probability of each of the candidate stations becoming a next station based on the multi-objective value and the pheromone includes: determining the candidate probability of each of the candidate stations becoming a next station based on the multi-objective value and the pheromone of the current station to each of the candidate stations through a preset probability calculation rule, wherein the preset probability calculation rule is represented as: wherein P denotes the candidate probability, i denotes the current station, j denotes a passing station, and k denotes the number of the current ant, denotes the pheromone of the current period i to j, denotes the pheromone of the current period i to l, denotes the multi-objective generation value, denotes the heuristic information, l denotes any one of all candidate next nodes that the ant can select at the current node i, a denotes the importance of the pheromone, and β denotes the heuristic factor.
4. The method of claim 1, wherein, The step of determining the initial optimal path of the ant colony corresponding to the current initial ant colony based on the total multi-objective value and locally updating the pheromone in the traffic network model based on the initial optimal path of the ant colony includes: obtaining the maximum carrying capacity of the current station to the next station in the current period in the travel process of the ant in the initial path, and obtaining the initial pheromone between each adjacent station in the traffic network model; updating the initial pheromone between each adjacent station in the initial path based on the maximum carrying capacity, the real-time passenger flow data of the current station to the next station, and the initial path through a preset pheromone concentration adjustment rule to obtain updated pheromone; determining the initial optimal path of the ant colony corresponding to the current initial ant colony in the iteration round based on the total multi-objective value, and reinforcing the updated pheromone based on the maximum carrying capacity corresponding to the initial optimal path of the ant colony, the real-time passenger flow data between each of the stations in the initial optimal path of the ant colony, and the initial optimal path of the ant colony to obtain the reinforced pheromone.
5. The method of claim 4, wherein, The initial parameters include a pheromone intensity constant. The step of updating the initial pheromone between each adjacent station in the initial path based on the maximum carrying capacity, the real-time passenger flow data of the current station to the next station, and the initial path through a preset pheromone concentration adjustment rule to obtain updated pheromone includes: determining the number of stations included in the initial path as the total path length of the initial path based on the initial path; updating the initial pheromone between each adjacent station in the initial path based on the maximum carrying capacity, the real-time passenger flow data of the current station to the next station, and the total path length through a preset pheromone concentration adjustment rule to obtain updated pheromone; The preset pheromone concentration adjustment rule is represented as: ; wherein i represents the current station, j represents the passing station, k represents the number of the current ant, p represents the pheromone evaporation coefficient, Pij(k) represents the pheromone of the current period from station i to j, Pij(k) represents the pheromone of the current period from station i to j, Pij(k) represents the pheromone of the current period from station i to j, Pij(k) represents the pheromone of the current period from station i to j, Q represents the pheromone intensity coefficient.
6. The method of claim 1, wherein, The method further includes: receive a user preference target, the user preference target being one of the ant colony optimization targets; determine the ant colony updated optimal path meeting the user preference target as a planning path, and display other ant colony updated optimal paths to the terminal device as alternative paths.
7. A route planning apparatus characterized by comprising: The device comprises: a receiving module, configured to receive a traffic network model, initial parameters of an ant colony algorithm, ant colony optimization targets, a starting station and a terminal station, initialize a plurality of ant colonies and the traffic network model according to the initial parameters to obtain initial ant colonies, wherein the traffic network model comprises station topological relations, train timetable information and real-time passenger flow data, the ant colony optimization targets comprise at least two of travel time, economic cost and transfer cost, and each of the ant colony optimization targets corresponds to one of the initial ant colonies; an exploration module, configured to, for each of the initial ant colonies, control each ant in the initial ant colony to start from the starting station, determine a next passing station in candidate stations based on multi-objective value and pheromone, and obtain an initial path corresponding to the ant until the terminal station is reached, wherein the multi-objective value is determined based on travel time, economic cost and transfer penalty coefficient between a current station and the candidate station; an updating module, configured to determine total multi-objective values corresponding to the initial paths, determine an ant colony initial optimal path corresponding to the current initial ant colony based on the total multi-objective values, locally update pheromone in the traffic network model based on the ant colony initial optimal path, cross-update pheromone according to the ant colony initial optimal paths in the case that all the initial ant colonies complete one iteration to obtain updated pheromone, and cross-update pheromone according to the ant colony initial optimal paths to obtain updated pheromone in the case that all the initial ant colonies complete one iteration, which comprises: cross-update pheromone according to the ant colony initial optimal paths to obtain updated pheromone in the case that each of the initial ant colonies reaches an iteration number corresponding to a preset cooperation period; and in the case that at least one of the initial ant colonies does not reach the iteration number corresponding to the preset cooperation period, save the ant colony initial optimal path corresponding to the initial ant colony reaching the iteration number corresponding to the preset cooperation period and stop iteration until the updated pheromone is obtained; a decision module, configured to repeatedly perform the step of obtaining the initial path corresponding to the ant until a termination condition is met to obtain a plurality of ant colony updated optimal paths, and display each of the ant colony updated optimal paths to a terminal device, wherein the termination condition comprises that a current iteration number reaches a preset maximum iteration number or the ant colony updated optimal paths corresponding to each of the initial ant colonies do not change in a preset continuous iteration number.
8. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the steps of the path planning method of any one of claims 1 to 6 when executing the program.
9. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program implements the steps of the path planning method of any one of claims 1 to 6 when executed by the processor.
Citation Information
Patent Citations
Method of path planning based on improved ant colony algorithm
CN107272679A
In-station path planning method and apparatus based on subway crowdedness
WO2023138212A1