A program for the Monte Carlo simulation of vehicle traffic along two-lane rural roads An
application of structured programming technique and
SIMULA-67 language
lr 143 - 1979 .SN 0347-6049
143
Statens väg- och trafikinstitut (VTl) - Fack - 581 01 'Linköping
National Road & Traffic Research Institute ' Fack - S-58101 Linköping > Sweden
A program for the Monte Carlo simulation
of vehicle traffic along two-Iane rural roads
An application of structured programming technique and
SIMULA-67 language
The documentation of the computer program given in the
following report relates to its status at the beginning
of 1979.
This means that the program has been tested
in a limited number of simulations.
As development work continues the SIMULA program will replace the present ALGOL-GENIUS program during spring 1979, in an ongoing comprehensive R &_D project and improve reliability continously. At the same time the related programs in the system will be rationalised. Validation of the basic traffic model is under progress
in both Sweden and the U.K.
In order to provide a larger number of those interested
in this field with information on the development of
the program, the next program version is now being docu-mented. The program description given here can
there-fore be regarded as a preliminary version. The
documen-tation of subsequent Versions already under work are
planned to be updated contiuously, possibly by using a loose-leaf system, by the working group.
If you wish to obtain further documentation of the pro-gram please notify this to the Institute.
The working group will be grateful for any suggestions or Opinions of use in future develOpment work.
C 0 N T E N T S 1.2.1 1.2.2 1.3.1 1.3.2 FOREWORD BACKGROUND General background
Basic attributes of the traffic simulation model Free flow traffic
Interaction model
Program system for
traffic simulation
Input data Output data
GENERAL PROGRAM DESIGN THE ROAD
THE EQUIPAGE
Equipage attributes
and basic behaviour
Short description of equipage procedures Variables controlling behaviour Predictive routines STRUCTURES Notation rules in 3 Jackson structures Program structures for equipages
SOURCE PROGRAM LIST
REFERENCES VTI MEDDELANDE 143 11 13 13 16 17 20 24 24 25 45 76General background
This report describes a computer program for simulating
vehiCle traffic on two-lane rural roads. For this
pur-pose structured programming has been used. Programming language is SIMULA 67.
As far as is known this is the first time structured
programming and SIMULA 67 have been applied together with a technical program of this size.
The program forms part of a program system described in this report. The program system in turn forms part of 1 a comprehensive, long-term R&D project assigned by the National Road Board. The purpose of this project is to determine the effect on traffic of road and traffic
engineering schemes in order to establish traffic quali-ty and road user costs in the rural road network. The background relating to system analysis has been treated in Report No. 44 of the National Road and Traffic Research Institute (Ref. 1). This has led to the development of
the simulation model mentioned above, which describes
the dynamic sequence of vehicle traffic over defined stretches of road for given traffic volumes and traffic compositions.
The program replaces one previously written programin
ALGOL-GENIUS since the computer used by the National
.Road Administration at that time Was the Datasaab D20;
Reprogramming has for several reasons been a natural
consequence of the following developments:
- The number of effects concerning traffic as derived from simulation have increased. This has led to re-peated modification and expansion of a successively VTI MEDDELANDE 143
more complex system model.
- The simulation technique has proved powerful and an increasing interest in the simulation model has been
shown both in Sweden and abroad.
- The National Road Administration has switched to another computer and is moving steadily further away
from ALGOL-GENIUS, a language which is generally becoming less frequently used.
The above reasons, together with an assessment of future expansions and modifications of the program as a research
tool, have led to the need for a more flexible program
structure which easily permits continuous extensions and adaptions to new problems.
Following a decision that the central program in the
system required rewriting, an inventory of existing tech-niques and programming languages was made with the
re-isults described below.
Jackson Structured Programming (JSP) technique has been used in systems and programming work.
The programming language used is SIMULA-67 which has ex-ceptional qualities for simulation as well as permitting a lucid organisation of the program text and well-struc-tured data.
Basic attributes of the traffic simulation model
Report No. 43 (ref. 2) of the National Road and Traffic ResearCh Institute contains documentation on the traffic simulation model. Here we shall give only a general de-scription of its basic principles. On the basis of its applications the model is divided into one part giving the speed of the freely moving vehicle along the road
*straight road with no speed limit.
vehicle streams.
Erss_§lew_25ꧧis
The basis of the moving vehicle part of the traffic simulation model is a statistical distribution of
drr%HS'desired speed on an ideal road, i.e. a wide, The stretch of road considered is divided into homogeneous sections or road blocks with regard to these parameters.
Each driver in the traffic_simulation program is allotted a speed class in the desired speed distribution. At
present, the speed distribution is divided into twenty-five classes, each class representing 4 % of the total range.
The speed distribution for this ideal situation is trans-formed to separate speed distributions for each road-block.
which is homogeneous with regard to road width, speed
In addition, the stretch The road block thus is a subdivision of the road
limit and horizontal curvature.
of road considered is divided into road blocks relating to vertical curvature and overtaking restrictions. This method is described in more detail in the Institute's preliminary reports No. 58 and 68 (ref. 3 and 4). The desired speed for an equipage - a driver-vehicle unit - in a particular roadblock is designated as the equipage's block speed, which indicates the driver's
"wish". Apart from the block speed the lepe, if any, is also assigned to the block. Each vehicle has also
been allotted a power/weight ratio, or p-value,
as well as air-amirolling resistance, which decide its ability to reach or maintain'its block speed on the
particular lepe. If, when entering a block, the equipage
has a speed slower than the block Speed or cannot
main-tain its block speed due to the lepe, its speed is cal-culated with the help of Newton's equation for momentum. The resulting speed is thus determined from a desire/ ability situation resulting in a speed profile along the
road and in which corrections have been made to the
_block speed with regard to the p-value of the equipage to allow for the vertical profile of the road and the air - and rolling resistance.
lêEêäêEEÅQQ_@9§§l'
In addition to the speed class and p-value each equipage is allotted a time and road coordinate for starting, a direction of travel and an initial speed. This permits faster vehicles to catch up with slower vehiclesalong the road and leads to overtaking or following. If over-taking starts as soon as one vehicle catches up with
another'flying"overtaking takes place. If overtaking
occurs after following an accelerated overtaking is
carried out.
Overtaking on a road without a wide shoulder can take place if
1. The following vehicle has sufficient power/weight coefficient.
2. The difference between the desired speed classes is sufficiently great.
3. Space is available for overtaking with regard to surrounding equipages' travelling in the same
di-rection. '
4. There is no overtaking prohibition.
1. The impeding vehicle's type and speed 2. Available sight distance
3. Oncoming equipages within the sight distance at hand
If the road has a wide shoulder overtaking can also take
place by passing, which means that the leading equipage moves with a particular probability onto the shoulder. If the road has a climbing lane the impeding equipage
will move into this lane.
During the overtaking sequence movements take place as
described in the freely-moving.vehicle model. When following occurs, however, the vehicle follows the pre-ceding vehicle with a constant time headway depending on the preceding vehicle's type.
Program system for traffic simulation
The simulation program described below compriSes the "heart" of a program system as shown in the accompanying diagram 1. In order to facilitate understanding of the traffic simulation program itself a short description of the overall programs is provided. In principle the traffic simulation model is built up in a model system which permits the following:
l. Simulation of the behaviour of free flow traffic in both directions, i.e. equipage dependence on road attributes speed limits in force and vehicle attributes, but excluding the interdependence of the vehicles.
2. Simulation of the behaviour of equipages also taking into account the interdependence of the surrounding equipages both in their own and the Opposite direction.
Here the SIMULA program is described for the latter of
these cases.
Overtaking takes place with a probability depending on 1. The impeding vehicle's type and speed
2. Available sight distance
3. Oncoming equipages within the sight distance at hand
If the road has a wide shoulder overtaking can also take
place by passing, which means that the leading equipage
moves with a particular probability onto the shoulder.
If the road has a climbing lane the impeding equipage
'will move into this lane.
During the overtaking sequence movements take place as
described in the freely-moving.vehicle model. When following occurs, however, the vehicle follows the pre-ceding vehicle with a constant time headway depending on the preceding vehicle's type.
Program system for traffic simulation
The simulation program described below compriSes the "heart" of a program system as shown in the accompanying diagram 1. In order to facilitate understanding of the traffic simulation program itself a short description of the overall programs is provided. In principle the traffic simulation model is built up in a model system which permits the following:
l. Simulation of the behaviour of free flow traffic in both directions, i.e. equipage dependence on road attributes speed limits in force and vehicle attributes, but excluding the interdependence of the vehicles.
2. Simulation of the behaviour of equipages also taking into account the interdependence of the surrounding equipages both in their own and the Opposite direction.
Here the SIMULA program is described for the latter of
these cases.
DR NER .VEHICLE ' TRAFFIC DATA
ROAD
TRAFFm
BLOCKING GENERATION PROGRAM PROGRAM I I . D P DESCRIPTIONEss' RM?)
OF THE
TRAF-OF C FIC INPUT I
/ I ___ , l i
4 "' / / / / / / / FREE FLOW TRAFFIC
TRAFF'C . SIMULATION SIMULATON
_'//z/ 1/
2 Jan-"'- ---""I I l l TRAFFIC : RESULTS J TRAFFIC RESULT PROCESSTNG PROGRAMS §\ \ \ \ \ \ N \ \ \ \ \ \STATISTlCAL STATISTlCAL TRAFF|C TRAFFIC OTHER
DISTR AT DISTR DESCRIPTION SAFETY TRAFFIC
SPOTS BETWEEN CHARACTERISTlCS CONCEPTS EFFECTS
. smrs ALONG THE ROAD
iSPOT SPEEP 1JOURNEY SPEED *IPERCENTAGES OF 1RlSK EXPOSURE TRAFFIC NOICE
21mm: HEADWAY :out-:NE LENGTH 1. 005142 FREQ . 2 JOURNEY TlME AND 3 NUMBERS OF OVERTAKINGI PÅSSINGS
varnas m AS -FREELY :40va -ousums OVERTAKlNGI PASSING
' 2TRAFFIC TIME DELAY 3 TRÅFFIC FUEL -CONSUMPTION 2 CONFLICT SlTUÅTIONS
TRAFFIC POLLUTION
Diagram l. VTI MEDDELANDE 143
The position of the simulation program in the program system.
.3.
EBEEE_§êEê
Input data in the simulation program.conSists of road and traffic data.
Road parameters
Data input to the "road-blocking" program consists of road geometry and surface type parameters as well as speed limits and overtaking restrictions. In Sweden this information is usually obtained from the National Road Data Bank, if an existing road is to be simulated. Other sources such as construction drawings can also - be used. The road blocking program is used to provide
a road representation for simulation.
The first stage of the program consists of calculations of block speeds for the free flow traffic program, i.e. a road block median speed and a transformation
coeffi-cient, or q-value, is given for each block.
Sight distances are given in both road directions in the form of sight distance polygons. These are obtained through direct input in the field or from construction drawings. They may also be obtained from alignment data by using a special calculation model.
Traffic parameters
Both simple and complex traffic generation programs have been develOped for simulating traffic streams in the
stretch of road under consideration.
.3.
1. Total flow (No. of vehicles/hour)
*2. Flow in each direction
3. Flow changes
4; APartial flow of heavy vehicles (traffic composition)
QBEEEE-§§E§
The results of the traffic simulation are printed in chronological order and are intended for further pro-cessing. Table l shows 15 different types of result,
the occasions during_traffic simulation at which they
are presented, a short description of the type of result provided and whether the result is given un-conditionally, conditionally or conditionally after the time specified.
mordinates, speed and track 0 = utannditional result V = amditional result
VT = andltional result' after time specified
VTI MEDDELANDE 14 3
.á ,
Table l Schematic description of output data
Infomation . . . 4
- I Occason Short descrlptlon of result 0 start of simulation general :information and 0
and upon error error message
l equipage enters driver and vehicle O stretch of road Characteristics
2 equipage leaves equipage statusx) 0 stretch of road
3 passing measuring equipage status , preceding O point equipage headway, reference
forwards and backwards '
4 direct overtaking equipage status , equipage type , 0 started sight distance, type and speed
of preoeding equipage , road wordinate and speed of on-caning equipages
5 accelerated over-taking as for type 4 0
started
6 over-taking coupleted equipage status 0 7 . passage point equipage status O 8 passage ompleted equipage status 0 9 lane change equipage status and new lane 0 10 following started equipage status 0 11 opportunity for direct as for type 4 O
overtaklng not accepted
1.2 opportmity for accele- as for type 4 0 rated over-taking not
accepted
13 block border passage equipage status, speed class, V equipage type and power/'weight coefficient
14 every change equipage status, predicted VT times and speeds, etc
The program is written in SIMULA 67 language. The main principle of SIMULA is pseudo-parallel execution, which can be regarded as a further develOpment of event con-trol of dynamic sequences. Ref (6). The description of the events which relate to a particular type of object are collected into a single process. The program consists of two processes:
l, Equipage generator process 2. Equipage process
The processes, which also contain data and procedures, provide a natural picture of the object they describe. In this way a good similarity to the model is obtained which is very important since simulation models tend to be highly complex.
1)
The equipage generator process creates equipage
ob-jects and allots them individual driver-vehicle attri-butes. Here they are also allotted their traffic
attributes. These objects will throughout be termed
quite simply'equipagesT Parameters which define
equi-pages consist of, among other things, the identity
number, basic desired speed and power/weight ratio.
Parameters giving their traffic attributes consist of, for example, starting point, starting time and direction of travel. The equipage generator process also activates the equipages at their starting times.
The equipage process describes all the possibilities for action that a particular equipage has, for example, "drive as a freely-moving equipage", "follow another
l) "Create" here refers to the creation of storage space for the attribute and the start of processing of the statements in the class body, or algorithm.
lO
equipage" or "overtake the equipage in front". The freedom of choice implied by the above covers many
al-ternatives, which means that the simulation model
tends to be very complex. This in turn places consider-'able demands on the program structureL The equipage
process has therefore been designed in accordance with Jackson structured programming (JSP). Ref (6).
THE ROAD
In the program the stretch of road considered consists of a sequence of consecutive road block objects and a sight distance function in each direction of travel. Each road block object is homogeneous with regard to the following road geometry and traffic regulation'
parameters:
l. Road width and road surface tYpe
2. Auxiliary lane/lateral space (i.e. wide shoulder) 3. SlOpe
4. Horizontal curvature 5. Speed limit
p6.j Overtaking restriction
The road block is represented in the program as an
. object from the class ROADBLOCK. This object has the following attributes:
I
§99ê2299_ê2§_lsagäb
WK WL
coordinate of road block beginning road block length
II Beêé_gs9@§252_§9§-I§ê§âis_;egglê2192_êäfsiêgfe§
ROADWIDTH
LANE
WI
WVBL
WQ
PASS
References III SIGHTREFroad width class
occurrence of auxiliary lane/lateral space slope
block speed for median equipage Q-Value
code relating to overtaking restriction
occurrence and coordinates of sight distance maximum
reference to distance length function
12
The road block object is linked in each direction in a SIMSET list with the headings DIRECTIONl and DIRECTIONZ respectively.
The sight distance at different points along the road is approximated with a linear function of the road coordi-nate. One function is required for each direction of
travel.
The sight distance function is represented for direction l_in the program by coordinate pair (BREAKPICTCOORDl, SIGHTDISTANCEl) and in a corresponding way for
direc-tion 2.
To facilitate determination of the sight distance at an arbitrary point along the road, the road block has
here, as mentioned above, been given a reference to the
sight distance function in the same direction.
SIGHTREF=n if Sn § WK < Sn + 1 where Sn ans Sn + 1 are road coordinates for two consecutive breakpoints and WK is the road coordinate of the road block beginning.
THE EQUIPAGE
Equipage attributes and basic behaviour'
In the program the equipage is represented as an object from the class VEH." The object has the following exo-genous (EX) or endoexo-genous (EN) attributes.
I
êêElEiêEEêElYê_êEEElêäåêê-ID EX identity number
DIRNU^ EX direction number
D1 4 EX direction one
ORIGIN EX number of the road block for start of equipage
ARRIVALTIME EX arrival time
BLNU EN block number
DEST EX number of the road block for destina-tion of equipage
FINISH EN destination reached
II Driver-vehicle attributes
SPCLASS EX speed class TIMEHEADWAY EX time headway
MINTIME EX . shortest stay in auxiliary lane/
lateral space after passing
P EX power/weight coefficient allotted
TYPE EX vehicle type
AIRRESIS- EX air resistance coefficient
TANCE
ROLLRESCOEF EX rolling resistance coefficient
III
Izêääis_êEE§lEBEE§_9§_Ebs_?9929ê9s
FOLLOWER EN equipage is following BEHCATCHUP EN equipage is caught up
LOCALS EN road coordinate at preceding event LOCALTIME EN time of preceding event
LOCALSP EN speed at preceding event
l4
AVERSP EN speed from preceding event to next event
NEWPRE-TIME ' EN predicted time of next event
PREBL- predicted time of passage of next
TIME EN road block border
' ' ' f next
,P SP predicted speed at passage o
REBL EN road block border
FREEBLSP EN free block speed
IV
Bsfsrsassê
BLOCK EN 'reference to actual road block
PSVEH EX reference to a "pseudo equipage object" . The events are assumed to occur momentarily at calculated
times. At each event the model data is updated and a particular event generated from among the possible con-secutive event types. A note of the predicted event is inserted Chronologically and logically in a list (SQS)
and the events are then executed in this order.
For programming reasons an equipage belongs to one and only one list. Since the need arises for an equipage to belong to a further list besides the process list a pseudo equipage object from the class PSEVDOVEH has been created. These objects have the reference REVEH to
their equipage.
The ordinary cycle for an arbitrary equipage is:
1. Predict the time of the next event - NEWPRE-TIME
2. Await the predicted time - HOLD -.
3. Move the equipage in time and space - DRIVE -. During phase 1 of the cycle NEWPRETIME, PREBLTIME,
AVERSP and PREBLSP are calculated in procedures TIMETO... During phase 3 of the cycle the procedure DRIVE updates
the attributes LOCALTIME, LOCALS, LOCALSP, AVERSP,
PREBLTIME and PREBLSP .
'
During phase 2 of the cycle it may happen that adjacent equipage interacts with the current equipage with
the result that the predicted time of the neXt event for this equipage is shown incorrect since it will occur earlier. Its ordinary cycle is consequently interrupted and the current equipage considers that a "surprise" has _occurred through the SURPRISE procedure. A prediction
of a new earlier event for the equipage is then made. Each equipage has been allotted a "head" and a "tail". The equipages constantly attempt to drive so that their heads do not overlap their tails. The lengths of the
heads and tails are defined as:
(AVforw-AVERSP)2
head length 2 . DACC if AVforw : AVERSP
O otherwise
tail length TIMEHEADWAY - AVERSP
where AVforw is AVERSP for a preceding equipage. Head length therefore indicates the distance required to slow
down with given retardation DACC to the speed of the
preceding vehicle. The tail length is chosen so that kequipages in a queue are separated by given time
inter-vals.
An important aspect of the program is that a road is divided into a number of lanes, where each equipage
in each lane behaves in a defined manner.
Direction of traffic:' __ _ _ _ _ _ _ _ _ _ __ _y__ _3__ Direction of traffic: a) + rightehand traffic __l __ __ _ _ _ _ 2_ a) + right-hand traffic b) +.left-hand traffic __2_ * _ _ _ _ _ _ _ _ _ ____l__ b) + left-hand traffic
' 3
16
An equipage can use three of the four lanes. Lane 2 is 'the ordinary lane in the direction of travel and lane 3
is a wide shoulder or auxiliary lane. In lane l priori-ty is given to traffic in the Opposing direction.
An equipage remains in its lane until it decides to
change lanes. :The reason for this decision may be in
>order to overtake, i.e. move out into lane 1 or
alter-natively move onto lane 3 to allow a catching-up faster
equipage to pass.
Short description of eguipage procedures
To acquaint the equipage as to which of the many compli-cated situations is in force,a number of procedures and variables are provided.
These situations are listed and described below. A brief description of the predicting routines i.e. the procedures which, among other things, calculate the time to a given next event, is also provided. The latter procedures are similar in that they all give a
time to the next block border if this event type occurs
before the given event.
.2.
YêEiêêls§_§92§§9l1199_ä§bêyi992
§ê§i§-§99§l§§§ PST(VEH,T) VEHBEHITRK(X) VEHLITRK(X) VEHFORWITRK(X) PASSING(X) STARTPOSSIBILITY CHANGETOTRACK(X) BEHINDVEAFFECTED REACTFORW REACTBACKWCalculates the road coordinate for
equipage B at the particular time (i.e. at TIME)
Calculates the road coordinate for equipage VEH at time T.
Calculates a reference to an equipage in lane x travelling behind.
Calculates a reference to an equipage alongside in lane x.
Calculates a reference to preceding equipage in lane x.
Decides whether own head or tail
over-laps that of another equipage in lane X. Decides whether start possibility
applies. Start possibility if head or tail of own equipage does not over-lap that of another equipage in lane 2 or lane 3.
Move own equipage to lane X.
Decides whether equipage travelling
behind in the same lane needs to be reactivated.
Reactivates preceding equipage
Reactivates next equipage travelling behind in the same lane.
REACTTRKlVEH CONSTRAINED < INTERESTING ACC(SPEED) BEABTOFOLR l8
Reactivates the nearest equipage whose tail lies behind the current equipage. Decides whether the current equipage is following.
When an equipage is reactivated the
procedure INTERESTING decides whether the equipage is in track 1 or track 2 and is being caught up by another
equipage. '
Calculates-acceleration ability at
SPEED
Decides whether a preceding equipage is "close". "Close" defines the
distance between the head of the cur-rent equipage and the tail of the preceding equipage as being less than
1.5 times the tail length of the pre-ceding equipage.
BQEEiQsê_ia_99912292299-wi§h_9ê29bi29_99
CATCHINGUP(X) VEHOBJCATCHING-UP(VO) CATCHINGUPBEF-NEWPRETIME(VB)Decides whether the current equipage catches up another equipage in track x before passing the next road block limit.
Decides whether equipage V0 catches up a preceding equipage before pass-ing the next road block border.
Decides whether equipage VB catches up the current equipage before VB's
NEWPRETIME. BQEElBêê_29-9921929ElQE-WlEE-9Y§EE§EÅQQ-9§-P§§§229 OVERTAKOCCAS FLYINGOVTAK-ACCEPT ACCOVERTAKING ACCEPTED ABLE
Decides whether an overtaking
tunity exists.* An overtaking
Oppor-tunity exists if maximum sight length exists in the road block and the
equipage is more than 3 m in front of the point of maximum sight length. Decides whether an Opportunity for overtaking is accepted.
Decides whether an opportunity for accelerated overtaking is accepted. Decides whether the vehicle has suffi-cient acceleration ability to carry out an overtaking.
WANT VACANT ALLOW TIRED OBJINSAMETRACK INITIALPOINTS, LPNT, FINISHPNTS m mnxent track
_-A random number is drawn and gives "true" with a specified probability. This probability depends on:
1) Accelerated/flying overtaking - OMT 2) Vehicle type and whether a private
car is taken into consideration when average speed is less or greater
than 20 m/s
3) Road width class -IVB 4) Visible/invisible meeting
5) Sight length
Decides at point of decision for acce-lerated or flying overtaking whether it is possible to change track to track l, i.e. whether track l is occupied by another equipage.
Decides whether the vehicle is permitted to carry out an overtaking. Permission is given if no overtaking prohibition applies and if no unbroken white line exists.
Decides whether the equipage abandons its attempts at overtaking. The proba-bility of this is at present O.
True if the head of the current equipage overlaps the tail of the preceding equi-page in the same track.
Decides upon overtaking or passing whether initial points, level points or finishing points apply.
direction of_travel
_ _ _ M _ _ _ m
EäeliiunES
(.initial points
13 m1
[j finish points
v
en;
Jr--v--JJL
4Eadehaçñh: - - 'Hål åarühw «* - m* -*
;__W__.=
;__ ._ _; tail leisüxäuieage sweet.. _. __ __
.a
20
SHORTRETURN Decides upon overtaking whether short return applies direction of travel F shañxetwnipohus mnzent L__v_-J tzaCk taillengüi
__ __ __ __ __ __. __ __
,Gå
__ __ __
o__ _. ;_ __ __ __ __ __ _lxaiépsraoärri___
__
OVERTAKING-
Decides whether an overtaking is to be
CONTINUE completed. Always completedat present. NEWOVERTAKING Decides whether a new overtaking is
like-ly, implicates that the driver wants to
overtake. Note that this makes NEWOVER-TAKING true if no new overtaking is
likely.
SCATCHINGUPl Decides upon completing an overtaking of 'equipages in a platoon, but not the
platoon leader, that the current equipage catches up another equipage in the current
track before overtaking is completed.
399229s§_i§_99219292i99_Ei§ä_:bs_sggipê9§_§2299_Eꧧeê
VACANTANDWANT- Decides when the current equipage is TOGOTOTRACK3 caught up in track 2 whether it can and v
wants to change track to track 3.
CANRETURN Decides whether the current equipage in
track 3 can return to track 2.
EE?§ÅSEÄY§-EQEEÅE§§
Apart from the block speed an average slope is assigned to each block. Each equipage also has a power/weight
coeffi-cient, P, which determines its ability
to reach its block speed,_given the
particular lepe.
'
PTS
free,
block speed
The TRAVEL procedure tests this ability by inserting values in the power equation:
where _
a = acceleration m/s2
p = power/weight ratio W/kg
v = speed m/s
Ca = air resistance coefficient cb = rolling resistance and "slope
coefficients"
In this test V is set to the block speed. If acceleration thereby becomes less than 0 or the current speed is less than the block speed, PTS is inserted in the power equation. Otherwise calculation is made
either with the same speed, TS, (time
over road stretch) or with a uniform re-tardation, RETARD, depending on whether the particular speed is equal to or greater than the block speed.
ll
roadcoordi-; nate
blockborder
In_procedure PTS there is a numeric in-tegration of the power equation over
time until either the free block speed has been exceeded (case 1 in the figure) or the blockborder exceeded (case 2);
TIMETOSTART-POSSIBILITY TIMETOBLOCK-LIMIT(C) 22 Use is made of dv . ' a = EE gives vt = vt _ At + At 0 a ds . -V = EE gives st = st _ At + At - Vt where_ _ a = acceleration v = speed 5 = distance t = time
Integration step At (DELTA in PTS) is-set to
At = k - PRECISION
[X]
where
k = a constant set to 3
PRECISION.= required precision in
integration
In the program PRECISION has been set to 0.5 %.
Calculates time to start possibility. Calculates time to next block limit. C indicates whether the current equi-page is free or constrained.
'BQEEÅQ§§_29_EQEIEQEEÅQE-WEE§_EêEEblES_EE
TIMETOCATCHU-TIMETOCATCHING
UPPOINT(X)
TIMETOBEHCATCH UPPOINT(C)Calculates time until the first of the
following events:
l)4 Catching up equipage in track 3 2) Catching up equipage in track 2 3) Block limit
If the equipage catches up another equipage in track x the procedure cal-culates the time to the catching-up point.
Calculates time to the point where the current equipage is caught up. C in-dicates whether the current equipage is free or constrained.
Routines in conjunction with preparation for following
TIMETOFOLLOW When an equipage has decided not to carry out a flying overtaking the pro-cedure calculates the time to the point ' where the equipage has slowed down and
travels with a given headway from the preceding equipage.
BQEElgêê_;2-99212992292_wiEb_92ê52§3299_9§_9ê§âigg
TIMETOOVTAKACC TIMETOINITIAL-POINTS(C) TIMETOLPNT(C)TIMETOFINISH-POINT(C)
TIMETOSFINISH-PNT(C)Calculates the time to the point for an accelerated overtaking.
Calculates the time to the point where the overtaking equipage is in level with the overtaken equipage. If the current equipage (overtaking) has a lower-aver-age speed than the overtaken equiplower-aver-age the time to the block border is calcu-lated. C indicates whether the current equipage is free or constrained.
Calculates the time to the point where the overtaking equipage is 3.3 m in front of the overtaken equipage. C indicates whether the current equipage is free or constrained.
Calculates the time to the finish point
in an Overtaking. If the overtaken equi-page has a greater average speed than - the current equipage the time to the
next block border is calculated. C
in-dicates whether the current equipage is
free or constrained.
Calculates the time to a short finish point in an overtaking. A short finish pOint applies when the current equipage overtakes individual equipages in the platoon with the exception of the pla-toon leader. C indicates whether the current equipage is free or constrained.
BQEEEEê_EE_SQQÅEQSEÄQQ_EÅEQ-9Y§EE§Eŧ9-êQ_§QBlPê9§
TIMETORETURN-POINT(C) Calculates the time to a possible pointfor returning from track 3 to track 1. C indicates whether the current equipage is free or constrained.
'124
STRUCTURES
Notation rules in Jackson structures
The Program documentation described below follows M Jackson's rules for structured programming wherever
these has been considered applicable; According to
Jackson a program can always be associated with three simple and basic concepts; sequence, iteration and selection. Ref (5).
The first of these, sequence, is unimportant here. A 'program section which is run through unconditionally
statement by statement is denoted by a rectangle..
Iteration is a program section which is run through 0 or more times as long as an iteration condition is
satisfied, for example, SIMULA'S while statement. Iteration is denoted by a rectangle containing an asterisk in the upper right hand corner
m m . _ _ _ m -o L . . -_ __ _ . n u. . . ,
Finally, in selection one of several alternative
program sections is run through. Selection is denoted
by a rectangle with a small circle in the upper right
i E . 0; f . f 4 ' F 1 1 '' ' 4 . m V hand corner. 2 0 c 1, i 9 ' I VTI MEDDELANDE 143
Backtracking is a special case of selection. This occurs when an alternative program section cannot be selected before one of the program sections has been begun. A program section is thus assumed but this can 'be rejected if the assumption proves to be wrong. In
this form of selection the assumed program seCtion is
denoted by P, posit, and the remaining sections by A,
admit.
For a closer study of Jackson structures we recommend
M.A. Jackson, Principles of Proqram Design, Academic
Press 1975 (5).
Program structures for equipages
VEH
/ \
\\\\\ \\x
WAITSUF
CHANGE
VEH
,mm
!
TDÄEHEADW TOTRACK (2 PROCESS '
When an equipage is activated it awaits a sufficient time interval in relation to other traffic,
WAITSUFTIMEHEADW , before moving to track 2,
-CHANGETOTRACK(2) -. The equipage starts and drives
to its destination, - VEHPROCESS -. Finally, the equipage terminates itself, - TERM -.
26 5 : Vüi 1 .a . i PriCX :LSS .-. -V. ... -.. .l i
WHILE NOT FINISH
r. , ., ?
å ammo "* t
! VDY i i /\ 2 no surprise \\.p
A !
SITUATION
SURPRISE i
The equipage process consists of an iteration of the
equipage process body, VEHPROBODY, which in turn consists of a choice between SITUATION and SURPRISE.
It is thereby assumed that no surprise occurs, i.e.
that the equipage is not reactivated by another equipage. Processing of a surprise therefore takes
place only when it must be admitted that the assumption
was wrong. [EHTWMION / / // O O II 0
TRACKZ
TRACK3
{ TRACK1
WA _.i,w . _ . . . m
For the equipage a situation consists of one of the alternatives TRACKZ, TRACK3 or TRACKl.'
27 ? I I_
TRACKZ
L 5 /ñii
EÄDQ ?EEE <35$TR ÃHEEZ ' 2 ADEDA i
m2 FREEZ PASS BEAB'IOFOIL
E .-
P
COMPL
! AIMOST
'CONSTRAINED
NOTBEIAB
_ OWNTRACK=2
5
fu. .. < -_ _ \ _ . áWhen an equipage comes to TRACKZ it first examines its forward-behind relationship with regard to other equi-.pages in order to know whether any of these are affec-ted and need to be reactivaaffec-ted, EXAMFRBEZ. "Affected" refers to whether the eqüipage continues to be free, FREEZ, and is finally CONSTRAINED. The period of freedom or constraint may be 0.
A free equipage at first drives completely freely,
COMPLFREEZ, then almost freely, ALMOSTFREE, (catches up or is caught up) and finally overtakes an equipage, PASS, which has moved into track 3, i.e. it passes.
A constrained equipage assumes that it is not too fatigued to follow the preceding equipage in track 2 and chooses a following behaviour, CHOOSEFOLLOWBEHA. If the assumption proves to be wrong this is treated in the alternative program section, NOTBEABTOIZ.
28 ' GEPL FREE I i t
while not behcatchup and not constrained
and not catchingup(2) and not catchingup(3) l
l
HON) 'X DRRE
An equipage is completely free in track 2, COMPLFREEZ,
as long as it is not caught up, is not constrained and does not catch up an equipage in tracks 2 or 3.
I not oonstrained and Catchingup2 behcatchup
PROCEBEHO
PROCESSO
(mmm
CATCHUPCAS
i
An almost free equipage can have been caught up just before by another equipage or can be catching up
another equipage. Catching up case PROCEBEHCATCHUPCA
or PROCESSCATCHUPCAS is processed depending on which case occurs. If neither case occurs, neither alterna-tive is processed. 'PRJIÃEH CÃHIRPCA
\
BEHCACHUP=F X; I i NHWKEIMEäEDE åmxxB DRDEI vacantandwantgototrackB / OCHANGE
O
TETRMIH3) VTI MEDDELANDE 143When an equipage is caught up its model data are updated to the current time. The equipage also examines whether the vehicle can, and whether tha driver wants to, move
into the auxiliary track, EXAMTRACK3.
PRIIBS'
CAEIEECMS
EKLD SHEEL (E5BJUCH
IIUNE FOHWED IEBEWÃ
objinsametrack4. / 1/ L 0 o o o o REMITOMV while not followpoint ai' PNHTULHIV DMEEOD
âgåfwnüå'
Slomu,
SIGWE,
IKED
: DRFE
Ãwüäp BAGQQRD TFKl v
When an equipage (A) in track (2) is assumed to catch up with another equipage (B) in the road block, (A)
will await the point when catching up takes place,
-'HOLD - and will update the model data, - DRIVE -.
If the equipage which is caught up is in the same track
'(2) it will then, and only then, be reactivated,
- SIGNALFORWARD -. In the next step equipage A selects
30
catching-up behaviour, - CHSECATCHUPBEHA. - (A) then
examines whether (B) enters the side area/auxiliary track.
If equipage (B) which is caught up enters track (3) equipage (A) will pass (see - PASS - below).
If equipage (B) remains in track (2) equipage (A) is offered a flying overtaking. If a flying overtaking is accepted (A) changes track from (2) to (1),
- CHANGETOTRACK(1) -.
*
If (A) does not accept the conditions for a flying
overtaking (A) prepares to follow (B), PREPFOLLOWING 2 -by adaption to following or until its.following point
has been reached, i.e. (A) has retarded to (B:s) speed. A following variable, FOLLOWING is set to TRUE
-in conjunction with adaption of equipage (A). In the same way an updating is made of the predicted time and speed at the next block limit passage, - RDUM -, and of the average speed, - AVERSP - if the equipage behind is affected by (A:s) adaption it will be reactivated,
- SIGNALBACKWARD - .
If an equipage in track (l) is affected it will be
reactivated, - SIGNALTRKl -.
The seguence is concluded by equipage (A) awaiting the
next event time, - HOLD -, and updating model data,
- DRIVE -.,
EmSS notcxmstaünai amüxadçâ ;nssnmm3) . not catchingup(2) P - A . EmSSMäREE ----INTTIHEE- ETNI-PAS ' IEBI
while initial- while not
points or lpnt finishpnts
INIT FREBX
HOLD i
PASBODY
w
DRIVE .
GOASIDEPZ
'
ASIDEPZF
while initial- while lpnt ponuxsamirmtlpnt
HOLD x
HOLD x
DRIVE DRIVE
When equipage (A) is in track (2) during passage
- PASS - it is assumed that (A) is unconstrained and
32
that there is an equipage to pass in track (3) PASS -ASFREE -. If the above assumptions are not fulfilled
- "PASSASFREE" - is abandoned. ' Passing in accordance with "PASSASFREE" consists of
an initial phase, - INITFREEPASS -, and a concluding
phase - FINIPASI.'
In "INITFREEPASS" equipage (A) is moved to a point in front of one or more equipages which have been passed
-one at a time, - INITFREEPASBODY -.
PasSing of each individual equipage consists of two parts. The equipage is moved first to a point
abreast With the equipage being passed, - GOASIDE2 -. (A) is then moved to a point just in front of the passed equipage, - ASIDEPZF -.
The passage sequence is furthermore divided into several parts with regard to block limit passages. The
various parts are delineated by event times which are awaited, "HOLD" and model data are updated, "DRIVE",
cmxsE
nmnrw
BEHA
paaüng //Imssxs O
PMEmGIWp
(xmsTRmmmD
TÃK
A constrained equipage in track (2) selects driving behavoiur, - CHOOSEFOLLOWBEHA -, which may be passing an equipage in track (3) - PASSAS - CONSTRAINED -, or
preparing for an accelerated overtaking, -
"PREPACCOV-TAK"
ImSSMS ' (INSIWUNED
INEHms
J
ETNHHBIH
while initial- while not
points or lpnt finishpnts
i
I
x
IKLD x
+ DRRE CONTINUE TOJAMSPNTwhile initial-
while lpnt
points and notlpnt J
HOUD X
En:) X
DRIVE DRIVE
The sequence in a passage where the current equipage (A) is constrained, "PASASCONSTRAINED", is carried out in the same way as in a passage where the current' equipage is free, compare "PASSASFREE" above. Only predictions of road coordinated, times and speeds are made in a different way.
'34 PñämCC
not tired while true \\\\\ 4 tn \\
WKUEOR
PHxNERmm;
ååäég§§?=F
HON) X
OVEECGME* (XIES _TRM3 1) DRDEZ
while not while not overtak- accover-occas taking accepted . l .
IKLD
x
x
nanm
IKLD WAIDEW DRIVE OVERICCEÃS Whikanot overtak-occasHon)
x
DRIVEWhen a constrained equipage considers an offer of
accelerated overtaking - PREPACCOVTAK -, it is assumed
that the driver does not give up his attempts to find
acceptable overtaking conditions. The-driver may
however give up, - GIVE UP -, with a particular
proba-bility, p, which at present is p :4 O.
>With the above assumption the equipage follows the preceding equipage until the overtaking conditions are
fulfilled and an accelerated overtaking is considered - WAITFOROVTAKOCCASF -, the equipage then examines
whether it should begin overtaking, PROOVERTAKOCCAS -if the overtaking conditions are not accepted a new opportunity is awaited, - WAITNEWOVTAKOCCAS -, for
accelerated overtaking. If an opportunity for
accele-rated overtaking is finally accepted the equipage
changes track to track (l) - CHANGETOTRACKl -.
DKH'TO AEKHZ following and omtxadçâ O FOLLOWINGz=F TRMEI,
When an equipage is_constrained in track (2) it is assumed, as mentioned above, that the equipage is able to follow the preceding equipage. If this assumption
proves wrong the accepted program section is interrupted
and the alternative section - NOTTOABTOlZ - is processed
instead.
36
.-.lm
EXAM
FIRST
'
-_
TIME
FREEB
?owman
.
1//// mücxüüüüñ»
» tofols,._/ I
- P A
CCIVIPL ALMOST .
-
FREEB
.FREEB
.. BODY FOUH'IIIVG:=FMSE
MEHDE:=O HIUWB v HXBWHM3=F
" CFANGE'IUTRACK(2)
When an equipage enters track (3) it first examines its front/rear relationship to other equipages in the track to find out whether any of these are affected
and need to be reactivated, - EXAMFRBE3 - if the
equipage has just changed to track (3) a minimum time
is set in track (3), - FIRSTTIME - the equipage
continues to be free, - FREE3 -, and is finally
constrained, - CONSTRAINED -. The duration of freedom
or constraint can be 0.
A free equipage moves first completely free COMPLFREE3 -then almost free - ALMOSTFREE3 - (catches up).
A constrained equipage assumes that it is able to
follow a preceding equipage in track (3), - BODY -,
and follows, - FOLLOW3 -, until a return to track (2)
is possible,
Hereby actual model data are reestablished and the equi-page returns to track (2) - CHANGETOTRACK(2) -.
If a constrained equipage is unable to follow the preceding equipage the variable - FOLLOWING - is set
to False.
GWPLHEE3
I
while not (can return or
catching up 3 or constrained)
I
HON) DRRE
An equipage in track (3) is completely free,
- COMPLFREE3 -, as long as it cannot return to track
(2) or catch up with the preceding equipage in track
(3) or is constrained. ALMDST FREEB not constrained and catchingUpB
:Kub
0
0
DRDEI ________ FOLLOW::TRUEIf an almost free equipage, - ALMOSTFREE3 -, is about to catch up a preceding equipage in the road block, the equipage will wait until the catching-up point, - HOLD -. The model data will be updated, - DRIVE -, and the - FOLLOW - Characteristic of the equipage will
be set to "True".
. 5 i
while hot :an reünrg
i
IKLD DRDE:
A constrained equipage followsmthe preceding equipage
as long as it cannot return to track (2).
38
amnm
amma
ann!
ammm
mmm
ggg_
§2;
amma
mmmxx
an
mmmmx gg?
BMX
nn '
(m
Gus
(m
mmm
baobåotip//////R\\\\\ \,nnnmnnsqo
o
nmwmwmnn
Hmmm
ADED
When an equipage comes to track (l) it is assumed that the overtaking (of one or several equipages in the pla-toon) will be followed Up - TRACKlBODYl - . The equi-page first examines its forward - behind relationship with regard to other eguipages in order to-know whether any of these are affected and need to be reactivated - EXAMFRBEl -. The equipage is moved first to a point abreast with the equipage being overtaken INITIAL -is then moved until a return to track (2) -is possible
- CONTTOOVFINPNT -.
When the equipage overtakes a platoon of eguipages in track (2) overtaking may have to be interrupted before the platoon-leader has been overtaken. The overtaking eguipage then moves to the nearest position where it
can force itself in between two eguipages in the platoon
- SHORTCONCLUS -. The equipage concludes its overtaking by return to track (2). Prediction of time for next passage of blockborder and speeds is done PREDICT -and the equipage behind is reactivated - REACTBACKWARD -.
INITIAL
I while initialpoints aminotlpntINITIAL X
BODY
//
GNEHDE PNTl ASHIPlThe above program section agrees with the previous
section, - INITFREEPAS -, apart from the location of the equipage subject in track (l) instead of track (2),
i.e. during overtaking instead of passage. This relates
to both cases, i.e. the equipage subject may be free or
constrained.
The structure charts for - GOASIDEPNTI -, - ASIDEPl -, - CONTTOOVFINPNT -, and - SHORTCONCLUS - are described
below. Since they have.similar structures
- GOASIDEPNTl - alone is described in more detail.
The more important differences for the other structures
are indicated in the chart.
_40
(EXEEDE
ENTl
1!
while initialpoints and not lpnt ' GNEEDE ENTHKDYEMEE
INIUEL
not catchingupl -not behcatchup not constrained IKKE BERGnot constrained not constrained and catchinguPl and behcatchup
EKED 0 DRRE FOQINhäUKE ÃlMOST FREEl
»hcatchup:=F O HOUD BERG? CONSTRAINED l INIT eonstrained and beabtofolr \\
'IKLD P)
EDLEWENG35&
DRDEI
ENEE
In - GOASIDEPNTl - the overtaking equipage is moved forward until it is abreast of the equipage being
overtaken.
"GOASIDEPNTl" consists of an iteration of
- GOASIDEPNTlBODY _ in which events occuring before
the point where the equipages are abreast; such as block border passages, are processed;
In "GOASIDEPNTlBODY" the overtaking equipage is moved forward first as a free equipage, - FREElINITIAL -,
and then as a constrained equipage, - CONSTRAINEDlINIT -.
In - FREElINITIAL - it is assumed that the overtaking
equipage neither catches up with the equipage in track (l) nor is caught up nor is constrained.
The equipage awaits the next event time, "HOLD", upon
which model data are updated, "DRIVE".
If any of the assumptions are not fulfilled the
equipage is processed in - ALMOSTFREEl -.
If the equipage is unconstrained but catches up
another preceding eguipage in track (l) this
catching-up point is awaited, "HOLD". Model data "DRIVE" are
then updated and variable "FOLLOWING" is set to "True". If the equipage is unconstrained and is caught up
variable - BEHCATCHUP - is set to "False". The next event time is then awaited, "HOLD", and model data
are updated, "DRIVE".
If however the equipage is constrained nothing happens in "ALMOSTFREEl" and the continuation is processed in - CONSTRAINEDlINIT -.
In CONSTRAINEDlINIT it is assumed that the eguipage is constrained and can follow the prededing equipage. The next event time is awaited, "HOLD", and model
data are updated, "DRIVE" if the assumption is not
fulfilled the variable "FOLLOWING" is set to "False".
42
The "GOASIDEPNTI" chart has now been described and the three remaining charts will be briefly commented upon.
Asnml "qume Amnmlx r Enn Amnmm mtrained and bamqpv mm: P HLKMEBFA mmm EEE
In - ASIDEPl -, the program requires the overtaking
equipage to be moved forward in order to examine
whether track 2 contains a further equipage which may
have to be overtaken.
Since this movement (As) is relatively small (As = 3 m)
the structure is Simplified in that the ALMOSTFREE
-case is disregarded.
exactly to - "GOASIDEPNTl" - above.
VTI MEDDELANDE 143
mmcnmnnumñ omsümnu
tandxmamdmp bäüuib
mx:a§günmpl
1-1010
ALMJSI' A
HOLD
mamma::A
DRIVE .FREElA DRIVE FASE
rntomSüanmd mzaxGUEnwd
and catchingupl and behcatchup \
HOLD O becatchupz=F '0 ' O
DRIVE NEWPRETIME :=TIME
' G: =T DRIVE .
In - CONTTOOVFINPNT - the concluding phase of over-taking is processed, i.e. until the final point is
44 smmmxm CMS
I
whüerbtszUmnmn530m
CHEHIN FHEES CDMHS EEE FDH nazaxsmmnmd v _ rntbdmmxmm omsüahmd nazafçdum3pl Indxnñnr . A * A'ml-ID P -AFREElS HCID P WG2=
DKWE DKWE ENSE
nd:cxsüaüñai tcnmününai
annáámmpl lxhämdmp
HOID U BECA'I'CHUP :=FT 0
DMWE MWPHHEMüätmE
----Lumnmsq* [BBB
When the equipage overtakes a platoon of equipages in
track (2) overtaking may have to be interrupted before the platoon leader has been overtaken. The
equipage must then force itselt in between two
equi-pages_in track (2), i.e. interrupt overtaking of the platoon. This is procesSed in - SHORTCONCLUS -. The
logic of this program structure corresponds exactly
to "GOASIDEPNTl" above.
SOURCE PROGRAM LIST -I O Q Q O U \ t L : J N -s 4 . . ) M . . . . . . . h -I -I -.l -A ' k a n ä' b d .4 CD 19 20 22 23 2h 25 26 27 28 29 30 31 32 33 3h 35 ?6 27 38 39 50 B1 M2 3 nu BS U6 57 MB 9 50 BEGIN . REF(INFILE)STYRDATÅ,TAPEIN,VEHTAPE,SIGHTDATÅ,OVTAKDATA: REF(OUTFILE)WRIOUT:
REAL ARRAY LIMIT1(124,1:2,1:2,1:23,LIMTT2(1:U,1 2,' 2,1 2), OVTAKEPR(?:U,1:2,1:2,1:2).DATAPOINT(1:<,1 5),
WDO(1:25,1:32),C2(1:4),BASDISSP(1 25); TEXT LABE;
REAL ROADLENGTH,MAXVEHGENERÅTORTIME,PRECISION;ACCDEM,TRK?PR,DEACC,C1, TRK?FORDROJ,RDUM,WRITIME,PRTIRED,CUTOFFTIME;
INTEGER I,J,M1,N2,RANDST,SPCLDIFF,TRK3VRED,DAT; INTEGER ARRAY NUMOFBL(1:2);
BOOLEAN LOUTP,CONTOUTP,ERR: PROCEDURE RAWLAB; BEGIN _ TAPEIN.INIMAGE;LARE:-TAPEIN.INTEXT(20):DAT::TAPEIN.ININT; WRIOUT.OUTIMAGE;WRIOUT.OUTTEXT(@ 0 Q): WRIOUT.OUTTEXT(LABE):WRIOUT.OUTINT(DAT,6); END RAWLAB; ' LABE:-BLANKS(20); BEGIN REAL SPEED,K!; INTEGER N,I; 1::1; FOR SPEEDz= 18.20,20.35,21.u7,22.22,23.0u ,23.6u,2u.16,2u.6u,25.11,25.56 ,26.00,26.U?,26.86,27.?O,27.75 ,28.20,28.68,29.19,2Q.7u,30.3u ,31.00,37.72,32.66,?u.29,37.50 D0 BEGIN'* BASDISSP(I):=SPEED; I::I+1; END; SPEED::BASDISSP(1?);
FOR N:=1 STEP 1 UNTIL 25 D0 BEGIN
FOR 1::1 STEP 1 UNTIL ?2 DO BEGIN K1:=O.8-I/10.0: WDQ(N,I)::BASDISSP(N)**K1-SPEED**K1; END; END; END; RANDST:: ; SPCLDIFF:=1; PRECISION:=O.CO$; C1::O.108: C2(1)::0.00GU59; C2(2)::0.000281; VTI MEDDELANDE 143 i
10? 10h 105 106 107 108 109 110 46 C2(3):=0.000153: C2(U)::0.000103; PRTIRED:=0.0; ACCDEM:=0.25; DEACC::?.O; TRK3PR::1.0; TRK3F0RDR0J:=5.0; TRK?VRED:=O.Q; . -WHIOUTz-NEW 0UTFILE(@UTSKRIQ>;WRIOUT.0PEN(BLANKS(120)); STYRDATAz-NEW INFILE(§STYRDATAQ):STYHDATA.OPEN(BLANKS(80)); STYRDATA.INIMAGE; ' -N1:=STYRDATA.ININT; N2:=STYRDATA.ININT{
IF STYRDATA.INCHAR='L' THEN LOUTP:=TRUE; IF STYRDATA.INCHAR='C' THEN CONTOUTPzzTRUE;
FOR J:=1,2 DO FOR I:=1,2,3 DO DATAPOINT(J,I)::STYRDATA.INREAL; STYRDATA.INIMAGE;
MAXVEHGENERATORTIME::STYRDATA.INREAL; CUTOFFTIME:=STYRDATA.INREAL:
WHITIHE::STYRDATA.INREAL; STYRDATA.CLOSE;
WRIOUT.OUTTEXT(Q 0 MAX VEHGENERATOR TIME:ê); WRIOUT.OUTFIX(MAXVEHGENERATC.TIME,1,7): WRIOUT.OUTTEXT(@ CUTOFFTIME:6);
WRIOUT.OUTFIX(CUTOFFTIME,1,7): wRIOUT.0UTIMAGE:
WRIOUT.OUTTEXT(Q 0 NUMBER OF BREAKPOINTSQ): _ WRIOUT.OUTINT(N1,S):WRIOUT.OUTINT(N2,5);WRIOUT.OUTIMAGE; IF LOUTP THEN WRIOUT.OUTTEXT(@ 0 SMALL OUTPUTê)ELSE WRIOUT.OUTTEXT(@ 0 BIG OUTPUTG):
IF CONTOUTP THEN
BEGIN WRIOUT.OUTIMAGE;
WRIOUT.OUTTEXT(G 0 CONTROL OUTPUT WRITIME:@); WRIOUT.OUTFIX(WRITIME,1,7)
END;
OVTAKDATAz-NEW INFILE(@OMKORDATA@);OVTAKDATA.OPEN(BLANKS(80));
BEGIN
INTEGER T,VB,ST,OMT;
'COMMENT TYPE ON VEHFRONTOF,ROADWIDHCLASS,TYPE ON SIGHTLIMIT, OVERTAKINGTYPE; FOR T:=1 STEP 1 FOR VB:=2,1 DO FOR ST:=2,1 DO FOR OMT:=2,1 D0 BEGIN OVTAKDATA.INIMAGE; OVTAKEPR(T,VB,ST,OMT);=OVTAKDATA.INREAL; LIMIT1(T,VB,ST,OMT)::OVTAKDATA.INREAL; LIMIT2(T,VB,ST,OMT):=OVTAKDATA.INREAL; END; OVTAKDATA.CLOSE; END; UNTIL U DO SIMULATION BEGIN REF(HEAD)DIRECTION1,DIRECTION2; REF(HEAD)ARRAY TRACK(1:2,1:7); REF(ROADBLOCK)BLOCK1,BLOCK2,BLOCK3;
REAL ARRAY BREAKPNTKOORD1(1:N1),BREAKPNTKOORD2(1:N2), SfGHTDISTANCE1(1:N1),SIGHTDISTANCE2(1:N2);
PROCESS CLASS VEH:
BEGIN INTEGER ID,0WNTRACK;
111 BOOLEnN D1,POLLOWING,BEHCATCHU?,FINISH; 112 INTRGER ORIGN,DHST,TYPE,SPCLASS,TIMEHEADWAY,BLOCKNF,DIRNU; 113 REAL åIRRESISTANCE.P,PREBLTIME,1BWPRETIME,PREBLSP,LOCALSP,LOCALS. 11a LOCALTIME,MINTIME,ARRIVALTIME,AVERSP: 115 REF(PSEVDOVEH)PSVEH; 116 REF(ROADBLOCK)BLOCK;
17 REAL PROCEDURE VBL(BLOCK,VKLASS); 18 \ REF(ROADBLOCK)BLOCK;INTEGER VKLASS; 119 INSPECT BLOCK DC 120 BEGIN 121 REAL A,C; 122 INTEGER B; 123 A:=WO ; 12h B:=-10*(A-O.8); 125 C:=WVBL**A; 126 VBL:=(C+WDO(VKLASS,B))**(1/A); 127 END VBL;
128 BOOLEAN PROCEDURE CONSTRAINED; 129 CONSTRAINEDzzFOLLOWING;
130 BEGIN
131 BOOLEAN PROCEDURE CATCHINGUP(X); 132 INTEGER X;
133 BEGIN
134 REF(VEH)VF;
135 VF:-VEHFORWITRK(X):
136 IF VFz/zNCNE THEN CATCHINGUP:=PST(VF,
137 PREBLTIME-VF.TIMEHEADWAY)<PST(CURRENT,PREBLTIME)+ 138 TRUNKLENG(CURRENT,VF)
119 END CATCHINGUP;
130 BOOLEAN PROCEDURE VEHOBJCATCHINGUP(VO); 1u1 REF(VEH)VO;
1H2 BEGIN REF(PSEVDOVEH)PSF;REF(VEH)VF; 1u3 PSF:-VOLPSVEH.PRED;
1uu IF PSF:/:NONE THEN VF:-PSF.REVEH;
1u5 IF VFz/:NONE THEN VEHOBJCATCHINGUP::PST(VF,VO.PREBLTIME-VF. 1H6 TIMEHEADWAY)<PST(VO,V0.PREBLTIME)+TRUNKLENG(VO,VF) 147 END VEHOBJCATCHINGUP; 1N8 REF(PSEVDOVEH)PROCEDURE BACKHARDITRACK(X); 1U9 INTEGER X; 150 BEGIN 151 REF(PSEVDOVEH)PSVEHOBJ; 152 REAL S1; 153 PSVEHOBJ:-TRACK(DIRNU,X).FIRST; 15h' S1:=PREDS(CURHENT); M
155 WHILE(IF PSVEHOBJ:/:NONE THEN PSVEHOBJ.REVEH.LOCALS>=S1 ELSE FALSE)DO 156 -PSVEHOBJ:-PSVEHOBJ.SUC:
157 WHILE(IF PSVEHOBJ=/=NONE THEN PREDS(PSVEHOBJ.REVEH)>=S1 ELSE FALSE)DG
158 159 160 161 162 163 16h 165 166 167
168
169
170
171
172
173
1711
175 176 177 178 79 180 181 182 183 18h 185 186 187 188 189 190 191 192 193 19h 195 196 197 198 199 200 201 202 20? 209 REAL REF(VEH) VEH; 48 PSVEHOBJ:-PSVEHOBJ.SUC; BACKHÅRDITFACK:-PSVEHOBJ: END BACKWÄRDITRACK; REECVEH)PEOCEDURE VEHBEHITRK(X); INTEGER x: BEGIN REF(PSEVDOVEH)PSVEHOBJ; PSVEHOBJ:-BACKWARDITRACK(X):IF PSVEHOBJ=/=NONE THEN VEHBEHITRKz-PSVEHOBJ.REVEH; END VEHBEHITRK; REF(VEH)PROCEDURE VEHLITRK(X); INTEGER X; BEGIN REF(PSEVDOVEH)PSVEHOBJ; PSVEHOBJ:-EOINTRACK(X);
IF PSVEHOBJz/:NONE THEN VEHLITRK:-PSVEHOBJ.REVEH;
END VEHLITRK; '
BOOLEAN PROCEDURE VEHINTRK1AFFEC; VEHINTRK1AFFEC:=PASING(1); REF(VEH)PROCEDURE VEHFORWITRK(X); INTEGER x; BEGIN REF(PSEVDOVEH)PSVEHOBJ: PSVEHOBJ:-FRONTOFITRACK(X);
IF PSVEHOBJ=/=NONE THEN VEHFORwITHK:-PSVEHOEJ.REVEE; END VEHFORWITRK; REF(PSEVDOVEH)PROCEDURE FRONTOFITRACK(X); INTEGER X; BEGIN REF(PSEVDOVEH)PSVEHOBJ; REAL 31; i a * "" PSVEHOBJ:-TRACK(DIRNU,X).LAST; S1::PREDS(CURRENT);
WHILE(IF PSVEHOBJz/:NONE THEN PREDS(PSVEHOBJ.REVEH)<:S1 PSVEHOBJ:-PSVEHOBJ.PRED; FRONTOFITRACKz-PSVEHOBJ; END FRONTOFITRACK; ' ELSE FALSE)DO PROCEDURE PST(VEH,T); REAL T; PST:=VEH.LOCALS+(T-VEH.LOCALTIME)*VEH.AVERSP;
REAL PROCEDURE TRUNKLENG(B1,B2): REF(VEH)B1,BZ: TRUNKLENG:=RMAX(0.0 ,SIGN(B1.AVERSP-BZ.AVERSP)* (B1.AVERSP-BZ.AVERSP) **2/(2.0*DEACC)); REAL PEOCEDURE'PREDS(B); REF(VEH)B; PREDs:=(TIME-B.L0CALTIME)*E.AVERSP+B.L0CALS; VTI MEDDELANDE 143
205 206 207 208 209 210 211 212 213 21h 215 216
2.17'
218 219 220 221 222 223 22h 225 226 227 228 229 230 231 232 233 23a 235 236 237 238 239 ZNO 2U1 2u2 2h? 2üü ZUS 2u6 2h? 2N8 2u9 250 251 252 25Q 255 255 256 REF(PSEVDOVEH)PROCEDURE EÖINTRACI(X): INTEEER x; BEGIN REF(PSEVDOVEH)P$VEHOBJ; REAL sx; PSVEHOBJ:-TRACK(DIRNU,X)4FIRST; S1:=PREDS(CURRENT);WHILE(IF PSVEHOBJ:/:NONE THEN PSVEHOBJ.REVEH.LOCALS>S1 ELSE FALSE)DO PSVEHOBJ:-PSVEHOBJ.SUC; '
WHILE(IE PEVEHOEJ=/=N0NE THEN PREDS(PSVEHOBJ.REVEH)>S1
PSVEHOBJ:-PSVEHOBJ.SUC;-IF(IF PSVEHOBJz/:NONE THEN PREDS(PSVEHOBJ.REVEH)=S1 EOINTRACKz-PSVEHOBJ;
END EOINTRACK;
ELSE FALSE)DO
ELSE EALSE)TEEN
REAL PROCEDURE RMAX(X,Y); REAL X,Y;
IF X>=Y THEN RMAX:=X ELSE RMAX:=Y;
BOOLEAN PROCEDURE PASING(X);
COMMENT X INDICATES EXAMINED TRACK; INTEGER X;
BEGIN REF(VEH)VF,VEHBEHINDQVEHLIKA;BOOLEAN BOL1,BOL2; VF:-VEHFORWITRK(X);
VEHLIKA:-VEHLITRK(X);
IF VEHLIKA=/:NONE THEN VFz-VEHLIKA; VEHBEHIND:-VEHBEHITRK(X);
IF VFz/zNONE THEN BOL1::LOCALS+TRUNKLENG(CURRENT,VF) >=PREDS(VF)-TAILLENG(VF)-0.8;
IF VEHBEHINDz/:NONE THEN BOL2::LOCALS-TAILLENG(CURRENT) <PREDS(VEHBEHIND)+TRUNKLENG(VEHBEHIND,CURRENT);
PASING::BOL1 OR BOLZ END PASING;
REAL PROCEDURE TAILLENG(B); REF(VEH)B;
TAILLENG:=B;AVERSP*B.TIMEHEADWAY;
BOOLEAN PROCEDURE SURPRISE; BEGIN
SURPRISE::TIME<NEWPRETIME-0.01; END SURPRISE;
BOOLEAN PROCEDURE WANT(OMT);
COMMENT OMTzTYPE OF OVERTAKING,1:FLYING,2=ACC; INTEGER ONT; BEGIN REF(VEH)VF; INTEGER T,VB,S1,ST: REAL 811,512; REF(PSEVDOVEH)PSVE; REF(PSEVDOVEH) ARRAY PSV(1:2); REAL SIGHT.ONCOSIGHT,REALSIGHT,G1,G2,0SAN,OMSAN; BOOLEAN BOL;
REAL PROCEDURE ONCOMVEHSIGHTITRK(X); INTEGER X;
BEGIN
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 27" 275 276 277 278 279 280 281 282 283 28h 285 286 287 288 289 290 291 292 293 293 295 296 297 298 299 300 301 302 30? 30h 305 306 307 308 309 310 311 312 313 31h 315 316 50 REAL ROADL.S1,S2: REF(PSEVDOVEH)PSVEHOBJ; SEO: SZ:=PREDS(CURRENT);
PSVEHOBJ:-TRACK IE D1 THEN 2 ELSE 1,X).FIRST; ROADL:=DIRECTION1.PREV OUA ROADBLOCK.WK+
DIRECTION1.PREV 00A ROADBLCCK.WL-DIRECTION1.FIRST QUA ROADBLOCK.WK; S1:=ROADL-S2;
WHILE(IF PSVEHOBJz/:NONE THEN PREDS(PSVEHOBJ.REVEH)>=S1 ELSE FALSE) DO PSVEHOBJ:-PSVEHOBJ.SUC; 'PSV(X):-PSVEHOBJ: IF PSVEHOBJzzNONE THEN ONCOMVEHSIGHTITRK:=SOOO ELSE -ONCOMVEHSIGHTITRK::ROADL-PREDS(PSVEHOBJ.REVEH)-82; SEOEND: END ONCOMVEHSIGHTITRK; VF:-VEHFORWITRK(2);
IF SPCLASS-SPCLDIFF<VF.SPCLASS THEN WANT::FALSE ELSE BEGIN
IF TYPE>=3 THEN T:=u ELSE IF TYPE=2 THEN T::3 ELSE
IF AVERSP>:2O THEN T:=2 ELSE T::1; VB:=BLOCK.ROADWIDH;
COMMENT PROCESS SIGHT; S1:=BLOCK.SIGHTREF; IF 01 THEN BEGIN FINDBREAKPNT1ITER:WHILE BREAKPNTKOORD1(S1)<=LOCALS D0 S1::S1+1; FINDBREAKPNT1END: SIGHT::INTPOL(BREAKPNTKOORD1(S1-1),SIGHTDISTANCE1(S1-1), BREAKPNTKOORD1(S1),SIGHTDISTANCE1(S1),LOCALS); 'END ELSE BEGIN FINDBREAKPNTZITER:WHILE BREAKPNTKOORD2(S1)<=LOCALS D0 S1:=S1+1; FINDBREAKPNT2END: SIGHT::INTPOL(BREAKPNTKOORD2(S1-1),SIGHTDISTANCE2(S1-1), BREAKPNTKOORD2(S1).SIGHTDISTANCE2(S1),LOCALS); END;
COMMENT PROCESS ONCOSIGHT DVS SIGHT RESPECT TO ONCOMMING TRAFFIC; SI1::ONCOMVEHSIGHTITRK(1): SI2::ONCOMVEHSIGHTITRK(2); IF SI1<SI2 THEN BEGIN ONCOSIGHT:=SI1; PSVE:-PSV(1); END ELSE BEGIN 0NCOSIGHT:=SI2; PSVE:-PSV(2); END;
COMMENT PROCESS SIGHTLIMITATION;
IF SIGHT<0NCOSIGHT THEN ST:=1 ELSE ST:=2;
REALSIGHT::RMIN(SIGHT,ONCOSIGHT); G1::LIMIT1(T,VB,ST,OMT):
G2:=LIMIT2(T,VB,ST,OMT); OSAN:=OVTAKEPR(T,VB,ST,OMT);
COMMENT PROCESS OVERTAKINGPROBABILITY;
IF REALSIGHT<=G1 THEN OMSAN:=0.0 ELSE
IF REALSIGHT>:GZ THEN OMSAN::OSAN ELSE
317 318 319 320 321 322 323 32U 325 326 327 328 329 330 331 332
333
321:
335 336 337 338 339 3u03u1
3u2
3113gun
Bus 3u6 347 3U8 3u9 350 351 352 353 354 355 356 357 358 359 360 361 362 363 36u 365 366 367 368 OMSAN:=INTPOL(G1,0.0,G2,0SAN,REALSIGHT); WANT:=BOL:=DRAW(OMSAN,RANDST);IF BOL THEN WRPOST(IF OMT:2 THEN
WRPOST(IF OMT=2 THEN 12 ELSE 11);5 ELSE B)ELSE
INSPECT WRIOUT DO BEGIN OUTINT(TYPE,3); OUTINT(VF.ID,5 ; OUTINT(VF.TYPE,3); OUTFIX(VF.AVERSP,3,8); OUTFIX(SIGHT,0,7); OUTFIX(ONCOSIGHT,O,7); OUTINT(ST,3);
IF PSVEz/:NONE THEN BEGIN OUTFIX(PREDS(PSVE.REVEH),0,7); OUTFIX(PSVE.REVEH.AVERSP,3,8);END;
END; '
END; END HANT;
BOOLEAN PROCEDURE OBJINSAMETRACK; BEGIN REF(VEH)VF;
VF:-VEHFORWITRK(0WNTRACK);
IF VFz/:NONE THEN OBJINSAMETRACK::
LOCALS+TRUNKLENG(CURRENT,VF)>=PREDS(VF)-TAILLENG(VF)-O.6 END OBJINSAMETRACK; PROCEDURE TS(TO,VC,SO,SBR,TST); NAME TST; REAL TO,VO,SO,SBR,TST; TST:=T0+(SBR-SO)/VO;
BOOLEAN PROCEDURE TIRED; TIRED::DRAW(PRTIRED,RANDST);
BOOLEAN PROCEDURE ALLOW; ALLOW::BLOCK.PASS<=O;
REAL PROCEDURE TIMETORETURNPOINT(C); CHARACTER C; BEGIN REF(VEH)VF,VB,VL; VF:-VEHFORWITRK(2); VB:-VEHBEHITRK(2): VL:-VEHLITRK(2); IF VL=/=NONE THEN VBz-VL:
BODYSCLT:IF NOT TIME<MINTIME THEN GOTO BODYOR1; IF Cz'F' THEN TRAVEL ELSE TRAVELCONSTRAINED; NEWPRETIME::RMIN(MINTIME,PREBLTIME);
TIMETORETURNPOINT::NEWPRETIME-TIME; GOTO BODYEND;
BODYOR1:IF NOT(IF VF:/=NONE THEN LOCALS+TRUNKLENG(CURHENT,VF)> PREDS(VF)-TAILLENG(VF) ELSE FALSE) THEN GOTO BODYOR2:
TIMETORETURNPOINT:= PREDTID(VF,C,LOCALS+TRUNKLENG(CURRENT,VF),VF.LOCALS-TAILLENG(VF)); GOTO BODYEND; BODYORZ:TIMETORETURNPOINT:: _ PREDTID(VB,C,LOCALS+TRUNKLENG(CURRENT,VB),VB.LOCALS-TAILLENG(VB))F BODYEND: VTI MEDDELANDE 143
370
373
372
373
37u
?75376
377
370
379
380
381 382 383 389 385 386 387 388389
390
391392
393
399
395
396
397
398
399
.uoo
01902
003
uou
nos
u06
907
008
u09
910
11 U1? H13 D1U U1S M16 ü17 B18 U19 N20 21 22 1123 NZU 52 END TIMETORETUHNPOINT:REAL PROCEDURE TIMETOCATCHINGUPOINT(X); COMMENT x INDICATES EXAMINED TRACK;
INTEGER x; ' BEGIN REF(VEH)VEHOBJ; VEHOBJz-VEHFORWITRK(X); IF CATCHINGUP(X) THEN TIMETOCATCHINGUPOINT::PREDTID(VEHOBJ;'F',LOCALS+ TRUNKLENG(CURRENT,VEHOBJ),VEHOBJ.LOCALS-TAILLENG(VEHOBJ)) ELSE BEGIN NEWPRETIME::PRERLTIME;TIMETOCATCHINGUPOINT::PREBLTIME-TIME;END; END TIHETOCATCHINGUPOINT; '
REAL PROCEDURE TIMETOCATCHU; BEGIN REAL T2,T?;
TF::TIMETOCATCHINGUPOINT(3): 4 IF T?<=0.02 THEN T?::PREBLTIME-TIME; T2::TIMETOCATCHINGUPOINT(2);
IF T?<T2 THEN TIMETOCATCHU::TIMETOCATCHINGUPOINT(3) ELSE TIMETOCATCHUzzT2;
END TIMETOCATCHU;
REAL PROCEDURE TIMETOSTARTPOSIBILITY; BEGIN INTEGER I: REF(VEH)VEHOBJ,VF,VB,BL; REAL BT; FOR I::2,1 DO BEGIN VF:-VEHFORWITRK(I): BL:-VEHLITRK(I); VBr-VEHBEHITRK(I); IF(IF VFz/:NONE THEN
LOCALS+TRUNKLENG(CURRENT,VF)>=PREDS(VF)-TAILLENG(VF) ELSE FALSEY THEN VEHOBJt-VF;
IF BLz/:NONE THEN VEHOBJ:-BL;
IF(IF VBz/:NONE THEN LOCALS-TAILLENG(CURRENT)<:
PREDS(VB)+TRUNKLENG(VB,CURRENT)ELSE FALSE)THEN VEHOBJz-VB; END; LOCALTIME::NEWPRETIME::TIME+(LOCALS+TRUNKLENG(CURRENT,VEHOBJ)+ TAILLENG(VEHOBJ)+2.0-PREDS(VEHOBJ))/VEHOBJ.AVERSP; PREBLTIME::LOCALTIME+BLOCK.WL/AVERSPä TIMETOSTARTPOSIBILITY::RMAX(0.01,NEWPRETIME-TIME); END*TIMETOSTARTPOSIBILITY;
REAL PROCEDURE TIMETOFINISHPOINT(C);
COMMENT C INDICATES FREE OR CONSTRAINED;
CHARACTER C; BEGIN REF(VEH)VEHOBJ; VEHOBJ:-VEHBEHITRK(OWNTRACK+1); TIMETOFINISHPOINT::PREDTID(VEHOBJ,C,LOCALS-TAILLENG(CURRENT)-1, VEHOBJ.LCCALS+TRUNKLENG(VEHOBJ,CURRENT)); IF AVERSP<VEHOBJ.AVERSP THEN BEGIN NEWPRETIMEzzPREBLTIME: TIMETOFINISHPOINT:zNEWPRETIME-TIME; END: END TIMETOFINISHPOINT; VTI MEDDELANDE 143
25 REAL PROCEDURE TIMETOOVTÅKOCC; U26 BEGIN
H27 TRAVELCONSTEAINED; .
28 IF(IF BLOCK.MAX:/O THEN LOCALS<RMAX(BLOCK.WK+O.3,8LOCK.MAX-?) 29 ELSE FALSEJTHEN NEWPRETIME::LOCALTIHE+
30 (BLOCK.MAX-LOCALS)/AVERSP ELSE NEWPRETIMEzzPREBLTIME: H31 TIMETOOVTAKOCC::NEWPRETIME-TIME;
N22v END TIMETOOVTAKOCC;
33 REAL PROCEDURE TIMETOSFINISHPNT(C); KBM' COMMENT C INDICATES FREE O CONSTRAINED; H35 CHARACTER C; 36 BEGIN REF(VEH)VB; H37 VB:-VEHBEHITRK(OWNTRACK+1)2 38 TIMETOSFINISHPNT::PREDTID(VB,C,LOCALS-TAILLENG(CURRENT)/2-1, U39 VB.LOCALS); MO END TIMETOSFINISHPNT;
UU1 REAL PROCEDURE TIMETOLPNT(C);
42 COMMENT C INDICATES FREE OR CONSTRAINED;
RNB CHARACTER C:
-NU BEGIN REE(VEH)VB;
HUS VB:-VEHBEHITRK(OWNTRACK+1);
UNG TIMETOLPNT::PREDTID(VB,C,LOCALS,VB.LOCALS+3.3); NU7 END TIMETOLPNT;
uu8 REAL PROCEDURE TIMETOINITIALPOINTS(C); ung COMMENT c INDICATES FREE OR CONSTRAINED; uso CHARACTER c;
u51 BEGIN
usz REF(VEH)VEHOBJ,BL;
u53 VEHOBJ:-VEHFORWITRK(OWNTRACK+1); usu BL:-VEHLITRK(OWNTRACK+1):
ass IF BLz/:NONE THEN VEHOBJ:-BL;
u56 TIMETOINITIALPOINTS::FREDTID(VEHOBJ,C,LOCALS-1.0,VEHOBJ.LOCALS); u57 IF AVERSP<VEHOBJ.AVERSP THEN
usa BEGIN '
u59 'NEWPRETIME::PREBLTIME;
uso TIMETOINITIALPOINTS:=NEWPRETIME-TIME;
61 END; .
62 END TIMETOINITIALPOINTS;
63 REAL PROCEDURE TIMETOFOLLOW;
nen BEGIN
u65 TRAVELCONSTRAINED;
u66 TIMETOFOLLOW::PREBLTIME-TIME;
u67 NEWPRETIMEzszEBLTIME; -'> ' -. - 'a-* i
-M68 END TIMETOFOLLOW;
69 REAL PROCEDURE TIMETOBLOCKLIMIT(C); N70 CHARACTER C;
u71 BEGIN
u72 IF c='F' THEN TRAVEL ELSE TRAVELCONSTRAINED; H73 NEWPRETIME:=PREBLTIME;
u7u TIMETOBLOCKLIMIT::NEWPRETIME-TIME;
H75 END_TIMETOBLOCKLIHIT;