Invention content
It is a kind of based on bidirectional research and evaluation function prune approach to provide proposition aiming at above-mentioned technical problem by the present invention
Public Transport Transfer method, this method can find relatively excellent, more full public transport in complicated traffic and map datum and change
Multiply scheme.
To achieve the above object, a kind of public transport based on bidirectional research and evaluation function prune approach designed by the present invention
Transfer method, it includes the following steps:
Step 1:The start site and terminus point that server is conveyed according to client, go directly as follows respectively
Circuit and special train routine calculation are once changed to before routine calculation, transfer and have the primary transfer routine calculation of walking, change to line twice
Road calculates, transfer for the first time has the transfer twice for having walking before the routine calculation of transfer twice of walking, second of transfer before
Routine calculation and the transfer routine calculation twice for having walking before transfer twice:
Wherein, straightforward line and special train routine calculation method are:
Calculate X (p)=Y (q) (1)
X (p) indicates that the circuit number for the public bus network gathered by start site, Y (q) indicate to pass through terminus point set
Public bus network circuit number;
If result is nonempty set, then it represents that have through riding scheme, obtain corresponding of intersection element in formula 1
Beginning site number I, by bus circuit number p and terminus point number J;
Once transfer routine calculation method is:
Website Hosting A1 (I, p, U) is denoted as all websites for including of each circuit number p in set X (I, p), it is right
All websites that circuit number q is included by bus before terminal in set Y (J, q) are denoted as Website Hosting B (J, q, V),
The set X (I, p) indicates that the public bus network gathered by start site, I indicate that the number of starting point website, p indicate line of riding
Road is numbered, and indicates that circuit number of riding for the first time, U indicate to change to site number, set Y (J, q) in the set of start site herein
Indicate that the public bus network Jing Guo terminus point set, J indicate that terminus point number, q indicate the circuit number by bus before terminal,
V indicates the transfer site number in terminus point set,
Calculate A1 (U)=B (V) (2)
If result is nonempty set, then it represents that have and change to primary riding scheme, it is corresponding to obtain intersection element in formula 2
Start site number I, by bus circuit number p indicate circuit number of riding for the first time herein, change to site number U, before terminal
By bus circuit number q and terminus point number J;
There is the primary transfer routine calculation of walking to be before transfer:
For changing to website U in each start site set in Website Hosting A1 (I, p, U), half is preset around search
Other bus stations within diameter range, other bus stations are denoted as Website Hosting A2 (I, p, U, M), and M indicates that transfer is got on the bus
Site number;
Calculate A2 (M)=B (V) (3)
If result is nonempty set, then it represents that having has the primary transfer Decision Making of Line Schemes of walking, V to indicate terminus point before changing to
Transfer site number in set obtains the corresponding start site number I of intersection element in formula 3, by bus circuit number p, this
Place indicates circuit number by bus for the first time, changes to site number U, indicates transfer get-off stop number herein, changes to website of getting on the bus
Number M, the circuit number q and terminus point number J by bus before terminal;
Transfer routine calculation is twice:
It is denoted as line by the public bus network of each transfer website U in the start site set in Website Hosting A1 (I, p, U)
Road set A3 (I, p, U, k), k represent second of circuit number by bus, for each circuit in line set A3 (I, p, U, k)
All websites passed through are denoted as Website Hosting A4 (I, p, U, k, S), and S represents second of transfer get-off stop number;
Calculate A4 (S)=B (V) (4)
If result is nonempty set, then it represents that have the riding scheme of transfer twice, it is corresponding to obtain intersection element in formula 4
Start site number I, circuit number p, indicates circuit number of riding for the first time herein by bus, changes to site number U, indicates herein
Get-off stop number is changed to for the first time, and ride circuit number k for the second time, second of transfer get-off stop number S, before terminal
Circuit number q and terminus point number J by bus;
There is the routine calculation of transfer twice of walking to be before transfer for the first time:
The public bus network that the site number M that gets on the bus is changed to by each station in Website Hosting A2 (I, p, U, M) is denoted as line
Road set A5 (I, p, U, M, k), all websites passed through for each circuit in line set A5 (I, p, U, M, k) are denoted as station
Point set A6 (I, p, U, M, k, S), S are second of transfer get-off stop number;
Calculate A6 (S)=B (V) (5)
If result is nonempty set, then it represents that having has the transfer Decision Making of Line Schemes twice of walking before transfer for the first time, obtain
The corresponding start site number I of intersection element in formula 5, circuit number p, indicates circuit number of riding for the first time herein by bus,
Transfer site number U is indicated to change to get-off stop number for the first time, is changed to the site number M that gets on the bus and indicate to change for the first time herein herein
It is multiplied by vehicle site number, second of circuit number k that rides changes to get-off stop number S for the second time, the circuit by bus before terminal
Number q and terminus point number J;
There is the routine calculation of transfer twice of walking to be before second transfer:
Get-off stop number S is changed to second for each of Website Hosting A4 (I, p, U, k, S), is preset around search
Other bus stations within radius, are denoted as Website Hosting A7 (I, p, U, k, S, G), and G indicates the line by bus before terminal
The site number of getting on the bus on road;
Calculate A7 (G)=B (V) (6)
If result is nonempty set, then it represents that having has the transfer Decision Making of Line Schemes twice of walking before second of transfer, obtain
The corresponding start site number I of intersection element in formula 6, circuit number p, indicates circuit number of riding for the first time herein by bus,
It changes to site number U to indicate to change to get-off stop number for the first time herein, second of circuit number k that rides, under second is changed to
Vehicle site number S, the site number G that gets on the bus of the circuit by bus before terminal, circuit number q and terminal by bus before terminal
Site number J;
There is the routine calculation of transfer twice of walking to be before transfer twice:
Get-off stop number S is changed to second for each of Website Hosting A6 (I, p, U, M, k, S), search surrounding is pre-
If other bus stations within radius, it is denoted as Website Hosting A8 (I, p, U, M, k, S, G), multiplying before G expression terminals
The site number of getting on the bus on fare road;
Calculate A8 (G)=B (V) (7)
If result is nonempty set, then it represents that having has the transfer Decision Making of Line Schemes twice of walking before transfer twice, obtain
The corresponding start site number I of intersection element in formula 7, circuit number p, indicates circuit number of riding for the first time herein by bus,
Transfer site number U is indicated to change to get-off stop number for the first time, is changed to the site number M that gets on the bus and indicate to change for the first time herein herein
It is multiplied by vehicle site number, second of circuit number k that rides changes to get-off stop number S for the second time, the circuit by bus before terminal
The site number G that gets on the bus, before terminal by bus circuit number q and terminus point number J;
Step 2:The start site and terminus point that server is conveyed according to client calculate separately out available in step 1
The required time of transit riding scheme, and time-consuming minimum transit riding scheme is recommended into client.
The present invention utilizes a large amount of circuit and website coordinate in virtual map, and city is predicted by above-mentioned transfer plan
People's riding scheme.Compared with the conventional method introduced in background technology, this method has that algorithm is simple, and calculation amount is few, efficient,
The advantages that prediction transfer circuit is complete;The invention utilizes the public bus network drawn in map and site information, double by using for reference
To search and evaluation function prune approach, some websites too far are filtered, avoid the calculating of excessive disabling the line, while according to tune
Degree system can obtain the operating condition of corresponding line vehicle, and in conjunction with transfer circuit, weight calculation and travel condition of vehicle calculate
Go out the transfer plan of citizens' activities.
Specific implementation mode
The following further describes the present invention in detail with reference to the accompanying drawings and specific embodiments.
A kind of Public Transport Transfer method based on bidirectional research and evaluation function prune approach of the present invention, it includes following step
Suddenly:
Step 1:The start site and terminus point that server is conveyed according to client, the data being utilized respectively in server
Library information (being plotted in the public bus network and site information in numerical map) carries out straightforward line and special train circuit as follows
It calculates, once change to routine calculation, the primary transfer routine calculation that has walking before transfer, twice transfer routine calculation, first time
Have before transfer walking change to routine calculation, second transfer twice before have the routine calculation of transfer twice and twice of walking
There is the transfer routine calculation twice of walking before transfer:
Wherein, straightforward line and special train routine calculation method are:
Such as Fig. 1, X (p)=Y (q) (1) is calculated
X (p) indicates that the circuit number for the public bus network gathered by start site, Y (q) indicate to pass through terminus point set
Public bus network circuit number;
If result is nonempty set, then it represents that have through riding scheme, obtain corresponding of intersection element in formula 1
Beginning site number I, by bus circuit number p and terminus point number J ignore the calculating if result is null set;
Once transfer routine calculation method is:
Website Hosting A1 (I, p, U) is denoted as all websites for including of each circuit number p in set X (I, p), it is right
All websites that circuit number q is included by bus before terminal in set Y (J, q) are denoted as Website Hosting B (J, q, V),
The set X (I, p) indicates that the public bus network gathered by start site, I indicate that the number of starting point website, p indicate line of riding
Road is numbered, and indicates that circuit number of riding for the first time, U indicate to change to site number, set Y (J, q) in the set of start site herein
Indicate that the public bus network Jing Guo terminus point set, J indicate that terminus point number, q indicate the circuit number by bus before terminal,
V indicates the transfer site number in terminus point set,
Such as Fig. 2, A1 (U)=B (V) (2) is calculated
If result is nonempty set, then it represents that have and change to primary riding scheme, it is corresponding to obtain intersection element in formula 2
Start site number I, by bus circuit number p indicate circuit number of riding for the first time herein, change to site number U, before terminal
Circuit number q and terminus point number J by bus, if result to ignore the calculating if null set;
There is the primary transfer routine calculation of walking to be before transfer:
For changing to website U, 350 meters of search surrounding in each start site set in Website Hosting A1 (I, p, U)
Other bus stations within radius, other bus stations are denoted as Website Hosting A2 (I, p, U, M), and M is indicated in transfer
Vehicle site number;
Such as Fig. 2, A2 (M)=B (V) (3) is calculated
If result is nonempty set, then it represents that having has the primary transfer Decision Making of Line Schemes of walking, V to indicate terminus point before changing to
Transfer site number in set obtains the corresponding start site number I of intersection element in formula 3, by bus circuit number p, this
Place indicates circuit number by bus for the first time, changes to site number U, indicates transfer get-off stop number herein, changes to website of getting on the bus
Number M, the circuit number q and terminus point number J by bus before terminal, ignores the calculating if result is null set;
Transfer routine calculation is twice:
It is denoted as line by the public bus network of each transfer website U in the start site set in Website Hosting A1 (I, p, U)
Road set A3 (I, p, U, k), k represent second of circuit number by bus, for each circuit in line set A3 (I, p, U, k)
All websites passed through are denoted as Website Hosting A4 (I, p, U, k, S), and S represents second of transfer get-off stop number;
Such as Fig. 3, A4 (S)=B (V) (4) is calculated
If result is nonempty set, then it represents that have the riding scheme of transfer twice, it is corresponding to obtain intersection element in formula 4
Start site number I, circuit number p, indicates circuit number of riding for the first time herein by bus, changes to site number U, indicates herein
Get-off stop number is changed to for the first time, and ride circuit number k for the second time, second of transfer get-off stop number S, before terminal
Circuit number q and terminus point number J by bus ignores the calculating if result is null set;
There is the routine calculation of transfer twice of walking to be before transfer for the first time:
The public bus network that the site number M that gets on the bus is changed to by each station in Website Hosting A2 (I, p, U, M) is denoted as line
Road set A5 (I, p, U, M, k), all websites passed through for each circuit in line set A5 (I, p, U, M, k) are denoted as station
Point set A6 (I, p, U, M, k, S), S are second of transfer get-off stop number;
Such as Fig. 3, A6 (S)=B (V) (5) is calculated
If result is nonempty set, then it represents that having has the transfer Decision Making of Line Schemes twice of walking before transfer for the first time, obtain
The corresponding start site number I of intersection element in formula 5, circuit number p, indicates circuit number of riding for the first time herein by bus,
Transfer site number U is indicated to change to get-off stop number for the first time, is changed to the site number M that gets on the bus and indicate to change for the first time herein herein
It is multiplied by vehicle site number, second of circuit number k that rides changes to get-off stop number S for the second time, the circuit by bus before terminal
Number q and terminus point number J ignores the calculating if result is null set;
There is the routine calculation of transfer twice of walking to be before second transfer:
Get-off stop number S, search surrounding 350 are changed to second for each of Website Hosting A4 (I, p, U, k, S)
Other bus stations within rice radius are denoted as Website Hosting A7 (I, p, U, k, S, G), ride before G expression terminals
The site number of getting on the bus of circuit;
Such as Fig. 3, A7 (G)=B (V) (6) is calculated
If result is nonempty set, then it represents that having has the transfer Decision Making of Line Schemes twice of walking before second of transfer, obtain
The corresponding start site number I of intersection element in formula 6, circuit number p, indicates circuit number of riding for the first time herein by bus,
It changes to site number U to indicate to change to get-off stop number for the first time herein, second of circuit number k that rides, under second is changed to
Vehicle site number S, the site number G that gets on the bus of the circuit by bus before terminal, circuit number q and terminal by bus before terminal
Site number J ignores the calculating if result is null set;
There is the routine calculation of transfer twice of walking to be before transfer twice:
Get-off stop number S, search surrounding are changed to second for each of Website Hosting A6 (I, p, U, M, k, S)
Other bus stations within 350 meters of radius, are denoted as Website Hosting A8 (I, p, U, M, k, S, G), and G is indicated before terminal
The site number of getting on the bus of circuit by bus;
Such as Fig. 3, A8 (G)=B (V) (7) is calculated
If result is nonempty set, then it represents that having has the transfer Decision Making of Line Schemes twice of walking before transfer twice, obtain
The corresponding start site number I of intersection element in formula 7, circuit number p, indicates circuit number of riding for the first time herein by bus,
Transfer site number U is indicated to change to get-off stop number for the first time, is changed to the site number M that gets on the bus and indicate to change for the first time herein herein
It is multiplied by vehicle site number, second of circuit number k that rides changes to get-off stop number S for the second time, the circuit by bus before terminal
The site number G that gets on the bus, the circuit number q and terminus point number J by bus before terminal, if result to ignore if null set
The calculating;
Step 2:The start site and terminus point that server is conveyed according to client calculate separately out available in step 1
The required time of transit riding scheme, and time-consuming minimum transit riding scheme is recommended into client.
In the step 2 of above-mentioned technical proposal, the sequence of server temporally from less to more multiplies available public transport in step 2
Vehicle scheme, which is listed, recommends client.
In above-mentioned technical proposal, when calculating the required time calculating of available transit riding scheme in step 1, vehicle traveling is every
It is determined as needing 1.5 minutes the time required to kilometer, is determined as 1.5 minutes the time required to every hundred meters of walking, one station institute of public transport driving
It takes time and is determined as 2 minutes, be determined as 1.5 minutes the time required to every hundred meters of walking, be determined as 5 the time required to transfer waiting time
Minute.
For circuit and website that above scheme is previously mentioned, a large amount of data acquisition is carried out in advance, builds corresponding data knot
Structure, the information such as storage site, circuit and website relationship, line information, while corresponding website and circuit are drawn in map;On
7 kinds of transfer plans are stated, bidirectional research and evaluation function prune approach are used for reference, obtain transfer plan;Through and special line scheme:Starting point
It is carried out at the same time effective website in seeking scope with terminal, secondly by the corresponding circuit of website, circuit and end that starting point is found
The circuit that point is found overlaps, as through or special line scheme;Transfer plan:Beginning and end is carried out at the same time in seeking scope
Effective website, secondly by the corresponding circuit of website, circuit obtains respective website, and the website of two circuit of starting point carries out
Match, an as transfer plan of two websites in search plan;Secondary transfer plan:It is similar with a transfer plan, starting point
After matching first time terminated line, the website of the circuit needs to match Article 2 circuit and the website of corresponding line, then with terminal
Website website is matched, and meet search range is secondary transfer plan;The transfer plan obtained according to appeal scheme is deposited
In a large amount of iteration scheme, the required time for calculating each scheme is needed at this time;
For special train, go directly, one or two transfer plan duplicate removals:
1, the through scheme duplicate removal of special train:Using the circuit in the first scheme (through riding scheme) as unique mark, choosing
Minimum a kind of scheme the time required to selecting.
2, a transfer plan duplicate removal:(there is walking before the primary riding scheme of transfer, transfer with second and third two schemes
Primary transfer Decision Making of Line Schemes) in two kinds of circuits (p-q), minimum a kind of scheme the time required to selection.
3, secondary transfer plan duplicate removal:With the 4th, 5,6, (transfer riding scheme twice is changed to for the first time for 7 four kind of scheme
There are the Decision Making of Line Schemes of transfer twice of walking, second of transfer have the Decision Making of Line Schemes of transfer twice of walking before, change to twice before
Have the transfer Decision Making of Line Schemes twice of walking before) in three kinds of circuits (p-k-q), minimum a kind of side the time required to selection
Case.
Again by dispatching system, the operating status of vehicle is obtained, all optimal riding schemes are finally obtained, according to correspondence
Scheme can calculate minimum walking, minimum time, least bus change and minimum stroke expense and nearest vehicle, go out convenient for civic
Row.
The content that this specification is not described in detail belongs to the prior art well known to professional and technical personnel in the field.