THE RIO DE JANEIRO SUBWAY SYSTEM-A CASE STUDY IN APPLYING THEORY TO PRACTICE MOSHEFRIEDMAN Departmentof Mathematics.Arizona State University,Tempt, AZ 85281.U.S.A.
and CARLOSA. G. CORDWIL IBM Brazil,Rio de Janeiro,Braxil (Received 13 January 1978;in revised~onn 30 October 1978) Abstract-A case study of translationof theoretical developments (Friedman, 1975; 1976) to implementation proceduresis outlinedwith specific referenceto the Rio de JaneiroSubway System. Withinthe overall framework of establishingthe time scheduleof trips of a single line that minimizesthisaveragewaitingtime of passengerswith possible generalization and extension to multi-line network, the present manuscript has the limited aim of developinga time table and determiningthe minimalnumberof trainsrequiredto keep up a given schedule of trips of a single line. The incorporationof a new ad-hoc procedureof “inclusionand exclusion trips” to and from an intermediateregulatingstation is a novel feature not included in the original FriedmanModel. This supplement characterizes an importantphysical attribute of the Rio de Janeiro System, namely, the limited train storage capacity at the terminalstations which is offset by virtualunlimitedstoragecapacity at the intermediateregulating station. The case study has generateda procedurefor creation and manipulationof large data bases in real life applicationsencounteringpracticalconstraintsusing a theoreticallysound set of efficientalgorithms. 1. lNTRoDucrtoN
Public transportation systems have recently gained increasing attention from operations research analysts (see, for example, Barat, 1975; 1976; Lampkin and Saalmans, 1967). The purpose of the present article is to report on a successful completion of the initial phase of a large scale application of a theoretical model to a real life network. The theoretical foundations have been developed for IBM Corporation in the general framewlrk of Project GADS, and were computerized on a low scale with an interactive man-machine approach. The results were partly published (Friedman, 1975; 1976).The application, which is still in progress, is being carried out on the Rio de Janeiro Subway System, mainly by C. A. G. Cordovil of IBM Brazil. It should consist of three principal phases. The first two cope with a single line situation, and the third one will attempt to extend them to a multi-line case. Phase I, which is already completed and to be described henceforth, is engineered to determine whether any given time table of trains is legitimate in terms of the physical attributes of the line on hand. Phase II will be geared at selecting the particular trains’ time schedule that minimizes the passengers’ average waiting time for a train. For this end more statistical information concerning passengers’ usage of the line, over a general day’s period, is still necessary. As it appears, the principal contribution of phase I is in overcoming a deeply rooted opinion by practitioners that abstract mathematical models are useful only as academic exercises for journals. Although the theory has not been implemented per se, it has indeed provided insight and a deeper comprehension of the problem. The original
Friedman model has been somewhat modified, by an ad-hoc procedure of “inclusion and exclusion trips” to an intermediate regulating station, and adapted to the particularities of the Rio de Janeiro Subway System. The theoretical adjustment is modest, and it should be, conceived that the considerable value of phase I hinges on the challenging of a big, real life network. The creation and manipulation of the large data bases, their transfer to an automated environment, the large scale computerization of the existing algorighms, and the ,)rchestration of the entire implementation should not, moreover, be underestimated. It is hoped that the dissemination of this information will prove helpful and be conducive to future similar operations on other public transportation systems. 2 THERto DEJANEtnOSUBWAY SYsrEM To facilitate understanding of the theoretical developments that will be given below, we first delineate briefly the network on hand. The Rio de Janeiro Subway System should be operative in 1979 and would initially consist of a single line serving I5 stations. The trains will traverse on pre-scheduled trips between the terminal stations Botafogo and Saenz Peiia. These stations have limited train storage capacity, which is different for active and non-active time periods of the line. An intermediate station, named Central do Bras& has the role of a regulating station. It can store all the trains serving on the line, it has an attached workshop for maintenance and repairs, and most importantly, trains can be rerouted to any direction from it. An additional role is to receive new trains to the line. The other 12 stations have no storage capacity and serve only for loading and unloading of passengers. 125
M. FRIEDMAN and C. A. G CORWVIL
126
Schematically, the Rio de Janeiro underground railway looks as follows:
cenlml do Bmsil
soemP&a Smrova of tmia Fig. 1. Schematic view of the Rio de Janeiro subway system.
The train storage capacities of the terminal stations Botafogo and Saenz Peiia when the line is not active are 9 and 3, respectively. These capacities diminish to 7 and 2, respectively, when the line is active. The reason is obvious. While operating, the stations need more space for receiving and dispatching trains. There are altogether 27 trains on the line, and each of them is capable of taking 2000 passengers. The travelling times between adjacent stations are constant and are equal both ways. Table 1 lists the travelling information. . On its trip a train stays for 24Osec in the terminal stations, then stops for 50sec at the regulating station and for 30sec at any other station. Due to physical conditions a minimal time interval of 30sec must separate between any two consecutive trips. It turns out that a train spends 895 set travelling on a trip and 410 set stopping at the 13 intermediate stations, a total of 1305sec. To determine the time interval for which a train is occupied by a trip, we must add the 240 set of obligatory parking in the terminal station; hence, the total occupation time of a train on one trip is 1545sec. The time intervals between the instants a train leaves Botafogo, Saenz Peril and Central do Brasil on one trip are 831 and S24sec, respectively. Similarly, the time lapses between the moments a train leaves Central do Brasil and is available for a new trip at Botafogo, Saenz Petia are 1021 and 714sec, respectively. Obviously, the latter two numbers may be augmented by an additional arbitrary factor which signifies the lee-way given to the planner. Naturally, these decision variables cannot
exceed some prescribed number that represents the lower bound on the level of services rendered to the public by the underground railway. 3. TBEORETICAL. DEVEL0PMENTg
The ensuing developments are an abstraction based on the system described in Section 2. Consider a one twoway (subway) line that has separate railways for the two directions, and that serves a given number of stations in both ways. Denote a general direction, and hence its starting terminal, by i, i = 1,2, and suppose that terminal i can store er,, eiz trains when the line is nonactive and active, respectively, where both eil, eiz are smaller than the total number of trains traversing on the line. There is an intermediate station, called the regulating station, that is capable of storing all the line’s trains, and from which trains can be rerouted. The remaining stations of the line have no train storage capacity and are used only for loading and unloading of passengers. Denote the starting instant of service at terminal i by X, and the total occupation time of a train on a trip that has started at terminal i by 4. If we index the regulating station with the number 3, then &p will denote the time duration after which a train that has left station i can depart from station i’. i# i’, i’ = 1,2.3. The service time period at terminal i is divided into k segments, where Xii is the time lapse between two consecutive departures and h is the number of departures of segment j, j = 1,. . ., /i. It turns out that the length of segment j of the ith direction is 6, = figif, and the total departures’ time at terminal i is
Table 1. Travelling times between adjacent stations in the Rio de Janeiro subway system Travelling time (set)
Station 1. Botafogo 2. Marques de Abrantes 3. Large de Machado 4. Catete
98 58 54 56 75 47 57 45 51 78 62 82 59 73
5. Glbria 6. Cinelandia 7. kg0 da Carioca 8. Uroguaiana 9. Presidente Vargas 10. Central do Brasil 11. Cidade Nova 12. Es&o de Sb 13. Afonso Pena 14. Engenho Velho IS. Saenr Peiia Total:
895
Consequently, the line is operating during the period [Tr, Kl, where TI = ,rni: ( Ti) - . and T, =
1”~
-.
(Tr + &I.
The quantities /i, hi, xi,, j = 1,. . .,/i, i = 1,2, which are designated to accommodate the passengers’ varying density during the line’s active period, are the decision variables in phase II of the application and should be established so as to minimize their average waiting time
The
Rio de
Janeiro
subway
for a train over the period [T,, I”,]. For this end, however, more statistical information concerning the passengers’ service demand for the line is still necessary to enable the implementation of the existing theory (Friedman, 1976). Nonetheless, in phase I these quantities are taken as given and are checked for their legitimacy, namely, whether a given set of values {Ji,fii, xii} is operable and complies with the specification of the line. The rapid fulfilment of this task is the principal input, besides the aforementioned statistical information, to phase II. The variables xi, are bounded from above the below, i.e. A, c xii 5 AZ, where A, signifies a physical condition embedded in the line, and A2 represents some level of users’ satisfaction. Usually, xrj is going to be some multiple of A,, xii = kA,. for a particular k = 1,. . ., K, where K is the greatest integer such that KAi 5 AZ.Obviously, k may or may not change over different segments. The number of scheduled trips from terminal i to the opposite one, i.e. 3 - i, up to the end of the jth segment is
and the total number of scheduled trips from terminal i is fi = r;,. The time table of trips from terminal i to terminal 3 - i, determined by the set of decision variables {Ji,fir. xi,}, is given as follows: yil = Ti, i= 1,2 yir=yLI-,+Xii,
(1) j=l,...,
f~j_1
Ii,
i=1,2, (2)
where Jo=o. The corresponding time table of trains ready for departure from terminal 3 - i after arriving from terminal i is given by d+i,l = yip+ &, I = 1,. . ., 8, i = 1,2,
I=1 ,..., fi,
i=1,2.
127
case study
We proceed to formally analyse these situations. The number of trains arriving at terminal i from the opposite terminal 3 - i during the time interval (y+,, yiJ, and ready for departure, is F,- i
he =
c ‘=I
c~,~, I=1 ,..., fi,
i=1,2,
(5)
where, Lit,.=
1 &4Y,.l-1,
Yul
0 otherwise.
(6)
The inventory of trains at terminal i after the Ith departure is calculated recursively by Aa = max (Act-1 + hit - l,O),
I = 1,. . ., E,
i = 1,2, (7)
where Aio is its initial given stock before the first trip, which must satisfy
If there exists a pair (i, I) such that Aa + hit+, > ei2, the excessive trains must travel immediately upon arrival to the regulating station. The number of such exclusion trips is Au + hi,+, - ei2, and since a minimal time interval of A, units has to separate any two consecutive trips, the inequality Ai, + hivl+l- ei2I [(YU - y&/&l-where Ial is the largest integer smaller than a if a is not an integer, and (a] = a - 1 if (I is an integer, for every a 2 O-must be satisfied. Note that this definition simply stands, when interpreted in the preceding inequality, for the maximal number of trips between yLI_, and yu that have a headway of A, time units. If this equality is violated, then the time table of trips determined by the set {Ji,f,,, xii} does not comply with the specifications of the line, and is consequently declared illegitimate and is discarded. Now, the total number of exclusion trips, provided the above inequality holds for every pair (i, I) for which Ati + hi,+,> en is
(3)
and similarly, the time table of trains leaving the regulating station after arriving from terminal i is &=yit+iip,
system-a
(4)
There are two reasons for augmenting the time table of complete terminal to terminal trips with partial trips from a terminal station to and from the regulating station. The first one is that the predetermined set {Jitfij, Xii} may bring about a train stock in one of the terminals that exceeds its storage capacity. In this case “exclusion trips” from it to the regulating station must be inserted. The second reason is an eventual lack of any train at a terminal to carry out a scheduled trip. In this case an “inclusion trip” from the regulating station to the appropriate terminal must be added.
where 1 Ae + hi.!+,> en 4r =
0 Ail + hi&+,I ei2.
(10)
Notice that by definition no exclusion trip uses a new train that has not been used before and that these trips may serve the passengers. The other extreme case is where there is a pair (i, I) such that AL,-, + hu = 0; namely, there is no train at the terminal to carry out the scheduled trip. In this case an “inclusion trip” from the regulating station to the terminal must be programmed. This trip uses a new train from the stock at the regulating station and obviously can also serve the passengers. If it happens that the current stock at the regulating station is zero, the time
M. FRIEDMAN andC.A. G. Comovrt
128
table of trips determined by the set {Il. fii, x,,} is declared illegitimate and is discarded. The time table may also violate the specifications of the line when the difference between the departure instant of the inclusion trip to at least one of the trips between which it is inserted is smaller than A, for all possible insertions. The total number of inclusion trips, provided the time table is legitimate, is
(11) with 1 AL,-,+hU=O 5u =
(12)
0
otherwise. The total number of trips determined by the set {Ji,fii, Xijl is NT=NP+NE+NI,
(13)
where Np is the number of complete terminal to terminal trips, i.e.
T(Z)-service starting instant at terminal Z. Z(Z)-_occupation time of a train on a trip that has started at terminal I. TEMPV(Z,ZZ)-time duration after which a train that has departed from station Z can leave station ZZ,Z,ZZ= 1,2,3. FREQ(Z, +-number of trips of segment J at terminal Z. X(Z,Z)-time interval between two consecutive trips of segment J at terminal Z. The output of the program prints, by terminal station, the above information, the time table of terminal to terminal departures, the time table of exclusion trips to the regulating station (HVPCB), the time table of inclusion trips from the regulating station to the terminals (HVCBT). the total number of trips and the minimal number of trains needed to maintain the time table. Trains that arrive at a terminal station after their last departure are routed back to the regulating station, when necessary, for night parking. Since these trains do not take passengers, these trips are not included in the time table.
2
Np
=
c
E,
(14)
-I
NE is the number of exclusion trips from the terminals to the regulating station given by (9), and Nz is the number of inclusion trips from the regulating station to the terminals given by (11). The minimal number of trains to execute all the scheduled trips NT, is obtained by varying the time horizon from Tr to T, and keeping track in every instance of the number of vehicles which is involved with the prescribed time table, i.e. the initial stocks at the terminals plus the number of inclusion trips from the regulating station minus the number of exclusion trips from the terminals to the regulating station. The number computed for a particular instant is constantly compared to the previous one, and the new value for the next comparison is the largest of them. The final answer is obtained, of course, when the varying time horixon has reached T,. Obviously, if at some moment the number of necessary trains exceeds the number of existing trains, the time table generated by the set {J,,fi,, xi,} is declared illegitimate and is discarded. 4. THE COIbfFmzu
5. FxAMF%W The examples of the actual runs of the computer programs are basedupon the data given in Section 2. The time is given in seconds. Example A. The following input has been used. Terminal l-ESTQR( 1) = 8 ESTQM( 1) = 7 LSEGM( 1) = 6 T(1) = 14,400 Z(1) = 1545 Terminal 2-ESTQR(2) = 3 ESTQM(2) = 2 LSEGM(2) = 6 T(2) = 14,400 Z(2) = 1545. The segments are identical in both terminals having the values: Frequency (F(Z, J))
Time interval (X(Z, Z))
8 10 10 6 10 8
450 230 360 540 270 450,
PROGRAKS
The simple formulas of Section 3 have been programmed on a large scale in the FORTRAN language. These programs are capable of accommodating a considerable range of situations. The computer work consists of a principal program (NMVLT) and two subroutines (HlCB2 and NOMIN). The input variables are: ESTQR(Z)--initial stock of trains at terminal station 1.
ESTQM(ZWrain storage capacity of terminal station Z when the line is active. LSEGM(Z)-number of segments which the service period is divided into at terminal station 1.
I
with total operation tune of 19.040sec. During the operation, terminal 1 has partially used its stock, getting. it down to a minimum of 2 trains. No exchtsion or inclusion trips to it were necessary. Terminal 2 has used its entire stock of trains, and 4 exciusion and inclusion trips to it had to be organized.
The Rio de Janeiro subway system-a Example
B. In this
example
the following
input
has
case study
129
Example C. We now use the input:
been employed.
Terminal I-ESTQR( 1) = 0 ESTQM( 1) = 4 LSEGM( 1) = 5 T(1) = 10,800 Z(1) = 1545
I-ESTQR( 1) = 6 ESTQM( 1) = 7 LSEGM(1) = 4 T(1) = 14,400 Z(1) = 1545
Terminal
Terminal 2-ESTQR(2) = 0 ESTQM(2) = 2 LSEGM(2) = 4 T(2) = 14,400 Z(2) = 1545.
Terminal 2-ESTQR(2) = 3 ESTQM(2) = 2 LSEGM(2) = 4 T(2) = 14,400 Z(2) = 1545. The segments are not identical and have the values:
The segments are: Terminal 1 Time interval (X( 1, JJ) Frequency (F( 1,J))
Terminal 1 Time interval (X( 1,J)) Frequency (F( 1, J)) 8 10 6 10
10 20 6 15 10
450 360 540 270,
Frequency (F(2, J))
360 180 540 180 360,
Terminal 2 Time interval (X(2, J))
10 20 6 15
360 180 540 180.
Frequency (F(2, I))
Terminal 2 Time interval (X(2, I))
6 10 10 8
The total operation time, however, is equal to 13,140 in both ways. During the operation, terminal 1 has partially used its stock, and 8 exclusion trips to the regulating station were necessary. Terminal 2, on the other hand, needed 20 inclusion trips from the regulating station. The minimal number of trains required to maintain the time table is 20.
540 270 360 450.
The total operation time is 16,740set in terminal 1 and 13,140set in terminal 2. Terminal 1 needed 21 inclusion trips from the regulating station, whereas terminal 2 required 21 exclusion trips and 1 inclusion trip. The minimal number of trains to keep up the time table is 19.
Table 2. Estimated numbers of peak hour passengers travelling among the stations of the Rio de Janeiro subway system
l 2 3 4 5 6 7 8 9 IO 11 12 13 14 15
l
2
3
4
5
167 261 312 537 47 124 104 1605 350 645 55 23 788
83 ‘41 328 1283 52 29 317 75 19 -
29 268 101 478 29 247 7 I 1
50 124 62 105 102 51 318 43 66 28 23 338
360 37 130 75 66 31 499 62 152 56 37 650
6
7
8
1578 1458 889 57 576 176 459 673 112 153 818 508 134 375 108 80 38 84 1465 2413 1954 86 121 222 383 838 1564 222 333 309 164 247 242 367 916 2416
9
IO
183 49 47 41 62 82 251 136 6% 102 66 1806
134 76 215 141 124 315 426 273 17 29 25 119
11
12
202 259 12 36 101 78 69 101 127 150 94 36 49 153 60 78 55 164 129 111 86 241 448 2583
13 139 11 117 42 27 I 3 25 21 72 98 199
14
15
95 248 10 89 . 71 37 10 66 14 41 I 108 3 266 7 300 3 276 70 284 70 361 419 5195 2273 -
hf.
130
FRIEDMAN
and C.
Acknowledgements-The authors are indebted for the help and supportfurnishedduring the executionof the applicationto Mr. JacquesDelormeand to the Directorsof Planningfor the Rio de
6. CONCLUSIONS
Phase I of the application to the Rio way system determines whether a given
de Janeiro sub set of frequencies of time intervals of departures at both terminals complies with the specification of the line. If it does, the computer lists the complete information concerning the established time table. This phase, especially its rapidity aspect, is vital for phase II, which has to pinpoint the particular time table of trains that minimizes the passengers’ average waiting time for a train throughout the active period of the line. For this end more statistical information concerning the passengers’ movement is still necessary. Part of the data is already available and is given in Table 2. Several more tables like this wilI enable the application to phase II. This will be reported affer completion in a forthcoming paper.
CCR79AN
IV
G
L&EL
21
::::
2%
CC06 toc7 coo9 C~qJfg
..
_
. -.
10
co11 co12 0013
5
00 15 cc14
_.
15
9% cc19 C”30 co21 co22 CO23 CO24 co25
2a
tion problem encounteredin a public transportationnetwork. Transpn Res. 9.203-204. Friedman M. (1976)A mathematicalprogrammingmodel for optimal schedulingof buses’ departures under deterministic conditions. Transpn Res. 10.8340. Lampkin W. and Saalmans P. D. (1967) The design of routes, service frequenciesand schedulesfor a municipal bus undertaking: a case study. Ops Res. Quart. 18,375-397.
._. DATE
=
.-
25 30 35
t: -
50 5S 60 .65 Tn ,”
. .-.
ITOSS-
23/21/49 J
--
-- -----tNOf21.
NT=0 NTV=O E(1 J=ESTORflJ ~f2J~,ZS~W)~QJ___~_._
hVELf WELf IFfYf
__
1 J=o 2 J=O l.lJ-Yf2.1)
,Ot.rJ
-
.__
JS.5.10
_.
--.
._
15 .._-
_.
._
-
.-
.._ - _-..
-.
L( I J=l Lf2J=l l(r3-I CTA a..
.-Ye. Cnrrrll
q::76 CO28 0029 0030 COll CO32 0033
_..
_..
-v
IFfWPCBfIOlA.Lf IOTAJJ J30.30.25 EXCLUI =I FETI~A=EflOfAJ-A(IOTA.Lf IotAJJ ~FtRETtRAJ35.40.43 -------.----EcIaTAb=o RET IRA=0 to TO 45 Et 1f’JFAJ.AttOFA& ftOTAJt -.-----.-NNOVf IOlAJMlET fRCtCUIZ( IOTArLt IOTA) IF IhNOVfIOtAJ-NVELt XOTA J JS5.50.50 NSt IOTA)=NNOVt IOlAJ ---.--.---. -60 -w-66NSf IOlAJnNVELt kVELt IOtAJlNNCVt IFf ICTAV-ltJtAJ70 IOTAVItfTA-GO 7C SO LIT”*LII .-.
-.-
1OlAJ IOTA) hS.70 -. .---.
----.
--- ..‘+NVELf J-EXCLUI
--.--
-.
_
IOTA
_
.._
_
J
-------
.-...
IFI MNStlJ-NStIJ J71.72.72 -Zr-wNS.‘&k=s*S+++-em----_72. IF f YNSIPJ-NSf PJ Jl3.74,?4 73 WNSf2J=NSf2J 74 NT = NSf IJ + N4f :I _. ~. ._ .--_NS( J.,
[email protected]________ ____ . . . NS(ZJ=O IFfLl-NTVl7S.BO.tO 75 NT=NTV .--. *o_ct fcT*J~~~~A,+)--_________-.----IFtYffOTA.LfXCfAJJ-YfK.L~KJJJlOS~fJS.90 65 10 l&V= 1OTA . co 10 105 90 tOfbru--.- 95 tFf INOfIOTAJ-L;l;~LJJ;~~.2~.20 100 IOTA=?--IOTA GO 10 20 105--1FtY4IOTA.CftCTAJJl,,O.,~1)+95 lFfYfK.LfKJJJ 115.115.95 L hit 110 II 5 hYV iii MNjilJ-NStlJ Jl2~,125.J2!5 120 YNSfI J=NSll J IFf MNSl2J-NSf2J Jl30.135.1& 125 MNS(ZJrNSf2J 130 c NT = NSfIJ + ?.StiJ IF tUl-NT-W 140+ 14f. 145 lb6 NT =NTV 145 NSfIJ = YNStlJ hSt2J = YNSf2J SETURN ~EN0
--.
.___+---___.v_
%32 CO44 co45 CO46 :::B 0049 ccso CC51 co92 (CE3 OOCO cc55 0056 CC57
_. _.
.-
::5”; CO60
CO6 1 coc2 COCl (Cfb qqes tc66 CO67 CO68 CC6S co70
Barat J. (1975)Estrutura metrouolitauae sistemade traasuortes: estudo do case Rio de ~Jaueiro.Motwgmfia Nb. 20, IPEA/INPEB. Barat J. (1976)Politica de desenvolvimentourbauo: aspectos metropolitanose locais. Monogmfia No. 20, IPEA/INPES. Friedman M. (1915) On a rapid calculationof a certain enumera-
NOYIN
’
IolAv-1 GO 10 10 IOTA=? . . ._ IO,,+2
co14
co40 ..-504L.
Janeiro UndergroundRailway,ProfessorsStelio Roxo and Fernando L. C. MaeDoweBda Costa
SUI3fiCUTIN NOMIN ( ES~IR,A.OUlZ,HVPCB.Y~~ND,NS.Nl lNTE6ER-ES~BRfiJrEf2J.EXEtWt~~~t-iRlrrAf2~i00JrOtl-i2f2~1OOJ DIWNStCN NVFL~~J~Y~Z.~OOJ.L~~J~~VPCD~~.~OOJ.NNOV~~J.NS~~J. 1r(HSf2 J WNSflJ = 0 .~.~.. ._ wNSf2f t 0.---
CC01
no
A. G. CORDOWL
-_
!”
-._
. . . . _____
._________
_.-_
__.
_
_____
._.
____-
.___.
.___.._.
---
.___
_ _
The Rio de Janeiro subway system-a FCQTR
‘AN
.. IV G
Lb&L.
21
CL... ‘,;,m: @OOl
l
*-._.e\*....Ul-.*..
R -0
T--+--N-
SUECOUTINE
c***** --G .-C
.. .
A-
case study
.-. ., *. . ” ._..*._.. _. -. MA 1N ‘HlCBi?’
-. -
131
. DATE
. .I ._.._ = 77055
-- AL6ORiTMO
.-_c_.___.“. 231;
IA-
1 /O’b
l ****
.
--
.
l ***.
~lC@2(T,X.FQEO.Z.fEMPV.EST0R.FSTDU.LSEGN[
c
***** --DETESMINACAG 00 UUYERO-MINIMO--DE-vFIEULOS +(ECES~AI?[D+-PIRA L OPEQACAO DE UHA LINHA DE TRANSPORTES, COY EX -4 -cLUSoEI NOL TERMINAIS E INCLUSCFS DE HORAR[oS NA CEN4 : -TRAL 00 RRASIL PAUL. ATENOIHENTO NOS TERYiNAiS. l c++**, _ _. _ _ _-. __ _ . . .~ -.. _ _ --._ _.. +.++* coo2 INTEGER CONTF.COFTS.ALTEQ(Zl .H(Z. lOO[.A(2.100[ dJU12(2,100;;~0NTE 1 ESTOR(2) rESTOM(2[,POlNT.FREG(2.24[.ALT~RA(2[,PO[NlV.PR,S[~~ NAO(2[ ------~OiW*(biC*--X-42.24~.LSEGY(ZCrDC%~2.[OG~+TEYPVt2r3~-.TfZI+ZI2i.Y42.ld3--coo3 ~~0~2.100[.NS(2[riN0(2l.CiCLOf2[.HVPC9[2.100[~H~CB7[2,10 : 018) ~~UBTA(2~100[~NV[AGf2[.NiCBTl2[~NEVPCR(2[.LiYiNF(~[ .LiMSUFtB[ cl***: . _. ..~.. _ ..- -_. _ -._. _ -l **** * 4 iNICiALiZACAO l[*Ji’ COOIGO DE INPRESSAO. C * C 2) IERAR TO0OS OS VETORES. c***.* l ***+ --... ------_---_-..-_ _. _ A J ICb/_ .___ -0004 coot 00 5 J I: 1.2 hS(Jl = 0 COO6 coo7 CiCLO[J[ = 0.0 -.-.. .-___.. .--... ._..-_..._.-_.. -__.__ -. _ [,.D(J)_t_O . ._. COOR CCC9 00 5 1=1.100 COI’) Y(J.i[ = 0.0 O(J.1) = 0.0 co11 ..-_. .._ ._ _--_-.~~,.r_I)_2~,~------:“b::: A(J.1) = 0.0 CC14 OCBtJoi[ = 0.0 CUiZ(J.1) = 0 _.__ __ - _._._. ..-_. __ .._ __ _.._. _.. .~ :::z HV=‘CB(d,#[ -=- 0.Q HVCBTA(J.it = C.0 :x:: 00 C ii = 1.B HVCBT(J.i.iiI * 0.0 ---.-.___.__. -5 -&DhZlhUE--_ s:;x 00 11 1 * 1.2 co21 INOfA2 = LSEGU(i I ::z: CO ii ii = i.IWJlA2 ._. _. . _~._. co 24 I[ ---CiCLO(IC,---CiCLQ(i[ 4 X( l.iiJ 4 FRF0ti.I.[I ;*..** l **** * C IMPRESSAC COS DAOFS FORNFCIOOS. ,****: l **** .____ CR [TE(+&r[~)_._._--___. _ _______ _ ..___-._.___-.-_~.__._.____ ___ co25 12 FORYATflH[.‘OElEF~:NACAO DO WLFRC M[N[NO DE VEICULOS NECESSARiOj 00 2* [PARA A DPERACAC CE UMA LtNHA DE TRANSPORTES.‘,f//r* SENTIOO OE 1 P 2ARA 2 -‘s/[ cc27 ~?TE(J~~-~~~~~OJ~T~~~~E~C~O~~~~ESTOR~I~,ESTOM~~[-----. i-4 002.3 FOWAT(lX.‘* TEHFO DE Vi4GEM = l .F12.5.’ l INSTANTE DO INIC IO OA ~3 [PERACAC = ‘.F12.5.’ * CICLO CE OPERACAO = ‘.Fl2.5.//.lX. ** ESTO,JJ ‘.12,//.1X. 1: FSTOOUE NAXINO PiR 2E NC INICIO 01. OFERACAO.(EM I) = I- *2r~,)_-_--___----_------__ .___.-.__..._. -- ---)lri 1 fOGSY-YeViYELTi3.rcc29 -. pig =19 LSEGW(i[ I = 1.2 co30 CO 16 J = 1.11 co31 WRi1E(~ir[S[i.J,~(i.J[ri.J~FRFO[i,J[ a022 15 FORYAT(lX,‘X(*,Il.‘.‘.i2.*l = ‘.F12.5.C%,‘FRE0(‘.[1.‘.‘,12,*[ = 0, co33 (IfI.,, co34 *~~-_i_~-_).i~r~~,l 3 ._ ._. _ 0025 URiTE(Ji,lB[Z~2l .T[2[ ,CiCLO( 2[.ESTOR(2[.ESTOU(2[ :R’ 88;‘; FOFLAT(lX,//.[X, ‘SELTIOC DE 2 PAPA 1 -‘,/I,’ + TEMPO DE VIAGEM = * l~F12.5~* 4 INSTAPlE 00 IhiCiC DA OPERACAO = ‘rF12.S.’ + CICLO DE J ZPERACAO = ‘.Fl2.‘,11.1Xr’* ESTOOUE NO [NICl C 01 OPERACAO fEW 2, = 3’,[2.//,lX, *. ECTCOIK WAXIWC PEQW(TiOO EM MOVIMENTO = l .12,//[ 19 COhTl hUE CO38 *RiTE(Ji,lQlI s:ix IQ1 FUFb’AT(1X.,,/,lX,’ SENT100 [‘*I[ fZ***** ***** . I E l DETFCHINACAO COE INSTINTES nE PARTIOA c**r*+ l **.* co4 1 IOTA = 1 70 co42 CONTF = 0 co43 CON15 = 1 CC44 Y(iOTAel[ = T([OlA[ CO45 iNC(iOTA[ = 0 -.
* a&?r-Iv*
-_--OAT
_.
-_
_. ._.___
FORTQAN CO46 co47 CO48 cc99 co50 CCC1 COE2 CCC3 CO54 co55 CC56
G
DATE
LkVEL + 1 iNO(IOTA[ = iNC(iOTA[ _. ._. . ._. J P [NO(IOTA+ -~ COhTF = CONTF l I INOK = J + 1 I( IOTA .J) + X( iOTA,CONTS[ v( IcTA~INO)O= [F( CDNTF --l=QECC lClA.CONTS8 [---25..3&30---I---~ LSEGN f IOTA) [ 35.40.40 IF (CONTS :~cI:“F I :OhTS l 1
25
3d 3s &cI
___ _
c,,:;:
IV
S%
~.
48 I-***.*
c
C C C C+**t*
GO 10 -26siF( IOTA 2[4:.4[.45 IOTA = 2 GO TO 20 -..- lNBl& 4.-INB( I) 4 IND(Z[ = iNO(2) +
.
OETERYlhACAO
*
DA
I1
__-._-
--
DO: TEMPOS ONOE A.) EY~l.ORIUNDDS e[ EM 2.‘YQiUNOCS 0iSPO~iBiLi0~0E NA CENTRAL .
-
__
=
77055
23?2[/49
-
---.
_~.______-.
-------__--
***a* TEREMOS VEICULOS DiSPON[VE[S: DF -2 .~ _.~.. -.___ DE 1. E 00 BRAS~L.
-.
_
; L l
***+*
*
132
M.
and C.
A.
G.
CORD~VIL
so
CO61 cac2 CC63 0064 0065 CC66 Cot7 (CFP
CC69 cc7c co7 I cc72 :::a cc75 CC76_
_.-.
:::l: co79 co90 COil CO62 cce3 OOE4 fCE5
COP6 coe7
coee COR9 COY’) cc91 co52 co93 CC54 cc55 fC56 CO97 costi
~___
CO44
::i3 Cl02
K = A_LOSA_-. - _._-. -_,_ .-.. INOK_ = fiti iKI 00 55 J = l~t&OK Cf tOlA.JI = VlC..I 4 2Iw.I 55 0CRIK.J) = IlK.Jl + TEYPVfK.3I IFI IfllA tI60.6I.EO 60 IOTA = I m 10 co c***** --_-_-.__. ..__.._. --_---_-_--._---_._ __._ .*I*** _ l l OElERYt hACA0 00 NUYERO OE VEtCULOS OUE CHECARAH EM I fOU 21. I I VINOOS DE 2 fOU II E WE POOEY ATENDER A PARTIDA 00 VEICULO ‘L’ DE I fou 2). C _.. ..~ CSt.L* tt**. -fS K = 3 IOTA J = I HtfOTA.tI = 0 _-.. _.lFI_AG_=-a-_ _-.____________-__._____ ___________ I NO lA2 INC ftClA) 00 e5 L : l.ILOT12 CtlNTE = 0 .-.. lYOLztAn~U_-_ _ . .. - ___.-----. __-_. -.----.-_._._--._.. IF I tFLAGI68.62.6l 00 75 LL=J.tNCK 66 IFI OftOTA.LLI YItOTA.LI I70.70.60 ?O---EONTE--CONT,! +- t ------.------kf tOfA.Li-= ?Chlr CON11 NUE 75 [FLAG-I J f LL CONTtNUE 8”: Ct.*** ***a* l OETERYINACACI 00 NUHERO OE VEICULOS QUE PERMANECEH EM I fOU ZI NJ* -~ I NSlAWTC EA-en,ltOA--‘t’~-EXCt-USA0 SE MECESSARiRr.-.- --.-- ~~l --I C 4 OETFRYtNACAO 00’ \EI ClJLbS NECESSAR 10s. INCLUSAO SE NECESSARIO. l C+**** l .*.* StMNAOftCTAI = 0 CnulE = INCIKI-J IFf IFLAG I6SCt.S le52 es0 ,851 IFf CONTE I652.6 LIMtNFfIOTAl=J 851 _. LtMSUPf , tOlAt=IM) CIHNAOf IOtAI=I EC2 htCelfrClAI=0 NEVPCBf IOTA I = 0 ALlFRAfIOTAI = 0 AL.TER IIOl4I = (I FOIhTV = 0 INOlA I = IhOftCl IJ I 00 120 L=I,tNClA IFIL-I I67.87.Ce 67 J=ESlORf IOTAI l Cf IO 11A.L) ,I GO 10 R9 1-4 -I A9 J=AIIOlA.tItHflOlA.L)_I IFf JISF.90.91 e9 4fIOlA.L) = n 90 Go TO 93
-~_ .
Cl03 ::x: Cl06 Cl07
FCRIRAN
FRIEDMAN
I b
G
LEVEL 91 92
93 54 95
96
97 :9e IO0 101 I 0% I 03
104
DATE
HI c42
21 AItCTA.LI = J IFf~IICT~.LI-ESl~MII~lAlI93.~~,92 NFVPCRIIOTAI=CEVFC~~I~JT~I+~ AIlCTA.Ll = PftOlA.LI-I J=J-1 HVPCSfIOlA.LI=YI IO1A.L IFf J4I I9S.9S.54 c$t;zp~~‘LI=”
31*90.00
110 IllClC4
77055
23/21/49
.I490.00
OUIZfIOlA.LI=I TRC lC=Yf lflTA.LI-lE*PVI K.IOlAI INOK=lNOfKI DO 46 FCINl=l .fNfK 96 IFflRElC-OCRfK.PfIkllI CON11 NW ALTFRfIOTAJ=ALlEFftOTP POIhl=tNCfKI+ALlERfI~T IFfALTEPIIOTAI-I 197.97 PARCl?L=CCBfK. IhOCI+90. IFfCAfiCEL-lRFlCI5’)*99. PARCFL=PLRCFL+FO -03 co ,n_o*. ~;C~it~~TA.PlYt~l.l,=PARCEL-9O.OO co TO II 6 l=FCthrl-1 HVCETf IOTA.POINl .I J=YvCR~I~O~A.~.~I~*I~~~~A~~S~G~I GO 1C 110 IFfFOINl-2Il’Y3rl 15.115 ALlERLftOlAI=ALTtRAftOlAItl INCRY=-fF IXI OCB IK. L)/-?O.QOb -+--ZtFf1RElC)I04.tOS.10t :RM HVC~J~A~~C~A.AL~EFL~II~TAII=~RE~C-INC SOYA-lRElC-INCFM cn 10 *1c1 iFf6ilitiAfto~~I-IIIa4,Io4,to7 LUYZO tNDTL=LSECYItClA~ DoIO8 RR=, . ,NOl& _. ___. -_..._____ ._ __ FUW=hUY+FFEQftol/.PRI ~F~CL~ERA~IOTAI-~NU~+~II~O~.~O~.~O~
so MA=SCMA+Xf
=
I CTA ,mF J IF f ‘OMA+PO.OO-CCEf M. 1 I t 114,II SOYArSCYA-PO,00 tNClA2=ALTERA f IOlA I-I
4.111
_~ IOTAI
-_
-_-.-__
-_..-.
--
The Rio de Janeiro sub;v~y system-a case study 0155
IFtICYI-tHVCETLt 101A.lNC1A21+90.00))l12.112~110 bRIlEtJt.ll3)lCT~.L.lOT4.ALlERAtlOTAl.SOMA 112 ATENDER O-HORARID Yt *,12,* ,*,I 113 FOFWATl#/. lX(r ’ +*+EPRD***lMPCSSlVEL 13,‘) COH F’ARTIOA NA CENlRAL 00 BRASIt_ : HVCBTAt’.l2.‘.*.12,‘) = ‘, 2614.7.’ = FALCC’,//) HVC8TAtlCTA.AlTE~AtlOTA))~SOUA I14 ;;srpy 116 -. -; = FOINT-I 115 tFOlNTV Pc1N1)1151.1152.1151 JUNTO = 1 1151 PD 1 hTV _ FClNT HVCRTtlOTA,POlhT ,llr~CRtK.POlhT)*00.OO GO TC 116 JUNlV = JUNTO 1152 _-. -. --.&JNTD-. JUNTO + 1 SOMC = IiVCBTt lCT#,FOlNT.JUNTV) + 90.00 1 = POINT + 1 1Ft SCWA OCBtK, 1)11153,11~4~1154 1153 HVCeTt IOTA,RO IhT ,JUNTO) = SOYA GO TO 116 WRllEtJl.llSS)IO1A.L :::’ //, 1X. ’ *~*ERRO**+lW’CSSIVEL ATFNDFR 0 HORAR17 Yt’.IE,‘.‘.l 5 FORWATt 13, 0) COY PAcT1C.A NA CENT4AC CO ARASlL.*.//) GO TC 12’) NlC8TtIOT4l=NlCRlt lOTA)*9~tZtInTA.L) I16 120 CONllNU? NVIAGt IOT4)xthOt IClA)+Nt CBTt IOTA)4NEVPCBt InTAt CALL hCHINtESTOR .A.CUtZ,HVPCP.Y.lWD.NS.Nl) ***,, ct.*** l FlNALtZACAC.l*PFF’SA~ F RFT@RNO CJARA CALCIILOS DA rlI-‘FRAChO NII 8 * : sEhTlon 2.
‘c:z CISR Cl59
:iz
IF
Cl62 ClC3 0 164 ClE5 Olt6 Cl67 c1ae ::s; 0171 Cl72 0173 0174
FCRlRAN
lb
c.
LEVEL
21
HlCB2
DA&
=
t7055
23/21/19
CL***.
01*0 tiei cIe2 Cl.53 ClE4 :::,” ClB? CIRB OlR9 Cl90 C)Sl Cl92 Cl93 Cl<4 Cl55 ClS6 c 197
0158 Cl99 :‘2:: c202 020l c234 c20s 0206 C2C7 02ae c2c9 ;r:; 0112 t’213 0214 -C215 0216 (217 02lB c219
C22@ 0221 c222 0223 “cl:: OiZ6 OP27 022B (ii9 (230 0231 c232 0233 02 34 0215 sx: 023R CZJS CiOl,
140 145 140
150
_---..
***cl
tFl10TA---F)l49,)45.)49 1flTA = 2 CO TO 65 IOTA = 1 I.-.-IOTA____ ._. KK = 3 J = 3 lOT4 ~~t~l~OttOTA)-tNttJ))lS~.l6O.lSS __
~_ .__
_.
_.
.~...
_ _.._. __.._
_
_
;O_‘;160 IOTA KK = 2 lNOK2=lND~L).--~. .~._. .--.-...-- _.-.. 160 URITE~J~~~~~)~~~~A,~.Y~~OTA,~)~~~~OTA~~)~M~~OTA.~)~A~~OTA.I),OU~~~ lIOTA.l).WVPCI?ltOlA.I),t=l.lhOK2) 165 FOFCATt2X.*INClCE e t’r11.*.‘113.*)‘.SX.‘Y I ‘,Fl4.7..5%.‘0 = ‘.F)Q 1.7.SX.‘H ~..‘.tb.s*.~QUlZ-=--‘.I*.~X.-‘HVPCR-r ‘.F9.2./, J = INDtK) + 1 GO TO t17O.lAO,lW).KK *=3-K 170 ._ __. .-_mOK3= lNOJKJ....-.__ ~RIlEtJl.17S)t tCTPrl.CIlOTA.l)~I=J.tNoK3 )-----.---.------‘-FOPYATtlX,’ 1hClCE = t*.ll.‘.‘.t3.‘)‘~5X.23X.‘O = ‘.Fl,4.7./) (75 &” I” 190 i;;2;ii -:I_ .._.._.. __~_. 1e0 tNOlA2=lNOtK) KRtTElJl.lB5lt101A.l.YttDTA.I).~ttOTA~I).AtlflTA,l).~Ul~tl~TA~tl,~V lFC~tIOTA.t).l=J,IhOlA2 ) -IBE-FtlSYATt)X. ~-lNSlCE-=--C~..l~tl-+~~~~..~)~..SX~~y-_~~~~#-r_ 1’. It.SX.*A I * .lt,SX.‘OlJt2 t ‘.14.SX.‘HVPCB = *.F9.2./) 170 K = 3 lOtA IFtSilrNAOt IOIL)) 1905r1905.1901 1901 II=t.tYlW~-IOFIt -.-... - ____.~.. 12=LtMSWJt IOTA) CON?E=lZ-II+1 uR~TE~J~~~~~~)~o~A~~oTA.~NO~~CTA).C~-’-~99~FORHALL.~XI/J.._LX.~!__hO._11E~OIUglO~Ol lOEVtO0 A CHEtCtA CC TRENS APCS Yt’.ll.*.‘.I3.’ 00 1904 1=11*12 HE XCL = Ct lOT0.1 t 4 90.00 ~tUit~lrl90Jl161L.1.C~IOF~lL~WExE~-1903 FOR*AT(l~,i~O li .li.;.;.ii.i j l .F14.7.5X.‘..........‘eSXe’MVPCd .F5.2*/I 1= CVNTI NUE 1904 . ..--.--~--1905 -URlTE~~i.f9Ct1OTI,Kr~)CBTllOTA)IQ2 FORYATtlX.//rlX I* NO. DE INCLUSOES NA CENTRAL P ARA '0 BRASlL lOEfi HORARIOS EM ‘,tl,’ tSENTlOO’~l2,‘) = ‘,tO, /. 15X. 15 ,XI * ,== . .,,, ,SX ,I, _____ -_-C.B._-_-_-______ ENTIOO 2 4X * ‘SE ‘/.15X. s/ ~_ .~ x , rrrz,. .,,##, 155
=--*.tC.cX.‘A
.
.._.....___ _. _.. ._ -
-
*
- ----.
-- _-.-
FtALTERbttOTP)) 17~,195,173 :ND,A2=ALTl !RA t IO 1A ) WRlTEtJI.1~ a*) tIOlA.t.HVC0TAl IOTA.t).t=l.INDTA2) 194. -FORWATt 1 K.lOK-.’ t-VCRT4+‘.1 t...~riZl.‘) w-‘.F 14~ h fl 195 lNOlAZ=thOtK) +ALlERt IOTA) DO 1951 t=l,th,,Tt2 KRt1EtJl.l96)lCT~,l.IHVCF3TtlCTA,t,IIl.)l=l-B) I : :r FOR~ATtlL.l~X.’ FVCeT (‘.tl.‘.‘.ll ‘,Fl4.7~9t2X,F9.2)./) ~RITElJI.197llCTl.hVlA~flflTAl FOFb’Altii;i+.imNc; 157 cf ‘i iAGEhS NECESSAPIAS PARA OPERAR A LINHA NO lENTlI~O’.12.’ = ‘.14./) - *RlTEtdlrl9R)lOT#.hSt ICTA) --FORW4Tt 1 X,’ 19r) NUYEFC WINIHO OE VEICULOS PARA OPERAR 0 SENTlDO’rIP.’ I. ‘*14./l IFtICTA-2)2OO.ZOE.i00 ?On IOTA=2 YRITCtJt,FOE) FORWATtlX,//I,)Y.’ SENT100 902 ?‘./) GO 10 )4R 2@5 ~RlTEtJl.Zltb)hl FOEMAT t///f ,l L ,’ 210 NUHIRC tYIN1MI)) TOTAL DE VEICULOS PARA ODERACAO 1A LINHP NDS DOIS SENTI?flS = l.lh) RETlRN FND 193
;i, .__.
- -
__-.
3
q>
M. FRIEDMAN and C. A. G. CORWVIL
134 FCATR0N
a00
coo2 coo3
1v
G
1
LEVEL
2;
C+*r** m-c__-+ C++*L+
p
coo4 coos
.-
“(“0:: coo9
9: ct*c+** - -----C*t*t+
_
0014
1010
“,“,t: co17
#&fJ *-*_-,_y.*-
-.-p-~_.)..k_.e__,f.A
______ _.___. -__- _________ 1V
G
*oPTIohS Ihr *OPTIONS IN *STATISTICS* 4SlATlSTlCS* +slrTisrics*
L_-__
INOX f ;S;GM,tr ) 00 25 J=l.INDI ffFAOf3L~t6)FREOff~J)~Xff~~)--FOFRATf IS. FIC.5 ) CONTl NUE
=
770%
23/21/49 ****a
__TEf,_.
“n”f’-r--.+-*=-
LEVEL
---
._
_-
__._
--._.
-
_____ **.I* ****al
CAt;t-~t~Bef--T~Xr~e.t~~~YeV-r~s~eR.~s~o~~L~~j-----------GO 10 5 CALL EX1T mo -__ ..-
._
-.
.
-
FCRlRAN
DATE
INTEGER FREOf2.24) .ESfORf2),E§lOMf2) DlMENStON tf2).Xf2.24).ZfZ)rfEMPVf2.3).LSEGMf2) CATA -Jt.df-+ 5.6 / .- -REAOf JC, IOrENO = 1010)fESlORfZ)~ESTQWff).LSEG~f)),lfl).Zfl).I=l.~) F0RPAT~12.~2.12.F12.7.F12.7.)2.12.)2.F12.7.F1~.7) lo” AFADfJL.IS)TEYPVIl .3).TE~PVfl.7).TFYPVf2.3).lEMPVf2.1) *5_--_~~~*lt~_~,6.4 ) -- ---------__-__-
cace
::t: 0012 co13
Mh IN
,
21
---_
.-.
._---. _.__.__.. --
MAIN
_..
.--
----...
______-_-
VA TE
=
CCUREE..N~f 57.NOBE~U~~BAO,NOIUP-----EFFECr*--uwO+EecBfB+ EFFECT* NAUE I WAIN . L INECNI = SOURCE STATEWEhlS = lT.PROGRAI* 5% = NO 01 AGNOSTICS GENEFATED ----.-------~ .._. --NO DIAGNO5tfCS lb15 STEP
-
.--.-
77055
--
23821149 __-_-
._.-
._..
1140 --------
---.