WO2024011864A1 - Bus route scheduling processing method and apparatus, device, and readable storage medium - Google Patents

Bus route scheduling processing method and apparatus, device, and readable storage medium Download PDF

Info

Publication number
WO2024011864A1
WO2024011864A1 PCT/CN2022/142235 CN2022142235W WO2024011864A1 WO 2024011864 A1 WO2024011864 A1 WO 2024011864A1 CN 2022142235 W CN2022142235 W CN 2022142235W WO 2024011864 A1 WO2024011864 A1 WO 2024011864A1
Authority
WO
WIPO (PCT)
Prior art keywords
bus
gene
preset
genes
initial
Prior art date
Application number
PCT/CN2022/142235
Other languages
French (fr)
Chinese (zh)
Inventor
蚁韩羚
田贤材
唐锲
余晓填
王孝宇
Original Assignee
深圳云天励飞技术股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳云天励飞技术股份有限公司 filed Critical 深圳云天励飞技术股份有限公司
Publication of WO2024011864A1 publication Critical patent/WO2024011864A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0631Resource planning, allocation, distributing or scheduling for enterprises or organisations
    • G06Q10/06316Sequencing of tasks or work
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/004Artificial life, i.e. computing arrangements simulating life
    • G06N3/006Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/12Computing arrangements based on biological models using genetic models
    • G06N3/126Evolutionary algorithms, e.g. genetic algorithms or genetic programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/40Business processes related to the transportation industry

Definitions

  • the present application relates to the field of smart transportation technology, and in particular to a bus route scheduling processing method, device, computer equipment and computer-readable storage medium.
  • bus line scheduling is mainly based on schedules pre-designed by manual experience. When designing the schedule, it relies too much on the subjective feelings of the dispatcher. In addition to considering the departure time, other factors will also be considered when dispatching buses. For example, in order to adapt to different public transportation situations, various factors such as different departure types and departure models will be configured on the same line. In terms of departure type, in addition to mainline trains on the same line, in order to adapt to the more concentrated passenger flow in different situations such as short-distance passenger flow and long-distance passenger flow, there will also be large station express trains or section line trains.
  • This application provides a bus line scheduling processing method, device, computer equipment and computer-readable storage medium, which can solve the technical problem of poor bus line scheduling in traditional technology.
  • this application provides a bus route scheduling processing method, including: obtaining different types of bus factors and combining the bus factors to obtain an initial bus gene, wherein the bus factors describe the bus routes The factors involved in the scheduling, the initial bus gene describes the initial departure frequency; calculate the fitness of each of the initial bus genes, and based on the size of the fitness, the initial bus genes are screened for survival of the fittest.
  • the naturally selected bus gene where the fitness describes the degree of excellence of the initial bus gene
  • obtain the bus gene mutation iteration variable and determine whether the bus gene mutation iteration variable meets the preset bus gene mutation termination condition; If the bus gene mutation iteration variable satisfies the preset bus gene variation termination condition, the naturally selected bus gene that meets the preset first fitness condition is screened out as the first target bus gene; according to the first target bus gene According to the corresponding departure frequency, the schedule of the bus line is obtained.
  • this application also provides a bus line scheduling processing device, including: a first acquisition unit, used to acquire different types of bus factors, and combine the bus factors to obtain an initial bus gene, where , the bus factors describe the factors involved in the scheduling of bus lines, and the initial bus genes describe the initial departure frequency; the first screening unit is used to calculate the fitness of each of the initial bus genes, and according to the The size of the fitness, the initial bus gene is screened for survival of the fittest, and the natural selection bus gene is obtained, wherein the fitness describes the degree of excellence of the initial bus gene; the first judgment unit is used to obtain the variation of the bus gene iterate variables, and determine whether the bus gene mutation iteration variable satisfies the preset bus gene variation termination condition; the second screening unit is used to filter out the bus gene variation iteration variable if it satisfies the preset bus gene variation termination condition.
  • the naturally selected bus gene that meets the preset first fitness condition is used as the first target bus gene; the first acquisition unit is used to obtain the bus line schedule according to the first target
  • this application also provides a computer device, which includes a memory and a processor.
  • a computer program is stored on the memory.
  • the processor executes the computer program, it implements the bus line scheduling processing method. A step of.
  • the present application also provides a computer-readable storage medium.
  • the computer-readable storage medium stores a computer program.
  • the processor causes the processor to perform the bus route scheduling. steps of the processing method.
  • This application provides a bus line scheduling processing method, device, computer equipment and computer-readable storage medium.
  • the processing method obtains the initial bus genes by obtaining different types of bus factors and combining the bus factors, and then evaluates the fitness of the initial bus genes, and selects the initial bus genes according to the size of the fitness, and obtains Naturally select the bus gene, then obtain the bus gene variation iteration variable, and determine whether the bus gene variation iteration variable meets the preset bus gene variation termination condition. If the bus gene variation iteration variable satisfies the preset bus gene variation termination condition, filter Naturally selected bus genes that meet the preset first fitness conditions are selected, and based on the departure times corresponding to the selected naturally selected bus genes, the bus line schedule is obtained, thereby combining the various factors involved in the bus line schedule.
  • Different types of public transportation factors are combined to construct an initial public transportation gene, and based on the adaptability screening of the genetic algorithm, the initial public transportation gene is subjected to natural selection of survival of the fittest through fitness, and then a combination that meets the preset first fitness condition is obtained.
  • type bus gene and obtain the bus line schedule according to the departure frequency corresponding to the bus gene, so that the bus line schedule is more in line with the actual needs that require a combination of multiple bus factors, and can improve the efficiency of bus routes based on multiple bus factors.
  • the objectivity of bus scheduling can reduce the operating costs of bus lines without increasing the average waiting time of passengers.
  • Figure 1 is a schematic flow chart of a bus line scheduling processing method provided by an embodiment of the present application
  • Figure 2 is a schematic diagram of the first sub-flow of the bus line scheduling processing method provided by the embodiment of the present application.
  • Figure 3 is a schematic diagram of the second sub-flow of the bus line scheduling processing method provided by the embodiment of the present application.
  • Figure 4 is a schematic diagram of the third sub-flow of the bus line scheduling processing method provided by the embodiment of the present application.
  • Figure 5 is a schematic diagram of the fourth sub-flow of the bus route scheduling processing method provided by the embodiment of the present application.
  • Figure 6 is a schematic block diagram of a bus line scheduling processing device provided by an embodiment of the present application.
  • Figure 7 is a schematic block diagram of a computer device provided by an embodiment of the present application.
  • the embodiment of the present application provides a bus route scheduling processing method.
  • the processing method can be applied to computer equipment such as desktops or servers, and can be used in smart buses to schedule bus routes based on multiple bus factors. For example, when scheduling bus line departures based on various bus factors such as departure time, departure type, and departure model, the bus line scheduling processing method provided by the embodiment of the present application can be used.
  • bus factors can be pre-configured manually on the configuration page of the simulation system.
  • the configured bus factors can include at least any two of the following: Types: departure time, departure type and departure model.
  • the simulation system performs the following operations: obtains departure time, departure type, departure model and other bus factors, and combines different types of bus factors to obtain an initial bus gene.
  • the initial bus gene Describe the initial bus schedule; calculate the fitness of each of the initial bus genes, and select the initial bus genes according to the size of the fitness to obtain the natural selection bus genes, where the fitness Describe the quality of the initial bus gene; obtain the bus gene variation iteration variable, and determine whether the bus gene variation iteration variable satisfies the preset bus gene variation termination condition; if the bus gene variation iteration variable satisfies the preset Based on the bus gene mutation termination condition, the naturally selected bus genes that meet the preset first fitness condition are selected as the first target bus genes; according to the departure frequency corresponding to the first target bus gene, the bus route arrangement is obtained Schedule.
  • the simulation system of the bus system is a system that uses a simulation model to simulate the map routes, bus stops, departure vehicles, passenger flow and other bus traffic scenarios involved in the bus lines.
  • Figure 1 is a schematic flowchart of a bus route scheduling processing method provided by an embodiment of the present application. As shown in Figure 1, the method includes the following steps S11-S16:
  • bus factors describe the factors involved in the scheduling of bus lines, and the initial bus genes describe the generated initial bus genes. Departure schedule.
  • the departure time Types include main line trains, station express trains and regional line trains, and the departure models include large cars, medium cars, small cars, etc.
  • the departure time Types include main line trains, station express trains and regional line trains
  • the departure models include large cars, medium cars, small cars, etc.
  • each type of public transportation factor can be set as a corresponding preset public transportation factor set.
  • Each of the preset public transportation factor sets includes the same Different factor objects of class Transit Factors.
  • the departure time of bus vehicles can be combined into a preset bus departure time set with a granularity of 1 minute, and the departure times within the operating time period of the bus vehicles can be described as ⁇ t 1 , t 2 ,...t n ⁇ , Among them, t 1 , t 2 ,...t n are departure times, and the value range is any integer between 0 and 1440. They are used to describe the minute count in 24 hours of operation of a bus line.
  • the 395th minute is equivalent to 06:30
  • t 1 describes the departure time of the first bus
  • t n describes the departure time of the last bus.
  • the departure time of the bus can also be divided into 2 minutes or other preset time units as a granularity, and it can also be divided.
  • the time within 24 hours is combined into a preset bus departure time set, and only the time within the longest operating time range of the bus line within the operating day is combined into a preset bus departure time set. For example, for a bus line, if the bus The first bus time of the line is 6:00, and the last bus time is 23:00 in the evening.
  • the departure time included in the preset bus departure time set can be between 6:00 and 23:00 on operating days.
  • the departure types of the bus vehicles used by the bus lines can be combined into a preset set of bus vehicle types, which can be described as ⁇ main line bus (Normal in English), interval line bus (Shuttle in English) ⁇ , also It can be described as ⁇ main line train (Normal in English), Dazhan Express train (Express in English), and section line train (Shuttle in English) ⁇ , among which, main line train, Dazhan Express train, and section line train are The specific type object of the departure type.
  • main line train, Dazhan Express train, and section line train are The specific type object of the departure type.
  • other departure types are generated, they can also be included in the preset bus vehicle type set.
  • the vehicle models of the bus vehicles used in the bus lines can be combined into a preset bus vehicle departure model set, which can be described as ⁇ large vehicle (Big in English), small vehicle (Small in English) ⁇ , or The description is ⁇ large car (Big in English), medium car (Medium in English), small car (Small in English) ⁇ , where large car, medium car, and small car are the specific vehicle models of public transportation vehicles.
  • the preset bus vehicle power type set ⁇ fuel vehicle, electric vehicle ⁇ , or construct different collections such as preset bus vehicle power type collection ⁇ fuel vehicle, gasoline-electric hybrid vehicle, electric vehicle ⁇ .
  • the initial bus gene can also be used to initialize the preset bus population, thereby initializing the preset bus population.
  • the preset bus population includes The number of initial bus genes may be a preset first number, and the preset first number may be a hyperparameter.
  • the bus factors describe the factors involved in the scheduling of bus lines.
  • the bus factors may also include at least one of the departure type and departure model of the bus vehicle. The departure type includes the main line.
  • the initial bus gene describes the initial departure frequency generated in the process of obtaining the bus line schedule. For example, based on the above-mentioned preset bus departure time set, preset bus vehicle type set and preset bus vehicle departure model set, the bus factors corresponding to 390, mainline buses and medium-sized buses are respectively extracted and combined into the initial bus gene (390 , main line car, medium-sized car), used to describe a main line train using a medium-sized car at 06:30.
  • the bus line scheduling can fully describe the actual factors of bus vehicle scheduling, and improve the efficiency of bus line scheduling based on departure time, departure type and departure model.
  • the objectivity of bus line scheduling corresponding to comprehensive factors can reduce the operating costs of bus lines without increasing the average waiting time of passengers.
  • bus factors can be comprehensively considered to improve the objectivity and effectiveness of bus line scheduling. This will reduce the bus company's costs without increasing the average waiting time for passengers.
  • the initial bus gene also includes:
  • the initial bus gene does not meet the preset bus business rules, the initial bus gene is not retained.
  • the preset bus business rules may include the following content One or more of the following: 1) The first and last train must be a main line; 2) At least one of the two adjacent trains must be a main line; 3) The number of sub-line types on the same line cannot exceed 3; 4) Two adjacent trains must be a main line The departure time interval of the line cannot exceed the specified maximum departure interval; 5) Each vehicle model has corresponding quantity constraints.
  • the initial bus gene satisfies the preset bus business rules, the initial bus gene is retained, and the retained initial bus gene can be added to the preset bus population, thereby initializing the preset bus population. If If the initial bus gene does not meet the preset bus business rules, the initial bus gene is not retained, the initial bus gene is not added to the preset bus population, the initial bus gene can be discarded or eliminated, In this way, the generated bus genes that do not comply with the preset bus business rules are filtered out, and until the preset first number of initial bus genes corresponding to the hyperparameters is obtained, as the basis for the mutation of bus genes based on the genetic algorithm, it can improve the efficiency of bus genes based on the initial The feasibility of progeny bus genes obtained from genetic variation of bus genes will further improve the objectivity of bus route scheduling based on departure time, departure type and departure model. Among them, hyperparameters are parameters preset by machine learning before learning.
  • the fitness of each initial bus gene is evaluated.
  • the fitness describes the quality of the initial bus genes, that is, the fitness is used to describe the quality of the initial bus genes.
  • the degree to which the initial bus gene meets the preset target requirements The higher the degree of the fitness meets the preset target requirements, the more worthy of retaining the initial bus gene is. The lower the degree of the fitness meets the preset target requirements.
  • the number of naturally selected bus genes can be a preset second number , wherein the preset second number is smaller than the preset first number, and the preset second number may also be a hyperparameter.
  • the calculation formula of the fitness can adopt the following calculation method:
  • the fitness of the bus gene - (bus vehicle cost + average waiting time of passengers * penalty coefficient);
  • the bus vehicle cost is the cost incurred by the operation of the bus vehicle.
  • the bus vehicle cost includes the purchase cost of the bus vehicle, the cost of the driver and passengers, vehicle fuel consumption and vehicle losses and other costs incurred during the operation of the bus vehicle. For different vehicle models, it can be Calculate the cost of public transportation vehicles.
  • the passenger waiting time is the time difference between the arrival time of the passenger at the bus stop and the arrival time of the next train at the bus stop.
  • the average waiting time of passengers is the average waiting time of all passengers on the bus line. For the average waiting time of passengers at a single bus stop on the bus line, the following process can be used to obtain it:
  • the bus time, and the boarding time can be the arrival time of the bus vehicle at the departure station, where the OD pair is the bus station pair consisting of the departure station and the destination station of the passenger's trip on the bus line;
  • the passenger arrival time is the time when the boarding passenger arrives at the departure station.
  • the passenger arrival time is early. At the stated boarding time;
  • bus stop A is an OD-centered departure station
  • the boarding passengers at bus stop A are A1, A2, A3, A4 and A5
  • the boarding time is t
  • the boarding time is t.
  • the arrival time of each passenger on the bus is randomly generated.
  • t1 to describe the arrival time of A1, t2 to describe the arrival time of A2, t3 to describe the arrival time of A3, and t4 to describe the arrival time of A4.
  • t5 describes the arrival time of A5, where t1, t2, t3, t4 and t5 are all earlier than t.
  • the waiting time of A1 is T-t1
  • the waiting time of A2 is T-t2
  • the waiting time of A3 is T-t3
  • the waiting time of A4 is T-t4
  • the waiting time of A5 is T-t5.
  • the average waiting time of passengers at their respective departure stations for all ODs in the bus line can be obtained, and the average waiting time of passengers at all departure stations is averaged, Get the average waiting time of passengers on this bus line.
  • the above process can be processed based on the simulation system of the public transportation system.
  • the arrival time of each passenger on the bus can also be counted in the following way: for a bus line, set up a site camera at each bus stop, and calculate the arrival time of each passenger through the video Collect and monitor, obtain the arrival video of passengers arriving at the departure station, perform face recognition on the arrival video to identify each initial passenger, and record the arrival time of the initial passenger at the bus stop based on the collected arrival video .
  • the vehicle camera in the bus collects the boarding video of the boarding passenger, and performs face recognition on the boarding video to obtain the target passenger who boarded the bus and assign the target passenger to the boarding video.
  • the passenger arrival time of each boarding passenger is randomly generated, which can more accurately reflect the arrival time of passengers arriving at the departure station.
  • the penalty coefficient is a hyperparameter, and the penalty coefficient can be:
  • the total bus vehicle cost of the bus line is the sum of the costs of all bus vehicles in the operating day
  • the average waiting time of the bus line is the average waiting time of passengers in the operating day of the bus line
  • the constant coefficient is a preset fixed value, which is Empirical value
  • constant coefficient initialization can be 0.5.
  • the above statistical method of fitness of bus genes and the setting of penalty coefficient fully take into account the two main purposes that need to be considered in the bus line scheduling process, that is, the average waiting time of passengers is as short as possible and the cost of bus vehicles is as low as possible, so that Reduce the operating costs of bus lines without increasing the average waiting time for passengers.
  • bus gene mutation iteration variable does not meet the preset bus gene variation termination condition, do not screen out the naturally selected bus genes that meet the preset first fitness condition;
  • bus gene mutation iteration variable meets the preset bus gene variation termination condition, select the naturally selected bus gene that meets the preset first fitness condition as the first target bus gene;
  • the bus gene mutation iteration variable is set in advance.
  • the bus gene mutation iteration variable is used to describe the variation of the initial bus gene.
  • the bus gene variation iteration variable is used to count the variation of the initial bus gene.
  • the bus gene variation is Iteration variables can be accessed through variable names.
  • the bus gene mutation iteration variables can be described in the form of key-value pairs.
  • the keywords of the key-value pairs ie, variable names
  • the key-value pairs The value (the value of the variable, that is, the value corresponding to the variable name) is used to describe the specific value of the mutation of the initial bus gene.
  • the value of the key-value pair can be accessed through the keyword of the key-value pair.
  • the bus gene mutation iteration variable It may be the number of mutation iterations of the initial bus gene, or the bus gene mutation iteration variable may be the number of population generations (that is, the number of bus gene iterations) in which the average population fitness of the bus population remains unchanged continuously.
  • the bus gene is based on the termination condition of gene mutation and natural selection of the genetic algorithm (i.e., the completion condition of gene mutation and natural selection).
  • the preset bus gene mutation termination condition can be the maximum number of mutation iterations of the bus gene, or all
  • S is a preset constant
  • the bus gene mutation termination condition is to select the naturally selected bus genes that meet the preset first fitness condition as the first target bus gene, where the preset first fitness condition can be several buses with larger fitness Gene, or for multiple bus genes with the same departure time, a selective method is used to determine a bus gene, such as randomly selecting one of the bus genes, or selecting the bus gene ranked first. For example, since different bus genes correspond to different departure times, it is impossible to send out more than one bus at the same minute during actual departure.
  • the bus gene corresponds to the departure frequency, therefore, after determining the first target bus gene, the departure frequency corresponding to the first target bus gene can be determined, and the departure frequency corresponding to the first target bus gene can be determined
  • the shifts are sorted according to the chronological order of departure time, thereby obtaining the schedule of the bus lines. If the preset bus gene mutation termination conditions are not met, the naturally selected bus genes that meet the preset first fitness condition will not be screened out, and the bus gene mutation and natural selection will continue until the preset bus gene mutation termination conditions are met. No more mutation and natural selection of bus genes.
  • the initial bus genes are obtained by obtaining different types of bus factors and combining the bus factors, and then the fitness of the initial bus genes is evaluated, and the initial bus genes are screened for survival of the fittest based on the fitness.
  • Obtain the natural selection bus gene then obtain the bus gene variation iteration variable, and determine whether the bus gene variation iteration variable meets the preset bus gene variation termination condition. If the bus gene variation iteration variable satisfies the preset bus gene variation termination condition, The naturally selected bus genes that meet the preset first fitness condition are screened out, and based on the departure frequency corresponding to the selected naturally selected bus gene, the bus line schedule is obtained, so that the bus line schedule involves many factors.
  • Different types of public transportation factors are combined to construct the initial public transportation gene, and based on the adaptive screening of the genetic algorithm, the initial public transportation gene is subjected to natural selection of survival of the fittest through fitness, and then the first public transportation gene that meets the preset fitness conditions is obtained.
  • the bus line scheduling is obtained, so that the bus line scheduling is more in line with the actual needs that require a combination of multiple bus factors, and can improve the efficiency of bus routes based on a variety of bus
  • the objectivity of factor scheduling can reduce the operating costs of bus lines without increasing the average waiting time of passengers.
  • Figure 2 is a schematic diagram of the first sub-flow of the bus route scheduling processing method provided by the embodiment of the present application. As shown in Figure 2, after obtaining the initial bus gene, it also includes:
  • the initial bus gene is added to a preset bus population, which describes a group of bus genes that undergo genetic mutation, and the bus gene mutation iteration is performed based on the preset bus population, and the bus gene is added to the preset bus population.
  • the preset bus population contains bus genes for natural selection of survival of the fittest.
  • the bus genes with the preset second fitness condition can be the preset third number of bus genes with greater fitness, as the second target bus genes, and the second target bus genes are genetically mutated, Obtain the offspring bus genes, and then add the offspring bus genes to the preset bus population to update the preset bus population.
  • the bus genes are screened for survival of the fittest based on the fitness of the bus gene, so that the preset bus population retains the elite buses corresponding to the feasible solutions with higher fitness.
  • Genes, in particular, the preset second fitness condition is to obtain bus genes from the preset bus population with a preset sampling probability, and the preset sampling probability is consistent with the bus genes included in the preset bus population.
  • the corresponding bus vehicle cost is inversely proportional, so that the preset bus population maintains a certain proportion of feasible solutions and prevents the preset bus population from deviating too far from the feasible area.
  • FIG. 3 is a second sub-flow schematic diagram of a bus route scheduling processing method provided by an embodiment of the present application.
  • a group of bus genes is described by a bus gene array.
  • the bus gene array contains bus gene elements. Each of the bus gene elements describes the departure frequency corresponding to a bus gene.
  • the bus gene elements include bus Gene node, the bus gene node stores one type of bus factors.
  • the second target bus gene is genetically mutated to obtain the offspring bus gene, including:
  • bus gene array is used to describe a group of bus genes.
  • the bus gene array contains bus gene elements, and each of the bus gene elements describes the departure corresponding to a bus gene.
  • the bus gene element includes a bus gene node, and each bus gene node stores a type of bus factor.
  • the bus gene element may include multiple bus gene nodes, and one bus gene element describes multiple types. public transportation factors, thereby combining multiple factors involved in the scheduling of bus lines to achieve comprehensive scheduling of bus lines based on multiple factors.
  • the two bus gene elements When performing gene mutation, two bus gene elements are obtained.
  • the two bus gene elements contain the same number of bus gene nodes. That is, the structures of the bus gene nodes contained in the two bus gene elements are the same. Intercept at several identical positions of the public transportation gene elements, that is, intercept at the position of the nth public transportation gene node of the two public transportation gene elements to obtain a pair of sub-transit gene elements at the corresponding position, and then add the sub-transit gene elements to The bus gene element replaces the two sub-bus gene elements contained in it in a crossover manner to obtain the offspring bus gene. For example, if there are two bus gene elements a and b, among which, the bus gene element a is [a 1 , a 2 , a 3 ,...
  • bus gene element b is [b 1 , b 2 , b 3 , ...b n ], where a n describes the n-th bus gene node of bus gene element a, b n describes the n-th bus gene node of bus gene element b, and each bus gene node description of bus gene elements a and b A type of transit factor. At least the following methods can be used to carry out genetic mutation and obtain offspring genes:
  • the third bus gene node a 3 of the bus gene element a can be selected, and the bus gene element a can be [a 1 , a 2 , a 3 ,...a n ] Intercept into two parts: sub-gene elements [a 1 , a 2 , a 3 ] and [a 4 ,...a n ], select the third bus gene node b 3 of the bus gene element b, and the bus gene element b can be [ b 1 , b 2 , b 3 ,...b n ] are intercepted into two parts: sub-gene element [b 1 , b 2 , b 3 ] and [b 4 ,...b n ], among which the sub-gene element at the corresponding position [ a 1 , a 2 , a 3 ] and [b 1 , b 2 , b 3 ] are pairs of sub-gene elements, and the sub-gene element at the corresponding position [ a 1 , a 2 ,
  • the offspring bus genes [a 1 , a 2 , a 3 , b 4 ,...b n ] and [b 1 , b 2 , b 3 , a 4 ,...a n ] can be obtained, thereby converting the bus genes Genetic elements mutate to produce offspring genes.
  • the third bus gene node a 3 and the fifth bus gene node a 5 of the bus gene element a can be selected, and the bus gene element a can be [a 1 , a 2 , a 3 ,... an ] are intercepted into three parts: sub-gene elements [a 1 , a 2 , a 3 ], [a 4 , a 5 ] and [a 6 ,...
  • the bus gene elements b can be intercepted as [b 1 , b 2 , b 3 ,...b n ] into sub-gene elements [b 1 , b 2 , b 3 ], [b 4 , b 5 ] and [b 6 ,...b n ].
  • the sub-gene element pairs at the corresponding positions include: [a 1 , a 2 , a 3 ] and [b 1 , b 2 , b 3 ], [a 4 , a 5 ] and [b 4 , b 5 ], and [a 6 ,...a n ] and [b 6 ,...b n ], and sub-gene elements can be selected For [a 1 , a 2 , a 3 ] and [b 1 , b 2 , b 3 ], [a 4 , a 5 ] and [b 4 , b 5 ], or [a 6 ,...a n ] and [ b 6 ,...b n ] adopt a crossover method to replace each other.
  • the offspring bus genes [a 1 , a 2 , a 3 , a 4 , a 5 , b 6 ,...b n ] and [b 1 , b 2 can be obtained , b 3 , b 4 , b 5 , a 6 ,...a n ], thereby mutating the bus gene elements to produce offspring bus genes.
  • Multi-point crossover Similar to the above-mentioned single-point crossover and double-point crossover, especially when multiple bus gene nodes are included, only bus gene nodes with 3 or more bus gene elements are selected, and the two bus gene elements are intercepted into four parts. Or four or more segments of sub-gene elements, and four or more pairs of sub-gene elements are obtained, and then the pairs of sub-gene elements are selected to replace each other in a crossover manner, thereby mutating the bus genes and producing offspring bus genes.
  • the above-mentioned way of mutating bus genes can fully reflect the randomness and diversity of bus gene mutations based on genetic algorithms, making the resulting bus genes more diverse, thereby further improving the objectivity of scheduling based on multiple bus factors as much as possible , reducing the operating costs of bus lines without increasing the average waiting time of passengers.
  • FIG. 4 is a schematic diagram of the third sub-flow of the bus route scheduling processing method provided by the embodiment of the present application.
  • a group of bus genes is described by a bus gene array.
  • the bus gene array contains bus gene elements.
  • Each of the bus gene elements describes a bus schedule corresponding to a bus gene.
  • the bus gene elements include bus gene nodes.
  • the bus gene elements The gene node stores a type of public transportation factor, as shown in Figure 4.
  • the second target public transportation gene is genetically mutated to obtain a descendant public transportation gene, including:
  • a bus gene element is obtained, and the bus gene node contained in the bus gene element is selected.
  • the bus gene node contained in the bus gene element can be randomly selected, so that the genetic variation can be better described. randomness, and replace the bus factors of the bus gene node with other bus factors of the same type to obtain the offspring bus genes. For example, if there is a bus gene element a as [a 1 , a 2 , a 3 ,... an ], the mth bus gene node a m contained in the bus gene element a can be randomly selected, where 1 ⁇ m ⁇ n, And replace a m with other bus factors of the same type.
  • bus gene mutation method enriches the bus gene mutation method, can fully reflect the randomness and diversity of bus gene mutation based on genetic algorithms, and makes the generated bus genes more diverse, thereby further improving the efficiency of bus gene mutation as much as possible.
  • the objectivity of bus schedules based on various bus factors can reduce the operating costs of bus lines without increasing the average waiting time of passengers.
  • the genetic mutation methods of Figure 3 and Figure 4 described above can be combined to genetically mutate the second target bus gene, For example, randomly selecting the single-point crossover, double-point crossover, multi-point crossover or single-point mutation described above to genetically mutate the specific second target bus gene can more prominently reflect the randomness of gene mutation based on genetic algorithms.
  • the resulting bus genes will be richer and more diverse, thereby further improving the objectivity of bus schedules based on a variety of bus factors, and reducing the operating costs of bus lines without increasing the average waiting time of passengers.
  • FIG. 5 is a schematic diagram of the fourth sub-flow of a bus route scheduling processing method provided by an embodiment of the present application. As shown in Figure 5, in this embodiment, after obtaining the schedule of the bus line, it also includes:
  • the fitness of the bus gene is - (bus vehicle cost + average passenger waiting time * penalty coefficient), and the higher the bus cost, it means that more bus vehicles need to be used to arrange more departures. The corresponding waiting time for passengers is lower. On the contrary, the lower the cost of bus vehicles, which means that fewer buses need to be used to arrange fewer departures, and the waiting time for passengers is relatively higher. Therefore, based on the fitness of the above-mentioned bus genes, when the penalty coefficient is high, the fitness of the bus genes focuses more on the average waiting time of passengers, resulting in more bus schedules with low passenger waiting times but high bus vehicle costs.
  • the penalty coefficient when the penalty coefficient is low, the fitness of bus genes focuses more on bus vehicle costs, resulting in more bus schedules with low bus vehicle costs but high passenger waiting times. Therefore, using a high penalty coefficient can obtain a passenger waiting time that is no higher than the average waiting time of passengers under the original schedule. By reducing the penalty coefficient, a bus schedule with lower bus vehicle cost can be obtained, so that the bus schedule can be obtained through dynamic Adjust the penalty coefficient to achieve an ideal balance between the average waiting time of passengers and the cost of bus vehicles, thereby reducing the cost of the bus company without increasing the average waiting time of passengers.
  • the initial bus gene is genetically mutated. Each time the initial bus gene is mutated for one generation, that is, the initial bus gene undergoes gene mutation iteration once, the corresponding generation of bus population can be obtained, and the characteristics of the bus population of this generation can be obtained. Corresponding schedule, according to the obtained schedule, obtain the estimated average waiting time corresponding to the schedule, and the estimated average waiting time is the schedule of the bus line obtained in each iteration The average waiting time for a bus is obtained, and then the historical average waiting time for the bus line is obtained based on the single historical schedule of the bus line. The single historical schedule can be the schedule currently being used by the bus line. surface.
  • the estimated average waiting time is less than or equal to the historical average waiting time, that is, compare the estimated average waiting time with the historical average waiting time. If the estimated average waiting time The time is less than or equal to the historical average waiting time, indicating that the schedule corresponding to the estimated average waiting time is better than the schedule corresponding to the historical average waiting time, and the estimated average waiting time is equal to
  • the bus time is used as the target to estimate the average waiting time, and the schedule corresponding to the estimated average waiting time is used as a feasible solution for the bus line scheduling.
  • the proportion of all the target estimated average waiting times in the number of all estimated average waiting times calculates the proportion of all the target estimated average waiting times in the number of all estimated average waiting times, and determine whether the proportion is less than or equal to the preset first proportion threshold. If the If the proportion is less than the preset first proportion threshold, the penalty coefficient is increased. If the proportion is greater than the preset first proportion threshold, then it is determined whether the proportion is greater than or equal to the preset second proportion threshold. If If the ratio is greater than or equal to the preset second ratio threshold, the penalty coefficient is reduced, wherein the preset first ratio threshold is smaller than the preset second ratio threshold. If the ratio is smaller than the The second proportion threshold is preset and the penalty coefficient is not reduced.
  • the amount by which the penalty coefficient is increased or decreased may be a preset value, and the value may be an empirical value.
  • the proportion of feasible solutions in the bus population of the last five generations For example, count the proportion of feasible solutions in the bus population of the last five generations. If the proportion is less than 0.2, it indicates that there are many infeasible solutions in the bus population. At this time, the penalty coefficient can be increased to 1.2 times the original value, so as to be more focused. Compared with the waiting time, we can find as many feasible solutions as possible. If the proportion is greater than 0.8, it indicates that there are many feasible solutions in the bus population. At this time, the penalty coefficient is reduced to 0.8 times of the original, so as to make it more feasible. Focus on cost and try to find as many feasible solutions to lower-cost shift scheduling as possible.
  • steps S57 to S59 are just an example to describe the processing flow of this embodiment, and are not intended to limit the order of step S57 and step S59.
  • the content of step S59 can also be determined first, and then the content of step S57 can be determined as needed, which does not affect the implementation result of this embodiment.
  • bus line scheduling processing methods described in the above embodiments can recombine the technical features contained in different embodiments as needed to obtain a combined implementation solution, but all of them are required in this application. within the scope of protection.
  • FIG. 6 is a schematic block diagram of a bus route scheduling processing device provided by an embodiment of the present application.
  • the bus line scheduling processing device includes a unit for executing the above-mentioned bus line scheduling processing method, and the bus line scheduling processing device can be configured in a computer device.
  • the bus line scheduling processing device 60 includes a first acquisition unit 61 , a first screening unit 62 , a first judgment unit 63 , a second screening unit 64 and a first acquisition unit 65 .
  • the first acquisition unit 61 is used to acquire different types of bus factors, and combine the bus factors to obtain an initial bus gene, where the bus factors describe the factors involved in the scheduling of bus lines, and the The initial bus gene describes the initial departure frequency;
  • the first screening unit 62 is used to calculate the fitness of each of the initial bus genes, and according to the size of the fitness, screen the initial bus genes for survival of the fittest to obtain the naturally selected bus genes, wherein: Fitness describes the quality of the initial bus gene;
  • the first judgment unit 63 is used to obtain the bus gene mutation iteration variable and determine whether the bus gene mutation iteration variable meets the preset bus gene mutation termination condition;
  • the second screening unit 64 is used to screen out the naturally selected bus genes that meet the preset first fitness condition as the first target bus gene if the bus gene mutation iterative variable satisfies the preset bus gene mutation termination condition;
  • the first obtaining unit 65 is configured to obtain the schedule of the bus line according to the departure frequency corresponding to the first target bus gene.
  • the fitness is calculated as follows:
  • the fitness of the bus gene - (bus vehicle cost + average waiting time of passengers * penalty coefficient);
  • the bus vehicle cost is the cost incurred by the operation of the bus vehicle
  • the average waiting time of passengers is the average waiting time of all passengers on the bus line
  • the penalty coefficient is a hyperparameter.
  • the bus route scheduling processing device 60 further includes:
  • a second acquisition unit configured to acquire a bus gene that satisfies the preset second fitness condition from the preset bus population as the second target bus gene if the preset bus gene mutation termination condition is not met;
  • a gene mutation unit used to genetically mutate the second target bus gene to obtain a descendant bus gene, and add the descendant bus gene to the preset bus population;
  • the third screening unit is used to calculate the fitness of the bus genes of the offspring, and select the bus genes included in the preset bus population for survival of the fittest based on the fitness of each bus gene included in the preset bus population. ;
  • the second judgment unit is used to judge again whether the preset bus gene mutation termination condition is met
  • an iterative unit configured to iterate the bus genes that satisfy the preset second fitness condition from the preset bus population as the second target bus gene if the preset bus gene mutation termination condition is still not satisfied; The genetic mutation process of the corresponding bus gene until the preset bus gene mutation termination condition is met;
  • An execution unit configured to execute the step of screening out naturally selected bus genes that meet the preset first fitness condition if the preset bus gene mutation termination condition is met.
  • a group of bus genes is described by a bus gene array.
  • the bus gene array contains bus gene elements. Each of the bus gene elements describes the departure frequency corresponding to a bus gene.
  • the bus gene elements include bus genes. Gene node, the bus gene node stores a type of bus factor, and the gene variation unit includes:
  • Intercepting sub-units is used to obtain two bus gene elements, and intercept the two bus gene elements at the same position to obtain a pair of sub-gene elements at the corresponding position;
  • the cross-exchange subunit is used to replace the two sub-gene elements contained in the sub-gene element with each other in a cross-over manner to obtain the offspring bus gene.
  • a group of bus genes is described by a bus gene array.
  • the bus gene array contains bus gene elements.
  • Each of the bus gene elements describes the departure frequency corresponding to a bus gene.
  • the bus gene elements include bus genes.
  • Gene node, the gene variation unit includes:
  • the first acquisition subunit is used to obtain the bus gene element and select the bus gene node contained in the bus gene element;
  • the replacement subunit is used to replace the public transportation factors of the public transportation gene node with other public transportation factors of the same type to obtain the descendant public transportation genes.
  • the bus route scheduling processing device 60 further includes:
  • the first statistical unit is used to perform gene mutation iterations on the initial bus gene n times, and count the estimated average waiting time corresponding to the bus line schedule obtained in each iteration, where n ⁇ 2 , n is an integer;
  • the third acquisition unit is used to obtain the historical average waiting time of the bus line based on the single historical schedule of the bus line;
  • the third judgment unit is used to judge whether the estimated average waiting time is less than or equal to the historical average waiting time
  • a determination unit configured to use the estimated average waiting time as the target estimated average waiting time if the estimated average waiting time is less than or equal to the historical average waiting time;
  • a calculation unit configured to calculate the proportion of the number of all the target estimated average waiting times to the number of all the estimated average waiting times
  • a fourth judgment unit used to judge whether the ratio is less than or equal to a preset first ratio threshold
  • An increasing unit configured to increase the penalty coefficient if the proportion is less than or equal to the preset first proportion threshold
  • the fifth judgment unit is used to judge whether the ratio is greater than or equal to the preset second ratio threshold.
  • a reducing unit configured to reduce the penalty coefficient if the ratio is greater than or equal to the preset second ratio threshold, wherein the preset first ratio threshold is smaller than the preset second ratio threshold.
  • the bus factors include departure time, departure type and departure model.
  • each unit in the above bus line scheduling processing device is only for illustration.
  • the bus line scheduling processing device can be divided into different units according to needs, and can also be divided into different units according to needs.
  • Each unit in the bus line scheduling processing device adopts different connection sequences and methods to complete all or part of the functions of the bus line scheduling processing device.
  • the above bus line scheduling processing device can be implemented in the form of a computer program, and the computer program can be run on the computer device as shown in Figure 7.
  • the computer device 500 may be a computer device such as a desktop computer or a server, or may be a component or component in other devices.
  • the computer device 500 includes a processor 502, a memory and a network interface 505 connected through a system bus 501.
  • the memory may include a non-volatile storage medium 503 and an internal memory 504, and the memory may also be volatile. storage media.
  • the non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032.
  • the computer program 5032 When executed, it can cause the processor 502 to execute the above-mentioned bus route scheduling processing method.
  • the processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500 .
  • the internal memory 504 provides an environment for the execution of the computer program 5032 in the non-volatile storage medium 503.
  • the computer program 5032 When executed by the processor 502, it can cause the processor 502 to perform the above-mentioned bus line scheduling processing method.
  • the network interface 505 is used for network communication with other devices.
  • the specific computer device 500 may include more or fewer components than shown, some combinations of components, or a different arrangement of components.
  • the computer device may only include a memory and a processor. In such an embodiment, the structure and function of the memory and processor are consistent with the embodiment shown in FIG. 7 and will not be described again.
  • the processor 502 is used to run the computer program 5032 stored in the memory to implement the following steps: obtain different types of bus factors and combine the bus factors to obtain an initial bus gene, wherein the bus The factors describe the factors involved in bus line scheduling, and the initial bus genes describe the initial departure frequency; the fitness of each initial bus gene is calculated, and according to the size of the fitness, the initial bus genes are Carry out the screening of survival of the fittest to obtain the natural selection bus gene, where the fitness describes the degree of excellence of the initial bus gene; obtain the bus gene mutation iteration variable, and determine whether the bus gene mutation iteration variable satisfies the preset bus gene Mutation termination condition; if the bus gene mutation iteration variable satisfies the preset bus gene mutation termination condition, select the naturally selected bus gene that meets the preset first fitness condition as the first target bus gene; according to the first According to the departure frequency corresponding to a target bus gene, the schedule of the bus line is obtained.
  • the processor 502 when the processor 502 implements the calculation of the fitness of each of the initial bus genes, the fitness is calculated as follows:
  • the fitness of the bus gene - (bus vehicle cost + average waiting time of passengers * penalty coefficient);
  • the bus vehicle cost is the cost incurred by the operation of the bus vehicle
  • the average waiting time of passengers is the average waiting time of all passengers on the bus line
  • the penalty coefficient is a hyperparameter.
  • the processor 502 after obtaining the initial bus genes, the processor 502 also implements the following steps:
  • the bus gene that meets the preset second fitness condition is obtained from the preset bus population as the second target bus gene;
  • the second target bus gene is Gene mutation, obtain offspring bus genes, and add the offspring bus genes to the preset bus population; calculate the fitness of the offspring bus genes, and calculate the fitness of each bus gene included in the preset bus population according to the degree, the bus genes included in the preset bus population are screened for survival of the fittest; it is again determined whether the preset bus gene mutation termination conditions are met; if the preset bus gene mutation termination conditions are still not met, iterate the The bus gene that satisfies the preset second fitness condition is obtained from the preset bus population and is used as the gene mutation process of the bus gene corresponding to the second target bus gene until the preset bus gene mutation termination condition is met; if The preset bus gene mutation termination condition is used to perform the step of screening out naturally selected bus genes that meet the preset first fitness condition.
  • a group of bus genes is described by a bus gene array.
  • the bus gene array contains bus gene elements. Each of the bus gene elements describes the departure frequency corresponding to a bus gene.
  • the bus gene elements include bus genes. Gene node. The bus gene node stores one type of bus factors.
  • the two sub-gene elements contained in the sub-gene element are replaced with each other in a crossover manner to obtain a descendant bus gene.
  • a group of bus genes is described by a bus gene array.
  • the bus gene array contains bus gene elements. Each of the bus gene elements describes the departure frequency corresponding to a bus gene.
  • the bus gene elements include bus genes. Gene node. The bus gene node stores one type of bus factors.
  • bus factors of the bus gene node are replaced with other bus factors of the same type to obtain the offspring bus genes.
  • the processor 502 after obtaining the bus schedule, the processor 502 also performs the following steps:
  • the initial bus gene is genetically mutated and iterated n times, and the estimated average waiting time corresponding to the bus line schedule obtained in each iteration is calculated, where n ⁇ 2, n is an integer; according to the Based on the single historical schedule of the bus line, obtain the historical average waiting time of the bus line; determine whether the estimated average waiting time is less than or equal to the historical average waiting time; if the estimated average waiting time If the bus time is less than or equal to the historical average waiting time, use the estimated average waiting time as the target estimated average waiting time; calculate the number of all target estimated average waiting times in all the estimated The proportion of the average waiting time; determine whether the proportion is less than or equal to the preset first proportion threshold; if the proportion is less than or equal to the preset first proportion threshold, increase the penalty coefficient ; Or, determine whether the proportion is greater than or equal to the preset second proportion threshold. If the proportion is greater than or equal to the preset second proportion threshold, reduce the penalty coefficient, wherein the preset first proportion The threshold is smaller than the preset second ratio threshold.
  • the bus factors include departure time, departure type and departure model.
  • the processor 502 may be a central processing unit (Central Processing Unit, CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), Application Specific Integrated Circuit (ASIC), off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • the general processor may be a microprocessor or the processor may be any conventional processor.
  • the present application also provides a computer-readable storage medium.
  • the computer-readable storage medium can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium.
  • the computer-readable storage medium stores a computer program, and the computer program is executed by the processor. When the processor performs the following steps:
  • a computer program product when run on a computer, causes the computer to execute the steps of the bus line scheduling processing method described in the above embodiments.
  • the computer-readable storage medium may be an internal storage unit of the aforementioned device, such as a hard disk or memory of the device.
  • the computer-readable storage medium may also be an external storage device of the device, such as a plug-in hard disk, a smart memory card (SMC), or a secure digital (SD) card equipped on the device. , Flash Card, etc.
  • the computer-readable storage medium may also include both an internal storage unit of the device and an external storage device.
  • the storage medium is a physical, non-transient storage medium, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk, which can store computer programs. medium.
  • the disclosed devices and methods can be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of each unit is only a logical function division, and there may be other division methods during actual implementation.
  • multiple units or components may be combined or integrated into another system, or some features may be omitted, or not implemented.
  • each functional unit in various embodiments of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium.
  • the technical solution of the present application is essentially or contributes to the existing technology, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions to cause an electronic device (which may be a personal computer, terminal, or network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Human Resources & Organizations (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Biophysics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • General Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Economics (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • General Business, Economics & Management (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Tourism & Hospitality (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Artificial Intelligence (AREA)
  • Biomedical Technology (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Mathematical Physics (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Development Economics (AREA)
  • Educational Administration (AREA)
  • Game Theory and Decision Science (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Physiology (AREA)
  • Genetics & Genomics (AREA)
  • Primary Health Care (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The present application relates to the technical field of intelligent transportation, and provides a bus route scheduling processing method and apparatus, a computer device, and a computer-readable storage medium. In order to solve the problem of a poor scheduling effect of bus routes, different types of bus factors are obtained, and the bus factors are combined to obtain initial bus genes; degrees of fitness of the initial bus genes are evaluated, and survival-of-the-fittest screening is performed on the initial bus genes according to the magnitude of the degrees of fitness so as to obtain natural selection bus genes; a bus gene variation iteration variable is obtained and whether the variable meets a preset bus gene variation termination condition is determined; if the variable meets a preset bus gene variation termination condition, natural selection bus genes that meet a preset first degree of fitness condition are selected; and a bus route scheduling table is obtained according to departure shifts corresponding to the selected natural selection bus genes. The objectivity of scheduling on the basis of a variety of bus factors can be improved, and operating costs of the bus routes can be reduced without increasing the average waiting time of passengers.

Description

公交线路排班的处理方法、装置、设备及可读存储介质Bus route scheduling processing method, device, equipment and readable storage medium
本申请要求于2022年7月14日提交中国专利局,申请号为202210827674.3、发明名称为“公交线路排班的处理方法、装置、设备及可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application requests the priority of the Chinese patent application submitted to the China Patent Office on July 14, 2022, with the application number 202210827674.3 and the invention title "Method, device, equipment and readable storage medium for processing bus line scheduling", which The entire contents are incorporated herein by reference.
技术领域Technical field
本申请涉及智慧交通技术领域,尤其涉及一种公交线路排班的处理方法、装置、计算机设备及计算机可读存储介质。The present application relates to the field of smart transportation technology, and in particular to a bus route scheduling processing method, device, computer equipment and computer-readable storage medium.
背景技术Background technique
目前,公交线路的调度主要依据由人工经验预先设计好的排班表。排班表在设计时,过度依赖于调度人员的主观感受,并且公交调度时,除了考虑发车时间,还会考虑其它因素。例如,为了适应不同的公共交通运输情况所需,在同一线路上会配置不同的发车类型与发车车型等多种因素。在发车类型上,在同一线路上除了正线车外,为了适应短途客流与长途客流等不同情形下较为集中的客流情况,还会存在大站快线车或者区间线车。在发车车型上,为了适应公共交通的高峰期与非高峰期不同的客流情况,在同一线路上,除了在高峰期安排大型车,还会在非高峰期安排中型车或者小型车等多种类型的车型。At present, bus line scheduling is mainly based on schedules pre-designed by manual experience. When designing the schedule, it relies too much on the subjective feelings of the dispatcher. In addition to considering the departure time, other factors will also be considered when dispatching buses. For example, in order to adapt to different public transportation situations, various factors such as different departure types and departure models will be configured on the same line. In terms of departure type, in addition to mainline trains on the same line, in order to adapt to the more concentrated passenger flow in different situations such as short-distance passenger flow and long-distance passenger flow, there will also be large station express trains or section line trains. In terms of departure types, in order to adapt to the different passenger flow conditions between peak and off-peak periods of public transportation, on the same line, in addition to arranging large vehicles during peak periods, various types such as medium-sized vehicles or small vehicles will also be arranged during off-peak periods. car model.
公交线路的上述多种因素,给公交调度的排班表设计带来了难度。因此,根据传统技术中设计的公交排班表,公交线路的调度在实际运营中往往效果较差,要么客流拥挤,要么浪费了公交资源。The above-mentioned factors of bus routes bring difficulty to the design of bus schedule. Therefore, according to the bus schedule designed in traditional technology, the dispatching of bus lines is often less effective in actual operations, resulting in either crowded passenger flow or a waste of bus resources.
发明内容Contents of the invention
本申请提供了一种公交线路排班的处理方法、装置、计算机设备及计算机可读存储介质,能够解决传统技术中公交线路的排班效果较差的技术问题。This application provides a bus line scheduling processing method, device, computer equipment and computer-readable storage medium, which can solve the technical problem of poor bus line scheduling in traditional technology.
第一方面,本申请提供了一种公交线路排班的处理方法,包括:获取不同类型的公交因素,并将所述公交因素进行组合,得到初始公交基因,其中,所述公交因素描述公交线路的排班所涉及的因素,所述初始公交基因描述初始的发车班次;计算每个所述初始公交基因的适应度,并根据所述适应度的大小,将所述初始公交基因进行优胜劣汰的筛选,得到自然选择公交基因,其中,所述适应度描述所述初始公交基因的优劣程度;获取公交基因变异迭代变量,并判断所述公交基因变异迭代变量是否满足预设公交基因变异终止条件;若所述公交基因变异迭代变量满足所述预设公交基因变异终止条件,筛选出满足预设第一适应度条件的自然选择公交基因,作为第一目标公交基因;根据所述第一目标公交基因所对应的发车班次,得到所述公交线路的排班表。In the first aspect, this application provides a bus route scheduling processing method, including: obtaining different types of bus factors and combining the bus factors to obtain an initial bus gene, wherein the bus factors describe the bus routes The factors involved in the scheduling, the initial bus gene describes the initial departure frequency; calculate the fitness of each of the initial bus genes, and based on the size of the fitness, the initial bus genes are screened for survival of the fittest. , obtain the naturally selected bus gene, where the fitness describes the degree of excellence of the initial bus gene; obtain the bus gene mutation iteration variable, and determine whether the bus gene mutation iteration variable meets the preset bus gene mutation termination condition; If the bus gene mutation iteration variable satisfies the preset bus gene variation termination condition, the naturally selected bus gene that meets the preset first fitness condition is screened out as the first target bus gene; according to the first target bus gene According to the corresponding departure frequency, the schedule of the bus line is obtained.
第二方面,本申请还提供了一种公交线路排班的处理装置,包括:第一获取单元,用于获取不同类型的公交因素,并将所述公交因素进行组合,得到初始公交基因,其中,所述公交因素描述公交线路的排班所涉及的因素,所述初始公交基因描述初始的发车班次;第一筛选单元,用于计算每个所述初始公交基因的适应度,并根据所述适应度的大小,将所述初始公交基因进行优胜劣汰的筛选,得到自然选择公交基因,其中,所述适应度描述所述初始公交基因的优劣程度;第一判断单元,用于获取公交基因变异迭代变量,并判断所述公交基因变异迭代变量是否满足预设公交基因变异终止条件;第二筛选单元,用于若所述公交基因变异迭代变量满足所述预设公交基因变异终止条件,筛选出满足预设第一适应度条件的自然选择公交基因,作为第一目标公交基因;第一获取单元,用于根据所述第一目标公交基因所对应的发车班次,得到所述公交线路的排班表。In the second aspect, this application also provides a bus line scheduling processing device, including: a first acquisition unit, used to acquire different types of bus factors, and combine the bus factors to obtain an initial bus gene, where , the bus factors describe the factors involved in the scheduling of bus lines, and the initial bus genes describe the initial departure frequency; the first screening unit is used to calculate the fitness of each of the initial bus genes, and according to the The size of the fitness, the initial bus gene is screened for survival of the fittest, and the natural selection bus gene is obtained, wherein the fitness describes the degree of excellence of the initial bus gene; the first judgment unit is used to obtain the variation of the bus gene iterate variables, and determine whether the bus gene mutation iteration variable satisfies the preset bus gene variation termination condition; the second screening unit is used to filter out the bus gene variation iteration variable if it satisfies the preset bus gene variation termination condition. The naturally selected bus gene that meets the preset first fitness condition is used as the first target bus gene; the first acquisition unit is used to obtain the bus line schedule according to the departure frequency corresponding to the first target bus gene. surface.
第三方面,本申请还提供了一种计算机设备,其包括存储器及处理器,所述存储器上存储有计算机程序,所述处理器执行所述计算机程序时实现所述公交线路排班的处理方法的步骤。In a third aspect, this application also provides a computer device, which includes a memory and a processor. A computer program is stored on the memory. When the processor executes the computer program, it implements the bus line scheduling processing method. A step of.
第四方面,本申请还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时使所述处理器执行所述公交线路排班的处理方法的步骤。In a fourth aspect, the present application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the processor causes the processor to perform the bus route scheduling. steps of the processing method.
本申请提供了一种公交线路排班的处理方法、装置、计算机设备及计算 机可读存储介质。所述处理方法通过获取不同类型的公交因素,并将公交因素进行组合,得到初始公交基因,然后评估初始公交基因的适应度,并根据适应度的大小,将初始公交基因进行优胜劣汰的筛选,得到自然选择公交基因,再获取公交基因变异迭代变量,并判断所述公交基因变异迭代变量是否满足预设公交基因变异终止条件,若所述公交基因变异迭代变量满足预设公交基因变异终止条件,筛选出满足预设第一适应度条件的自然选择公交基因,并根据筛选出的自然选择公交基因所对应的发车班次,得到公交线路的排班表,从而将公交线路的排班所涉及的多种不同类型的公交因素进行组合,来构建初始公交基因,并基于遗传算法的适应性筛选,将所述初始公交基因通过适应度进行优胜劣汰的自然选择,进而得到符合预设第一适应度条件的组合型公交基因,并根据公交基因对应的发车班次,得到公交线路的排班,从而使公交线路的排班更符合需要将多种公交因素进行组合考虑的实际所需,能够提高基于多种公交因素排班的客观性,在不增加乘客平均等车时间的前提下,降低公交线路的运营成本。This application provides a bus line scheduling processing method, device, computer equipment and computer-readable storage medium. The processing method obtains the initial bus genes by obtaining different types of bus factors and combining the bus factors, and then evaluates the fitness of the initial bus genes, and selects the initial bus genes according to the size of the fitness, and obtains Naturally select the bus gene, then obtain the bus gene variation iteration variable, and determine whether the bus gene variation iteration variable meets the preset bus gene variation termination condition. If the bus gene variation iteration variable satisfies the preset bus gene variation termination condition, filter Naturally selected bus genes that meet the preset first fitness conditions are selected, and based on the departure times corresponding to the selected naturally selected bus genes, the bus line schedule is obtained, thereby combining the various factors involved in the bus line schedule. Different types of public transportation factors are combined to construct an initial public transportation gene, and based on the adaptability screening of the genetic algorithm, the initial public transportation gene is subjected to natural selection of survival of the fittest through fitness, and then a combination that meets the preset first fitness condition is obtained. type bus gene, and obtain the bus line schedule according to the departure frequency corresponding to the bus gene, so that the bus line schedule is more in line with the actual needs that require a combination of multiple bus factors, and can improve the efficiency of bus routes based on multiple bus factors. The objectivity of bus scheduling can reduce the operating costs of bus lines without increasing the average waiting time of passengers.
附图说明Description of drawings
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are some embodiments of the present application, which are of great significance to this field. Ordinary technicians can also obtain other drawings based on these drawings without exerting creative work.
图1为本申请实施例提供的公交线路排班的处理方法的一个流程示意图;Figure 1 is a schematic flow chart of a bus line scheduling processing method provided by an embodiment of the present application;
图2为本申请实施例提供的公交线路排班的处理方法的第一个子流程示意图;Figure 2 is a schematic diagram of the first sub-flow of the bus line scheduling processing method provided by the embodiment of the present application;
图3为本申请实施例提供的公交线路排班的处理方法的第二个子流程示意图;Figure 3 is a schematic diagram of the second sub-flow of the bus line scheduling processing method provided by the embodiment of the present application;
图4为本申请实施例提供的公交线路排班的处理方法的第三个子流程示意图;Figure 4 is a schematic diagram of the third sub-flow of the bus line scheduling processing method provided by the embodiment of the present application;
图5为本申请实施例提供的公交线路排班的处理方法的第四个子流程示意图;Figure 5 is a schematic diagram of the fourth sub-flow of the bus route scheduling processing method provided by the embodiment of the present application;
图6为本申请实施例提供的公交线路排班的处理装置的一个示意性框图;Figure 6 is a schematic block diagram of a bus line scheduling processing device provided by an embodiment of the present application;
图7为本申请实施例提供的计算机设备的示意性框图。Figure 7 is a schematic block diagram of a computer device provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of this application.
应当理解,当在本说明书和所附权利要求书中使用时,术语“包括”和“包含”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。It should be understood that, when used in this specification and the appended claims, the terms "comprises" and "comprises" indicate the presence of described features, integers, steps, operations, elements and/or components but do not exclude the presence of one or The presence or addition of multiple other features, integers, steps, operations, elements, components and/or collections thereof.
本申请实施例提供了一种公交线路排班的处理方法,所述处理方法可以应用于台式机或者服务器等计算机设备中,并可以运用于智慧公交中基于多种公交因素进行公交线路的排班中,例如基于发车时间、发车类型及发车型号等多种公交因素,对公交线路的发车班次进行排班时,可以采用本申请实施例提供的公交线路排班的处理方法。The embodiment of the present application provides a bus route scheduling processing method. The processing method can be applied to computer equipment such as desktops or servers, and can be used in smart buses to schedule bus routes based on multiple bus factors. For example, when scheduling bus line departures based on various bus factors such as departure time, departure type, and departure model, the bus line scheduling processing method provided by the embodiment of the present application can be used.
例如,在智慧公交中,基于公交系统的仿真系统对公交线路进行排班时,可以由人工在仿真系统的配置页面上预先配置不同类型的公交因素,配置的公交因素可以包括如下的至少任意两种:发车时间、发车类型及发车型号,仿真系统进行如下运算:获取发车时间、发车类型及发车型号等公交因素,并将不同类型的公交因素进行组合,得到初始公交基因,所述初始公交基因描述初始的发车班次;计算每个所述初始公交基因的适应度,并根据所述适应度的大小,将所述初始公交基因进行优胜劣汰的筛选,得到自然选择公交基因,其中,所述适应度描述所述初始公交基因的优劣程度;获取公交基因变异迭代变量,并判断所述公交基因变异迭代变量是否满足预设公交基因变异终止条件;若所述公交基因变异迭代变量满足所述预设公交基因变异终止条件,筛选出满足预设第一适应度条件的自然选择公交基因,作为第一目标公交基因;根据所述第一目标公交基因所对应的发车班次,得到所述公交线 路的排班表。其中,公交系统的仿真系统为采用仿真模型模拟公交线路涉及的地图路线、公交站点、发车车辆、乘客流量等公交的交通情景的系统。For example, in smart public transportation, when scheduling bus lines based on the simulation system of the bus system, different types of bus factors can be pre-configured manually on the configuration page of the simulation system. The configured bus factors can include at least any two of the following: Types: departure time, departure type and departure model. The simulation system performs the following operations: obtains departure time, departure type, departure model and other bus factors, and combines different types of bus factors to obtain an initial bus gene. The initial bus gene Describe the initial bus schedule; calculate the fitness of each of the initial bus genes, and select the initial bus genes according to the size of the fitness to obtain the natural selection bus genes, where the fitness Describe the quality of the initial bus gene; obtain the bus gene variation iteration variable, and determine whether the bus gene variation iteration variable satisfies the preset bus gene variation termination condition; if the bus gene variation iteration variable satisfies the preset Based on the bus gene mutation termination condition, the naturally selected bus genes that meet the preset first fitness condition are selected as the first target bus genes; according to the departure frequency corresponding to the first target bus gene, the bus route arrangement is obtained Schedule. Among them, the simulation system of the bus system is a system that uses a simulation model to simulate the map routes, bus stops, departure vehicles, passenger flow and other bus traffic scenarios involved in the bus lines.
请参阅图1,图1为本申请实施例提供的公交线路排班的处理方法的流程示意图。如图1所示,该方法包括以下步骤S11-S16:Please refer to Figure 1 , which is a schematic flowchart of a bus route scheduling processing method provided by an embodiment of the present application. As shown in Figure 1, the method includes the following steps S11-S16:
S11、获取不同类型的公交因素,并将所述公交因素进行组合,得到初始公交基因,其中,所述公交因素描述公交线路的排班所涉及的因素,所述初始公交基因描述产生的初始的发车班次。S11. Obtain different types of bus factors, and combine the bus factors to obtain an initial bus gene. The bus factors describe the factors involved in the scheduling of bus lines, and the initial bus genes describe the generated initial bus genes. Departure schedule.
具体地,随着公交运输的发展,对公交线路进行公交车辆的排班时,除了考虑公交车辆的发车时间,还会考虑发车类型及发车型号等多种类型的公交因素,其中,所述发车类型包括正线车、大站快线车及区间线车,所述发车型号包括大型车、中型车及小型车等。对公交线路的公交车辆进行排班时,需要将多种类型的公交因素进行组合优化,得到每一组合对应的发车班次,将运营日内的所有发车班次按照发车时间进行排序,实现对公交线路的排班,从而尽可能使得在乘客平均等车时间不增加的情况下,降低公交线路的运输成本。Specifically, with the development of bus transportation, when scheduling bus vehicles on bus lines, in addition to considering the departure time of the bus vehicles, various types of bus factors such as departure type and departure model will also be considered. Among them, the departure time Types include main line trains, station express trains and regional line trains, and the departure models include large cars, medium cars, small cars, etc. When scheduling bus vehicles on bus lines, it is necessary to combine and optimize multiple types of bus factors to obtain the departure frequency corresponding to each combination. All departures within the operating day are sorted according to departure time to realize the optimization of bus lines. Scheduling, so as to reduce the transportation cost of bus lines as much as possible without increasing the average waiting time of passengers.
本申请实施例,考虑多种类型的公交因素,对公交线路进行排班时,可以将每种类型的公交因素设置为对应的预设公交因素集合,每个所述预设公交因素集合包含同一类的公交因素的不同因素对象。例如,公交车辆的发车时间,可以以1分钟为粒度,将公交车辆的运营时间段内的发车时间组合成预设公交发车时间集合,可以描述为{t 1,t 2,…t n},其中,t 1,t 2,…t n为发车时间,取值范围为0-1440之间的任意整数,用于描述一个公交线路的运营日内24小时的分钟计数,例如,第395分钟等同于06:30,t 1描述首班车的发车时间,t n描述末班车的发车时间,当然,公交车辆的发车时间,也可以以2分钟或者其它预设时间单位为粒度进行划分,并且,还可以不以24小时内的时间组合成预设公交发车时间集合,仅以该公交线路在运营日内最长运营时间范围内的时间组合成预设公交发车时间集合,例如,对一条公交线路,若该公交线路的首班车时间为6:00,末班车时间为晚上23:00,所述预设公交发车时间集合包含的发车时间可以为运营日内6:00--23:00内的时间。对于发车类型,可以将所述公交线路采用的公交车辆的发车类型组合成预设公交车辆类型集合,可以描述为{正线车(英文为Normal),区间线车(英文 为Shuttle)},也可以描述为{正线车(英文为Normal),大站快线车(英文为Express),区间线车(英文为Shuttle)},其中,正线车、大站快线车、区间线车为发车类型的具体类型对象,此外,随着公交运输的发展,若产生其它的发车类型,也可以包含进预设公交车辆类型集合。对于发车型号,可以将所述公交线路采用的公交车辆的车辆型号组合成预设公交车辆发车型号集合,可以描述为{大型车(英文为Big),小型车(英文为Small)},也可以描述为{大型车(英文为Big),中型车(英文为Medium),小型车(英文为Small)},其中,大型车、中型车、小型车为公交车辆的具体车辆型号,此外,随着公交车辆的发展,若产生其它的发车型号,也可以包含进预设公交车辆发车型号集合中。此外,还可以根据公交车辆的动力系统为燃油车、油电混动车、电动车等不同的动力类型,并根据公交路线中采用的公交车辆的动力系统,构建预设公交车辆动力类型集合{燃油车,电动车},或者构建预设公交车辆动力类型集合{燃油车,油电混动车,电动车}等不同的集合。需要说明的是,上述每种类型的预设公交因素集合示例仅用于解释多种类型的公交因素所可能存在的不同集合情形,并不用于限定公交因素的集合形式,随着公交运输的发展,完全可以将更多种类型的公交因素组合成各自对应的预设公交因素集合,并运用到本申请实施例中来。 In the embodiment of this application, multiple types of public transportation factors are considered. When scheduling bus lines, each type of public transportation factor can be set as a corresponding preset public transportation factor set. Each of the preset public transportation factor sets includes the same Different factor objects of class Transit Factors. For example, the departure time of bus vehicles can be combined into a preset bus departure time set with a granularity of 1 minute, and the departure times within the operating time period of the bus vehicles can be described as {t 1 , t 2 ,...t n }, Among them, t 1 , t 2 ,...t n are departure times, and the value range is any integer between 0 and 1440. They are used to describe the minute count in 24 hours of operation of a bus line. For example, the 395th minute is equivalent to 06:30, t 1 describes the departure time of the first bus, and t n describes the departure time of the last bus. Of course, the departure time of the bus can also be divided into 2 minutes or other preset time units as a granularity, and it can also be divided. The time within 24 hours is combined into a preset bus departure time set, and only the time within the longest operating time range of the bus line within the operating day is combined into a preset bus departure time set. For example, for a bus line, if the bus The first bus time of the line is 6:00, and the last bus time is 23:00 in the evening. The departure time included in the preset bus departure time set can be between 6:00 and 23:00 on operating days. As for the departure type, the departure types of the bus vehicles used by the bus lines can be combined into a preset set of bus vehicle types, which can be described as {main line bus (Normal in English), interval line bus (Shuttle in English)}, also It can be described as {main line train (Normal in English), Dazhan Express train (Express in English), and section line train (Shuttle in English)}, among which, main line train, Dazhan Express train, and section line train are The specific type object of the departure type. In addition, with the development of public transportation, if other departure types are generated, they can also be included in the preset bus vehicle type set. For the departure model, the vehicle models of the bus vehicles used in the bus lines can be combined into a preset bus vehicle departure model set, which can be described as {large vehicle (Big in English), small vehicle (Small in English)}, or The description is {large car (Big in English), medium car (Medium in English), small car (Small in English)}, where large car, medium car, and small car are the specific vehicle models of public transportation vehicles. In addition, as If the development of public transportation vehicles produces other departure models, they can also be included in the set of preset bus departure models. In addition, the preset bus vehicle power type set {fuel vehicle, electric vehicle}, or construct different collections such as preset bus vehicle power type collection {fuel vehicle, gasoline-electric hybrid vehicle, electric vehicle}. It should be noted that the above examples of each type of preset public transportation factor collection are only used to explain the different collection situations that may exist for multiple types of public transportation factors, and are not used to limit the collection form of public transportation factors. With the development of public transportation, , it is completely possible to combine more types of public transportation factors into corresponding preset public transportation factor sets and apply them to the embodiments of the present application.
然后,从每个预设公交因素集合中,抽取每个所述预设公交因素集合包含的具体公交因素,并将抽取的公交因素进行组合,从而获取不同类型的公交因素,并将所述公交因素进行组合,得到初始公交基因,为了便于后续将初始公交基因进行基因变异,还可以采用初始公交基因初始化预设公交种群,从而将所述预设公交种群进行初始化,所述预设公交种群包含初始公交基因的数量可以为预设第一数量,所述预设第一数量可以为超参数。其中,所述公交因素描述公交线路的排班所涉及的因素,所述公交因素除了包括发车时间,还可以包括公交车辆的发车类型和发车型号中的至少一种,所述发车类型包括正线车、大站快线车和区间线车中的至少一种,所述发车型号包括大型车、中型车与小型车中的至少一种。所述初始公交基因描述在得到所述公交线路的排班过程中产生的初始的发车班次。例如,根据上述预设公交发车时间集合、预设公交车辆类型集合及预设公交车辆发车型号集合,分别从中抽取390、正线车及中型车所对应的公交因素,组合成初始公交基因(390, 正线车,中型车),用于描述在06:30使用中型车发出一班正线车。尤其当结合上述描述的发车时间、发车类型与发车型号对公交线路的进行排班时,能使公交线路的排班充分描述公交车辆排班的实际因素,提高基于发车时间、发车类型与发车型号所对应的综合因素的公交线路排班的客观性,在不增加乘客平均等车时间的前提下,降低公交线路的运营成本。Then, from each preset public transportation factor set, extract specific public transportation factors included in each preset public transportation factor set, and combine the extracted public transportation factors to obtain different types of public transportation factors, and combine the public transportation factors The factors are combined to obtain the initial bus gene. In order to facilitate the subsequent genetic mutation of the initial bus gene, the initial bus gene can also be used to initialize the preset bus population, thereby initializing the preset bus population. The preset bus population includes The number of initial bus genes may be a preset first number, and the preset first number may be a hyperparameter. Wherein, the bus factors describe the factors involved in the scheduling of bus lines. In addition to the departure time, the bus factors may also include at least one of the departure type and departure model of the bus vehicle. The departure type includes the main line. At least one of a train, a station express train and a regional train, and the departure model includes at least one of a large car, a medium-sized car and a small car. The initial bus gene describes the initial departure frequency generated in the process of obtaining the bus line schedule. For example, based on the above-mentioned preset bus departure time set, preset bus vehicle type set and preset bus vehicle departure model set, the bus factors corresponding to 390, mainline buses and medium-sized buses are respectively extracted and combined into the initial bus gene (390 , main line car, medium-sized car), used to describe a main line train using a medium-sized car at 06:30. Especially when the bus line scheduling is combined with the departure time, departure type and departure model described above, the bus line scheduling can fully describe the actual factors of bus vehicle scheduling, and improve the efficiency of bus line scheduling based on departure time, departure type and departure model. The objectivity of bus line scheduling corresponding to comprehensive factors can reduce the operating costs of bus lines without increasing the average waiting time of passengers.
进一步地,为了更加准确地体现遗传算法的随机性,可以随机抽取每个所述预设公交因素集合包含的具体因素对象,从而随机获取不同类型的公交因素,并将所述公交因素进行组合,进而随机性地得到初始公交基因。Further, in order to more accurately reflect the randomness of the genetic algorithm, specific factor objects contained in each of the preset public transportation factor sets can be randomly extracted, thereby randomly obtaining different types of public transportation factors, and combining the public transportation factors, Then the initial bus gene is obtained randomly.
通过获取不同类型的公交因素,并将多种所述公交因素进行组合,实现对公交线路的排班优化时,能够综合考虑多种公交因素,提高公交线路排班的客观性性与有效性,从而在不增加乘客平均等车时间的前提下,降低公交公司的成本。By obtaining different types of bus factors and combining multiple bus factors, when optimizing bus line scheduling, multiple bus factors can be comprehensively considered to improve the objectivity and effectiveness of bus line scheduling. This will reduce the bus company's costs without increasing the average waiting time for passengers.
进一步地,所述得到初始公交基因之后,还包括:Further, after obtaining the initial bus gene, it also includes:
判断所述初始公交基因是否满足预设公交业务规则;Determine whether the initial bus gene meets the preset bus business rules;
若所述初始公交基因满足所述预设公交业务规则,保留所述初始公交基因;If the initial bus gene satisfies the preset bus business rules, retain the initial bus gene;
若所述初始公交基因不满足所述预设公交业务规则,不保留所述初始公交基因。If the initial bus gene does not meet the preset bus business rules, the initial bus gene is not retained.
具体地,获取所述初始公交基因后,为了使产生的公交基因能够满足实际公交线路的需要,判断所述初始公交基因是否满足预设公交业务规则,所述预设公交业务规则可以包括如下内容中的一条或多条:1)首尾班车必须为正线;2)相邻两班车至少有一班为正线;3)同一线路的子线类型数量不能超过3种;4)相邻两班正线的发车时间间隔不能超过指定的最大发车间隔;5)每种车型都有相应的数量约束。若所述初始公交基因满足所述预设公交业务规则,保留所述初始公交基因,并可以将保留的初始公交基因添加至预设公交种群,从而将所述预设公交种群进行初始化,若所述初始公交基因不满足所述预设公交业务规则,不保留所述初始公交基因,不将所述初始公交基因添加至所述预设公交种群,可以将所述初始公交基因丢弃或者淘汰掉,从而将产生的不符合预设公交业务规则的公交基因过滤掉,并且直至得到超参数所对应的预设第一数量的初始公交基因,作为基于遗传算法的公交基因的 变异基础,能够提高基于初始公交基因的基因变异得到的后代公交基因的可行性,从而进一步地提高基于发车时间、发车类型与发车型号的公交线路排班的客观性。其中,超参数是机器学习在学习之前预先设置好的参数。Specifically, after obtaining the initial bus gene, in order to make the generated bus gene meet the needs of the actual bus line, it is determined whether the initial bus gene satisfies the preset bus business rules. The preset bus business rules may include the following content One or more of the following: 1) The first and last train must be a main line; 2) At least one of the two adjacent trains must be a main line; 3) The number of sub-line types on the same line cannot exceed 3; 4) Two adjacent trains must be a main line The departure time interval of the line cannot exceed the specified maximum departure interval; 5) Each vehicle model has corresponding quantity constraints. If the initial bus gene satisfies the preset bus business rules, the initial bus gene is retained, and the retained initial bus gene can be added to the preset bus population, thereby initializing the preset bus population. If If the initial bus gene does not meet the preset bus business rules, the initial bus gene is not retained, the initial bus gene is not added to the preset bus population, the initial bus gene can be discarded or eliminated, In this way, the generated bus genes that do not comply with the preset bus business rules are filtered out, and until the preset first number of initial bus genes corresponding to the hyperparameters is obtained, as the basis for the mutation of bus genes based on the genetic algorithm, it can improve the efficiency of bus genes based on the initial The feasibility of progeny bus genes obtained from genetic variation of bus genes will further improve the objectivity of bus route scheduling based on departure time, departure type and departure model. Among them, hyperparameters are parameters preset by machine learning before learning.
S12、计算每个所述初始公交基因的适应度,并根据所述适应度的大小,将所述初始公交基因进行优胜劣汰的筛选,得到自然选择公交基因,其中,所述适应度描述所述初始公交基因的优劣程度。S12. Calculate the fitness of each initial bus gene, and select the initial bus genes according to the size of the fitness to obtain the natural selection bus gene. The fitness describes the initial bus gene. The degree of pros and cons of bus genes.
具体地,对于得到的多个所述初始公交基因,评估每个所述初始公交基因的适应度,所述适应度描述所述初始公交基因的优劣程度,即所述适应度用于描述所述初始公交基因符合预设目标要求的程度,所述适应度符合预设目标要求的程度越高,表明所述初始公交基因越值得保留,所述适应度符合预设目标要求的程度越低,表明所述初始公交基因越不值得保留,所述初始公交基因被淘汰掉的概率越大,并可以将所有所述初始公交基因按照所述适应度由大到小的顺序进行排序,得到公交基因排序序列,并从所述公交基因排序序列中筛选适应度靠前的若干个自然选择公交基因,从而根据所述适应度的大小,将所述初始公交基因进行优胜劣汰的筛选,完成初始公交基因的自然选择,保留优秀的初始公交基因(即精英基因),淘汰掉不适应的初始公交基因,从而得到若干个自然选择公交基因,例如,所述自然选择公交基因的数量可以为预设第二数量,其中,所述预设第二数量小于所述预设第一数量,所述预设第二数量也可以为超参数。其中,所述适应度的计算公式可以采取如下计算方式:Specifically, for the multiple initial bus genes obtained, the fitness of each initial bus gene is evaluated. The fitness describes the quality of the initial bus genes, that is, the fitness is used to describe the quality of the initial bus genes. The degree to which the initial bus gene meets the preset target requirements. The higher the degree of the fitness meets the preset target requirements, the more worthy of retaining the initial bus gene is. The lower the degree of the fitness meets the preset target requirements. It shows that the less worth retaining the initial bus gene, the greater the probability that the initial bus gene will be eliminated, and all the initial bus genes can be sorted according to the fitness from large to small to obtain the bus genes Sort the sequence, and select several naturally selected bus genes with the highest fitness from the bus gene sorting sequence, so that the initial bus genes are screened for survival of the fittest according to the fitness, and the initial bus genes are completed. Natural selection retains excellent initial bus genes (i.e. elite genes) and eliminates unsuitable initial bus genes, thereby obtaining several naturally selected bus genes. For example, the number of naturally selected bus genes can be a preset second number , wherein the preset second number is smaller than the preset first number, and the preset second number may also be a hyperparameter. Among them, the calculation formula of the fitness can adopt the following calculation method:
公交基因的适应度=-(公交车辆成本+乘客平均等车时间*惩罚系数);The fitness of the bus gene = - (bus vehicle cost + average waiting time of passengers * penalty coefficient);
其中,取负数是为了便于理解,因为一般公交基因的适应度越高,代表公交基因越好、越值得保留。公交车辆成本为公交车辆运营产生的成本,公交车辆成本包括公交车辆的购车成本、司乘人员的成本、车辆油耗及车辆损耗等公交车辆运营过程中产生的各种成本,针对不同车辆型号,可以统计公交车辆的成本。乘客等车时间为乘客到达公交站点的到站时间与下一班车次到达该公交站点的到站时间的时间差。乘客平均等车时间为所述公交线路的所有乘客的等车时间的平均值。对于所述公交线路的单个公交站点的乘客平均等车时间,可以采取如下处理过程获取:Among them, the negative number is taken to facilitate understanding, because generally the higher the fitness of the bus gene, the better the bus gene is and the more worthy it is to retain. The bus vehicle cost is the cost incurred by the operation of the bus vehicle. The bus vehicle cost includes the purchase cost of the bus vehicle, the cost of the driver and passengers, vehicle fuel consumption and vehicle losses and other costs incurred during the operation of the bus vehicle. For different vehicle models, it can be Calculate the cost of public transportation vehicles. The passenger waiting time is the time difference between the arrival time of the passenger at the bus stop and the arrival time of the next train at the bus stop. The average waiting time of passengers is the average waiting time of all passengers on the bus line. For the average waiting time of passengers at a single bus stop on the bus line, the following process can be used to obtain it:
1)对于该条公交线路的每个OD对,在预设时间内,基于公交车辆上安 装的摄像头,收集该OD对的出发站点的上车人数,并且得到该OD对的上车乘客的上车时间,上车时间可以为该公交车辆达到该出发站点的车辆到站时间,其中,所述OD对为所述公交线路中乘客出行的出发站点与目的站点所组成的公交站点对;1) For each OD pair of the bus line, within a preset time, based on the camera installed on the bus vehicle, collect the number of people who boarded the bus at the departure station of the OD pair, and obtain the number of boarding passengers of the OD pair. The bus time, and the boarding time can be the arrival time of the bus vehicle at the departure station, where the OD pair is the bus station pair consisting of the departure station and the destination station of the passenger's trip on the bus line;
2)以所述上车时间为基准,随机产生每个上车乘客的乘客到站时间,所述乘客到站时间为所述上车乘客到达该出发站点的时间,所述乘客到站时间早于所述上车时间;2) Based on the boarding time, randomly generate the passenger arrival time of each boarding passenger. The passenger arrival time is the time when the boarding passenger arrives at the departure station. The passenger arrival time is early. At the stated boarding time;
3)根据所述初始公交基因包含的公交车辆的预设发车时间及公交车辆在每两个相邻公交站点之间的运行时间,统计该公交车辆到达该出发站点的车辆预估达到时间;3) According to the preset departure time of the bus vehicle contained in the initial bus gene and the running time of the bus vehicle between each two adjacent bus stops, calculate the estimated arrival time of the bus vehicle at the departure stop;
4)将所述车辆预估到达时间减去乘客到站时间,得到该上车乘客的等车时间,将所有所述上车乘客的等车时间进行相加并求平均值,即得到该出发站点的所有乘客的等车时间的平均值,即乘客平均等车时间。4) Subtract the passenger's arrival time from the estimated arrival time of the vehicle to obtain the waiting time of the passenger who boarded the bus. Add the waiting time of all passengers who boarded the bus and average it to obtain the departure time. The average waiting time of all passengers at the station is the average waiting time of passengers.
例如,若公交站点A为一个OD对中的出发站点,在预设时间内,若该公交站点A的上车乘客为A1、A2、A3、A4与A5,上车时间为t,以上车时间t为基准,随机产生每个上车乘客的到站时间,可以以t1描述A1的到站时间,t2描述A2的到站时间,t3描述A3的到站时间,t4描述A4的到站时间,t5描述A5的到站时间,其中,t1、t2、t3、t4及t5均早于t。若根据所述初始公交基因包含的公交车辆的预设发车时间及公交车辆在每两个相邻公交站点之间的运行时间,得到公交车辆到达该出发站点的车辆预估达到时间为T,则A1的等车时间为T-t1,A2的等车时间为T-t2,A3的等车时间为T-t3,A4的等车时间为T-t4,A5的等车时间为T-t5,乘客平均等车时间可以采取如下计算公式:T v={(T-t1)+(T-t2)+(T-t3)+(T-t4)+(T-t5)}/5,T v即为上车乘客A1、A2、A3、A4与A5的平均等车时间。 For example, if bus stop A is an OD-centered departure station, within the preset time, if the boarding passengers at bus stop A are A1, A2, A3, A4 and A5, the boarding time is t, and the boarding time is t. Using t as the benchmark, the arrival time of each passenger on the bus is randomly generated. We can use t1 to describe the arrival time of A1, t2 to describe the arrival time of A2, t3 to describe the arrival time of A3, and t4 to describe the arrival time of A4. t5 describes the arrival time of A5, where t1, t2, t3, t4 and t5 are all earlier than t. If based on the preset departure time of the bus vehicle contained in the initial bus gene and the running time of the bus vehicle between each two adjacent bus stops, the estimated arrival time of the bus vehicle at the departure stop is obtained as T, then The waiting time of A1 is T-t1, the waiting time of A2 is T-t2, the waiting time of A3 is T-t3, the waiting time of A4 is T-t4, and the waiting time of A5 is T-t5. The average waiting time of passengers can be calculated using the following formula: T v = {(T-t1)+(T-t2)+(T-t3)+(T-t4)+(T-t5)}/5, T v That is the average waiting time for boarding passengers A1, A2, A3, A4 and A5.
进一步地,根据上述单个出发站点的乘客平均等车时间,可得到该条公交线路中所有OD对各自的出发站点的乘客平均等车时间,并将所有出发站点的乘客平均等车时间求均值,得到该条公交线路的乘客平均等车时间。上述过程,可以基于公交系统的仿真系统进行处理。Further, based on the average waiting time of passengers at the above single departure station, the average waiting time of passengers at their respective departure stations for all ODs in the bus line can be obtained, and the average waiting time of passengers at all departure stations is averaged, Get the average waiting time of passengers on this bus line. The above process can be processed based on the simulation system of the public transportation system.
在另一实施例中,对于每个上车乘客的乘客到站时间,也可以采取如下方式进行统计:针对一条公交线路,在每个公交站点设置站点摄像头,对每 个乘客的到达时间通过视频采集进行监测,得到乘客到达出发站点的到站视频,并对到站视频进行人脸识别,以识别出每个初始乘客,并根据采集的到站视频记录该初始乘客到达公交站点的到站时间。另外,针对每辆公交车辆的上车乘客,基于公交车辆内的车辆摄像头采集上车乘客的上车视频,并对上车视频进行人脸识别,以得到上车的目标乘客,并将目标乘客与初始乘客各自的人脸识别结果进行比对,从而将目标乘客与初始乘客对应起来,并根据初始乘客的到站时间,确定目标乘客的到站时间,即为上车乘客的乘客到站时间。相比上述以所述上车时间为基准,随机产生每个上车乘客的乘客到站时间,能更加准确的反映乘客达到出发站点的到站时间。In another embodiment, the arrival time of each passenger on the bus can also be counted in the following way: for a bus line, set up a site camera at each bus stop, and calculate the arrival time of each passenger through the video Collect and monitor, obtain the arrival video of passengers arriving at the departure station, perform face recognition on the arrival video to identify each initial passenger, and record the arrival time of the initial passenger at the bus stop based on the collected arrival video . In addition, for each passenger boarding the bus, the vehicle camera in the bus collects the boarding video of the boarding passenger, and performs face recognition on the boarding video to obtain the target passenger who boarded the bus and assign the target passenger to the boarding video. Compare the face recognition results of each of the initial passengers to match the target passenger with the initial passenger, and determine the arrival time of the target passenger based on the arrival time of the initial passenger, which is the arrival time of the passenger who boarded the bus. . Compared with the above-mentioned boarding time as the basis, the passenger arrival time of each boarding passenger is randomly generated, which can more accurately reflect the arrival time of passengers arriving at the departure station.
惩罚系数为超参数,惩罚系数可以为:The penalty coefficient is a hyperparameter, and the penalty coefficient can be:
Figure PCTCN2022142235-appb-000001
Figure PCTCN2022142235-appb-000001
其中,公交线路的公交车辆总成本为运营日内所有公交车辆的成本之和,公交线路的平均等车时间为公交线路的运营日内乘客的平均等车时间,常系数为预设的固定值,为经验值,常系数初始化可以为0.5。Among them, the total bus vehicle cost of the bus line is the sum of the costs of all bus vehicles in the operating day, the average waiting time of the bus line is the average waiting time of passengers in the operating day of the bus line, and the constant coefficient is a preset fixed value, which is Empirical value, constant coefficient initialization can be 0.5.
上述公交基因的适应度的统计方式及惩罚系数的设置,充分考虑了公交线路排班过程中需要考虑的两个主要目的,即乘客平均等车时间尽可能短且公交车辆成本尽可能低,从而在不增加乘客平均等车时间的前提下,降低公交线路的运营成本。The above statistical method of fitness of bus genes and the setting of penalty coefficient fully take into account the two main purposes that need to be considered in the bus line scheduling process, that is, the average waiting time of passengers is as short as possible and the cost of bus vehicles is as low as possible, so that Reduce the operating costs of bus lines without increasing the average waiting time for passengers.
S13、获取公交基因变异迭代变量,并判断所述公交基因变异迭代变量是否满足预设公交基因变异终止条件;S13. Obtain the bus gene variation iteration variable, and determine whether the bus gene variation iteration variable meets the preset bus gene variation termination condition;
S14、若所述公交基因变异迭代变量不满足所述预设公交基因变异终止条件,不筛选出满足预设第一适应度条件的自然选择公交基因;S14. If the bus gene mutation iteration variable does not meet the preset bus gene variation termination condition, do not screen out the naturally selected bus genes that meet the preset first fitness condition;
S15、若所述公交基因变异迭代变量满足所述预设公交基因变异终止条件,筛选出满足预设第一适应度条件的自然选择公交基因,作为第一目标公交基因;S15. If the bus gene mutation iteration variable meets the preset bus gene variation termination condition, select the naturally selected bus gene that meets the preset first fitness condition as the first target bus gene;
S16、根据所述第一目标公交基因所对应的发车班次,得到所述公交线路的排班表。S16. Obtain the bus schedule according to the departure frequency corresponding to the first target bus gene.
具体地,预先设置公交基因变异迭代变量,所述公交基因变异迭代变量用于描述初始公交基因的变异情况,采用所述公交基因变异迭代变量来统计初始公交基因的变异情况,所述公交基因变异迭代变量可以通过变量名访问, 所述公交基因变异迭代变量可以采用键值对形式描述,所述键值对的关键词(即变量名)用于描述公交基因变异迭代变量,所述键值对的值(变量的值,即变量名对应的值)用于描述初始公交基因的变异具体数值,所述键值对的值可以通过键值对的关键词进行访问,所述公交基因变异迭代变量可以为所述初始公交基因的变异迭代次数,或者所述公交基因变异迭代变量可以为公交种群的平均种群适应度连续保持不变的种群代数(即公交基因迭代的数量)。Specifically, the bus gene mutation iteration variable is set in advance. The bus gene mutation iteration variable is used to describe the variation of the initial bus gene. The bus gene variation iteration variable is used to count the variation of the initial bus gene. The bus gene variation is Iteration variables can be accessed through variable names. The bus gene mutation iteration variables can be described in the form of key-value pairs. The keywords of the key-value pairs (ie, variable names) are used to describe the bus gene mutation iteration variables. The key-value pairs The value (the value of the variable, that is, the value corresponding to the variable name) is used to describe the specific value of the mutation of the initial bus gene. The value of the key-value pair can be accessed through the keyword of the key-value pair. The bus gene mutation iteration variable It may be the number of mutation iterations of the initial bus gene, or the bus gene mutation iteration variable may be the number of population generations (that is, the number of bus gene iterations) in which the average population fitness of the bus population remains unchanged continuously.
基于公交基因变异迭代变量,对于初始公交基因的每一次迭代,获取公交基因变异迭代变量,并判断所述公交基因变异迭代变量是否满足预设公交基因变异终止条件,所述预设公交基因变异终止条件描述公交基因基于遗传算法的基因变异与自然选择的终结条件(即基因变异与自然选择的完成条件),所述预设公交基因变异终止条件可以为达到公交基因的最大变异迭代次数,或者所有公交基因组成的公交种群的平均种群适应度连续S轮保持不变(S为预设常数),其中,所述平均种群适应度为公交种群中所有公交基因的适应度的平均值。若所述公交基因变异迭代变量不满足所述预设公交基因变异终止条件,不筛选出满足预设第一适应度条件的自然选择公交基因,若所述公交基因变异迭代变量满足所述预设公交基因变异终止条件,筛选出满足预设第一适应度条件的自然选择公交基因,作为第一目标公交基因,其中,所述预设第一适应度条件可以为适应度较大的若干个公交基因,或者,对于发车时间相同的多个公交基因,采取择一方式确定一个公交基因,例如随机选取其中的一个公交基因,或者选取排在首位的公交基因。例如,由于不同的公交基因对应的发车班次不同,在实际发车时,不可能在同一分钟发出多于一个班次的公交车辆,因此,相邻的两个或者多个公交基因的发车时间虽然可以相同,但当存在多个相同发车时间的公交基因时,可以只考虑其中一个公交基因,而忽略掉其它相同发车时间的公交基因。例如,对于发车时间相同的公交基因[(390,normal,medium),(395,normal,big),(395,express,medium)],可以默认等价于[(390,normal,medium),(395,normal,big)]。Based on the bus gene variation iteration variable, for each iteration of the initial bus gene, the bus gene variation iteration variable is obtained, and it is judged whether the bus gene variation iteration variable satisfies the preset bus gene variation termination condition, and the preset bus gene variation terminates Condition description: The bus gene is based on the termination condition of gene mutation and natural selection of the genetic algorithm (i.e., the completion condition of gene mutation and natural selection). The preset bus gene mutation termination condition can be the maximum number of mutation iterations of the bus gene, or all The average population fitness of the bus population composed of bus genes remains unchanged for S consecutive rounds (S is a preset constant), where the average population fitness is the average of the fitness of all bus genes in the bus population. If the bus gene mutation iteration variable does not meet the preset bus gene mutation termination condition, the naturally selected bus gene that meets the preset first fitness condition will not be screened out. If the bus gene mutation iteration variable satisfies the preset The bus gene mutation termination condition is to select the naturally selected bus genes that meet the preset first fitness condition as the first target bus gene, where the preset first fitness condition can be several buses with larger fitness Gene, or for multiple bus genes with the same departure time, a selective method is used to determine a bus gene, such as randomly selecting one of the bus genes, or selecting the bus gene ranked first. For example, since different bus genes correspond to different departure times, it is impossible to send out more than one bus at the same minute during actual departure. Therefore, although the departure times of two or more adjacent bus genes can be the same , but when there are multiple bus genes with the same departure time, you can only consider one of the bus genes and ignore other bus genes with the same departure time. For example, for bus genes [(390,normal,medium),(395,normal,big),(395,express,medium)] with the same departure time, it can be equivalent to [(390,normal,medium),( 395,normal,big)].
由于公交基因对应发车班次,由此,确定所述第一目标公交基因后,即可确定所述第一目标公交基因所对应的发车班次,并可以将所述第一目标公 交基因所对应的发车班次,按照发车时间的时间先后顺序进行排序,从而得到所述公交线路的排班表。若不满足所述预设公交基因变异终止条件,不筛选出满足预设第一适应度条件的自然选择公交基因,继续进行公交基因的变异与自然选择,直至满足预设公交基因变异终止条件,不再进行公交基因的变异与自然选择。Since the bus gene corresponds to the departure frequency, therefore, after determining the first target bus gene, the departure frequency corresponding to the first target bus gene can be determined, and the departure frequency corresponding to the first target bus gene can be determined The shifts are sorted according to the chronological order of departure time, thereby obtaining the schedule of the bus lines. If the preset bus gene mutation termination conditions are not met, the naturally selected bus genes that meet the preset first fitness condition will not be screened out, and the bus gene mutation and natural selection will continue until the preset bus gene mutation termination conditions are met. No more mutation and natural selection of bus genes.
本申请实施例,通过获取不同类型的公交因素,并将公交因素进行组合,得到初始公交基因,然后评估初始公交基因的适应度,并根据适应度的大小,将初始公交基因进行优胜劣汰的筛选,得到自然选择公交基因,再获取公交基因变异迭代变量,并判断所述公交基因变异迭代变量是否满足预设公交基因变异终止条件,若所述公交基因变异迭代变量满足预设公交基因变异终止条件,筛选出满足预设第一适应度条件的自然选择公交基因,并根据筛选出的自然选择公交基因所对应的发车班次,得到公交线路的排班表,从而将公交线路的排班所涉及的多种不同类型的公交因素进行组合,来构建初始公交基因,并基于遗传算法的适应性筛选,将所述初始公交基因通过适应度进行优胜劣汰的自然选择,进而得到符合预设第一适应度条件的组合型公交基因,并根据公交基因对应的发车班次,得到公交线路的排班,从而使公交线路的排班更符合需要将多种公交因素进行组合考虑的实际所需,能够提高基于多种公交因素排班的客观性,在不增加乘客平均等车时间的前提下,降低公交线路的运营成本。In the embodiment of this application, the initial bus genes are obtained by obtaining different types of bus factors and combining the bus factors, and then the fitness of the initial bus genes is evaluated, and the initial bus genes are screened for survival of the fittest based on the fitness. Obtain the natural selection bus gene, then obtain the bus gene variation iteration variable, and determine whether the bus gene variation iteration variable meets the preset bus gene variation termination condition. If the bus gene variation iteration variable satisfies the preset bus gene variation termination condition, The naturally selected bus genes that meet the preset first fitness condition are screened out, and based on the departure frequency corresponding to the selected naturally selected bus gene, the bus line schedule is obtained, so that the bus line schedule involves many factors. Different types of public transportation factors are combined to construct the initial public transportation gene, and based on the adaptive screening of the genetic algorithm, the initial public transportation gene is subjected to natural selection of survival of the fittest through fitness, and then the first public transportation gene that meets the preset fitness conditions is obtained. Combined bus genes, and based on the departure frequency corresponding to the bus gene, the bus line scheduling is obtained, so that the bus line scheduling is more in line with the actual needs that require a combination of multiple bus factors, and can improve the efficiency of bus routes based on a variety of bus The objectivity of factor scheduling can reduce the operating costs of bus lines without increasing the average waiting time of passengers.
请参阅图2,图2为本申请实施例提供的公交线路排班的处理方法的第一个子流程示意图。如图2所示,所述得到初始公交基因之后,还包括:Please refer to Figure 2. Figure 2 is a schematic diagram of the first sub-flow of the bus route scheduling processing method provided by the embodiment of the present application. As shown in Figure 2, after obtaining the initial bus gene, it also includes:
将所述初始公交基因添加至预设公交种群;Add the initial bus gene to the preset bus population;
所述判断是否满足预设公交基因变异终止条件之后,还包括:After determining whether the preset bus gene mutation termination conditions are met, it also includes:
S21、若不满足所述预设公交基因变异终止条件,从所述预设公交种群中获取满足预设第二适应度条件的公交基因,作为第二目标公交基因;S21. If the preset bus gene mutation termination condition is not met, obtain the bus gene that meets the preset second fitness condition from the preset bus population as the second target bus gene;
S22、将所述第二目标公交基因进行基因变异,得到后代公交基因,并将所述后代公交基因添加至所述预设公交种群;S22. Genetically mutate the second target bus gene to obtain the offspring bus gene, and add the offspring bus gene to the preset bus population;
S23、计算所述后代公交基因的适应度,并根据所述预设公交种群包含的每个公交基因的适应度,将所述预设公交种群包含的公交基因进行优胜劣汰的筛选;S23. Calculate the fitness of the bus genes of the offspring, and select the bus genes included in the preset bus population for survival of the fittest based on the fitness of each bus gene included in the preset bus population;
S24、再次判断是否满足所述预设公交基因变异终止条件;S24. Determine again whether the preset bus gene mutation termination conditions are met;
S25、若仍不满足所述预设公交基因变异终止条件,迭代所述从所述预设公交种群中获取满足预设第二适应度条件的公交基因、作为第二目标公交基因所对应的公交基因的基因变异过程,直至满足所述预设公交基因变异终止条件;S25. If the preset bus gene mutation termination condition is still not satisfied, iteratively obtain the bus gene that satisfies the preset second fitness condition from the preset bus population as the bus corresponding to the second target bus gene. The genetic mutation process of the gene until the preset bus gene mutation termination conditions are met;
S26、若满足所述预设公交基因变异终止条件,执行所述筛选出满足预设第一适应度条件的自然选择公交基因的步骤。S26. If the preset bus gene mutation termination condition is met, perform the step of screening out naturally selected bus genes that meet the preset first fitness condition.
具体地,将所述初始公交基因添加至预设公交种群,所述预设公交种群描述进行基因变异的公交基因的群体,基于所述预设公交种群进行公交基因的变异迭代,并将所述预设公交种群包含的公交基因进行优胜劣汰的自然选择。Specifically, the initial bus gene is added to a preset bus population, which describes a group of bus genes that undergo genetic mutation, and the bus gene mutation iteration is performed based on the preset bus population, and the bus gene is added to the preset bus population. The preset bus population contains bus genes for natural selection of survival of the fittest.
若不满足所述预设公交基因变异终止条件,不筛选出满足预设第一适应度条件的自然选择公交基因之后,从所述预设公交种群中获取满足预设第二适应度条件的公交基因,所述预设第二适应度条件的公交基因可以为适应度较大的预设第三数量的公交基因,作为第二目标公交基因,并将所述第二目标公交基因进行基因变异,得到后代公交基因,再将所述后代公交基因添加至所述预设公交种群,以更新所述预设公交种群。If the preset bus gene mutation termination conditions are not met, and the naturally selected bus genes that meet the preset first fitness condition are not screened out, buses that meet the preset second fitness condition are obtained from the preset bus population. Genes, the bus genes with the preset second fitness condition can be the preset third number of bus genes with greater fitness, as the second target bus genes, and the second target bus genes are genetically mutated, Obtain the offspring bus genes, and then add the offspring bus genes to the preset bus population to update the preset bus population.
由于初始公交基因的每一次迭代变异,均根据公交基因的适应度的大小,将公交基因进行优胜劣汰的筛选,从而使所述预设公交种群保留了适应度较高的可行解所对应的精英公交基因,尤其地,所述预设第二适应度条件为以预设采样概率从所述预设公交种群中获取公交基因,且所述预设采样概率与所述预设公交种群包含的公交基因所对应的公交车辆成本大小成反比,从而使所述预设公交种群保持一定比例的可行解,使所述预设公交种群不至于偏离可行区域太远。Since each iteration of the initial bus gene changes, the bus genes are screened for survival of the fittest based on the fitness of the bus gene, so that the preset bus population retains the elite buses corresponding to the feasible solutions with higher fitness. Genes, in particular, the preset second fitness condition is to obtain bus genes from the preset bus population with a preset sampling probability, and the preset sampling probability is consistent with the bus genes included in the preset bus population. The corresponding bus vehicle cost is inversely proportional, so that the preset bus population maintains a certain proportion of feasible solutions and prevents the preset bus population from deviating too far from the feasible area.
计算所述后代公交基因的适应度,得到所述预设公交种群包含的每个公交基因的适应度,并根据所述预设公交种群包含的每个公交基因的适应度,将所述预设公交种群包含的公交基因再次进行优胜劣汰的自然选择,并再次判断是否满足所述预设公交基因变异终止条件,若仍不满足所述预设公交基因变异终止条件,继续迭代从所述预设公交种群中获取满足预设第二适应度条件的公交基因,并将获取的公交基因进行基因变异,直至满足所述预设公 交基因变异终止条件,若满足所述预设公交基因变异终止条件,筛选出满足预设第一适应度条件的自然选择公交基因,并将筛选出的自然选择公交基因转换为公交线路的排班,得到所述公交线路的排班表,从而基于遗传算法,利用适应度较大的公交基因进行迭代的基因变异,最终得到综合多种公交因素的公交排班,能够提高基于多种公交因素排班的客观性,从而在不增加乘客平均等车时间的前提下,降低公交线路的运营成本。Calculate the fitness of the bus genes of the offspring to obtain the fitness of each bus gene included in the preset bus population, and convert the preset bus gene according to the fitness of each bus gene included in the preset bus population. The bus genes contained in the bus population are again subjected to natural selection of survival of the fittest, and it is again determined whether the preset bus gene mutation termination conditions are met. If the preset bus gene mutation termination conditions are still not met, the iteration continues from the preset bus gene mutation termination conditions. Obtain bus genes that meet the preset second fitness condition from the population, and genetically mutate the acquired bus genes until the preset bus gene mutation termination conditions are met. If the preset bus gene mutation termination conditions are met, filter Naturally selected bus genes that meet the preset first fitness condition are selected, and the selected naturally selected bus genes are converted into bus line schedules to obtain the bus line schedule. Based on the genetic algorithm, the fitness Through iterative gene mutation of larger bus genes, a bus schedule that integrates multiple bus factors is finally obtained, which can improve the objectivity of bus schedules based on multiple bus factors, thereby reducing the average waiting time of passengers without increasing the bus schedule. Bus line operating costs.
在一实施例中,请参阅图3,图3为本申请实施例提供的公交线路排班的处理方法的第二个子流程示意图。如图3所示,一组公交基因采用公交基因数组描述,所述公交基因数组包含公交基因元素,每个所述公交基因元素描述一个公交基因所对应的发车班次,所述公交基因元素包含公交基因节点,所述公交基因节点存储一个类型的公交因素,在该实施例中,所述将所述第二目标公交基因进行基因变异,得到后代公交基因,包括:In one embodiment, please refer to FIG. 3 , which is a second sub-flow schematic diagram of a bus route scheduling processing method provided by an embodiment of the present application. As shown in Figure 3, a group of bus genes is described by a bus gene array. The bus gene array contains bus gene elements. Each of the bus gene elements describes the departure frequency corresponding to a bus gene. The bus gene elements include bus Gene node, the bus gene node stores one type of bus factors. In this embodiment, the second target bus gene is genetically mutated to obtain the offspring bus gene, including:
S31、获取两个公交基因元素,并在两个所述公交基因元素的相同位置进行截取,得到相对应位置的子基因元素对;S31. Obtain two bus gene elements, and intercept them at the same position of the two bus gene elements to obtain a pair of sub-gene elements at the corresponding position;
S32、将所述子基因元素对包含的两个子基因元素采取交叉方式进行互相替换,得到后代公交基因。S32. Replace the two sub-gene elements contained in the sub-gene element with each other in a crossover manner to obtain the offspring bus gene.
具体地,一条公交线路的所有发车班次采用数组描述,即采用公交基因数组描述一组公交基因,所述公交基因数组包含公交基因元素,每个所述公交基因元素描述一个公交基因所对应的发车班次,所述公交基因元素包含公交基因节点,每个所述公交基因节点存储一个类型的公交因素,尤其所述公交基因元素可以包含多个公交基因节点,一个所述公交基因元素描述多个类型的公交因素,从而将公交线路的排班所涉及的多个因素组合起来,实现对公交线路进行综合多种因素的排班。Specifically, all departures of a bus line are described using an array, that is, a bus gene array is used to describe a group of bus genes. The bus gene array contains bus gene elements, and each of the bus gene elements describes the departure corresponding to a bus gene. The bus gene element includes a bus gene node, and each bus gene node stores a type of bus factor. In particular, the bus gene element may include multiple bus gene nodes, and one bus gene element describes multiple types. public transportation factors, thereby combining multiple factors involved in the scheduling of bus lines to achieve comprehensive scheduling of bus lines based on multiple factors.
进行基因变异时,获取两个公交基因元素,两个所述公交基因元素包含相同数量的公交基因节点,即两个所述公交基因元素包含的公交基因节点的结构是相同的,在两个所述公交基因元素的若干个相同位置进行截取,即均在两个所述公交基因元素的第n个公交基因节点的位置进行截取,得到相对应位置的子公交基因元素对,然后将所述子公交基因元素对包含的两个子公交基因元素采取交叉方式进行互相替换,得到后代公交基因。例如,若存在两个公交基因元素a和b,其中,公交基因元素a为【a 1,a 2,a 3,…a n】, 公交基因元素b为【b 1,b 2,b 3,…b n】,其中,a n描述公交基因元素a的第n个公交基因节点,b n描述公交基因元素b的第n个公交基因节点,公交基因元素a和b的每个公交基因节点描述一个类型的公交因素。至少可以采取以下方式进行基因变异,得到后代基因: When performing gene mutation, two bus gene elements are obtained. The two bus gene elements contain the same number of bus gene nodes. That is, the structures of the bus gene nodes contained in the two bus gene elements are the same. Intercept at several identical positions of the public transportation gene elements, that is, intercept at the position of the nth public transportation gene node of the two public transportation gene elements to obtain a pair of sub-transit gene elements at the corresponding position, and then add the sub-transit gene elements to The bus gene element replaces the two sub-bus gene elements contained in it in a crossover manner to obtain the offspring bus gene. For example, if there are two bus gene elements a and b, among which, the bus gene element a is [a 1 , a 2 , a 3 ,... an ], and the bus gene element b is [b 1 , b 2 , b 3 , ...b n ], where a n describes the n-th bus gene node of bus gene element a, b n describes the n-th bus gene node of bus gene element b, and each bus gene node description of bus gene elements a and b A type of transit factor. At least the following methods can be used to carry out genetic mutation and obtain offspring genes:
1)单点交叉。例如,对于上述两个公交基因元素a和b,可以选取公交基因元素a的第3个公交基因节点a 3,可以将公交基因元素a为【a 1,a 2,a 3,…a n】截取为子基因元素【a 1,a 2,a 3】与【a 4,…a n】两部分,选取公交基因元素b的第3个公交基因节点b 3,可以将公交基因元素b为【b 1,b 2,b 3,…b n】截取为子基因元素【b 1,b 2,b 3】与【b 4,…b n】两部分,其中,相对应位置的子基因元素【a 1,a 2,a 3】与【b 1,b 2,b 3】为子基因元素对,相对应位置的子基因元素【a 4,…a n】与【b 4,…b n】为子基因元素对,并可以选取子基因元素对【a 4,…a n】与【b 4,…b n】,将【a 4,…a n】与【b 4,…b n】采取交叉方式进行互相替换,可以得到后代公交基因【a 1,a 2,a 3,b 4,…b n】与【b 1,b 2,b 3,a 4,…a n】,从而将公交基因元素进行变异,产生后代公交基因。 1) Single point crossover. For example, for the above two bus gene elements a and b, the third bus gene node a 3 of the bus gene element a can be selected, and the bus gene element a can be [a 1 , a 2 , a 3 ,...a n ] Intercept into two parts: sub-gene elements [a 1 , a 2 , a 3 ] and [a 4 ,...a n ], select the third bus gene node b 3 of the bus gene element b, and the bus gene element b can be [ b 1 , b 2 , b 3 ,…b n ] are intercepted into two parts: sub-gene element [b 1 , b 2 , b 3 ] and [b 4 ,…b n ], among which the sub-gene element at the corresponding position [ a 1 , a 2 , a 3 ] and [b 1 , b 2 , b 3 ] are pairs of sub-gene elements, and the corresponding position sub-gene elements [a 4 ,... an ] and [b 4 ,...b n ] is a sub-gene element pair, and you can select the sub-gene element pair [a 4 ,... an ] and [b 4 ,...b n ], and select [a 4 ,... an ] and [b 4 ,...b n ] By replacing each other in the crossover method, the offspring bus genes [a 1 , a 2 , a 3 , b 4 ,...b n ] and [b 1 , b 2 , b 3 , a 4 ,...a n ] can be obtained, thereby converting the bus genes Genetic elements mutate to produce offspring genes.
2)双点交叉。例如,对于上述两个公交基因元素a和b,可以选取公交基因元素a的第3个公交基因节点a 3与第5个公交基因节点a 5,可以将公交基因元素a为【a 1,a 2,a 3,…a n】截取为子基因元素【a 1,a 2,a 3】、【a 4,a 5】与【a 6,…a n】三部分,选取公交基因元素b的第3个公交基因节点b 3与第5个公交基因节点b 5,可以将公交基因元素b为【b 1,b 2,b 3,…b n】截取为子基因元素【b 1,b 2,b 3】、【b 4,b 5】与【b 6,…b n】三部分,其中,相对应位置的子基因元素对共包括:【a 1,a 2,a 3】与【b 1,b 2,b 3】,【a 4,a 5】与【b 4,b 5】,及【a 6,…a n】与【b 6,…b n】,并可以选取子基因元素对【a 1,a 2,a 3】与【b 1,b 2,b 3】,【a 4,a 5】与【b 4,b 5】,或者【a 6,…a n】与【b 6,…b n】采取交叉方式进行互相替换,例如可以得到后代公交基因【a 1,a 2,a 3,a 4,a 5,b 6,…b n】与【b 1,b 2,b 3,b 4,b 5,a 6,…a n】,从而将公交基因元素进行变异,产生后代公交基因。 2) Double point intersection. For example, for the above two bus gene elements a and b, the third bus gene node a 3 and the fifth bus gene node a 5 of the bus gene element a can be selected, and the bus gene element a can be [a 1 , a 2 , a 3 ,... an ] are intercepted into three parts: sub-gene elements [a 1 , a 2 , a 3 ], [a 4 , a 5 ] and [a 6 ,... an ], and select the bus gene element b For the third bus gene node b 3 and the fifth bus gene node b 5 , the bus gene elements b can be intercepted as [b 1 , b 2 , b 3 ,...b n ] into sub-gene elements [b 1 , b 2 , b 3 ], [b 4 , b 5 ] and [b 6 ,...b n ]. Among them, the sub-gene element pairs at the corresponding positions include: [a 1 , a 2 , a 3 ] and [b 1 , b 2 , b 3 ], [a 4 , a 5 ] and [b 4 , b 5 ], and [a 6 ,...a n ] and [b 6 ,...b n ], and sub-gene elements can be selected For [a 1 , a 2 , a 3 ] and [b 1 , b 2 , b 3 ], [a 4 , a 5 ] and [b 4 , b 5 ], or [a 6 ,...a n ] and [ b 6 ,...b n ] adopt a crossover method to replace each other. For example, the offspring bus genes [a 1 , a 2 , a 3 , a 4 , a 5 , b 6 ,...b n ] and [b 1 , b 2 can be obtained , b 3 , b 4 , b 5 , a 6 ,…a n ], thereby mutating the bus gene elements to produce offspring bus genes.
3)多点交叉。与上述单点交叉和双点交叉相似,尤其在包含多个公交基因节点时,只是选取了公交基因元素3个或者3个以上的公交基因节点,并将两个公交基因元素分别截取为四部分或者四部分以上段的子基因元素,并得到四对或者四对以上的子基因元素对,然后选取子基因元素对采取交叉方 式进行互相替换,从而将公交基因进行变异,产生后代公交基因。3) Multi-point crossover. Similar to the above-mentioned single-point crossover and double-point crossover, especially when multiple bus gene nodes are included, only bus gene nodes with 3 or more bus gene elements are selected, and the two bus gene elements are intercepted into four parts. Or four or more segments of sub-gene elements, and four or more pairs of sub-gene elements are obtained, and then the pairs of sub-gene elements are selected to replace each other in a crossover manner, thereby mutating the bus genes and producing offspring bus genes.
上述公交基因进行变异的方式,能够充分体现基于遗传算法的公交基因变异的随机性与多样性,使产生的后代公交基因更加形式多样,从而进一步尽可能提高基于多种公交因素排班的客观性,在不增加乘客平均等车时间的前提下,降低公交线路的运营成本。The above-mentioned way of mutating bus genes can fully reflect the randomness and diversity of bus gene mutations based on genetic algorithms, making the resulting bus genes more diverse, thereby further improving the objectivity of scheduling based on multiple bus factors as much as possible , reducing the operating costs of bus lines without increasing the average waiting time of passengers.
在一实施例中,请参阅图4,图4为本申请实施例提供的公交线路排班的处理方法的第三个子流程示意图。一组公交基因采用公交基因数组描述,所述公交基因数组包含公交基因元素,每个所述公交基因元素描述一个公交基因所对应的发车班次,所述公交基因元素包含公交基因节点,所述公交基因节点存储一个类型的公交因素,如图4所示,在该实施例中,所述将所述第二目标公交基因进行基因变异,得到后代公交基因,包括:In one embodiment, please refer to FIG. 4 , which is a schematic diagram of the third sub-flow of the bus route scheduling processing method provided by the embodiment of the present application. A group of bus genes is described by a bus gene array. The bus gene array contains bus gene elements. Each of the bus gene elements describes a bus schedule corresponding to a bus gene. The bus gene elements include bus gene nodes. The bus gene elements The gene node stores a type of public transportation factor, as shown in Figure 4. In this embodiment, the second target public transportation gene is genetically mutated to obtain a descendant public transportation gene, including:
S41、获取公交基因元素,选取所述公交基因元素包含的公交基因节点;S41. Obtain the bus gene element and select the bus gene node contained in the bus gene element;
S42、将所述公交基因节点的公交因素采用相同类型的其它公交因素进行替换,得到后代公交基因。S42. Replace the bus factors of the bus gene node with other bus factors of the same type to obtain the offspring bus genes.
具体地,进行基因变异时,获取一个公交基因元素,并选取所述公交基因元素包含的公交基因节点,尤其可以随机选取所述公交基因元素包含的公交基因节点,从而可以更好的描述基因变异的随机性,并将所述公交基因节点的公交因素采用相同类型的其它公交因素进行替换,得到后代公交基因。例如,若存在公交基因元素a为【a 1,a 2,a 3,…a n】,可以随机选取公交基因元素a包含的第m个公交基因节点a m,其中,1<m<n,并将a m替换为同类型的其它公交因素,例如,若a m为发车型号中的大型车,可以随机采用发车型号中的中型车或者小型车替换大型车,从而得到后代公交基因,这种公交基因的变异方式可以称为单点突变。上述公交基因进行变异的方式,更加丰富了公交基因变异的方式,能够充分体现基于遗传算法的公交基因变异的随机性与多样性,使产生的后代公交基因更加形式多样,从而进一步尽可能提高基于多种公交因素排班的客观性,在不增加乘客平均等车时间的前提下,降低公交线路的运营成本。 Specifically, when performing gene mutation, a bus gene element is obtained, and the bus gene node contained in the bus gene element is selected. In particular, the bus gene node contained in the bus gene element can be randomly selected, so that the genetic variation can be better described. randomness, and replace the bus factors of the bus gene node with other bus factors of the same type to obtain the offspring bus genes. For example, if there is a bus gene element a as [a 1 , a 2 , a 3 ,... an ], the mth bus gene node a m contained in the bus gene element a can be randomly selected, where 1<m<n, And replace a m with other bus factors of the same type. For example, if a m is a large vehicle in the starting model, you can randomly replace the large vehicle with a medium-sized car or a small car in the starting model, so as to obtain the bus genes of future generations. The way the bus gene mutates can be called a single point mutation. The above-mentioned bus gene mutation method enriches the bus gene mutation method, can fully reflect the randomness and diversity of bus gene mutation based on genetic algorithms, and makes the generated bus genes more diverse, thereby further improving the efficiency of bus gene mutation as much as possible. The objectivity of bus schedules based on various bus factors can reduce the operating costs of bus lines without increasing the average waiting time of passengers.
进一步地,将所述第二目标公交基因进行基因变异,得到后代公交基因时,可以将上述描述的图3与图4的基因变异方式结合起来,将所述第二目标公交基因进行基因变异,例如,随机选取上述描述的单点交叉、双点交叉、 多点交叉或者单点突变,将具体的第二目标公交基因进行基因变异,能够更加突出的体现基于遗传算法的基因变异的随机性,使产生的后代公交基因更加丰富多样,从而进一步提高基于多种公交因素排班的客观性,在不增加乘客平均等车时间的前提下,降低公交线路的运营成本。Further, when the second target bus gene is genetically mutated to obtain the bus gene of the offspring, the genetic mutation methods of Figure 3 and Figure 4 described above can be combined to genetically mutate the second target bus gene, For example, randomly selecting the single-point crossover, double-point crossover, multi-point crossover or single-point mutation described above to genetically mutate the specific second target bus gene can more prominently reflect the randomness of gene mutation based on genetic algorithms. The resulting bus genes will be richer and more diverse, thereby further improving the objectivity of bus schedules based on a variety of bus factors, and reducing the operating costs of bus lines without increasing the average waiting time of passengers.
在一实施例中,请参阅图5,图5为本申请实施例提供的公交线路排班的处理方法的第四个子流程示意图。如图5所示,在该实施例中,所述得到所述公交线路的排班表之后,还包括:In one embodiment, please refer to FIG. 5 , which is a schematic diagram of the fourth sub-flow of a bus route scheduling processing method provided by an embodiment of the present application. As shown in Figure 5, in this embodiment, after obtaining the schedule of the bus line, it also includes:
S51、将所述初始公交基因进行基因变异迭代n次,并统计每次迭代得到的所述公交线路的排班表所对应的预估平均等车时间,其中,n≥2,n为整数;S51. Iterate the genetic mutation of the initial bus gene n times, and calculate the estimated average waiting time corresponding to the bus line schedule obtained in each iteration, where n≥2, n is an integer;
S52、根据所述公交线路的单次历史排班,获取所述公交线路的历史平均等车时间;S52. Obtain the historical average waiting time of the bus line based on the single historical schedule of the bus line;
S53、判断所述预估平均等车时间是否小于或者等于所述历史平均等车时间;S53. Determine whether the estimated average waiting time is less than or equal to the historical average waiting time;
S54、若所述预估平均等车时间大于所述历史平均等车时间,不将所述预估平均等车时间作为目标预估平均等车时间;S54. If the estimated average waiting time is greater than the historical average waiting time, do not use the estimated average waiting time as the target estimated average waiting time;
S55、若所述预估平均等车时间小于或者等于所述历史平均等车时间,将所述预估平均等车时间作为目标预估平均等车时间;S55. If the estimated average waiting time is less than or equal to the historical average waiting time, use the estimated average waiting time as the target estimated average waiting time;
S56、计算所有所述目标预估平均等车时间的数量在所有所述预估平均等车时间的数量中所占的比例;S56. Calculate the proportion of the number of all the target estimated average waiting times to the number of all the estimated average waiting times;
S57、判断所述比例是否小于或者等于预设第一比例阈值;S57. Determine whether the ratio is less than or equal to the preset first ratio threshold;
S58、若所述比例小于或者等于所述预设第一比例阈值,将所述惩罚系数增大;S58. If the ratio is less than or equal to the preset first ratio threshold, increase the penalty coefficient;
S59、若所述比例大于所述预设第一比例阈值,判断所述比例是否大于或者等于预设第二比例阈值;S59. If the proportion is greater than the preset first proportion threshold, determine whether the proportion is greater than or equal to the preset second proportion threshold;
S60、若所述比例大于或者等于所述预设第二比例阈值,将所述惩罚系数减小,其中,所述预设第一比例阈值小于所述预设第二比例阈值;S60. If the ratio is greater than or equal to the preset second ratio threshold, reduce the penalty coefficient, wherein the preset first ratio threshold is smaller than the preset second ratio threshold;
S61、若所述比例小于所述预设第二比例阈值,不将所述惩罚系数减小。S61. If the ratio is smaller than the preset second ratio threshold, do not reduce the penalty coefficient.
具体地,由于公交基因的适应度为-(公交车辆成本+乘客平均等车时间*惩罚系数),同时,公交车辆成本越高,意味着需要使用更多的公交车辆安排 更多的发车班次,相对应的乘客的等车时间就越低,相反,公交车辆成本越低,意味着需要使用更少的公交车辆安排更少的发车班次,乘客的等车时间相对越高。由此,基于上述公交基因的适应度,当惩罚系数高时,公交基因的适应度更侧重乘客平均等车时间,从而产生更多乘客等待时间低、但公交车辆成本偏高的公交车辆排班,当惩罚系数低时,公交基因的适应度更侧重公交车辆成本,从而产生更多公交车辆成本低、但乘客等待时间高的公交车辆排班。由此,采用高惩罚系数,能够获取乘客等待时间不高于原有排班下的乘客平均等车时间,通过降低惩罚系数,能够获取公交车辆成本较低的公交车辆排班,从而可以通过动态调整惩罚系数,在乘客平均等车时间与公交车辆成本取得一种较为理想的平衡状态,从而实现在不增加乘客平均等车时间的前提下,降低公交公司的成本。Specifically, since the fitness of the bus gene is - (bus vehicle cost + average passenger waiting time * penalty coefficient), and the higher the bus cost, it means that more bus vehicles need to be used to arrange more departures. The corresponding waiting time for passengers is lower. On the contrary, the lower the cost of bus vehicles, which means that fewer buses need to be used to arrange fewer departures, and the waiting time for passengers is relatively higher. Therefore, based on the fitness of the above-mentioned bus genes, when the penalty coefficient is high, the fitness of the bus genes focuses more on the average waiting time of passengers, resulting in more bus schedules with low passenger waiting times but high bus vehicle costs. , when the penalty coefficient is low, the fitness of bus genes focuses more on bus vehicle costs, resulting in more bus schedules with low bus vehicle costs but high passenger waiting times. Therefore, using a high penalty coefficient can obtain a passenger waiting time that is no higher than the average waiting time of passengers under the original schedule. By reducing the penalty coefficient, a bus schedule with lower bus vehicle cost can be obtained, so that the bus schedule can be obtained through dynamic Adjust the penalty coefficient to achieve an ideal balance between the average waiting time of passengers and the cost of bus vehicles, thereby reducing the cost of the bus company without increasing the average waiting time of passengers.
将所述初始公交基因进行基因变异,所述初始公交基因每变异一代,即所述初始公交基因进行基因变异迭代1次,即可得到相对应的一代公交种群,并可以得到该代公交种群所对应的排班表,根据得到的排班表,获取所述排班表对应的预估平均等车时间,所述预估平均等车时间为每次迭代得到的所述公交线路的排班表的平均等车时间,再根据所述公交线路的单次历史排班,获取所述公交线路的历史平均等车时间,所述单次历史排班可以为所述公交线路当前正在使用的排班表。The initial bus gene is genetically mutated. Each time the initial bus gene is mutated for one generation, that is, the initial bus gene undergoes gene mutation iteration once, the corresponding generation of bus population can be obtained, and the characteristics of the bus population of this generation can be obtained. Corresponding schedule, according to the obtained schedule, obtain the estimated average waiting time corresponding to the schedule, and the estimated average waiting time is the schedule of the bus line obtained in each iteration The average waiting time for a bus is obtained, and then the historical average waiting time for the bus line is obtained based on the single historical schedule of the bus line. The single historical schedule can be the schedule currently being used by the bus line. surface.
判断所述预估平均等车时间是否小于或者等于所述历史平均等车时间,即比较所述预估平均等车时间与所述历史平均等车时间的大小,若所述预估平均等车时间小于或者等于所述历史平均等车时间,表明所述预估平均等车时间所对应的排班表优于所述历史平均等车时间所对应的排班表,将所述预估平均等车时间作为目标预估平均等车时间,将所述预估平均等车时间所对应的排班表作为所述公交线路的排班的可行性解。Determine whether the estimated average waiting time is less than or equal to the historical average waiting time, that is, compare the estimated average waiting time with the historical average waiting time. If the estimated average waiting time The time is less than or equal to the historical average waiting time, indicating that the schedule corresponding to the estimated average waiting time is better than the schedule corresponding to the historical average waiting time, and the estimated average waiting time is equal to The bus time is used as the target to estimate the average waiting time, and the schedule corresponding to the estimated average waiting time is used as a feasible solution for the bus line scheduling.
计算所有所述目标预估平均等车时间的数量在所有所述预估平均等车时间的数量中所占的比例,并判断所述比例是否小于或者等于预设第一比例阈值,若所述比例小于所述预设第一比例阈值,将所述惩罚系数增大,若所述比例大于所述预设第一比例阈值,再判断所述比例是否大于或者等于预设第二比例阈值,若所述比例大于或者等于所述预设第二比例阈值,将所述惩罚系数减小,其中,所述预设第一比例阈值小于所述预设第二比例阈值,若所 述比例小于所述预设第二比例阈值,不将所述惩罚系数减小。其中,将所述惩罚系数进行增大或者减小的数量,可以为预先设定的值,并且该值可以为经验值。例如,统计最近五代公交种群中可行性解的占比,若该占比小于0.2,表明公交种群中存在很多不可行的解,此时可将惩罚系数增大为原来的1.2倍,从而更侧重于等车时间,,能尽可能地找到更多可行性解,若该占比大于0.8,表明公交种群中存在很多的可行性解,此时将惩罚系数减小为原来的0.8倍,从而更侧重于成本,尽可能找到更多较低成本的排班的可行性解。通过惩罚系数的动态调整,能够动态的在公交车辆成本与乘客平均等车时间之间取得较优的权衡,尽可能找到更多较低成本的排班的可行性解,能够进一步提高基于多种公交因素排班的客观性,从而在不增加乘客平均等车时间的前提下,降低公交线路的运营成本。Calculate the proportion of all the target estimated average waiting times in the number of all estimated average waiting times, and determine whether the proportion is less than or equal to the preset first proportion threshold. If the If the proportion is less than the preset first proportion threshold, the penalty coefficient is increased. If the proportion is greater than the preset first proportion threshold, then it is determined whether the proportion is greater than or equal to the preset second proportion threshold. If If the ratio is greater than or equal to the preset second ratio threshold, the penalty coefficient is reduced, wherein the preset first ratio threshold is smaller than the preset second ratio threshold. If the ratio is smaller than the The second proportion threshold is preset and the penalty coefficient is not reduced. The amount by which the penalty coefficient is increased or decreased may be a preset value, and the value may be an empirical value. For example, count the proportion of feasible solutions in the bus population of the last five generations. If the proportion is less than 0.2, it indicates that there are many infeasible solutions in the bus population. At this time, the penalty coefficient can be increased to 1.2 times the original value, so as to be more focused. Compared with the waiting time, we can find as many feasible solutions as possible. If the proportion is greater than 0.8, it indicates that there are many feasible solutions in the bus population. At this time, the penalty coefficient is reduced to 0.8 times of the original, so as to make it more feasible. Focus on cost and try to find as many feasible solutions to lower-cost shift scheduling as possible. Through the dynamic adjustment of the penalty coefficient, it is possible to dynamically achieve a better trade-off between the cost of bus vehicles and the average waiting time of passengers, find as many feasible solutions to lower-cost scheduling as possible, and further improve the efficiency of bus schedules based on multiple The objectivity of bus factor scheduling can reduce the operating costs of bus lines without increasing the average waiting time of passengers.
需要说明的是,图5所示的实施例中,步骤S57至步骤S59只是描述该实施例的处理流程所对应的一种示例,不是为了限定步骤S57与步骤S59的先后顺序,在另一实施例中,也可以先进行判断步骤S59的内容,再根据需要判断步骤S57的内容,并不影响该实施例的实施结果。It should be noted that in the embodiment shown in FIG. 5 , steps S57 to S59 are just an example to describe the processing flow of this embodiment, and are not intended to limit the order of step S57 and step S59. In another implementation, In this example, the content of step S59 can also be determined first, and then the content of step S57 can be determined as needed, which does not affect the implementation result of this embodiment.
需要说明的是,上述各个实施例所述的公交线路排班的处理方法,可以根据需要将不同实施例中包含的技术特征重新进行组合,以获取组合后的实施方案,但都在本申请要求的保护范围之内。It should be noted that the bus line scheduling processing methods described in the above embodiments can recombine the technical features contained in different embodiments as needed to obtain a combined implementation solution, but all of them are required in this application. within the scope of protection.
请参阅图6,图6为本申请实施例提供的公交线路排班的处理装置的一个示意性框图。对应于上述所述公交线路排班的处理方法,本申请实施例还提供一种公交线路排班的处理装置。如图6所示,该公交线路排班的处理装置包括用于执行上述所述公交线路排班的处理方法的单元,该公交线路排班的处理装置可以被配置于计算机设备中。具体地,请参阅图6,该公交线路排班的处理装置60包括第一获取单元61、第一筛选单元62、第一判断单元63、第二筛选单元64及第一获取单元65。Please refer to FIG. 6 , which is a schematic block diagram of a bus route scheduling processing device provided by an embodiment of the present application. Corresponding to the above-mentioned bus line scheduling processing method, embodiments of the present application also provide a bus line scheduling processing device. As shown in FIG. 6 , the bus line scheduling processing device includes a unit for executing the above-mentioned bus line scheduling processing method, and the bus line scheduling processing device can be configured in a computer device. Specifically, please refer to FIG. 6 . The bus line scheduling processing device 60 includes a first acquisition unit 61 , a first screening unit 62 , a first judgment unit 63 , a second screening unit 64 and a first acquisition unit 65 .
其中,第一获取单元61,用于获取不同类型的公交因素,并将所述公交因素进行组合,得到初始公交基因,其中,所述公交因素描述公交线路的排班所涉及的因素,所述初始公交基因描述初始的发车班次;Among them, the first acquisition unit 61 is used to acquire different types of bus factors, and combine the bus factors to obtain an initial bus gene, where the bus factors describe the factors involved in the scheduling of bus lines, and the The initial bus gene describes the initial departure frequency;
第一筛选单元62,用于计算每个所述初始公交基因的适应度,并根据所述适应度的大小,将所述初始公交基因进行优胜劣汰的筛选,得到自然选择 公交基因,其中,所述适应度描述所述初始公交基因的优劣程度;The first screening unit 62 is used to calculate the fitness of each of the initial bus genes, and according to the size of the fitness, screen the initial bus genes for survival of the fittest to obtain the naturally selected bus genes, wherein: Fitness describes the quality of the initial bus gene;
第一判断单元63,用于获取公交基因变异迭代变量,并判断所述公交基因变异迭代变量是否满足预设公交基因变异终止条件;The first judgment unit 63 is used to obtain the bus gene mutation iteration variable and determine whether the bus gene mutation iteration variable meets the preset bus gene mutation termination condition;
第二筛选单元64,用于若所述公交基因变异迭代变量满足所述预设公交基因变异终止条件,筛选出满足预设第一适应度条件的自然选择公交基因,作为第一目标公交基因;The second screening unit 64 is used to screen out the naturally selected bus genes that meet the preset first fitness condition as the first target bus gene if the bus gene mutation iterative variable satisfies the preset bus gene mutation termination condition;
第一获取单元65,用于根据所述第一目标公交基因所对应的发车班次,得到所述公交线路的排班表。The first obtaining unit 65 is configured to obtain the schedule of the bus line according to the departure frequency corresponding to the first target bus gene.
在一实施例中,所述适应度采取如下计算方式:In one embodiment, the fitness is calculated as follows:
公交基因的适应度=-(公交车辆成本+乘客平均等车时间*惩罚系数);The fitness of the bus gene = - (bus vehicle cost + average waiting time of passengers * penalty coefficient);
其中,公交车辆成本为公交车辆运营产生的成本,乘客平均等车时间为所述公交线路的所有乘客的等车时间的平均值,惩罚系数为超参数。Among them, the bus vehicle cost is the cost incurred by the operation of the bus vehicle, the average waiting time of passengers is the average waiting time of all passengers on the bus line, and the penalty coefficient is a hyperparameter.
在一实施例中,所述公交线路排班的处理装置60还包括:In one embodiment, the bus route scheduling processing device 60 further includes:
添加单元,用于将所述初始公交基因添加至预设公交种群,其中,所述预设公交种群描述进行基因变异的公交基因群体;An adding unit for adding the initial bus gene to a preset bus population, wherein the preset bus population describes a bus gene group that undergoes genetic mutation;
第二获取单元,用于若不满足所述预设公交基因变异终止条件,从所述预设公交种群中获取满足预设第二适应度条件的公交基因,作为第二目标公交基因;A second acquisition unit, configured to acquire a bus gene that satisfies the preset second fitness condition from the preset bus population as the second target bus gene if the preset bus gene mutation termination condition is not met;
基因变异单元,用于将所述第二目标公交基因进行基因变异,得到后代公交基因,并将所述后代公交基因添加至所述预设公交种群;A gene mutation unit, used to genetically mutate the second target bus gene to obtain a descendant bus gene, and add the descendant bus gene to the preset bus population;
第三筛选单元,用于计算所述后代公交基因的适应度,并根据所述预设公交种群包含的每个公交基因的适应度,将所述预设公交种群包含的公交基因进行优胜劣汰的筛选;The third screening unit is used to calculate the fitness of the bus genes of the offspring, and select the bus genes included in the preset bus population for survival of the fittest based on the fitness of each bus gene included in the preset bus population. ;
第二判断单元,用于再次判断是否满足所述预设公交基因变异终止条件;The second judgment unit is used to judge again whether the preset bus gene mutation termination condition is met;
迭代单元,用于若仍不满足所述预设公交基因变异终止条件,迭代所述从所述预设公交种群中获取满足预设第二适应度条件的公交基因、作为第二目标公交基因所对应的公交基因的基因变异过程,直至满足所述预设公交基因变异终止条件;an iterative unit, configured to iterate the bus genes that satisfy the preset second fitness condition from the preset bus population as the second target bus gene if the preset bus gene mutation termination condition is still not satisfied; The genetic mutation process of the corresponding bus gene until the preset bus gene mutation termination condition is met;
执行单元,用于若满足所述预设公交基因变异终止条件,执行所述筛选出满足预设第一适应度条件的自然选择公交基因的步骤。An execution unit, configured to execute the step of screening out naturally selected bus genes that meet the preset first fitness condition if the preset bus gene mutation termination condition is met.
在一实施例中,一组公交基因采用公交基因数组描述,所述公交基因数组包含公交基因元素,每个所述公交基因元素描述一个公交基因所对应的发车班次,所述公交基因元素包含公交基因节点,所述公交基因节点存储一个类型的公交因素,所述基因变异单元包括:In one embodiment, a group of bus genes is described by a bus gene array. The bus gene array contains bus gene elements. Each of the bus gene elements describes the departure frequency corresponding to a bus gene. The bus gene elements include bus genes. Gene node, the bus gene node stores a type of bus factor, and the gene variation unit includes:
截取子单元,用于获取两个公交基因元素,并在两个所述公交基因元素的相同位置进行截取,得到相对应位置的子基因元素对;Intercepting sub-units is used to obtain two bus gene elements, and intercept the two bus gene elements at the same position to obtain a pair of sub-gene elements at the corresponding position;
交叉互换子单元,用于将所述子基因元素对包含的两个子基因元素采取交叉方式进行互相替换,得到后代公交基因。The cross-exchange subunit is used to replace the two sub-gene elements contained in the sub-gene element with each other in a cross-over manner to obtain the offspring bus gene.
在一实施例中,一组公交基因采用公交基因数组描述,所述公交基因数组包含公交基因元素,每个所述公交基因元素描述一个公交基因所对应的发车班次,所述公交基因元素包含公交基因节点,所述基因变异单元包括:In one embodiment, a group of bus genes is described by a bus gene array. The bus gene array contains bus gene elements. Each of the bus gene elements describes the departure frequency corresponding to a bus gene. The bus gene elements include bus genes. Gene node, the gene variation unit includes:
第一获取子单元,用于获取公交基因元素,选取所述公交基因元素包含的公交基因节点;The first acquisition subunit is used to obtain the bus gene element and select the bus gene node contained in the bus gene element;
替换子单元,用于将所述公交基因节点的公交因素采用相同类型的其它公交因素进行替换,得到后代公交基因。The replacement subunit is used to replace the public transportation factors of the public transportation gene node with other public transportation factors of the same type to obtain the descendant public transportation genes.
在一实施例中,所述公交线路排班的处理装置60还包括:In one embodiment, the bus route scheduling processing device 60 further includes:
第一统计单元,用于将所述初始公交基因进行基因变异迭代n次,并统计每次迭代得到的所述公交线路的排班表所对应的预估平均等车时间,其中,n≥2,n为整数;The first statistical unit is used to perform gene mutation iterations on the initial bus gene n times, and count the estimated average waiting time corresponding to the bus line schedule obtained in each iteration, where n ≥ 2 , n is an integer;
第三获取单元,用于根据所述公交线路的单次历史排班,获取所述公交线路的历史平均等车时间;The third acquisition unit is used to obtain the historical average waiting time of the bus line based on the single historical schedule of the bus line;
第三判断单元,用于判断所述预估平均等车时间是否小于或者等于所述历史平均等车时间;The third judgment unit is used to judge whether the estimated average waiting time is less than or equal to the historical average waiting time;
确定单元,用于若所述预估平均等车时间小于或者等于所述历史平均等车时间,将所述预估平均等车时间作为目标预估平均等车时间;A determination unit configured to use the estimated average waiting time as the target estimated average waiting time if the estimated average waiting time is less than or equal to the historical average waiting time;
计算单元,用于计算所有所述目标预估平均等车时间的数量在所有所述预估平均等车时间的数量中所占的比例;A calculation unit configured to calculate the proportion of the number of all the target estimated average waiting times to the number of all the estimated average waiting times;
第四判断单元,用于判断所述比例是否小于或者等于预设第一比例阈值;A fourth judgment unit, used to judge whether the ratio is less than or equal to a preset first ratio threshold;
增大单元,用于若所述比例小于或者等于所述预设第一比例阈值,将所述惩罚系数增大;An increasing unit configured to increase the penalty coefficient if the proportion is less than or equal to the preset first proportion threshold;
第五判断单元,用于判断所述比例是否大于或者等于预设第二比例阈值The fifth judgment unit is used to judge whether the ratio is greater than or equal to the preset second ratio threshold.
减小单元,用于若所述比例大于或者等于所述预设第二比例阈值,将所述惩罚系数减小,其中,所述预设第一比例阈值小于所述预设第二比例阈值。A reducing unit configured to reduce the penalty coefficient if the ratio is greater than or equal to the preset second ratio threshold, wherein the preset first ratio threshold is smaller than the preset second ratio threshold.
在一实施例中,所述公交因素包括发车时间、发车类型及发车型号。In one embodiment, the bus factors include departure time, departure type and departure model.
需要说明的是,所属领域的技术人员可以清楚地了解到,上述公交线路排班的处理装置和各单元的具体实现过程,可以参考前述方法实施例中的相应描述,为了描述的方便和简洁,在此不再赘述。It should be noted that those skilled in the art can clearly understand that the above-mentioned bus line scheduling processing device and the specific implementation process of each unit can refer to the corresponding descriptions in the foregoing method embodiments. For the convenience and simplicity of description, I won’t go into details here.
同时,上述公交线路排班的处理装置中各个单元的划分和连接方式仅用于举例说明,在其他实施例中,可将公交线路排班的处理装置按照需要划分为不同的单元,也可将公交线路排班的处理装置中各单元采取不同的连接顺序和方式,以完成上述公交线路排班的处理装置的全部或部分功能。At the same time, the division and connection of each unit in the above bus line scheduling processing device are only for illustration. In other embodiments, the bus line scheduling processing device can be divided into different units according to needs, and can also be divided into different units according to needs. Each unit in the bus line scheduling processing device adopts different connection sequences and methods to complete all or part of the functions of the bus line scheduling processing device.
上述公交线路排班的处理装置可以实现为一种计算机程序的形式,该计算机程序可以在如图7所示的计算机设备上运行。The above bus line scheduling processing device can be implemented in the form of a computer program, and the computer program can be run on the computer device as shown in Figure 7.
请参阅图7,图7是本申请实施例提供的一种计算机设备的示意性框图。该计算机设备500可以是台式机电脑或者服务器等计算机设备,也可以是其他设备中的组件或者部件。Please refer to FIG. 7 , which is a schematic block diagram of a computer device provided by an embodiment of the present application. The computer device 500 may be a computer device such as a desktop computer or a server, or may be a component or component in other devices.
参阅图7,该计算机设备500包括通过系统总线501连接的处理器502、存储器和网络接口505,其中,存储器可以包括非易失性存储介质503和内存储器504,所述存储器也可以为易失性存储介质。Referring to Figure 7, the computer device 500 includes a processor 502, a memory and a network interface 505 connected through a system bus 501. The memory may include a non-volatile storage medium 503 and an internal memory 504, and the memory may also be volatile. storage media.
该非易失性存储介质503可存储操作系统5031和计算机程序5032。该计算机程序5032被执行时,可使得处理器502执行一种上述公交线路排班的处理方法。The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. When the computer program 5032 is executed, it can cause the processor 502 to execute the above-mentioned bus route scheduling processing method.
该处理器502用于提供计算和控制能力,以支撑整个计算机设备500的运行。The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500 .
该内存储器504为非易失性存储介质503中的计算机程序5032的运行提供环境,该计算机程序5032被处理器502执行时,可使得处理器502执行一种上述公交线路排班的处理方法。The internal memory 504 provides an environment for the execution of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, it can cause the processor 502 to perform the above-mentioned bus line scheduling processing method.
该网络接口505用于与其它设备进行网络通信。本领域技术人员可以理解,图7中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备500的限定,具体的计算机设 备500可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。例如,在一些实施例中,计算机设备可以仅包括存储器及处理器,在这样的实施例中,存储器及处理器的结构及功能与图7所示实施例一致,在此不再赘述。The network interface 505 is used for network communication with other devices. Those skilled in the art can understand that the structure shown in Figure 7 is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device 500 to which the solution of the present application is applied. The specific computer device 500 may include more or fewer components than shown, some combinations of components, or a different arrangement of components. For example, in some embodiments, the computer device may only include a memory and a processor. In such an embodiment, the structure and function of the memory and processor are consistent with the embodiment shown in FIG. 7 and will not be described again.
其中,所述处理器502用于运行存储在存储器中的计算机程序5032,以实现如下步骤:获取不同类型的公交因素,并将所述公交因素进行组合,得到初始公交基因,其中,所述公交因素描述公交线路的排班所涉及的因素,所述初始公交基因描述初始的发车班次;计算每个所述初始公交基因的适应度,并根据所述适应度的大小,将所述初始公交基因进行优胜劣汰的筛选,得到自然选择公交基因,其中,所述适应度描述所述初始公交基因的优劣程度;获取公交基因变异迭代变量,并判断所述公交基因变异迭代变量是否满足预设公交基因变异终止条件;若所述公交基因变异迭代变量满足所述预设公交基因变异终止条件,筛选出满足预设第一适应度条件的自然选择公交基因,作为第一目标公交基因;根据所述第一目标公交基因所对应的发车班次,得到所述公交线路的排班表。Wherein, the processor 502 is used to run the computer program 5032 stored in the memory to implement the following steps: obtain different types of bus factors and combine the bus factors to obtain an initial bus gene, wherein the bus The factors describe the factors involved in bus line scheduling, and the initial bus genes describe the initial departure frequency; the fitness of each initial bus gene is calculated, and according to the size of the fitness, the initial bus genes are Carry out the screening of survival of the fittest to obtain the natural selection bus gene, where the fitness describes the degree of excellence of the initial bus gene; obtain the bus gene mutation iteration variable, and determine whether the bus gene mutation iteration variable satisfies the preset bus gene Mutation termination condition; if the bus gene mutation iteration variable satisfies the preset bus gene mutation termination condition, select the naturally selected bus gene that meets the preset first fitness condition as the first target bus gene; according to the first According to the departure frequency corresponding to a target bus gene, the schedule of the bus line is obtained.
在一实施例中,所述处理器502在实现所述计算每个所述初始公交基因的适应度时,所述适应度为如下计算方式:In one embodiment, when the processor 502 implements the calculation of the fitness of each of the initial bus genes, the fitness is calculated as follows:
公交基因的适应度=-(公交车辆成本+乘客平均等车时间*惩罚系数);The fitness of the bus gene = - (bus vehicle cost + average waiting time of passengers * penalty coefficient);
其中,公交车辆成本为公交车辆运营产生的成本,乘客平均等车时间为所述公交线路的所有乘客的等车时间的平均值,惩罚系数为超参数。Among them, the bus vehicle cost is the cost incurred by the operation of the bus vehicle, the average waiting time of passengers is the average waiting time of all passengers on the bus line, and the penalty coefficient is a hyperparameter.
在一实施例中,所述处理器502在实现所述得到初始公交基因之后,还实现以下步骤:In one embodiment, after obtaining the initial bus genes, the processor 502 also implements the following steps:
将所述初始公交基因添加至预设公交种群,其中,所述预设公交种群描述进行基因变异的公交基因群体;Add the initial bus gene to a preset bus population, wherein the preset bus population describes a bus gene group that undergoes genetic mutation;
所述判断是否满足预设公交基因变异终止条件之后,还包括:After determining whether the preset bus gene mutation termination conditions are met, it also includes:
若不满足所述预设公交基因变异终止条件,从所述预设公交种群中获取满足预设第二适应度条件的公交基因,作为第二目标公交基因;将所述第二目标公交基因进行基因变异,得到后代公交基因,并将所述后代公交基因添加至所述预设公交种群;计算所述后代公交基因的适应度,并根据所述预设公交种群包含的每个公交基因的适应度,将所述预设公交种群包含的公交基 因进行优胜劣汰的筛选;再次判断是否满足所述预设公交基因变异终止条件;若仍不满足所述预设公交基因变异终止条件,迭代所述从所述预设公交种群中获取满足预设第二适应度条件的公交基因、作为第二目标公交基因所对应的公交基因的基因变异过程,直至满足所述预设公交基因变异终止条件;若满足所述预设公交基因变异终止条件,执行所述筛选出满足预设第一适应度条件的自然选择公交基因的步骤。If the preset bus gene mutation termination condition is not met, the bus gene that meets the preset second fitness condition is obtained from the preset bus population as the second target bus gene; the second target bus gene is Gene mutation, obtain offspring bus genes, and add the offspring bus genes to the preset bus population; calculate the fitness of the offspring bus genes, and calculate the fitness of each bus gene included in the preset bus population according to the degree, the bus genes included in the preset bus population are screened for survival of the fittest; it is again determined whether the preset bus gene mutation termination conditions are met; if the preset bus gene mutation termination conditions are still not met, iterate the The bus gene that satisfies the preset second fitness condition is obtained from the preset bus population and is used as the gene mutation process of the bus gene corresponding to the second target bus gene until the preset bus gene mutation termination condition is met; if The preset bus gene mutation termination condition is used to perform the step of screening out naturally selected bus genes that meet the preset first fitness condition.
在一实施例中,一组公交基因采用公交基因数组描述,所述公交基因数组包含公交基因元素,每个所述公交基因元素描述一个公交基因所对应的发车班次,所述公交基因元素包含公交基因节点,所述公交基因节点存储一个类型的公交因素,所述处理器502在实现所述将所述第二目标公交基因进行基因变异,得到后代公交基因时,具体实现以下步骤:In one embodiment, a group of bus genes is described by a bus gene array. The bus gene array contains bus gene elements. Each of the bus gene elements describes the departure frequency corresponding to a bus gene. The bus gene elements include bus genes. Gene node. The bus gene node stores one type of bus factors. When the processor 502 implements the genetic mutation of the second target bus gene to obtain the offspring bus gene, the processor 502 specifically implements the following steps:
获取两个公交基因元素,并在两个所述公交基因元素的相同位置进行截取,得到相对应位置的子基因元素对;Obtain two bus gene elements and intercept them at the same position of the two bus gene elements to obtain a pair of sub-gene elements at the corresponding position;
将所述子基因元素对包含的两个子基因元素采取交叉方式进行互相替换,得到后代公交基因。The two sub-gene elements contained in the sub-gene element are replaced with each other in a crossover manner to obtain a descendant bus gene.
在一实施例中,一组公交基因采用公交基因数组描述,所述公交基因数组包含公交基因元素,每个所述公交基因元素描述一个公交基因所对应的发车班次,所述公交基因元素包含公交基因节点,所述公交基因节点存储一个类型的公交因素,所述处理器502在实现所述将所述第二目标公交基因进行基因变异,得到后代公交基因时,具体实现以下步骤:In one embodiment, a group of bus genes is described by a bus gene array. The bus gene array contains bus gene elements. Each of the bus gene elements describes the departure frequency corresponding to a bus gene. The bus gene elements include bus genes. Gene node. The bus gene node stores one type of bus factors. When the processor 502 implements the genetic mutation of the second target bus gene to obtain the offspring bus gene, the processor 502 specifically implements the following steps:
获取公交基因元素,选取所述公交基因元素包含的公交基因节点;Obtain the bus gene element and select the bus gene node contained in the bus gene element;
将所述公交基因节点的公交因素采用相同类型的其它公交因素进行替换,得到后代公交基因。The bus factors of the bus gene node are replaced with other bus factors of the same type to obtain the offspring bus genes.
在一实施例中,所述处理器502在实现所述得到所述公交线路的排班表之后,还实现以下步骤:In one embodiment, after obtaining the bus schedule, the processor 502 also performs the following steps:
将所述初始公交基因进行基因变异迭代n次,并统计每次迭代得到的所述公交线路的排班表所对应的预估平均等车时间,其中,n≥2,n为整数;根据所述公交线路的单次历史排班,获取所述公交线路的历史平均等车时间;判断所述预估平均等车时间是否小于或者等于所述历史平均等车时间;若所述预估平均等车时间小于或者等于所述历史平均等车时间,将所述预估平均 等车时间作为目标预估平均等车时间;计算所有所述目标预估平均等车时间的数量在所有所述预估平均等车时间的数量中所占的比例;判断所述比例是否小于或者等于预设第一比例阈值;若所述比例小于或者等于所述预设第一比例阈值,将所述惩罚系数增大;或者,判断所述比例是否大于或者等于预设第二比例阈值若所述比例大于或者等于所述预设第二比例阈值,将所述惩罚系数减小,其中,所述预设第一比例阈值小于所述预设第二比例阈值。The initial bus gene is genetically mutated and iterated n times, and the estimated average waiting time corresponding to the bus line schedule obtained in each iteration is calculated, where n≥2, n is an integer; according to the Based on the single historical schedule of the bus line, obtain the historical average waiting time of the bus line; determine whether the estimated average waiting time is less than or equal to the historical average waiting time; if the estimated average waiting time If the bus time is less than or equal to the historical average waiting time, use the estimated average waiting time as the target estimated average waiting time; calculate the number of all target estimated average waiting times in all the estimated The proportion of the average waiting time; determine whether the proportion is less than or equal to the preset first proportion threshold; if the proportion is less than or equal to the preset first proportion threshold, increase the penalty coefficient ; Or, determine whether the proportion is greater than or equal to the preset second proportion threshold. If the proportion is greater than or equal to the preset second proportion threshold, reduce the penalty coefficient, wherein the preset first proportion The threshold is smaller than the preset second ratio threshold.
在一实施例中,所述处理器502在实现所述获取不同类型的公交因素时,所述公交因素包括发车时间、发车类型及发车型号。In one embodiment, when the processor 502 implements the acquisition of different types of bus factors, the bus factors include departure time, departure type and departure model.
应当理解,在本申请实施例中,处理器502可以是中央处理单元(Central Processing Unit,CPU),该处理器502还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。其中,通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。It should be understood that in the embodiment of the present application, the processor 502 may be a central processing unit (Central Processing Unit, CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), Application Specific Integrated Circuit (ASIC), off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general processor may be a microprocessor or the processor may be any conventional processor.
本领域普通技术人员可以理解的是实现上述实施例的方法中的全部或部分流程,是可以通过计算机程序来完成,该计算机程序可存储于一计算机可读存储介质。该计算机程序被该计算机系统中的至少一个处理器执行,以实现上述方法的实施例的流程步骤。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented through a computer program, and the computer program can be stored in a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the process steps of the embodiments of the above method.
因此,本申请还提供一种计算机可读存储介质。该计算机可读存储介质可以为非易失性的计算机可读存储介质,也可以为易失性的计算机可读存储介质,该计算机可读存储介质存储有计算机程序,该计算机程序被处理器执行时使处理器执行如下步骤:Therefore, the present application also provides a computer-readable storage medium. The computer-readable storage medium can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. The computer-readable storage medium stores a computer program, and the computer program is executed by the processor. When the processor performs the following steps:
一种计算机程序产品,当其在计算机上运行时,使得计算机执行以上各实施例中所描述的所述公交线路排班的处理方法的步骤。A computer program product, when run on a computer, causes the computer to execute the steps of the bus line scheduling processing method described in the above embodiments.
所述计算机可读存储介质可以是前述设备的内部存储单元,例如设备的硬盘或内存。所述计算机可读存储介质也可以是所述设备的外部存储设备,例如所述设备上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述计算机可读存储介质还可以既包括所述设备的内部存储单元也包括外部 存储设备。The computer-readable storage medium may be an internal storage unit of the aforementioned device, such as a hard disk or memory of the device. The computer-readable storage medium may also be an external storage device of the device, such as a plug-in hard disk, a smart memory card (SMC), or a secure digital (SD) card equipped on the device. , Flash Card, etc. Further, the computer-readable storage medium may also include both an internal storage unit of the device and an external storage device.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的设备、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the above-described equipment, devices and units can be referred to the corresponding processes in the foregoing method embodiments, and will not be described again here.
所述存储介质为实体的、非瞬时性的存储介质,例如可以是U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、磁碟或者光盘等各种可以存储计算机程序的实体存储介质。The storage medium is a physical, non-transient storage medium, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk, which can store computer programs. medium.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art can appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software, or a combination of both. In order to clearly illustrate the relationship between hardware and software Interchangeability, in the above description, the composition and steps of each example have been generally described according to functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each specific application, but such implementations should not be considered beyond the scope of this application.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的。例如,各个单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of each unit is only a logical function division, and there may be other division methods during actual implementation. For example multiple units or components may be combined or integrated into another system, or some features may be omitted, or not implemented.
本申请实施例方法中的步骤可以根据实际需要进行顺序调整、合并和删减。本申请实施例装置中的单元可以根据实际需要进行合并、划分和删减。另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以是两个或两个以上单元集成在一个单元中。The steps in the methods of the embodiments of this application can be sequence adjusted, combined, and deleted according to actual needs. The units in the device of the embodiment of the present application can be merged, divided, and deleted according to actual needs. In addition, each functional unit in various embodiments of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
该集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分,或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台电子设备(可以是个人计算机,终端,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present application is essentially or contributes to the existing technology, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions to cause an electronic device (which may be a personal computer, terminal, or network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application.
以上所述,仅为本申请的具体实施方式,但本申请明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person familiar with the technical field can easily think of various equivalents within the technical scope disclosed in the present application. modifications or substitutions, these modifications or substitutions shall be covered by the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.

Claims (10)

  1. 一种公交线路排班的处理方法,其特征在于,包括:A bus line scheduling processing method, which is characterized by including:
    获取不同类型的公交因素,并将所述公交因素进行组合,得到初始公交基因,其中,所述公交因素描述公交线路的排班所涉及的因素,所述初始公交基因描述初始的发车班次;Obtain different types of bus factors, and combine the bus factors to obtain an initial bus gene, where the bus factors describe factors involved in bus line scheduling, and the initial bus gene describes the initial departure frequency;
    计算每个所述初始公交基因的适应度,并根据所述适应度的大小,将所述初始公交基因进行优胜劣汰的筛选,得到自然选择公交基因,其中,所述适应度描述所述初始公交基因的优劣程度;The fitness of each initial bus gene is calculated, and based on the size of the fitness, the initial bus genes are screened for survival of the fittest to obtain natural selection bus genes, where the fitness describes the initial bus gene degree of excellence;
    获取公交基因变异迭代变量,并判断所述公交基因变异迭代变量是否满足预设公交基因变异终止条件;Obtain the bus gene variation iteration variable, and determine whether the bus gene variation iteration variable meets the preset bus gene variation termination condition;
    若所述公交基因变异迭代变量满足所述预设公交基因变异终止条件,筛选出满足预设第一适应度条件的自然选择公交基因,作为第一目标公交基因;If the bus gene mutation iteration variable satisfies the preset bus gene mutation termination condition, select the naturally selected bus gene that meets the preset first fitness condition as the first target bus gene;
    根据所述第一目标公交基因所对应的发车班次,得到所述公交线路的排班表。According to the departure frequency corresponding to the first target bus gene, a schedule of the bus line is obtained.
  2. 根据权利要求1所述公交线路排班的处理方法,其特征在于,所述公交因素包括发车时间、发车类型及发车型号。The bus route scheduling processing method according to claim 1, characterized in that the bus factors include departure time, departure type and departure model.
  3. 根据权利要求1所述公交线路排班的处理方法,其特征在于,所述适应度采取如下计算方式:The bus line scheduling processing method according to claim 1, characterized in that the fitness adopts the following calculation method:
    公交基因的适应度=-(公交车辆成本+乘客平均等车时间*惩罚系数);The fitness of the bus gene = - (bus vehicle cost + average waiting time of passengers * penalty coefficient);
    其中,公交车辆成本为公交车辆运营产生的成本,乘客平均等车时间为所述公交线路的所有乘客的等车时间的平均值,惩罚系数为超参数。Among them, the bus vehicle cost is the cost incurred by the operation of the bus vehicle, the average waiting time of passengers is the average waiting time of all passengers on the bus line, and the penalty coefficient is a hyperparameter.
  4. 根据权利要求1所述公交线路排班的处理方法,其特征在于,所述得到初始公交基因之后,还包括:The bus route scheduling processing method according to claim 1, characterized in that after obtaining the initial bus gene, it further includes:
    将所述初始公交基因添加至预设公交种群,其中,所述预设公交种群描述进行基因变异的公交基因群体;Add the initial bus gene to a preset bus population, wherein the preset bus population describes a bus gene group that undergoes genetic mutation;
    所述判断是否满足预设公交基因变异终止条件之后,还包括:After determining whether the preset bus gene mutation termination conditions are met, it also includes:
    若不满足所述预设公交基因变异终止条件,从所述预设公交种群中获取满足预设第二适应度条件的公交基因,作为第二目标公交基因;If the preset bus gene mutation termination condition is not met, obtain the bus gene that meets the preset second fitness condition from the preset bus population as the second target bus gene;
    将所述第二目标公交基因进行基因变异,得到后代公交基因,并将所述后代公交基因添加至所述预设公交种群;Genetically mutate the second target bus gene to obtain a progeny bus gene, and add the progeny bus gene to the preset bus population;
    计算所述后代公交基因的适应度,并根据所述预设公交种群包含的每个公交基因的适应度,将所述预设公交种群包含的公交基因进行优胜劣汰的筛选;Calculate the fitness of the bus genes of the offspring, and select the bus genes included in the preset bus population for survival of the fittest based on the fitness of each bus gene included in the preset bus population;
    再次判断是否满足所述预设公交基因变异终止条件;Determine again whether the preset bus gene mutation termination conditions are met;
    若仍不满足所述预设公交基因变异终止条件,迭代所述从所述预设公交种群中获取满足预设第二适应度条件的公交基因、作为第二目标公交基因所对应的公交基因的基因变异过程,直至满足所述预设公交基因变异终止条件;If the preset bus gene mutation termination condition is still not satisfied, iterate and obtain the bus gene that satisfies the preset second fitness condition from the preset bus population as the bus gene corresponding to the second target bus gene. Gene mutation process until the preset bus gene mutation termination conditions are met;
    若满足所述预设公交基因变异终止条件,执行所述筛选出满足预设第一适应度条件的自然选择公交基因的步骤。If the preset bus gene mutation termination condition is met, the step of screening out naturally selected bus genes that meet the preset first fitness condition is performed.
  5. 根据权利要求4所述公交线路排班的处理方法,其特征在于,一组公交基因采用公交基因数组描述,所述公交基因数组包含公交基因元素,每个所述公交基因元素描述一个公交基因所对应的发车班次,所述公交基因元素包含公交基因节点,所述公交基因节点存储一个类型的公交因素,所述将所述第二目标公交基因进行基因变异,得到后代公交基因,包括:The bus route scheduling processing method according to claim 4, characterized in that a group of bus genes is described by a bus gene array, the bus gene array contains bus gene elements, and each of the bus gene elements describes a bus gene. Corresponding to the departure schedule, the bus gene element includes a bus gene node, and the bus gene node stores a type of bus factor. The second target bus gene is genetically mutated to obtain a descendant bus gene, including:
    获取两个公交基因元素,并在两个所述公交基因元素的相同位置进行截取,得到相对应位置的子基因元素对;Obtain two bus gene elements and intercept them at the same position of the two bus gene elements to obtain a pair of sub-gene elements at the corresponding position;
    将所述子基因元素对包含的两个子基因元素采取交叉方式进行互相替换,得到后代公交基因。The two sub-gene elements contained in the sub-gene element are replaced with each other in a crossover manner to obtain a descendant bus gene.
  6. 根据权利要求4所述公交线路排班的处理方法,其特征在于,一组公交基因采用公交基因数组描述,所述公交基因数组包含公交基因元素,每个所述公交基因元素描述一个公交基因所对应的发车班次,所述公交基因元素包含公交基因节点,所述公交基因节点存储一个类型的公交因素,所述将所述第二目标公交基因进行基因变异,得到后代公交基因,包括:The bus route scheduling processing method according to claim 4, characterized in that a group of bus genes is described by a bus gene array, the bus gene array contains bus gene elements, and each of the bus gene elements describes a bus gene. Corresponding to the departure schedule, the bus gene element includes a bus gene node, and the bus gene node stores a type of bus factor. The second target bus gene is genetically mutated to obtain a descendant bus gene, including:
    获取公交基因元素,选取所述公交基因元素包含的公交基因节点;Obtain the bus gene element and select the bus gene node contained in the bus gene element;
    将所述公交基因节点的公交因素采用相同类型的其它公交因素进行替换,得到后代公交基因。The bus factors of the bus gene node are replaced with other bus factors of the same type to obtain the offspring bus genes.
  7. 根据权利要求1所述公交线路排班的处理方法,其特征在于,所述得到所述公交线路的排班表之后,还包括:The bus line scheduling processing method according to claim 1, characterized in that after obtaining the bus line schedule, it further includes:
    将所述初始公交基因进行基因变异迭代n次,并统计每次迭代得到的所述公交线路的排班表所对应的预估平均等车时间,其中,n≥2,n为整数;Iterate the gene mutation of the initial bus gene n times, and calculate the estimated average waiting time corresponding to the bus line schedule obtained in each iteration, where n≥2, n is an integer;
    根据所述公交线路的单次历史排班,获取所述公交线路的历史平均等车时间;Obtain the historical average waiting time of the bus line based on the single historical schedule of the bus line;
    判断所述预估平均等车时间是否小于或者等于所述历史平均等车时间;Determine whether the estimated average waiting time is less than or equal to the historical average waiting time;
    若所述预估平均等车时间小于或者等于所述历史平均等车时间,将所述预估平均等车时间作为目标预估平均等车时间;If the estimated average waiting time is less than or equal to the historical average waiting time, use the estimated average waiting time as the target estimated average waiting time;
    计算所有所述目标预估平均等车时间的数量在所有所述预估平均等车时间的数量中所占的比例;Calculate the proportion of the number of all said target estimated average waiting times to the number of all said estimated average waiting times;
    判断所述比例是否小于或者等于预设第一比例阈值;Determine whether the ratio is less than or equal to a preset first ratio threshold;
    若所述比例小于或者等于所述预设第一比例阈值,将所述惩罚系数增大;If the ratio is less than or equal to the preset first ratio threshold, increase the penalty coefficient;
    或者,判断所述比例是否大于或者等于预设第二比例阈值Or, determine whether the ratio is greater than or equal to a preset second ratio threshold
    若所述比例大于或者等于所述预设第二比例阈值,将所述惩罚系数减小,其中,所述预设第一比例阈值小于所述预设第二比例阈值。If the ratio is greater than or equal to the preset second ratio threshold, the penalty coefficient is reduced, wherein the preset first ratio threshold is smaller than the preset second ratio threshold.
  8. 一种公交线路排班的处理装置,其特征在于,包括:A bus line scheduling processing device, which is characterized by including:
    第一获取单元,用于获取不同类型的公交因素,并将所述公交因素进行组合,得到初始公交基因,其中,所述公交因素描述公交线路的排班所涉及的因素,所述初始公交基因描述初始的发车班次;The first acquisition unit is used to obtain different types of bus factors, and combine the bus factors to obtain an initial bus gene, where the bus factors describe factors involved in bus line scheduling, and the initial bus gene Describe the initial departure schedule;
    第一筛选单元,用于计算每个所述初始公交基因的适应度,并根据所述适应度的大小,将所述初始公交基因进行优胜劣汰的筛选,得到自然选择公交基因,其中,所述适应度描述所述初始公交基因的优劣程度;The first screening unit is used to calculate the fitness of each of the initial bus genes, and according to the size of the fitness, the initial bus genes are screened for survival of the fittest to obtain natural selection bus genes, wherein the adaptation Degree describes the quality of the initial bus gene;
    第一判断单元,用于获取公交基因变异迭代变量,并判断所述公交基因变异迭代变量是否满足预设公交基因变异终止条件;The first judgment unit is used to obtain the bus gene variation iteration variable and determine whether the bus gene variation iteration variable meets the preset bus gene variation termination condition;
    第二筛选单元,用于若所述公交基因变异迭代变量满足所述预设公交基因变异终止条件,筛选出满足预设第一适应度条件的自然选择公交基因,作为第一目标公交基因;The second screening unit is used to screen out the naturally selected bus genes that meet the preset first fitness condition as the first target bus gene if the bus gene variation iteration variable satisfies the preset bus gene variation termination condition;
    第一获取单元,用于根据所述第一目标公交基因所对应的发车班次,得到所述公交线路的排班表。The first acquisition unit is used to obtain the schedule of the bus line according to the departure frequency corresponding to the first target bus gene.
  9. 一种计算机设备,其特征在于,所述计算机设备包括存储器以及与所述存储器相连的处理器;所述存储器用于存储计算机程序;所述处理器用于运行所述计算机程序,以执行如权利要求1-7任一项所述方法的步骤。A computer device, characterized in that the computer device includes a memory and a processor connected to the memory; the memory is used to store a computer program; the processor is used to run the computer program to execute the claims Steps of the method described in any one of 1-7.
  10. 一种计算机可读存储介质,其特征在于,所述存储介质存储有计算 机程序,所述计算机程序被处理器执行时可实现如权利要求1-7中任一项所述方法的步骤。A computer-readable storage medium, characterized in that the storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1-7 can be implemented.
PCT/CN2022/142235 2022-07-14 2022-12-27 Bus route scheduling processing method and apparatus, device, and readable storage medium WO2024011864A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210827674.3A CN115293519A (en) 2022-07-14 2022-07-14 Bus route scheduling processing method, device and equipment and readable storage medium
CN202210827674.3 2022-07-14

Publications (1)

Publication Number Publication Date
WO2024011864A1 true WO2024011864A1 (en) 2024-01-18

Family

ID=83823121

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/142235 WO2024011864A1 (en) 2022-07-14 2022-12-27 Bus route scheduling processing method and apparatus, device, and readable storage medium

Country Status (2)

Country Link
CN (1) CN115293519A (en)
WO (1) WO2024011864A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115293519A (en) * 2022-07-14 2022-11-04 深圳云天励飞技术股份有限公司 Bus route scheduling processing method, device and equipment and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102737356A (en) * 2012-06-13 2012-10-17 西安理工大学 Intelligent bus scheduling calculation method
CN111340406A (en) * 2020-05-22 2020-06-26 广州交通信息化建设投资营运有限公司 Method and system for realizing bus dynamic arrangement model based on OD passenger flow
US20200349485A1 (en) * 2019-07-11 2020-11-05 Beihang University Optimization method for joint scheduling of manned buses and autonomous buses
CN113269475A (en) * 2021-06-28 2021-08-17 浩鲸云计算科技股份有限公司 Bus scheduling method and system based on genetic algorithm
CN115293519A (en) * 2022-07-14 2022-11-04 深圳云天励飞技术股份有限公司 Bus route scheduling processing method, device and equipment and readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102737356A (en) * 2012-06-13 2012-10-17 西安理工大学 Intelligent bus scheduling calculation method
US20200349485A1 (en) * 2019-07-11 2020-11-05 Beihang University Optimization method for joint scheduling of manned buses and autonomous buses
CN111340406A (en) * 2020-05-22 2020-06-26 广州交通信息化建设投资营运有限公司 Method and system for realizing bus dynamic arrangement model based on OD passenger flow
CN113269475A (en) * 2021-06-28 2021-08-17 浩鲸云计算科技股份有限公司 Bus scheduling method and system based on genetic algorithm
CN115293519A (en) * 2022-07-14 2022-11-04 深圳云天励飞技术股份有限公司 Bus route scheduling processing method, device and equipment and readable storage medium

Also Published As

Publication number Publication date
CN115293519A (en) 2022-11-04

Similar Documents

Publication Publication Date Title
CN109167835B (en) Physical resource scheduling method and system based on kubernets
CN108989098B (en) Time delay optimization-oriented scientific workflow data layout method in hybrid cloud environment
CN107370802A (en) A kind of collaboration storage dispatching method based on alternating direction multiplier method
WO2024011864A1 (en) Bus route scheduling processing method and apparatus, device, and readable storage medium
CN108965014A (en) The service chaining backup method and system of QoS perception
CN111614754B (en) Fog-calculation-oriented cost-efficiency optimized dynamic self-adaptive task scheduling method
CN108667657A (en) A kind of mapping method of virtual network based on local feature information towards SDN
CN102281290A (en) Emulation system and method for a PaaS (Platform-as-a-service) cloud platform
CN113918240A (en) Task unloading method and device
CN109102142A (en) A kind of personnel evaluation methods and system based on evaluation criterion tree
CN105119751A (en) Service evaluation and selection method based on environment real-time perceiving
CN112100233A (en) Flight time linking method and system based on tabu search algorithm
CN103281374A (en) Method for rapid data scheduling in cloud storage
CN114327811A (en) Task scheduling method, device and equipment and readable storage medium
CN108170861B (en) Distributed database system collaborative optimization method based on dynamic programming
CN111131447A (en) Load balancing method based on intermediate node task allocation
CN114780244A (en) Container cloud resource elastic allocation method and device, computer equipment and medium
CN107103360B (en) Reliable application distribution distributed genetic method based on mixed cloud
CN114925523A (en) Traffic user balance robust optimization method and system based on uncertain supply and demand
CN104320484B (en) A kind of task immigration method in wireless sensor network based on integration incentive mechanism
CN117391858A (en) Inductive blockchain account distribution method and device based on graphic neural network
CN109889573B (en) NGSA multi-target-based copy placement method in hybrid cloud
CN106502842B (en) Data reconstruction method and system
WO2024011867A1 (en) Method and apparatus for optimizing scheduling table of a plurality of bus routes, and related device
CN116611749A (en) Intelligent electric power data input method and system based on micro-service architecture

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22950971

Country of ref document: EP

Kind code of ref document: A1