CN110991706B - Method for automatically compiling bus timetable and vehicle scheduling plan - Google Patents
Method for automatically compiling bus timetable and vehicle scheduling plan Download PDFInfo
- Publication number
- CN110991706B CN110991706B CN201911120311.0A CN201911120311A CN110991706B CN 110991706 B CN110991706 B CN 110991706B CN 201911120311 A CN201911120311 A CN 201911120311A CN 110991706 B CN110991706 B CN 110991706B
- Authority
- CN
- China
- Prior art keywords
- vehicle
- time
- train
- departure
- vehicles
- Prior art date
- Legal status (The legal status 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 status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 33
- 241001248035 Trigonidiinae Species 0.000 claims description 25
- 230000035772 mutation Effects 0.000 claims description 25
- 108090000623 proteins and genes Proteins 0.000 claims description 20
- 230000008569 process Effects 0.000 claims description 15
- 238000004364 calculation method Methods 0.000 claims description 9
- 230000002068 genetic effect Effects 0.000 claims description 8
- 235000012054 meals Nutrition 0.000 claims description 7
- 230000014759 maintenance of location Effects 0.000 claims description 4
- 238000013507 mapping Methods 0.000 claims description 3
- 238000012163 sequencing technique Methods 0.000 claims description 3
- 230000001174 ascending effect Effects 0.000 claims description 2
- 238000010586 diagram Methods 0.000 description 7
- 230000008303 genetic mechanism Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000010845 search algorithm Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000004083 survival effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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/00—Administration; Management
- G06Q10/04—Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/12—Computing arrangements based on biological models using genetic models
- G06N3/126—Evolutionary algorithms, e.g. genetic algorithms or genetic programming
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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/00—Administration; Management
- G06Q10/06—Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
- G06Q10/063—Operations research, analysis or management
- G06Q10/0631—Resource planning, allocation, distributing or scheduling for enterprises or organisations
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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/00—Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
- G06Q50/40—Business processes related to the transportation industry
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02T—CLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
- Y02T10/00—Road transport of goods or passengers
- Y02T10/10—Internal combustion engine [ICE] based vehicles
- Y02T10/40—Engine management systems
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Physics & Mathematics (AREA)
- Human Resources & Organizations (AREA)
- Strategic Management (AREA)
- Theoretical Computer Science (AREA)
- Economics (AREA)
- Health & Medical Sciences (AREA)
- General Physics & Mathematics (AREA)
- Biophysics (AREA)
- Tourism & Hospitality (AREA)
- General Business, Economics & Management (AREA)
- Entrepreneurship & Innovation (AREA)
- Marketing (AREA)
- Life Sciences & Earth Sciences (AREA)
- Bioinformatics & Computational Biology (AREA)
- Game Theory and Decision Science (AREA)
- General Health & Medical Sciences (AREA)
- Operations Research (AREA)
- Quality & Reliability (AREA)
- Development Economics (AREA)
- Evolutionary Biology (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Artificial Intelligence (AREA)
- Software Systems (AREA)
- Mathematical Physics (AREA)
- General Engineering & Computer Science (AREA)
- Educational Administration (AREA)
- Computing Systems (AREA)
- Molecular Biology (AREA)
- Evolutionary Computation (AREA)
- Data Mining & Analysis (AREA)
- Computational Linguistics (AREA)
- Biomedical Technology (AREA)
- Genetics & Genomics (AREA)
- Physiology (AREA)
- Primary Health Care (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Traffic Control Systems (AREA)
- Train Traffic Observation, Control, And Security (AREA)
Abstract
The invention relates to a method for automatically compiling a bus schedule and a vehicle scheduling plan. The method provided by the invention has the advantages that the time schedule and the vehicle scheduling plan are simultaneously arranged in consideration of the connection between the bus time schedule and the vehicle scheduling plan, the constraint in actual scheduling, such as dining problems of drivers and constraints during vehicle business, is met as far as possible, the invalid rest time among the vehicles is reduced as far as possible, the vehicles are gathered together as far as possible, and the subsequent scheduling of the drivers is convenient.
Description
Technical Field
The invention relates to an automatic programming method for a bus schedule and a vehicle scheduling plan.
Background
Timetables and vehicle scheduling plans are important components of a bus operation plan. The bus schedule is a basis for measuring the accurate point rate and the reliability of the bus, and determines the departure time, arrival time, stop time, departure time interval and the like of the bus at the head and the tail stations and in the parking lot, and the problem of the bus schedule is generally the problem of determining the departure frequency. The vehicle scheduling plan may be described as a sequence of scheduling vehicles to execute all the number of vehicles, determining the number of vehicles required based on the passenger demand, and each vehicle to execute a number of tasks for the number of vehicles given a schedule.
Genetic algorithm is a random search algorithm, which is evolved through the biological evolution process simulating the natural selection and genetic mechanism of Darwin biological evolution theory. The basic idea of the genetic algorithm is: the coding space is used for replacing the problem parameter space, and starting from a population which can represent a potential solution set of the problem, according to the principle of survival and superior and inferior of the fittest in the biological evolution process, the fitness is used as the basis for evaluating the quality of the individual, and selection operators, crossover operators and mutation operators are repeatedly used for acting on the population to enable the population to continuously evolve and gradually approach to the optimal solution.
Disclosure of Invention
The invention aims at: and automatically generating a bus schedule and a vehicle scheduling plan.
In order to achieve the above purpose, the technical scheme of the invention is to provide a method for automatically compiling a bus schedule and a vehicle scheduling plan, which is characterized by comprising the following steps:
step1, setting an objective function of a model as follows:where Z represents the total objective function,representing the total number of vehicles used, X k Indicating whether the kth vehicle is executing the number of vehicles, which is a (0, 1) variable; m represents the total number of vehicles; t represents total ineffective rest time, < >>Wherein X is kij The (0, 1) variable indicates that the kth vehicle executes the vehicle number j,/after the vehicle number i is executed>Indicates departure time of train number j, +.>Represents the arrival time of the train number i, t usedrest Representing effective rest time between two adjacent train passes;
setting constraint conditions of the model, wherein the constraint conditions comprise schedule constraint and vehicle scheduling plan constraint, and the constraint conditions comprise:
the schedule constraints include:
the value range of the departure interval of each period is satisfied: h is a min ≤h i ≤h max The present invention relates to a method for manufacturing a semiconductor deviceIn h min Represents the minimum departure interval, h max Represents the maximum departure interval, h i Representing departure intervals between adjacent train numbers;
the departure time of the final bus does not exceed the latest operation time of the line:
in the method, in the process of the invention,indicates departure time of the train number n, +.>T represents departure time of the first class bus up Indicating the latest business hours of ascending +.>T represents departure time of descending first class vehicle down Indicating the latest business hours of the downlink;
the vehicle shift schedule constraints include:
the number of cars links up restraint, guarantees that every number of cars all has the vehicle to carry out and is carried out once, has:
adjacent train number connection constraint:
wherein,% is the remainder operator;
vehicle total man-hour constraint:
in the method, in the process of the invention,time of arrival, t, representing last pass performed by vehicle k in Time of vehicle entering parking lot is indicated, +.>Indicating the departure time, t, of the first train carried out by the vehicle k out Time t 'indicating vehicle leaving parking lot' fenban Indicating the actual shift time, t max Representing the maximum total man-hour of the vehicle, t up_in Represent the up-travel field time, t down_in Indicating the down travel time, j' indicating the number of the last train number of the vehicle execution, t up_out Represents the uplink departure time, t down_out Indicating the downlink departure time, i' indicating the number of the first train number executed by the vehicle;
and (3) constraint during business car operation:wherein t is max_work Representing the maximum business hours of the vehicle;
and 2, solving the model established in the step1 by adopting a genetic algorithm, so as to obtain a bus schedule and a vehicle scheduling plan.
Preferably, in step1, the effective rest time t between two adjacent train passes usedrest The calculation formula of (2) is as follows:
wherein t is rest Representing the minimum rest time, t fenban Indicates the time of being able to divide the shift, T meal Indicating the dining time interval, t meal Indicating the meal rest time.
Preferably, the step2 includes the steps of:
step 201: encoding to generate an initial population
Coding in real number mode, setting the length of gene as 2n, setting the first n bits as the interval between adjacent train number, and taking the value according to formula h min ≤h i ≤h max The 1 st and 2 nd positions represent the first class vehicles, the value is 0, and the departure time of each train number is calculated in sequence according to the departure time of the first class vehicles; the latter n bits are integers arranged continuously from 1 to n, wherein n represents total departure in the whole day, the odd number represents the number of upward vehicles, the even number represents the number of downward vehicles, and the whole genes are represented as pop (1) = [0,0,11,10 …,1,2,3,4 … n]。
Step 202: calculating individual fitness values
Calculating a bus schedule and a vehicle scheduling plan according to an initial group, calculating an objective function according to a formula in a model while generating the two, namely the number Z of vehicles and an invalid rest time T, wherein the objective function is minimum and is not 0, and setting an individual fitness value as the reciprocal of the objective function;
step 203: judging whether the algorithm is terminated
When the algorithm reaches the maximum iteration times, stopping updating, outputting an optimal individual gene, decoding according to a coding rule, wherein the first n bits are the departure intervals between adjacent vehicles, the 1 st bit and the 2 nd bit represent the first class vehicles, the value is 0, and the departure time of each vehicle number is calculated in sequence according to the departure time of the first class vehicles to form a timetable; the latter n bits are a vehicle scheduling plan, and a train number chain set, namely a cell array block is obtained according to the fitness value calculation process;
step 204: performing a selection operation: individuals were selected using elite retention strategy:
step 205: performing a cross-over operation
Generate [0,1 ]]The random number x between them, if x < P c ,P c And if the intersection probability is represented, executing intersection operation, dividing the intersection operation into two types according to the position of the randomly generated intersection point, and recording the position of the intersection point as i:
(1) If the crossover occurs in the first n bits, adopting a single-point crossover mode to carry out integral exchange from the ith bit to the last bit of the two individuals;
(2) If the crossing occurs in the rear n bits, in order to ensure the integrity and the uniqueness of the train number, a partial mapping crossing mode is adopted, the front n bits are kept unchanged, and the specific steps of the rear n bit crossing are as follows:
step 2051, generating a random integer with a value range of [1, n-i ] as a crossing length l, and marking the ith bit to the (i+l+1) th bit in the parent individual as a crossing part;
step 2052, newly creating a child individual set, wherein the length is 2n, the first n bits are identical to the corresponding parent individual, and the nth bit to the (n+l+1) th bit are the intersection parts of the corresponding parent individuals;
step 2053, scanning the nth position to the 2nth position in the father 2 from left to right on the child individuals 1, deleting the existing train number in the child individuals 1, and sequentially filling the remaining genes into the child individuals 1 to obtain the child individuals 1; similarly, child 2 is manipulated to obtain child 2.
Step 206: performing mutation operation
Generate [0,1 ]]Random number x between x, if x<P m ,P m And (3) expressing the mutation probability, executing mutation operation, dividing the mutation operation into two types according to the position of the randomly generated mutation point, and recording the position of the mutation point as i:
(1) If the variation occurs in the first n bits, randomly generating an integer to replace the original value of the ith bit according to the value range of the departure interval of the ith bit;
(2) If the variation occurs in the latter n bits, a random integer j with a value range of [1,2n-i ] is generated, and the values of the ith bit and the jth bit in the individual are interchanged.
After the mutation operation, a new population is obtained, and the process goes to step 202.
Preferably, in step 202, the calculation process of the objective function includes the following steps:
2021, calculating departure time of all train numbers according to the front n-bit departure intervals and the departure time of the first class train of the gene code, forming a timetable, and extracting the rear n bits of the gene to be recorded as a set tricps;
step 2022, defining an empty cell array for storing train number chains, denoted as blocks, each train number chain being an array representing a scheduling plan of a vehicle;
step 2023, arranging the first train sub-trigs (1) in the train execution trigs, and updating a train sub-chain set block;
step 2024, sequentially arranging subsequent sub-vehicle trigs (j) in the trigs, and giving priority to the vehicles already used;
step 2025, calculate the succession time between the trigs (j) and the trigs (j-1), i.e. departure time of the train number trigs (j) minus arrival time of the train number trigs (j-1), see if it is satisfiedAndif not, go to step 2027, if yes, continue;
step 2026, calculating total working hours and business hours of the train number after the three ps (j) are continued, judging whether the constraint of the total working hours and the business hours of the vehicle is met according to the formula of the constraint of the total working hours and the constraint of the business hours of the vehicle, if not, turning to step 2027, and if so, continuing;
step 2027, arranging a new vehicle to execute the number of times;
step 2028, updating a train number chain, and calculating an invalid rest time of the train number chain;
step 2029, judging whether all the train numbers in the aggregate trigs are scheduled for the vehicle to execute, if not, turning to step 2024, if yes, ending, and obtaining the number of the vehicles and the invalid rest time, thereby obtaining an objective function;
step 20210, calculating individual fitness value, i.e. the inverse of the objective function.
Preferably, the step 204 includes the steps of:
step 2041, calculating fitness value f of each individual i Calculating the relative fitness of the individuals according to the formula, i.e. the probability p that each individual is inherited into the next generation population i :
Wherein pop represents the population number of the genetic algorithm;
2042, sequencing all individuals in the population according to the relative fitness;
step 2043, selecting the first k individuals with larger fitness according to the fitness of the individuals by utilizing an elite reservation strategy, replacing the k individuals with smaller fitness, and accelerating the algorithm convergence speed.
The method provided by the invention has the advantages that the time schedule and the vehicle scheduling plan are simultaneously arranged in consideration of the connection between the bus time schedule and the vehicle scheduling plan, the constraint in actual scheduling, such as dining problems of drivers and constraints during vehicle business, is met as far as possible, the invalid rest time among the vehicles is reduced as far as possible, the vehicles are gathered together as far as possible, and the subsequent scheduling of the drivers is convenient.
Drawings
FIG. 1 is a schematic diagram of an invalid rest time;
FIG. 2 is a step diagram of a genetic algorithm for bus schedules and vehicle shift scheduling problems;
FIG. 3 is an objective function calculation process;
FIG. 4 is a schematic diagram of a first n-bit interleaving operation;
FIG. 5 is a schematic diagram of a post n-bit interleaving operation;
FIG. 6 is a schematic diagram of the first n-bit mutation operation;
FIG. 7 is a schematic diagram of the last n-bit mutation operation.
Detailed Description
The invention will be further illustrated with reference to specific examples. It is to be understood that these examples are illustrative of the present invention and are not intended to limit the scope of the present invention. Further, it is understood that various changes and modifications may be made by those skilled in the art after reading the teachings of the present invention, and such equivalents are intended to fall within the scope of the claims appended hereto.
The method provided by the invention is based on the following assumption:
(1) The bus route runs up and down, and vehicles at the terminal stations at the two ends can enter and exit the parking lot;
(2) The number of times of bus running in the whole day of the bus route is a fixed value, and the bus can be numbered from small to large according to the time sequence of departure, wherein the uplink is numbered with odd numbers, and the downlink is numbered with even numbers;
(3) The maximum number of the cars allocated to the line is a fixed value, and the value is the maximum number of the cars allocated to the line in the peak time;
(4) Determining a class-dividing time according to the actual operation process of a public transportation enterprise, and returning the vehicle to a parking lot when the interval time between two adjacent train numbers is greater than or equal to the value, wherein a driver can be replaced in the period;
(5) Treatment of the dining condition of the driver: the arrival time of the train number is in the dining time, and the interval time between the arrival time of the train number and the adjacent train number is smaller than the time capable of being divided into shifts and larger than or equal to the dining rest time. If a plurality of train numbers are in dining time of the same train, only one of the adjacent train numbers is required to have the rest time greater than or equal to the dining rest time;
(6) All times were accurate to minutes.
The definitions and descriptions of partial nouns used in the present invention are shown in Table 1 below:
TABLE 1
The model parameters and variables used in the present invention are described in table 2 below:
TABLE 2
The model of the invention comprises the following:
(1) Objective function
The objective function Z of the model is the number of vehiclesAnd the total invalid rest time T, the number of vehicles is directly related to the enterprise operation cost, and the order of magnitude of the number of vehicles is considered to be multiplied by 100, so that the calculation formula of the objective function is as follows:
t represents an ineffective rest time, and as shown in fig. 1, three cases can be divided:
1) The interval time of two train numbers is smaller than the time of the separable class, the arrival time of the last train number is in dining time, and at the moment, the invalid rest time = the interval time of the adjacent train numbers-the dining time;
2) The interval time of the two train passes is more than or equal to the time of the separable class, and the invalid rest time=0;
3) Otherwise, invalid rest time = adjacent train interval time-train interval minimum rest time
Total invalid rest time = Σsum of invalid rest times between all train numbers
Time interval for all adjacent passes-time for all active rest times
The formula is:
(2) Constraint conditions
1) Timetable constraints
Value range meeting departure intervals of each period
h min ≤h i ≤h max (3)
The departure time of the final bus does not exceed the latest operation time of the line
2) Vehicle shift schedule constraints
Train number engagement constraint
Each train number is guaranteed to have vehicles executing and to be executed once.
Adjacent train number connection constraint
The adjacent train number executed by the same train must be up and down, and the interval time is greater than or equal to the shortest rest time. The shortest rest time needs to consider the constraint of dining of a driver, and when the arrival time of the train number is in a dining time interval and the interval time between the arrival time of the train number and the adjacent train number is smaller than the time capable of dividing the train number, the interval time between the adjacent train number is required to be ensured to be not smaller than the dining rest time.
Wherein% is the remainder operator, the same applies below.
Vehicle total man-hour constraint
In the case of no shift, the total man-hour of the vehicle=the last time the vehicle enters the parking lot-the time the vehicle starts to leave the parking lot, and in the case of shift, the total man-hour of the vehicle=the last time the vehicle enters the parking lot-the time the vehicle starts to leave the parking lot-the shift rest time.
Restraint during business car
And when the shift is not carried out, the business car=last shift arrival time-first shift car departure time, and when the shift is carried out, the business car=last shift arrival time-first shift car departure time-shift rest time.
(2) Problem solving method
The model is solved by adopting a genetic algorithm, and the steps are as follows, as shown in fig. 2:
step1: encoding to generate an initial population
Coding in a real number mode, setting the length of a gene to be 2n, setting the first n bits to be the departure interval between adjacent train numbers, and taking the value according to a formula (3), wherein the 1 st bit and the 2 nd bit represent the first class train, taking the value to be 0, and sequentially calculating the departure time of each train number according to the departure time of the first class train; the latter n bits are integers arranged continuously from 1 to n, where n represents total departure throughout the day, odd represents the number of upward vehicles, even represents the number of downward vehicles, and are used to generate a vehicle shift schedule, and the overall gene may be represented as pop (1) = [0,0,11,10 …,1,2,3,4 … n ].
Step2: calculating individual fitness values
The bus schedule and the vehicle shift schedule are calculated according to the initial population according to the steps shown in fig. 3, and the objective functions, i.e., the number of vehicles and the invalid rest time, are calculated according to the formulas in the model while both are generated. Since the objective function is the smallest, and not 0, the individual fitness value is set to the inverse of the objective function.
The specific steps are as follows:
step1: calculating departure time of all train numbers according to the front n-bit departure intervals and the departure time of the first class train of the gene code to form a timetable, and extracting the rear n bits of the gene to be recorded as a set of trips;
step2: defining an empty cell array for storing train number chains, namely blocks, wherein each train number chain is an array and represents a scheduling plan of a vehicle;
step3: arranging a first train number trigs (1) in the train execution trigs, and updating a train number chain set block;
step4: sequentially arranging subsequent sub-trigs (j) in the trigs, wherein j is E [2, n ], and the vehicles which are used are preferentially considered;
step5: calculating the connection time between the trigs (j) and the trigs (j-1), namely subtracting the arrival time of the train number trigs (j-1) from the departure time of the train number trigs (j), checking whether the equation (9) and the equation (10) are satisfied, if not, turning to Step7, and if so, continuing;
step6: calculating the total working hours and business hours of the train number chain after the trigs (j) are continued, judging whether the constraint of the total working hours and business hours of the vehicle is met according to a formula (11) and a formula (12), if not, turning to Step7, and if so, continuing;
step7: scheduling a new vehicle to execute the number of times;
step8: updating a train number chain, and calculating invalid rest time of the train number chain according to a formula (2);
step9: judging whether all the train numbers in the set of trigs are arranged for the execution of the vehicles, if not, turning to Step4, if so, ending, obtaining the number of the vehicles and the invalid rest time, and obtaining an objective function according to a formula (1).
Step10: an individual fitness value, i.e. the inverse of the objective function, is calculated.
Step3: judging whether the algorithm is terminated
The invention adopts the appointed iteration times of the reaching algorithm as the algorithm termination condition. When the algorithm reaches the maximum iteration times, stopping updating, outputting an optimal individual gene, decoding according to a coding rule, wherein the first n bits are the departure intervals between adjacent vehicles, the 1 st bit and the 2 nd bit represent the first class vehicles, the value is 0, and the departure time of each vehicle number is calculated in sequence according to the departure time of the first class vehicles to form a timetable; and the latter n bits are a vehicle scheduling plan, and a train number chain set, namely a cell array block, is obtained according to the fitness value calculation process.
Step4: performing a selection operation
The invention adopts elite retention strategy to select the individual, and the steps are as follows:
step1: calculating fitness value f of each individual i Calculating the relative fitness of the individuals, i.e., the probability that each individual is inherited into the next generation population, according to equation (13);
step2: sequencing all individuals in the population according to the relative fitness;
step3: and selecting the first k individuals with larger fitness according to the fitness of the individuals by utilizing an elite retention strategy, replacing the k individuals with smaller fitness, and accelerating the algorithm convergence speed.
Step5: performing a cross-over operation
Crossover probability P c The value of (1) is 0.7, and [0,1 ] is generated]The random number x between them, if x < P c Then a crossover operation is performed. According to the gene coding characteristics, the invention divides the cross operation into two types according to the position of the randomly generated cross point, and the positions of the cross point are recorded as i:
(1) If the crossover occurs in the first n bits, then the i-th bit to the last bit of the two individuals are exchanged in their entirety using a single point crossover approach as shown in fig. 4.
(2) If the crossing occurs in the latter n bits, a partial mapping crossing mode is adopted in order to ensure the integrity and the uniqueness of the train number. The first n bits are kept unchanged, and the specific steps of the last n bit crossing are as follows:
step1, generating a random integer with a value range of [1, n-i ] as a crossing length l, and marking the ith bit to the (i+l+1) th bit in a parent individual as a crossing part;
step2, newly creating a child individual set, wherein the length of the child individual set is 2n, the first n bits are identical with that of the corresponding parent individual, and the nth bit to the (n+l+1) th bit are the intersection parts of the corresponding parent individual;
step3, scanning the nth position to the 2nth position in the father 2 from left to right on the child individuals 1, deleting the existing train number in the child individuals 1, and sequentially filling the remaining genes into the child individuals 1 to obtain the child individuals 1; similarly, child 2 is manipulated to obtain child 2.
The operation diagram is shown in fig. 5.
Step6: performing mutation operation
Probability of variation P m The value of (2) is 0.05, and generates[0,1]The random number x between them, if x < P m And executing the mutation operation. According to the gene coding characteristics, the invention divides mutation operation into two types according to the position of the randomly generated mutation point, and the mutation point position is i:
(1) If the mutation occurs in the first n bits, as shown in fig. 6, an integer is randomly generated according to the value range of the departure interval of the ith bit to replace the original value of the ith bit.
(2) If the mutation occurs in the latter n bits, a random integer j with a value in the range of [1,2n-i ] is generated, and the values of the ith and jth bits in the individual are interchanged, as shown in FIG. 7.
After the mutation operation, a new population is obtained, and the step2 is transferred.
Claims (2)
1. A method for automatically scheduling buses and scheduling vehicles, comprising the steps of:
step1, setting an objective function of a model as follows:wherein Z represents the total objective function, +.>Representing the total number of vehicles used, X k Indicating whether the kth vehicle is executing the number of vehicles, which is a (0, 1) variable; m represents the total number of vehicles; t represents total ineffective rest time, < >>Wherein X is kij The (0, 1) variable indicates that the kth vehicle executes the vehicle number j,/after the vehicle number i is executed>Indicates departure time of train number j, +.>Represents the arrival time of the train number i, t usedrest Representing effective rest time between two adjacent train numbers, adjacent train numbersEffective rest time t between two train passes usedrest The calculation formula of (2) is as follows:
wherein t is rest Representing the minimum rest time, t fenban Indicates the time of being able to divide the shift, T meal Indicating the dining time interval, t meal Representing meal rest time;
setting constraint conditions of the model, wherein the constraint conditions comprise schedule constraint and vehicle scheduling plan constraint, and the constraint conditions comprise: the schedule constraints include:
the value range of the departure interval of each period is satisfied: h is a min ≤h i ≤h max Wherein, h min Represents the minimum departure interval, h max Represents the maximum departure interval, h i Representing departure intervals between adjacent train numbers;
the departure time of the final bus does not exceed the latest operation time of the line:
in the method, in the process of the invention,indicates departure time of the train number n, +.>T represents departure time of the first class bus up Indicating the latest business hours of ascending +.>T represents departure time of descending first class vehicle down Indicating the latest business hours of the downlink;
the vehicle shift schedule constraints include:
the number of cars links up restraint, guarantees that every number of cars all has the vehicle to carry out and is carried out once, has:
adjacent train number connection constraint:
wherein,% is the remainder operator;
vehicle total man-hour constraint:
in the method, in the process of the invention,time of arrival, t, representing last pass performed by vehicle k in Indicating the time when the vehicle enters the parking lot,indicating the departure time, t, of the first train carried out by the vehicle k out Time t 'indicating vehicle leaving parking lot' fenban Indicating the actual shift time, t max Representing the maximum total man-hour of the vehicle, t up_in Represent the up-travel field time, t down_in Indicating the down travel time, j' indicating the number of the last train number of the vehicle execution, t up_out Represents the uplink departure time, t down_out Indicating the downlink departure time, i' indicating the number of the first train number executed by the vehicle;
and (3) constraint during business car operation:wherein t is max_work Representing the maximum business hours of the vehicle;
in the steps: h is a min ,h max The method is determined by site, and the peak and peaked time periods of the passenger flow are different according to the peak and peaked time periods of the passenger flow; n, m, t rest 、t meal 、t fenban 、T up 、T down 、t max 、t max_work 、t up_in 、t up_out 、t down_in 、t down_out Determined by the line conditions;
and 2, solving the model established in the step1 by adopting a genetic algorithm so as to obtain a bus schedule and a vehicle scheduling plan, wherein the method comprises the following steps of:
step 201: encoding to generate an initial population
Coding in real number mode, setting the length of gene as 2n, setting the first n bits as the interval between adjacent train number, and taking the value according to formula h min ≤h i ≤h max Wherein the 1 st and 2 nd positions represent the first class vehicles, the value is 0, and the first class vehicles are sent outCalculating departure time of each train number in turn; the latter n bits are integers arranged continuously from 1 to n, wherein n represents total departure in the whole day, the odd number represents the number of upward vehicles, the even number represents the number of downward vehicles, and the whole genes are represented as pop (1) = [0,0,11,10 …,1,2,3,4 … n];
Step 202: calculating individual fitness values
Calculating a bus schedule and a vehicle scheduling plan according to an initial group, and simultaneously calculating an objective function, namely a vehicle number Z and an invalid rest time T according to formulas in a model, wherein the objective function is minimum and is not 0, and an individual fitness value is set as the reciprocal of the objective function, wherein the calculation process of the objective function comprises the following steps:
2021, calculating departure time of all train numbers according to the front n-bit departure intervals and the departure time of the first class train of the gene code, forming a timetable, and extracting the rear n bits of the gene to be recorded as a set tricps;
step 2022, defining an empty cell array for storing train number chains, denoted as blocks, each train number chain being an array representing a scheduling plan of a vehicle;
step 2023, arranging the first train sub-trigs (1) in the train execution trigs, and updating a train sub-chain set block;
step 2024, sequentially arranging subsequent sub-vehicle trigs (j) in the trigs, and giving priority to the vehicles already used;
step 2025, calculate the succession time between the trigs (j) and the trigs (j-1), i.e. departure time of the train number trigs (j) minus arrival time of the train number trigs (j-1), see if it is satisfiedAnd->If not, go to step 2027, if yes, continue;
step 2026, calculating total working hours and business hours of the train number after the three ps (j) are continued, judging whether the constraint of the total working hours and the business hours of the vehicle is met according to the formula of the constraint of the total working hours and the constraint of the business hours of the vehicle, if not, turning to step 2027, and if so, continuing;
step 2027, arranging a new vehicle to execute the number of times;
step 2028, updating a train number chain, and calculating an invalid rest time of the train number chain;
step 2029, judging whether all the train numbers in the aggregate trigs are scheduled for the vehicle to execute, if not, turning to step 2024, if yes, ending, and obtaining the number of the vehicles and the invalid rest time, thereby obtaining an objective function;
step 20210, calculating an individual fitness value, i.e. the inverse of the objective function;
step 203: judging whether the algorithm is terminated
When the algorithm reaches the maximum iteration times, stopping updating, outputting an optimal individual gene, decoding according to a coding rule, wherein the first n bits are the departure intervals between adjacent vehicles, the 1 st bit and the 2 nd bit represent the first class vehicles, the value is 0, and the departure time of each vehicle number is calculated in sequence according to the departure time of the first class vehicles to form a timetable; the latter n bits are a vehicle scheduling plan, and a train number chain set, namely a cell array block is obtained according to the fitness value calculation process;
step 204: performing a selection operation: individuals were selected using elite retention strategy:
step 205: performing a cross-over operation
Generate [0,1 ]]The random number x between them, if x < P c ,P c And if the intersection probability is represented, executing intersection operation, dividing the intersection operation into two types according to the position of the randomly generated intersection point, and recording the position of the intersection point as i:
(1) If the crossover occurs in the first n bits, adopting a single-point crossover mode to carry out integral exchange from the ith bit to the last bit of the two individuals;
(2) If the crossing occurs in the rear n bits, in order to ensure the integrity and the uniqueness of the train number, a partial mapping crossing mode is adopted, the front n bits are kept unchanged, and the specific steps of the rear n bit crossing are as follows:
step 2051, generating a random integer with a value range of [1, n-i ] as a crossing length l, and marking the ith bit to the (i+l+1) th bit in the parent individual as a crossing part;
step 2052, newly creating a child individual set, wherein the length is 2n, the first n bits are identical to the corresponding parent individual, and the nth bit to the (n+l+1) th bit are the intersection parts of the corresponding parent individuals;
step 2053, scanning the nth position to the 2nth position in the father 2 from left to right on the child individuals 1, deleting the existing train number in the child individuals 1, and sequentially filling the remaining genes into the child individuals 1 to obtain the child individuals 1; similarly, operating the child generation individuals 2 to obtain child generation individuals 2;
step 206: performing mutation operation
Generate [0,1 ]]The random number x between them, if x < P m ,P m And (3) expressing the mutation probability, executing mutation operation, dividing the mutation operation into two types according to the position of the randomly generated mutation point, and recording the position of the mutation point as i:
(1) If the variation occurs in the first n bits, randomly generating an integer to replace the original value of the ith bit according to the value range of the departure interval of the ith bit;
(2) If the variation occurs in the latter n bits, generating a random integer j with a value range of [1,2n-i ], and exchanging the values of the ith bit and the jth bit in the individual;
after the mutation operation, a new population is obtained, and the process goes to step 202.
2. A method of automating the scheduling of buses and scheduling of vehicles as claimed in claim 1, wherein said step 204 comprises the steps of:
step 2041, calculating fitness value f of each individual i Calculating the relative fitness of the individuals according to the formula, i.e. the probability p that each individual is inherited into the next generation population i :
Wherein pop represents the population number of the genetic algorithm;
2042, sequencing all individuals in the population according to the relative fitness;
step 2043, selecting the first k individuals with larger fitness according to the fitness of the individuals by utilizing an elite reservation strategy, replacing the k individuals with smaller fitness, and accelerating the algorithm convergence speed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911120311.0A CN110991706B (en) | 2019-11-15 | 2019-11-15 | Method for automatically compiling bus timetable and vehicle scheduling plan |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911120311.0A CN110991706B (en) | 2019-11-15 | 2019-11-15 | Method for automatically compiling bus timetable and vehicle scheduling plan |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110991706A CN110991706A (en) | 2020-04-10 |
CN110991706B true CN110991706B (en) | 2023-05-05 |
Family
ID=70084533
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911120311.0A Active CN110991706B (en) | 2019-11-15 | 2019-11-15 | Method for automatically compiling bus timetable and vehicle scheduling plan |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110991706B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112967519B (en) * | 2021-02-01 | 2022-05-13 | 青岛海信网络科技股份有限公司 | Public transport means scheduling method, device and equipment |
CN112884216B (en) * | 2021-02-04 | 2023-06-23 | 国网湖南省电力有限公司 | Method for calculating minimum number of vehicles in single bus route |
CN117151313B (en) * | 2023-10-31 | 2024-02-02 | 杭州数知梦科技有限公司 | Comprehensive multi-factor bus driving plan optimization method, system and application |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104239484A (en) * | 2014-09-05 | 2014-12-24 | 浙江工业大学 | Multi-mode bus combinatorial dispatch-based schedule making method |
CN106203680A (en) * | 2016-06-28 | 2016-12-07 | 上海工程技术大学 | A kind of public transit vehicle resource regulating method based on improved adaptive GA-IAGA |
CN108399455A (en) * | 2017-02-08 | 2018-08-14 | 北京京东尚科信息技术有限公司 | Dispatching method based on genetic algorithm and device |
CN108734353A (en) * | 2018-05-22 | 2018-11-02 | 青岛海信网络科技股份有限公司 | A kind of public bus network route plan generation method and device |
CN109460936A (en) * | 2018-11-21 | 2019-03-12 | 深圳市都市数据技术有限公司 | A kind of public transit vehicle smart shift scheduling method, intelligent terminal and storage medium |
-
2019
- 2019-11-15 CN CN201911120311.0A patent/CN110991706B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104239484A (en) * | 2014-09-05 | 2014-12-24 | 浙江工业大学 | Multi-mode bus combinatorial dispatch-based schedule making method |
CN106203680A (en) * | 2016-06-28 | 2016-12-07 | 上海工程技术大学 | A kind of public transit vehicle resource regulating method based on improved adaptive GA-IAGA |
CN108399455A (en) * | 2017-02-08 | 2018-08-14 | 北京京东尚科信息技术有限公司 | Dispatching method based on genetic algorithm and device |
CN108734353A (en) * | 2018-05-22 | 2018-11-02 | 青岛海信网络科技股份有限公司 | A kind of public bus network route plan generation method and device |
CN109460936A (en) * | 2018-11-21 | 2019-03-12 | 深圳市都市数据技术有限公司 | A kind of public transit vehicle smart shift scheduling method, intelligent terminal and storage medium |
Non-Patent Citations (1)
Title |
---|
吕燕杰 ; 赵宇 ; 蔡鸿明 ; .公交智能调度中行车时刻表编排算法研究.微型电脑应用.2009,(第11期),全文. * |
Also Published As
Publication number | Publication date |
---|---|
CN110991706A (en) | 2020-04-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110991706B (en) | Method for automatically compiling bus timetable and vehicle scheduling plan | |
Zuo et al. | Vehicle scheduling of an urban bus line via an improved multiobjective genetic algorithm | |
Fonseca et al. | A matheuristic for transfer synchronization through integrated timetabling and vehicle scheduling | |
Lova et al. | An efficient hybrid genetic algorithm for scheduling projects with resource constraints and multiple execution modes | |
CN110114806A (en) | Signalized control method, relevant device and system | |
EP2932488B1 (en) | Transportation plan creation support apparatus and transportation plan creation support method | |
CN107146068B (en) | Train operation daily plan compiling and allocating method based on balanced application | |
CN107895225A (en) | A kind of cooperation type method for allocating tasks of multi-Agent Lothrus apterus | |
CN110598998A (en) | Automatic scheduling method for intelligent station crew members | |
CN102122251A (en) | Method for scheduling multi-spacecraft parallel test task based on genetic algorithm | |
Bouzaiene-Ayari et al. | From single commodity to multiattribute models for locomotive optimization: A comparison of optimal integer programming and approximate dynamic programming | |
CN111291303A (en) | Electric bus scheduling optimization method considering heterogeneity of shift | |
CN110889596B (en) | Construction plan scheduling method and system for railway engineering line | |
CN115700631A (en) | Expressway power conversion station optimal configuration method considering carbon emission | |
CN112465211A (en) | Rail transit train full load rate control method and application | |
CN113033928B (en) | Method, device and system for designing bus shift model based on deep reinforcement learning | |
CN113344336A (en) | Vehicle scheduling method and device and storage medium | |
CN114331231B (en) | Method and system for scheduling public transport | |
Shrivastava et al. | Modeling an integrated public transportation system-a case study in Dublin, Ireland | |
Baek et al. | Co-evolutionary genetic algorithm for multi-machine scheduling: coping with high performance variability | |
CN109426918A (en) | A method of Workshop Production is carried out based on time data and processes scheduled production | |
CN113536692A (en) | Intelligent dispatching method and system for high-speed rail train in uncertain environment | |
CN113837438A (en) | Subway duty scheduling planning optimization method based on SPFA algorithm | |
Azadeh et al. | A hybrid computer simulation–genetic algorithm for scheduling optimisation of cargo trains with time and queue limitations | |
CN117151313B (en) | Comprehensive multi-factor bus driving plan optimization method, system and application |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |