CN110991706A - Method for automatically compiling bus schedule and vehicle scheduling plan - Google Patents
Method for automatically compiling bus schedule and vehicle scheduling plan Download PDFInfo
- Publication number
- CN110991706A CN110991706A CN201911120311.0A CN201911120311A CN110991706A CN 110991706 A CN110991706 A CN 110991706A CN 201911120311 A CN201911120311 A CN 201911120311A CN 110991706 A CN110991706 A CN 110991706A
- Authority
- CN
- China
- Prior art keywords
- vehicle
- time
- train
- departure
- bus
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 24
- 230000035772 mutation Effects 0.000 claims description 24
- 108090000623 proteins and genes Proteins 0.000 claims description 20
- 238000004364 calculation method Methods 0.000 claims description 9
- 230000002068 genetic effect Effects 0.000 claims description 8
- 230000001413 cellular effect Effects 0.000 claims description 6
- 230000014759 maintenance of location Effects 0.000 claims description 5
- 150000001875 compounds Chemical class 0.000 claims description 4
- 238000013459 approach Methods 0.000 claims description 3
- 230000001174 ascending effect Effects 0.000 claims description 3
- 238000013507 mapping Methods 0.000 claims description 3
- 235000012054 meals Nutrition 0.000 claims description 2
- 238000010586 diagram Methods 0.000 description 5
- NAWXUBYGYWOOIX-SFHVURJKSA-N (2s)-2-[[4-[2-(2,4-diaminoquinazolin-6-yl)ethyl]benzoyl]amino]-4-methylidenepentanedioic acid Chemical compound C1=CC2=NC(N)=NC(N)=C2C=C1CCC1=CC=C(C(=O)N[C@@H](CC(=C)C(O)=O)C(O)=O)C=C1 NAWXUBYGYWOOIX-SFHVURJKSA-N 0.000 description 1
- 230000008303 genetic mechanism Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000010845 search algorithm Methods 0.000 description 1
- 238000012163 sequencing technique Methods 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 invention considers the relation between the bus schedule and the vehicle scheduling plan, and the method arranges the schedule and the vehicle scheduling plan simultaneously, meets the constraint in the actual scheduling as much as possible, such as the dining problem of a driver, the constraint of a vehicle during business and the like, reduces the invalid rest time between the vehicle times as much as possible, enables the vehicle times to be gathered together as much as possible, and facilitates the subsequent scheduling of the driver.
Description
Technical Field
The invention relates to an automatic compilation method of a bus schedule and a vehicle scheduling plan.
Background
Schedules and vehicle shift schedules are important components of bus operation schedules. The bus timetable is a basis for measuring the bus punctuality rate and reliability, the departure time, arrival time, stop time, departure time interval and the like of the bus at the first and last stations and the parking lot are determined, and the problem of the bus timetable is generally the problem of determining the departure frequency. A vehicle shift schedule may be described as a sequence of vehicles scheduled to perform all of the number of passes, the number of vehicles required and the number of passes performed per vehicle determined by the passenger flow demand, given a schedule.
The genetic algorithm is a random search algorithm and is evolved through a biological evolution process simulating natural selection and genetic mechanism of Darwinian biological evolution theory. The basic idea of the genetic algorithm is as follows: the coding space is used for replacing the problem parameter space, starting from a population which can represent a potential solution set of the problem, the fitness is used as the basis for evaluating the individual advantages and disadvantages according to the principle that a suitable person exists and is superior or inferior in the biological evolution process, and the selection, crossing and mutation operators are repeatedly used to act on the population, so that the population is continuously evolved and gradually approaches to the optimal solution.
Disclosure of Invention
The invention aims to: and automatically generating a bus schedule and a vehicle scheduling plan.
In order to achieve the aim, 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 of:
step1, setting a target function of a model as follows:wherein Z represents the overall objective function,indicating the total number of vehicles used, XkA variable (0,1) indicating whether the kth vehicle executes the train number; m represents the total number of vehicles; t represents the total invalid rest time and,wherein XkijA variable of (0,1) indicating that the kth vehicle executed the number of cars i and then executed the number of cars j,indicates the departure time of the train number j,indicating the arrival time, t, of the train number iusedrestRepresenting the effective rest time between two adjacent train numbers;
and setting constraint conditions of the model, wherein the constraint conditions comprise schedule constraint and vehicle shift scheduling plan constraint, and the following steps of:
the schedule constraints include:
the value range of departure intervals in each time period is satisfied: h ismin≤hi≤hmaxIn the formula, hminIndicates the minimum departure interval, hmaxIndicates the maximum departure interval, hiRepresenting departure intervals between adjacent vehicle numbers;
the departure time of the last bus does not exceed the latest operation time of the line:
in the formula (I), the compound is shown in the specification,the departure time of the vehicle number n is shown,shows the departure time of the first-class uplink car, TupThe latest business hours of the upper line are shown,indicates the departure time of the first-class vehicle in the down line, TdownRepresenting the latest business hours of the downlink;
vehicle shift schedule constraints include:
the train number links up the restraint, guarantees that every train number all has the vehicle to carry out and is carried out once, has:
and (3) continuous constraint of adjacent train numbers:
wherein,% is a remainder operator;
vehicle total man-hour constraints:
in the formula (I), the compound is shown in the specification,time of arrival, t, representing the last train number performed by vehicle kinIndicating the time at which the vehicle entered the parking lot,indicating the departure time, t, of the first pass performed by vehicle koutIndicates the time t 'at which the vehicle leaves the parking lot'fenbanRepresenting the actual shift time, tmaxRepresents the maximum vehicle total man-hours, tup_inRepresenting the up-flight time, tdown_inRepresenting the down approach time, j' representing the number of the last train performed by the vehicle, tup_outRepresenting the uplink departure time, tdown_outIndicating a down departure time, i' indicating the number of the first train performed by the vehicle;
constraint during business vehicle operation:in the formula, tmax_workRepresenting the maximum working hours of the vehicle;
and 2, solving the model established in the step1 by adopting a genetic algorithm, thereby obtaining a bus schedule and a vehicle scheduling plan.
Preferably, in step1, the effective rest time t between two adjacent train numbersusedrestThe calculation formula of (2) is as follows:
in the formula, trestDenotes the minimum rest time, tfenbanIndicating shift time, TmealIndicates a dining time interval, tmealIndicating meal rest time.
Preferably, the step2 comprises the steps of:
step 201: encoding to generate an initial population
Coding in a real number mode, setting the gene length to be 2n, setting the front n bits as the departure interval between adjacent trains, and taking values according to a formula hmin≤hi≤hmaxThe 1 st and 2 nd represent the first bus, the value is 0, and the departure time of each bus number is calculated in sequence according to the departure time of the first bus; the last n bits are integers which are arranged from 1 to n in series, wherein n represents total departure in a full day, odd numbers represent ascending train times, even numbers represent descending trainsThe number of vehicles used to generate a vehicle shift schedule is represented by the general gene 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 the initial group, calculating a target function, namely the number Z of vehicles and the invalid rest time T according to a formula in the model while generating the bus schedule and the vehicle scheduling plan, wherein the target function is minimum and is not 0, and the individual fitness value is set as the reciprocal of the target function;
step 203: determining whether the algorithm is terminated
When the algorithm reaches the maximum iteration times, stopping updating, outputting the optimal individual genes, decoding according to the encoding rule, wherein the front n bits are the departure intervals between adjacent bus times, the 1 st and 2 nd bits represent the first bus, the value is 0, and the departure time of each bus time is sequentially calculated according to the departure time of the first bus to form a timetable; the next n bits are vehicle scheduling plans, and a train number chain set, namely a cellular array block, is obtained according to the calculation process of the fitness value;
step 204: and executing selection operation: selecting individuals by adopting an elite retention strategy:
step 205: performing a crossover operation
To generate [0,1]X is a random number in between, if x < Pc,PcAnd (3) representing the cross probability, executing cross operation, dividing the cross operation into two types according to the position of the randomly generated cross point, and recording the position of the cross point as i:
(1) if the crossing occurs at the front n bits, the integral exchange is carried out from the ith bit to the last bit of the two individuals in a single-point crossing mode;
(2) if the crossing occurs at the rear n bits, in order to ensure the integrity and 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 crossing of the rear n bits are as follows:
step 2051, generating a random integer with a value range of [1, n-i ] as a cross length l, and marking the ith bit to the (i + l + 1) th bit in the parent individual as a cross part;
step 2052, newly building a child individual set, wherein the length is 2n, the front n bits are the same as the corresponding parent individuals, and the n bit to the (n + l + 1) th bit are the cross parts of the corresponding parent individuals;
step 2053, scanning the nth position to the 2 nth position in the parent 2 from left to right for the child individual 1, deleting the existing train number in the child individual 1, and sequentially filling the remaining genes into the child individual 1 to obtain the child individual 1; and similarly, operating the offspring individuals 2 to obtain the offspring individuals 2.
Step 206: performing mutation operations
To generate [0,1]X is a random number in between, if x < Pm,PmAnd (3) representing the mutation probability, executing mutation operation, dividing the mutation operation into two types according to the position of the randomly generated mutation point, and marking 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 ith departure interval;
(2) if the variation occurs in the last n bits, a random integer j with the value range of [1,2n-i ] is generated, and the values of the ith bit and the jth bit in the individual are exchanged.
After 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 departure intervals of n front-bit trains of the gene codes and departure time of the first-class train to form a timetable, and extracting n rear-bit trains of the gene codes and recording the n rear-bit trains as an aggregate tripts;
step 2022, defining an empty cellular array for storing the train number chains, which is recorded as block, wherein each train number chain is an array representing a shift schedule of a vehicle;
step 2023, arranging the vehicle to execute a first train trip (1) in the trips, and updating a train trip set block;
2024, arranging the subsequent train numbers of the tries (j) in sequence, and giving priority to the used vehicles;
step 2025, calculating the connection time between the tries (j) and the tries (j-1), i.e. the departure time of the train times tries (j)Subtract the arrival time of the train trips (j-1) to see if it is satisfiedAndif not, go to step 2027, if yes, continue;
step 2026, calculating the total working hours and business vehicle hours of the train number chain after the trips (j) is continued, and judging whether the total working hours and the business vehicle hours of the train are satisfied according to the formula of the total working hours constraint and the business vehicle hours constraint, if not, turning to step 2027, and if so, continuing;
step 2027, arranging a new vehicle to execute the train number;
step 2028, updating the train number chain, and calculating the invalid rest time of the train number chain;
step 2029, judging whether all the vehicle numbers in the set tries are scheduled to be executed by the vehicles, if not, turning to step 2024, if yes, ending, and obtaining the number of the vehicles and the invalid rest time so as to obtain a target function;
step 20210, calculate the individual fitness value, i.e. the inverse of the objective function.
Preferably, said step 204 comprises the steps of:
step 2041, calculating the fitness value f of each individualiThe relative fitness of the individuals is calculated according to the following formula, i.e. the probability p that each individual is inherited into the next generation populationi:
In the formula, popsize represents the population number of the genetic algorithm;
2042, sorting all the individuals in the population according to relative fitness;
and 2043, selecting the first k individuals with higher fitness according to the individual fitness by using an elite retention strategy to replace the k individuals with lower fitness, so that the algorithm convergence speed is accelerated.
The invention considers the relation between the bus schedule and the vehicle scheduling plan, and the method arranges the schedule and the vehicle scheduling plan simultaneously, meets the constraint in the actual scheduling as much as possible, such as the dining problem of a driver, the constraint of a vehicle during business and the like, reduces the invalid rest time between the vehicle times as much as possible, enables the vehicle times to be gathered together as much as possible, and facilitates the subsequent scheduling of the driver.
Drawings
FIG. 1 is a schematic view of an invalid rest time;
FIG. 2 is a diagram of a bus schedule and vehicle shift plan problem genetic algorithm steps;
FIG. 3 is an objective function calculation process;
FIG. 4 is a schematic diagram of the 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 operation of first n-bit mutation;
FIG. 7 is a schematic diagram of the post-n mutation operation.
Detailed Description
The invention will be further illustrated with reference to the following specific examples. It should be understood that these examples are for illustrative purposes only and are not intended to limit the scope of the present invention. Further, it should be understood that various changes or modifications of the present invention may be made by those skilled in the art after reading the teaching of the present invention, and such equivalents may fall within the scope of the present invention as defined in the appended claims.
The method provided by the invention is based on the following assumptions:
(1) the bus line runs up and down, and vehicles at terminal stations at two ends can enter and exit the parking lot;
(2) the number of the bus running in the bus route on the whole day is a fixed value, and the bus running in the bus route can be numbered from small to large according to the departure time sequence, wherein the uplink is numbered by odd numbers, and the downlink is numbered by even numbers;
(3) the maximum number of the distributed vehicles of the line is a fixed value, and the value is the maximum number of the distributed vehicles at the peak time;
(4) determining the shift time according to the actual operation process of a bus enterprise, and when the interval time between two adjacent bus numbers is greater than or equal to the value, returning the bus to the parking lot, wherein the driver can be replaced;
(5) and (3) processing the dining condition of the driver: the train number arrival time is within the dining time, and the interval time between the train number arrival time and the adjacent train number is less than the time for shift and more than or equal to the dining rest time. If a plurality of train numbers of the same vehicle are in the dining time, the rest time of one adjacent train number is more than or equal to the dining rest time;
(6) all times were accurate to minutes.
Some of the nouns used in the present invention are defined and described in the following Table 1:
TABLE 1
The model parameters and variable specifications used in the present invention are shown in table 2 below:
TABLE 2
The model of the invention comprises the following contents:
(1) objective function
The objective function Z of the model being the number of vehiclesAnd the weighted sum of the total invalid rest time T, since the number of vehicles is directly related to the enterprise operation cost, and the number of vehicles is multiplied by 100 by considering the magnitude order of the two, the calculation formula of the objective function is as follows:
t represents the invalid rest time, and as shown in fig. 1, can be divided into three cases:
1) the interval time between two trains is less than the time for separating the shifts, the arrival time of the last train is the dining time, and the invalid rest time is the interval time between the adjacent trains and the dining time;
2) the interval time between two trains is more than or equal to the time for separating shifts, and the invalid rest time is equal to 0;
3) otherwise, invalid rest time is equal to the minimum rest time between adjacent train intervals
Total invalid rest time ═ sum of all inter-train invalid rest times ∑
All adjacent train interval times sigma all effective rest times
The formula is expressed as:
(2) constraint conditions
1) Schedule constraints
Meet the value range of departure intervals in each time period
hmin≤hi≤hmax(3)
The departure time of the last bus does not exceed the latest operation time of the line
2) Vehicle shift schedule constraints
Train number connection constraint
And ensuring that each train number is executed by the vehicle once.
Consecutive turn constraint
The adjacent train numbers executed by the same train must be uplink and downlink, 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 the dining time interval and the interval time between the arrival time of the train number and the adjacent train number is less than the separable time, the interval time between the arrival time of the train number and the adjacent train number needs to be ensured not to be less than the dining rest time.
Wherein% is the remainder operator, as follows.
Vehicle total man-hour constraint
And in the case of no shift, the total vehicle working hours are the time when the vehicle enters the parking lot last and the time when the vehicle starts to leave the parking lot, and in the case of shift, the total vehicle working hours are the time when the vehicle enters the parking lot last, the time when the vehicle starts to leave the parking lot last and the shift rest time.
Restraint during business vehicle
The business vehicle is the arrival time of the last bus-the departure time of the first bus under the condition of no shift, and the business vehicle is the arrival time of the last shift-the departure time of the first bus-the shift rest time under the condition of shift.
(2) Problem solving method
The above model is solved by genetic algorithm, as shown in fig. 2, the steps are as follows:
step1: encoding to generate an initial population
Coding by adopting a real number mode, setting the gene length to be 2n, setting the front n bits as the departure interval between adjacent bus numbers, and taking values according to a formula (3), wherein the 1 st and 2 nd bits represent the first bus, the value is 0, and the departure time of each bus number is sequentially calculated according to the departure time of the first bus; the last n bits are integers arranged in series from 1 to n, where n represents total departure on a full day, odd represents ascending, even represents descending, and is used to generate a vehicle shift schedule, and the whole gene can be represented by pop (1) ═ 0,0,11,10 …,1, 2,3,4 … n.
Step2: calculating individual fitness values
According to the steps shown in fig. 3, a bus schedule and a vehicle scheduling plan are calculated according to the initial group, and a target function, namely the number of vehicles and the invalid rest time, is calculated according to a formula in the model while the bus schedule and the vehicle scheduling plan are generated. Since the objective function is minimum and not 0, the individual fitness value is set to the inverse of the objective function.
The specific steps are described as follows:
step1: calculating departure time of all the train numbers according to departure intervals of n front-position trains of the gene codes and departure time of the first-class train to form a timetable, and extracting n rear-position trains of the gene codes and recording the n rear-position trains as an aggregate tripts;
step2: defining an empty cellular array for storing train number chains, and marking the train number chains as blocks, wherein each train number chain is an array and represents a scheduling plan of a vehicle;
step3: arranging the vehicle to execute a first train number tripts (1) in the tripts, and updating a train number chain set block;
step 4: arranging the subsequent train times of the tries (j) in sequence, wherein j belongs to [2, n ], and preferentially considering the used train;
step 5: calculating the continuing time between the tries (j) and the tries (j-1), namely subtracting the arrival time of the train times tries (j-1) from the departure time of the train times tries (j), checking whether the formula (9) and the formula (10) are met, if not, turning to Step7, and if so, continuing;
step 6: calculating the total working hours and business vehicle hours of the train number chain after the rounds (j) are continued, judging whether the total working hours and the business vehicle hours of the train are satisfied according to a formula (11) and a formula (12), if not, turning to Step7, and if so, continuing;
step 7: arranging a new vehicle to execute the train number;
step 8: updating the train number chain, and calculating the invalid rest time of the train number chain according to the formula (2);
step 9: and (3) judging whether all the vehicle numbers in the set tries are scheduled to be executed by the vehicles, if not, turning to Step4, if so, ending to obtain the vehicle number and the invalid rest time, and obtaining the target function according to the formula (1).
Step 10: an individual fitness value, i.e. the inverse of the objective function, is calculated.
And step3: determining whether the algorithm is terminated
The invention adopts the specified iteration times of the algorithm as the termination condition of the algorithm. When the algorithm reaches the maximum iteration times, stopping updating, outputting the optimal individual genes, decoding according to the encoding rule, wherein the front n bits are the departure intervals between adjacent bus times, the 1 st and 2 nd bits represent the first bus, the value is 0, and the departure time of each bus time is sequentially calculated according to the departure time of the first bus to form a timetable; and the next n bits are a vehicle scheduling plan, and a train number chain set, namely a cellular array block, is obtained according to the calculation process of the fitness value.
And 4, step 4: performing a selection operation
The invention adopts an elite reservation strategy to select individuals, and the steps are as follows:
step1: calculating fitness value f of each individualiAccording toFormula (13) calculates the relative fitness of the individuals, i.e. the probability that each individual is inherited into the next generation population;
step2: sequencing all individuals in the population according to the relative fitness;
step3: and (3) selecting the first k individuals with larger fitness according to the individual fitness by using an elite retention strategy to replace the k individuals with smaller fitness, so that the algorithm convergence speed is accelerated.
And 5: performing a crossover operation
Cross probability PcIs taken to be 0.7, to generate [0,1 ]]X is a random number in between, if x < PcThen the interleaving operation is performed. According to the gene coding characteristics, the invention divides the cross operation into two types according to the position of the cross point generated randomly, and records the position of the cross point as i:
(1) if the crossing occurs in the first n bits, the i-th bit to the last bit of the two individuals are exchanged as a whole by adopting a single-point crossing manner as shown in fig. 4.
(2) If the intersection occurs in the last n bits, in order to ensure the integrity and uniqueness of the train number, a partial mapping intersection mode is adopted. The front n bits are kept unchanged, and the specific steps of crossing the rear n bits are as follows:
step1, generating a random integer with the value range of [1, n-i ] as the cross length l, and marking the ith to (i + l + 1) th bits in the parent individuals as cross parts;
step2, creating a child individual set with the length of 2n, wherein the front n position is the same as the corresponding parent individual, and the nth position to the n + l +1 position are the cross parts of the corresponding parent individuals;
step3, scanning the nth position to the 2 nth position in the parent 2 from left to right for the child individual 1, deleting the existing train number in the child individual 1, and filling the remaining genes into the child individual 1 in sequence to obtain the child individual 1; and similarly, operating the offspring individuals 2 to obtain the offspring individuals 2.
The operation schematic is shown in fig. 5.
Step 6: performing mutation operations
Probability of variation PmIs taken to be 0.05, to generate [0,1 ]]X is a random number in between, if x < PmThen a mutation operation is performed. According to the gene coding characteristics, the invention divides mutation operation into two types according to the position of a randomly generated mutation point, and records the positions of the mutation point as i:
(1) if the variation occurs in the first n bits, as shown in fig. 6, an integer is randomly generated to replace the original value of the ith bit according to the value range of the ith departure interval.
(2) If the mutation occurs in the last n bits, a random integer j with a value range of [1,2n-i ] is generated as shown in fig. 7, and the values of the ith bit and the jth bit in the individual are exchanged.
And (5) obtaining a new population after mutation operation, and turning to the step 2.
Claims (5)
1. A method for automatically compiling a bus schedule and a vehicle scheduling plan is characterized by comprising the following steps:
step1, setting a target function of a model as follows:wherein Z represents the overall objective function,indicating the total number of vehicles used, XkA variable (0,1) indicating whether the kth vehicle executes the train number; m represents the total number of vehicles; t represents the total invalid rest time and,wherein XkijA variable of (0,1) indicating that the kth vehicle executed the number of cars i and then executed the number of cars j,indicates the departure time of the train number j,indicating the arrival time, t, of the train number iusedrestRepresenting the effective rest time between two adjacent train numbers;
and setting constraint conditions of the model, wherein the constraint conditions comprise schedule constraint and vehicle shift scheduling plan constraint, and the following steps of:
the schedule constraints include:
the value range of departure intervals in each time period is satisfied: h ismin≤hi≤hmaxIn the formula, hminIndicates the minimum departure interval, hmaxIndicates the maximum departure interval, hiRepresenting departure intervals between adjacent vehicle numbers;
the departure time of the last bus does not exceed the latest operation time of the line:
in the formula (I), the compound is shown in the specification,the departure time of the vehicle number n is shown,shows the departure time of the first-class uplink car, TupThe latest business hours of the upper line are shown,indicates the departure time of the first-class vehicle in the down line, TdownRepresenting the latest business hours of the downlink;
vehicle shift schedule constraints include:
the train number links up the restraint, guarantees that every train number all has the vehicle to carry out and is carried out once, has:
and (3) continuous constraint of adjacent train numbers:
wherein,% is a remainder operator;
vehicle total man-hour constraints:
in the formula (I), the compound is shown in the specification,time of arrival, t, representing the last train number performed by vehicle kinIndicating the time at which the vehicle entered the parking lot,indicating the departure time, t, of the first pass performed by vehicle koutIndicating that the vehicle is out of parkTime of field, t'fenbanRepresenting the actual shift time, tmaxRepresents the maximum vehicle total man-hours, tup_inRepresenting the up-flight time, tdown_inRepresenting the down approach time, j' representing the number of the last train performed by the vehicle, tup_outRepresenting the uplink departure time, tdown_outIndicating a down departure time, i' indicating the number of the first train performed by the vehicle;
constraint during business vehicle operation:in the formula, tmax_workRepresenting the maximum working hours of the vehicle;
and 2, solving the model established in the step1 by adopting a genetic algorithm, thereby obtaining a bus schedule and a vehicle scheduling plan.
2. The method for automatically compiling bus schedule and vehicle shift schedule as claimed in claim 1, wherein in step1, the effective rest time t between two adjacent train numbersusedrestThe calculation formula of (2) is as follows:
in the formula, trestDenotes the minimum rest time, tfenbanIndicating shift time, TmealIndicates a dining time interval, tmealIndicating meal rest time.
3. The method for automatically compiling a bus schedule and a vehicle shift schedule as set forth in claim 1, wherein said step2 comprises the steps of:
step 201: encoding to generate an initial population
Coding in a real number mode, setting the gene length to be 2n, setting the front n bits as the departure interval between adjacent trains, and taking values according to a formula hmin≤hi≤hmaxWherein the 1 st and 2 nd represent the first bus, the value is 0, according to the first busThe departure time of each bus is calculated in sequence according to the departure time of the regular bus; the last n bits are integers which are arranged from 1 to n in series, wherein n represents total departure in a whole day, odd represents ascending train number, even represents descending train number and is used for generating a vehicle shift schedule, and the overall gene is represented by 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 the initial group, calculating a target function, namely the number Z of vehicles and the invalid rest time T according to a formula in the model while generating the bus schedule and the vehicle scheduling plan, wherein the target function is minimum and is not 0, and the individual fitness value is set as the reciprocal of the target function;
step 203: determining whether the algorithm is terminated
When the algorithm reaches the maximum iteration times, stopping updating, outputting the optimal individual genes, decoding according to the encoding rule, wherein the front n bits are the departure intervals between adjacent bus times, the 1 st and 2 nd bits represent the first bus, the value is 0, and the departure time of each bus time is sequentially calculated according to the departure time of the first bus to form a timetable; the next n bits are vehicle scheduling plans, and a train number chain set, namely a cellular array block, is obtained according to the calculation process of the fitness value;
step 204: and executing selection operation: selecting individuals by adopting an elite retention strategy:
step 205: performing a crossover operation
To generate [0,1]X is a random number in between, if x < Pc,PcAnd (3) representing the cross probability, executing cross operation, dividing the cross operation into two types according to the position of the randomly generated cross point, and recording the position of the cross point as i:
(1) if the crossing occurs at the front n bits, the integral exchange is carried out from the ith bit to the last bit of the two individuals in a single-point crossing mode;
(2) if the crossing occurs at the rear n bits, in order to ensure the integrity and 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 crossing of the rear n bits are as follows:
step 2051, generating a random integer with a value range of [1, n-i ] as a cross length l, and marking the ith bit to the (i + l + 1) th bit in the parent individual as a cross part;
step 2052, newly building a child individual set, wherein the length is 2n, the front n bits are the same as the corresponding parent individuals, and the n bit to the (n + l + 1) th bit are the cross parts of the corresponding parent individuals;
step 2053, scanning the nth position to the 2 nth position in the parent 2 from left to right for the child individual 1, deleting the existing train number in the child individual 1, and sequentially filling the remaining genes into the child individual 1 to obtain the child individual 1; and similarly, operating the offspring individuals 2 to obtain the offspring individuals 2.
Step 206: performing mutation operations
To generate [0,1]X is a random number in between, if x < Pm,PmAnd (3) representing the mutation probability, executing mutation operation, dividing the mutation operation into two types according to the position of the randomly generated mutation point, and marking 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 ith departure interval;
(2) if the variation occurs in the last n bits, a random integer j with the value range of [1,2n-i ] is generated, and the values of the ith bit and the jth bit in the individual are exchanged.
After mutation operation, a new population is obtained, and the process goes to step 202.
4. The method as claimed in claim 3, wherein the calculation of the objective function in step 202 comprises the steps of:
2021, calculating departure time of all train numbers according to departure intervals of n front-bit trains of the gene codes and departure time of the first-class train to form a timetable, and extracting n rear-bit trains of the gene codes and recording the n rear-bit trains as an aggregate tripts;
step 2022, defining an empty cellular array for storing the train number chains, which is recorded as block, wherein each train number chain is an array representing a shift schedule of a vehicle;
step 2023, arranging the vehicle to execute a first train trip (1) in the trips, and updating a train trip set block;
2024, arranging the subsequent train numbers of the tries (j) in sequence, and giving priority to the used vehicles;
step 2025, calculating the connection time between the tries (j) and the tries (j-1), i.e. the departure time of the train times tries (j) minus the arrival time of the train times tries (j-1), and checking whether the connection time meets the requirementAndif not, go to step 2027, if yes, continue;
step 2026, calculating the total working hours and business vehicle hours of the train number chain after the trips (j) is continued, and judging whether the total working hours and the business vehicle hours of the train are satisfied according to the formula of the total working hours constraint and the business vehicle hours constraint, if not, turning to step 2027, and if so, continuing;
step 2027, arranging a new vehicle to execute the train number;
step 2028, updating the train number chain, and calculating the invalid rest time of the train number chain;
step 2029, judging whether all the vehicle numbers in the set tries are scheduled to be executed by the vehicles, if not, turning to step 2024, if yes, ending, and obtaining the number of the vehicles and the invalid rest time so as to obtain a target function;
step 20210, calculate the individual fitness value, i.e. the inverse of the objective function.
5. A method for automated bus schedule and vehicle shift scheduling as claimed in claim 3 wherein said step 204 comprises the steps of:
step 2041, calculating the fitness value f of each individualiThe relative fitness of the individuals is calculated according to the following formula, i.e. the probability p that each individual is inherited into the next generation populationi:
In the formula, popsize represents the population number of the genetic algorithm;
2042, sorting all the individuals in the population according to relative fitness;
and 2043, selecting the first k individuals with higher fitness according to the individual fitness by using an elite retention strategy to replace the k individuals with lower fitness, so that the algorithm convergence speed is accelerated.
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 true CN110991706A (en) | 2020-04-10 |
CN110991706B 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) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112884216A (en) * | 2021-02-04 | 2021-06-01 | 国网湖南省电力有限公司 | Method for calculating minimum number of vehicles in single bus line |
CN112967519A (en) * | 2021-02-01 | 2021-06-15 | 青岛海信网络科技股份有限公司 | Public transport means scheduling method, device and equipment |
CN117151313A (en) * | 2023-10-31 | 2023-12-01 | 杭州数知梦科技有限公司 | 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 |
---|
吕燕杰;赵宇;蔡鸿明;: "公交智能调度中行车时刻表编排算法研究" * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112967519A (en) * | 2021-02-01 | 2021-06-15 | 青岛海信网络科技股份有限公司 | Public transport means scheduling method, device and equipment |
CN112967519B (en) * | 2021-02-01 | 2022-05-13 | 青岛海信网络科技股份有限公司 | Public transport means scheduling method, device and equipment |
CN112884216A (en) * | 2021-02-04 | 2021-06-01 | 国网湖南省电力有限公司 | Method for calculating minimum number of vehicles in single bus line |
CN112884216B (en) * | 2021-02-04 | 2023-06-23 | 国网湖南省电力有限公司 | Method for calculating minimum number of vehicles in single bus route |
CN117151313A (en) * | 2023-10-31 | 2023-12-01 | 杭州数知梦科技有限公司 | Comprehensive multi-factor bus driving plan optimization method, system and application |
CN117151313B (en) * | 2023-10-31 | 2024-02-02 | 杭州数知梦科技有限公司 | Comprehensive multi-factor bus driving plan optimization method, system and application |
Also Published As
Publication number | Publication date |
---|---|
CN110991706B (en) | 2023-05-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110991706A (en) | Method for automatically compiling bus schedule and vehicle scheduling plan | |
CN111582691B (en) | Double-layer planning-based transportation capacity matching method for multiple transportation modes of passenger transport hub | |
CN104268722B (en) | Dynamic flexible job-shop scheduling method based on multi-objective Evolutionary Algorithm | |
CN110287564B (en) | Medium-speed magnetic levitation energy-saving running chart optimization method based on genetic algorithm | |
CN112257999B (en) | Self-adaptive large-scale neighborhood searching method for large-scale pure electric bus scheduling problem | |
CN109934364B (en) | Tool on-time distribution method based on genetic simulated annealing algorithm | |
CN114118799A (en) | Genetic algorithm workshop scheduling method based on virtual process | |
CN110598998A (en) | Automatic scheduling method for intelligent station crew members | |
CN111754039A (en) | Method for comprehensive integrated optimization design of pure electric bus network | |
CN113077086A (en) | Method for designing bus synchronous transfer timetable for connecting subway hubs | |
CN115471133A (en) | Workshop comprehensive scheduling system based on order management and rolling optimization scheduling | |
CN111461402A (en) | Logistics schedule optimization method and device, computer readable storage medium and terminal | |
CN110889596B (en) | Construction plan scheduling method and system for railway engineering line | |
CN115952896A (en) | Flexible job shop scheduling method based on material process alignment | |
CN115862322A (en) | Vehicle variable speed limit control optimization method, system, medium and equipment | |
CN113792989A (en) | Demand-driven shared sightseeing vehicle inter-area parallel optimization scheduling method | |
CN117371611A (en) | Subway train operation plan programming method, medium and system | |
CN113344336A (en) | Vehicle scheduling method and device and storage medium | |
CN113033928B (en) | Method, device and system for designing bus shift model based on deep reinforcement learning | |
CN114970103A (en) | Instant delivery path optimization method considering dispenser experience and random travel time | |
CN114331231B (en) | Method and system for scheduling public transport | |
CN116468469A (en) | Network taxi demand prediction method based on improved EMD-LSTM | |
Gholami et al. | Train routing and timetabling via a genetic algorithm | |
CN113536692A (en) | Intelligent dispatching method and system for high-speed rail train in uncertain environment | |
CN110516372B (en) | Electric vehicle charge state space-time distribution simulation method considering quasi-dynamic traffic flow |
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 |