do pdfm - Intelligent-Infrastructure

29 downloads 24334 Views 5MB Size Report
Python . .... 40. 4.2.4. Travel Time Calculation ...................................................................................................... .... 63. 4.2.9.4. Plot Cumulated Volume(Time) Function .
Cracow University of Technology Rafał Kucharski [email protected] Promoted by: Andrzej Szarata PhD Reviewed by: Prof. Andrzej Adamski

[MASTER THESIS] Designing a Visum based tool to defend the thesis: The static assignment transport models rely on assumptions that may result in model inaccuracy

Kraków 2010

2

Contents 1.

The Idea ........................................................................................................................................... 5

Outline of the thesis ................................................................................................................................. 8 1.

Formulation of thesis ......................................................................................................................... 9

2.

Methodological prerequisites ........................................................................................................... 10

3.

2.1.

Picture of transport modeling .................................................................................................. 10

2.2.

Definitions .............................................................................................................................. 11

Software description ....................................................................................................................... 21 3.1.

Overview ................................................................................................................................ 21

3.2.

PTV VISUM ............................................................................................................................ 22

3.3.

Python .................................................................................................................................... 34

3.3.1. VisumPy ............................................................................................................................. 35 3.3.2. Win32com .......................................................................................................................... 35 3.3.3. Graphical User Interface (WxGlade) .................................................................................... 35 3.3.4. Scipy and Numpy ................................................................................................................ 36 3.3.5. Pickle.................................................................................................................................. 36 3.3.6. xlwt ..................................................................................................................................... 36 3.3.7. Matplotlib ............................................................................................................................ 36 4.

The script ........................................................................................................................................ 37 4.1.

Main Window .......................................................................................................................... 38

4.2.

Main Flowchart and Sub-procedures ....................................................................................... 39

4.2.1. Open Visum and load version file ........................................................................................ 40 4.2.2. Select demand segment ..................................................................................................... 40 4.2.3. Select time distribution ........................................................................................................ 40 4.2.4. Travel Time Calculation ...................................................................................................... 41 4.2.4.1.

Traffic flow model ............................................................................................................ 45

4.2.5. Prepare Database ............................................................................................................... 47 4.2.5.1.

Get General Data ............................................................................................................ 47

4.2.5.2.

Get Path Data ................................................................................................................. 49

4.2.6. Set Journeys Departure Times ............................................................................................ 51 4.2.7. Main Calculation ................................................................................................................. 53 4.2.7.1.

General Information ........................................................................................................ 53

4.2.7.2.

Algorithm ........................................................................................................................ 56

4.2.8. Plot Space-Time Cylinder ................................................................................................... 58 4.2.9. Plot Characteristics ............................................................................................................. 60

3

4.2.9.1.

Result calculation sub-procedure .................................................................................... 60

4.2.9.2.

Main plot procedure ........................................................................................................ 61

4.2.9.3.

Plot Volume(Time) Function ........................................................................................... 63

4.2.9.4.

Plot Cumulated Volume(Time) Function ......................................................................... 63

4.2.9.5.

Plot Inflow/Outflow(Time) Function ................................................................................. 64

4.2.9.6.

Plot Travel Time(Time) Function .................................................................................... 65

5.

4.2.10.

Generate Excel Report .................................................................................................... 66

4.2.11.

Save/Load Database ....................................................................................................... 68

Evaluation........................................................................................................................................ 69 5.1.

Model used for evaluation ........................................................................................................ 69

5.2.

KA.ver ..................................................................................................................................... 70

5.3.

Simulation .ver files ................................................................................................................. 72

Simulation file number 2................................................................................................................... 73 Simulation file number 2................................................................................................................... 73 Simulation file number 3................................................................................................................... 74 Simulation file number 4................................................................................................................... 74 Simulation file number 5................................................................................................................... 75 Simulation file number 6................................................................................................................... 75 Simulation file number 7................................................................................................................... 76 Simulation file number 8................................................................................................................... 76 Simulation file number 9................................................................................................................... 77 Simulation file number 10................................................................................................................. 77 Simulation file number 11................................................................................................................. 77 Simulation file number 12................................................................................................................. 78 Simulation file number 13................................................................................................................. 78 Simulation file number 14................................................................................................................. 79 Simulation file number 15................................................................................................................. 79 Simulation file number 16................................................................................................................. 80 Simulation file number 17................................................................................................................. 80 5.4.

Simulations ............................................................................................................................. 81

5.5.

Data Analysis .......................................................................................................................... 81

5.5.1. OD pairs analysis .................................................................................................................... 83 5.5.1.1.

General analysis .............................................................................................................. 83

5.5.1.2.

Assignment analysis ........................................................................................................ 85

5.5.1.3.

Differences between simulations ...................................................................................... 87

1.

Links Analysis ......................................................................................................................... 90

5.5.1.4.

General Analysis .............................................................................................................. 91

5.5.1.5.

Link Travel Times ............................................................................................................ 93

5.5.1.6.

Inflow/Outflow Distributions .............................................................................................. 94

5.5.1.7.

Traffic Density.................................................................................................................. 95

5.5.1.8.

Impact of random departure time distribution .................................................................... 98

5.5.2. Turns Analysis ....................................................................................................................... 102 5.5.2.1.

Turn Travel Times .......................................................................................................... 103

5.5.2.2.

Differences between simulations .................................................................................... 105

5.6.

Summary............................................................................................................................... 109

6.

Proof ............................................................................................................................................. 110

7.

Conclusions ................................................................................................................................... 112

References ........................................................................................................................................... 114 4

1.

The Idea

The two-dimensional representation of transportation network, where volumes over links are indicated, is for many reasons widely used in transport studies. Volumes are usually understood as cumulative flow (the total number of users crossing the reference point on homogeneous network element: link, node, turn, etc. through assignment period) and that is probably the most desired data to collect from transport model. However, traffic conditions do not depend solely on cumulative flow. Most of the theories claim they depend mainly on temporal density of the traffic flow resulting in congestion, or bottleneck effects that dynamically affect travel time. Therefore, it’s desired to provide the transport model with actual time dependent traffic conditions. Static assignment methods rely mainly on network parameters derived from cumulative flow, rather than actual traffic conditions. It is debatable if assignment calculation that relies on cumulative flow data can provide good quality transport model. How to improve static transport model so that it provides dynamic data? The main idea was brought by Prof. Peter Nijkamp during his lecture in Poznan, October 2009 (Nijkamp 2009), when he mentioned Space-Time Cylinder. This Cylinder is a three-dimensional structure of which two dimensions (X, Y) represent the network area – i.e. City, Region, Country. The thing that the cylinder adds is the dynamics – the third axis of transport model, axis of time. The cylinder contains data about journeys being taken within assignment time over the network area. Journey will be represented via curve inside the cylinder. The example of Space-Time Cylinder in comparison to typical transport model is shown below.

1. We can see typical transport model with volume bar by the link. The thickness of bar reflects the traffic volume.

Figure 1 Two dimensional transport model

5

2. The same network, but represented as a space-time cylinder. Black lines represent transport network, and the colorful curves above are journey journeys.. Axes X, and Y are axes of space, and axis Z (vertical) is the axis of time. All journeys can be seen, rotation and filtering of cylinder gives information about traffic conditions.

Figure 2 Space-Time Cylinder The visual impact for the user of the model is immense. Dynamical paths are no longer the multi-dimensional multi vectors of numbers; they are curves inside well defined, and easy to interpret interpret space. We still can see the network as we used to, but simple 3d rotation of the default top-view top view of the network gives us variety of information. For example we can see how and when congestion occurs, we may see if our traffic flow models are appropriate, we can compare calculated travel times that with empirical ones, we can dynamically calculate shortest path for various departure times, and that’s just for the start. Space-Time Time Cylinder is calculated jointly with database that can provide numerous s additional information. In particular: continuous time functions of link volume, cumulated volume, travel time, and inflow distributions as Figure 3 Link Characteristics shows.

6

Figure 3 Link Characteristics

The range of data that can be gathered from the cylinder was tempting enough to make effort to generate it. Visum seemed to be a perfect tool to be extended to provide such data. It was known that Visum has its script interface that makes it flexible, and programmable. It was known that such a cylinder can be generated, and it was generated. PROBLEM I. Why do we want to base on static assignment and generate results like in dynamic assignment? That’s a hard question. The full procedure bases on Visum static assignment procedures. Initial plan was to make it available also for dynamic procedures, unfortunately it didn’t happen ( Mainly due to lack of description of dynamic assignment and fact that Visum dynamic assignment operates on discrete time intervals rather than continuous time variable). Nonetheless, such comprehensive analysis of static assignment can be very beneficial, and hopefully can bring reflection on the accuracy of static models, and where application of static models is reasonable. Moreover, the proposed structure can be easily employed in dynamic assignment and make its results far more user-friendly. The proposed core algorithm of calculation process is comparable to the ones used in Dynamic User Equilibrium, and possibly can be modified so that is executes full Dynamic Assignment. 7

Outline of the thesis Thesis starts with explanation of its idea followed by formal declaration of the thesis. Chapter 2 with methodological prerequisites contains inevitable definition of terms used in thesis declaration. Chapter 3 describes the software used to write the script, while Chapter 4 shows the script architecture and algorithm. Chapter 0 describes evaluation process. Final chapters are proof of the thesis and conclusions. Main and crucial part of the thesis is the Visum Add-On, which main functionality is generation of continuous time-dependent functions of network performances. Data from those functions is basis of thesis defense. The functions are generated and analyzed for typical Visum transport model. The evaluation of the results brings a conclusion that defends a thesis. In this paper, the script idea and algorithm are detailed, as well as brief overview of transport modeling theory. The paper contains also proposal for transport model evaluation For transport modeling professionals the most interesting will probably be generation of time dependent functions of link travel time, turn queuing time, link inflow density. One may also find interesting the lemma examining the relation between network journey start distributions and network performance (chapter 5.5.1.8). Moreover, evidenced impact of input data for the results of modeling can be helpful. Although key result of the thesis is a script, author has tried to formulate the thesis as a problem that can be solved using the script. Due to this, it may seem that script is only a tool for evaluation, but in fact, evaluation is held only to test the script. To make the thesis consistent its logical structure is: 1. 2. 3. 4. 5. 6. 7.

idea, formulation of thesis, methodological prerequisites, software description, script description –a tool to proof the thesis, evaluation – proving the thesis final proof of thesis

Whenever in thesis an expression “script” is used, it is supposed to mean the Visum Add-On Script, written by author in python language to prove the thesis. The “script” is fully described in Chapter 4. Author has tried to keep formal style of the thesis; however, there are several “Problem boxes” in the thesis. Those boxes are author’s way to share problems that he experienced in less formal way.

8

1.

Formulation of thesis

The Thesis that is examined in this paper is stated in logic language as follows: The static assignment transport models rely on assumptions that may result in model inaccuracy , what can be paraphrased as: The result of certain assumptions in transport models is their inaccuracy The thesis consists of following terms requiring definition: Transport model, assignment, static assignment, static assignment transport model, assumptions of static assignment transport models the term defined as the result is: inaccuracy terms are defined in following chapters of thesis. The thesis is a modal logic proposition with ◊ modal operator of possibility used: ◊ ( → ) where:

p is proposition: “The static assignment transport model rely on certain assumptions” q is proposition: “The model is inaccurate” so, the thesis would look like:

◊( → ↔ It is possible that ”If The static assignment transport model rely on certain assumptions then: The model is inaccurate” Due to modality of the thesis, reductio ad absurdum proof is suitable. The negation of thesis, can be stated as follows: The static assignment transport models rely on assumptions that may not result in model inaccuracy What is equal to: The static assignment transport models rely on assumptions that always result in model accuracy

Due to fundamental law of the Modal Logic written in S5 language ◊ paraphrased now as:

↔ ~□~ , the antithesis can be

“It’s possible that the static assignment transport models rely on assumptions that result in model inaccuracy” if and only if “It’s not necessary that the static assignment transport models rely on assumptions that will not result in model inaccuracy” Then to prove the thesis man need to prove that: The static assignment transport models relied on certain assumption can be inaccurate, and there is causation between assumptions and inaccuracy. Therefore, when the causality between assumptions and inaccuracy is proved, the thesis is defended.

9

2.

Methodological prerequisites

This chapter aims to cover the basics of the theories and concepts required to understand the idea of both the thesis and the script. The majority of its contents are quotations from referenced papers, however for a readers’ convenience it starts with a brief overall picture of transport modeling state-of-the-art covering all of and only all of the terms required to understand the thesis and the proposed script. The picture is followed by the sequence of definitions of various authors explaining transport modeling issues most important for the thesis. The overall view may seem eclectic, but the author’s intention was to collect different approaches from different classics of transport modeling, including: Papageorgiou, Willumsen, Ortuzar, M.Bell, Hehnser, Daganzo and more.

2.1.

Picture of transport modeling

(brackets give references to respective Definitions, Ctrl+Click to follow)

A transportation system (Def. I) can, with great benefit for its users, be represented by means of a transport model (Def. II). Mathematical model of transport system is it’s simplification described by means of equations and theoretical statements. Model is assumed to represent the reality from a particular point of view, moreover the model’s reaction on environmental changes is supposed to be similar to the reaction of modeled object (Def. III). Transport models differ in terms of detail, which depends on the model application. Detailed microscopic models (Def. IV) treat each agent in transportation network (vehicles, passengers, pedestrians) individually and model them using discrete traffic flow equations (queuing theory, car following model, etc.) while macroscopic approach in modeling (Def. V) treats platoons of vehicles and constant flow relationships are usually employed (simplified theory of kinematic waves, fundamental diagram, flow-density relationship, etc.). Microscopic models, therefore, use mainly simulation (Def. VI) process, which is often stochastic and nondeterministic (Def. VII). Transport model can be divided into demand model and supply model. The transport supply (network model) (Def. VIII) is modeled using graph theory as a set of nodes, and arcs, where nodes are interpreted as intersections, or interchanges, and arcs widely named links are elements between the junctions (road, railway, pavement). The demand (Def. IX) is modeled usually with a specific set of origin-destination nodes where journey can start and/or end. The quantities of journeys taken in transport network are gathered in OD matrix (Def. X), which is the result of demand modeling process which can be carried out variously, and the basic approach is to model three out of four classic stages of trip generation, trip distribution, and modal split (Def. XI). There is an interaction between transport supply and demand (Def. XII). On one hand commonly used speedflow curves, and capacity restrain functions (CR functions, or VDF functions) (0) assume that the link travel costs (Def. XIV) and travel time (Def. XV) increase while cumulative flow over the link move toward its capacity Def. XVI). On the other hand the shortest path (Def. XVII Def. XVIII) for demand OD pair is chosen as a set of links with minimal cost. This is a main cause for iterative nature of most of the assignment methods (Def. XX). There is a variety of available methods to assign a paths (routes) to demand and there’s significant distinction between static assignment (Def. XXII) , which assumes that traffic conditions do not vary over the time, and dynamic assignment (Def. XXIII) which consider fluctuations in travel conditions. The most significant assignment methods are: all-or-nothing assignment (Def. XXV) that doesn’t take into account the interaction mentioned above and relies only on shortest path search. Incremental assignment (Def. XXVI) which can be defined as a sequence of successive all-or-nothing assignments. Equilibrium assignment (Def. XXVII) which results (due to Wardrop’s principle) in a network in which none of the users can change his route without increasing his travel time. Stochastic Assignment (Def. XXVIII), which emphasize the variability in drivers’ perceptions, and others. Another part of transport modeling crucial for the thesis is variety of mentioned above traffic flow theories (Def. XXIX). Traffic can (compare with distinction between micro- and macroscopic models) be treated discrete or continuous. Discrete traffic flow theories are among others: car following models (Def. XXXIII), simulations and queuing theory applications (Def. XXXIV), while continuous ones rely mostly on fundamental diagram (Def. XXXV) based on simplified theory on kinematic waves (Def. XXXVI).

10

2.2.

Definitions

Def. I. Transportation System A transportation system basically consists of two elements: transportation supply, and travel demand. The transportation supply is the set of facilities and means available to users of the transportation network. The travel demand is expressed by numbers of users using the network for a given reason, with a transportation means, at a given time of a day. The interaction between transportation supply and travel demand produces a flow pattern on network links. A representation of transportation supply and a model of travel demand are necessary to compute the network flow pattern. Moreover, a model has to be built to simulate the interaction between the two elements (Papageorgiou 1991, 513) Def. II. Transport model A transportation model, like all models represents an abstraction of the real world. The aim of the modeling process is system analysis, forecasting and model-based preparation for decisions taken in real world (PTV Vision 2009, 16) Def. III. Model A model can be defined as a simplified representation of a part of the real world which concentrates on certain elements considered important for its analysis from a particular point of view. Models are, therefore, problem and viewpoint specific. [...] Mathematical models attempt to replicate the system of interest and its behavior by means of mathematical equations based on certain theoretical statements about it. Although they are still simplified representations, these models may be very complex and often require large amounts of data to be used. However, invaluable in offering a ‘common ground’ for discussing policy and examining the inevitable compromises required in practice with a minimum of objectivity(Ortuzar i Willumsen 2001, 2) Def. IV. Microscopic modeling Simulation models may be classified as macroscopic or microscopic. The term microscopic denotes a model that simulates the movement of individual vehicles. Macroscopic denotes a grouping of vehicles and the application of flow relationships of large systems (Papageorgiou 1991, 497) Def. V. Macroscopic modeling The macroscopic simulation approach vehicles.(Papageorgiou 1991, 491)

is

to

treat

platoons

of

vehicles

rather

than

individual

Beside macro, and micro scope, there’s also mesoscopic modeling, that tries to combine advantages of both. Def. VI. Traffic Simulation […] we first make a clear distinction between pure simulation models and assignment models (or alternatively, nonequilibrium and equilibrium models). We define assignment models as models that do take route choice into account, whereas the pure simulation models are “only” propagating the traffic flow along the given routes while no route changes take place (in fact, they can be used as a dynamic network loading component in an assignment model). Pure simulation models may be microscopic (at vehicle level) or macroscopic (at flow level).(Bliemer 2001, 10) Simulations are useful for small networks (or subnetworks such as weaving areas, interchanges and small freeway sections) without route choice where one can hope to obtain the necessary information to make predictions, and where problems of sensitivity of the results to the initial conditions do not arise. In instances like these, methods of dynamic traffic management based on models can be possible. It is my opinion that in any particular application one should always choose the simplest model that can predict what is at stake.(Daganzo 1999, 113) 11

Def. VII.

Indeterminism of traffic modeling

[…] it seems that models cannot be expected to provide precise (or even reasonable) predictions on a link by link basis for large congested networks. […] Nonetheless models can perhaps play some role in an evaluation process. If one decides for example, that traffic into the central part of a city should be meteres (so as to prevent crowding), it may be reasonable to use a simple and reasonable traffic model to predict the overall effects of the strategy in the city center. Of course those predictions still have t be taken with “a grain of salt”.(Daganzo 1999, 113) Def. VIII.

Network model

A transportation network is a flow network representing the movement of people, vehicle, or goods. Any transportation network can be represented as a graph in mathematical sense, consisting of a set of a links, and set of nodes. The links represent the movements between the nodes, which in turn represent points in space (and possibly also in time). (Bell i Iida 1997, 3) Def. IX. Demand Model Travel demand represents the users’ need to travel. It can be classified by reason, means and time. It is numerically expressed by the number of users DOD of an OD pair of nodes. The number of OD pairs depends on the adopted zoning. In general, it is a decreasing function of travel cost COD between nodes O and D (elastic demand)(Papageorgiou 1991, 514) Def. X. OD Matrix Matrices are one of the most important components of demand models. They are used to display the demand between each origin and destination zone (these are then called demand matrices). In OD matrices, the demand is coded (by the number of trips) from origin zone i to destination zone j.(PTV Vision 2009, 94) Def. XI. Four-step model (four-stage model) [...] The four stages relate to: •

Trip generation



Trip distribution



Modal split



Assignment

Each stage addresses an intuitively reasonable question: How many travel movements will be made, where will they go, by what mode will the travel be carried out, and what route will be taken? (Button i Hehnser 2000, 17) Def. XII.

Supply-Demand Interaction

Travel demand depends on travel costs. On the other hand, costs on links and paths depend on flow pattern. Therefore, a mutual interaction between demand and costs (as a measure of supply) is generated. This interaction has two simultaneous effects, definition of demand value DOD, a function of a travel cost, for each OD pair, and a flow pattern resulting from the distribution.(Papageorgiou 1991, 513)

12

Def. XIII.

Speed-Flow, Cost-Flow, Capacity Restrain, Volume Delay Functions

A familiar relationship in traffic engineering is that relating the speed on link to its flow. This concept was originally developed for long links in motorways, tunnels or trunk roads. [...] as flow increases, speed tends to decrease after an initial period of little change; when flow approaches capacity the rate of reduction in speed increases. Maximum flow is obtained at capacity and when attempts are made to force traffic volumes beyond this value as unstable region with low flows and low speeds is reached. For practical reasons, in traffic assignment this type of relationship is handled in terms of travel time per unit distance versus flow, or more generally, as a cost-flow relationship [...]. Traffic assignment methods taking into account congestion effects need a set of suitable functions relating link attributes (capacity, free flow speed) and flow on the network with the resulting speeds or costs. This can be written in general terms as: =

(

=

(

that is the cost on a link a is a function of all the flows V in the network, i.e. not just flows on the link itself. This general formulation is relevant in urban areas where there is a good deal of interaction between flows on different links and their corresponding delays [...]. However this can be simplified if one considers long links, that is links where most of the travel time takes place on the link rather than at the end junctions. In this case the function is said to be separable and we can write:

That is, the cost on the link depends just on its flow and the link characteristics. This assumption simplifies the estimation of these functions and the development and use of suitable trip assignment techniques. It must be recognized, however, that it becomes much less realistic as one works with denser and more congested urban areas. A number of general functional forms have been proposed to embody the general relationship in equation. The following are desirable properties [of the functions - RK] from the point of view of traffic assignment: •

Realism; the modeled travel times should be realistic enough.



The function should be non-decreasing and monotone; increasing flow should not reduce travel time.[...]



The function should be continuous and differentiable



The function should allow the existence of an overload region, i.e. it should not generate infinite travel time, even when flow is equal or greater than capacity. [...]



For practical reasons the cost-flow relationship should be easy to transfer from one context to another; the use of engineering parameters like free-flow speed, capacity, and number of junction per kilometer is therefore desirable.

Def. XIV.

Travel Cost

Travel cost functions are used in order to mathematically model the process of route choice. […] A traveler will choose the route which provides him or her with highest expected utility or the lowest expected disutility. The disutility of a route can be expressed in route costs, where the costs can include variety of attributes of the route. […] Some attributes are explicitly expressed in monetary costs, other attributes do not have a direct monetary value attached. The dominant attribute on which travelers base their decisions is generally the expected travel time. Some attributes – such as travel time and (to a lesser extent) fuel costs – are difficult to forecast in advance, since congestion makes these attributes less predictable. These observations of uncertainty imply that we are dealing with a stochastic decision process and this leads to the hypothesis that travelers base their route choice decision on expected route costs. Furthermore, each traveler may perceive or value route costs differently (i.e. they have different disutility functions) such that the route choice process is not uniform among travelers.(Bliemer 2001, 43) The travel cost of a link is assumed to be a function of flow , which represents the number of users moving on the link in a time unit; that is = ( . […] Thefunctions most frequently used in practical application are derived from theoretical considerations and experimental observation. They contain some parameters that should be estimated from observed data(Papageorgiou 1991, 513)

13

The flow units using a link may be travelers or the vehicles (cars, buses, aircraft) carrying them in the case of passengers. […] The costs of traversing particular link are the function of a number of its attributes, the most important of which is length, as this will affect travel time(Button i Hehnser 2000, 167) Def. XV.

Travel time

The link travel time functions describe how long it takes for […] vehicles that enter link a at time instant t to reach the end of the link. A common hypothesis is that the link travel time increases as it gets “busier” on the link. The term “busier” can in modeling mean that the link inflow rate increases or that the link occupancy increases. (Bliemer 2001, 47) Def. XVI.

Capacity

It seems reasonable to suppose that every link has a maximum flow that it can carry, referred to here as its capacity. In the case of the roads, this is often taken to be the rate at which a queue of cars discharges over a stop line, which has been found to be about 1900 cars per hour per lane, with variations between countries. […] The capacity of path is the minimum of the capacities of the constituent links.(Bell i Iida 1997, 34) When the outflow rate reaches a certain level called the outflow capacity, congestion occurs and travel time increases on that link. Outflow capacity is time dependent, it depends on conditions of connecting links. (Bliemer 2001, 47) Def. XVII.

Path

By the path problem we shall mean the following: ℎ

!"#

!

&'



%$" (

#) % !# &'

A general procedure for determining all the solutions to the path problem has been described by Riguet (Berge i Ghouila-Houri 1962, 170) Def. XVIII.

Shortest Path

The shortest path problem is the following: *

!ℎ

,. 4

ℎ +, $$# !ℎ 5

! " !ℎ

#)

(Berge i Ghouila-Houri 1962, 175)



! 6 % !#

,

-)&

., ≥ 0 "ℎ ℎ " 11 &

! 6 &% $- ℎ !ℎ ! !ℎ !#! 1 1

7 1 $ $ $) 11 $ #$$ &1

11

!ℎ

!ℎ

2

1

!ℎ2 #

∈9

A crucial step in many network programming methods is the finding of shortest (or, more generally, least cost) paths between any pair of nodes or centroids.(Bell i Iida 1997, 25)

14

Def. XIX.

Shortest Spanning Tree

Given a connected, undirected graph, a spanning tree of that graph is a subgraph which is a tree and connects all the vertices together. A single graph can have many different spanning trees. A minimum spanning tree (MST) or minimum weight spanning tree is then a spanning tree with weight less than or equal to the weight of every other spanning tree.(Gallager 1983) # $

#

"ℎ ℎ $

11

!

!$ 1

(Berge i Ghouila-Houri 1962, 177) Def. XX.



= (:, ; ,

!ℎ. *! $

-

!#

!#

(

!

- ∈ ; $$

= = (:,

7 1(- $ $ $ℎ# ! $ #$$ &1

,

-)&

"ℎ#$ 1

1(- ≥ 0 !ℎ

>∈?

Assignment

Traffic assignment is the process of allocating all the trips in one or more trip matrices to their routes (paths) in the network, resulting in flows on its links. This task is undertaken following certain rules or principles of route choice, and is deemed to represent travel behavior in some realistic or desirable way.(Button i Hehnser 2000, 169)

Given transport network supply and travel demand, a traffic assignment model determines an optimal trade-off between supply and demand, based on some given decision rules. These decision rules include the route choice beahviour of the travelers (which in many models are the only rules). The outcomes of the model are the route split proportions, the traffic flows, and the travel times and costs of the network.(Bliemer 2001, 6)

Assignment models for mathematical traffic analyses have been proposed since the 1950s and since then a great evolution of these models has taken place. It started with the traffic equilibrium definitions given by (Wardrop 1952) that were translated into practical mathematical optimization problem by Beckhan (1956). This model has received a lot of attention in the literature and has been continuously imporeve dand extended. While the first models all considered the static traffic assignment problem, dynamic traffic assignment models have been developed at a rapid pace since the 1970s. Although static assignment models still play an important role in traffic analyses (especially long-term), one has come to realize that traffic is essentially a dynamic process that cannot satisfactory be captured by a static modeling approach. More and more effort is put into making dynamic assignment models produce empirically more realistic outcomes and computationally more efficient, resulting in a wide variety of different approaches to the dynamic traffic assignment problem.(Bliemer 2001, 9)

Def. XXI.

Path Choice

When considering path choice, the shortest (or least cost) path will in many cases not be chosen for various reasons, principally a lack of knowledge or errors in perception(Bell i Iida 1997, 29) Def. XXII.

Static and dynamic assignment

In classifying traffic models we can first of all make the distinction between static assignment approaches and dynamic assignment approaches. Static models assume that traffic conditions do not vary over time, while dynamic models explicitly consider fluctuations in link level variables (travelers on a certain link are affected by travelers traversing that link at an earlier time instant), route lever variables travelers’ route choice depends on the prevailing conditions at the time of departure) and sometimes even fluctuations in demand level variables(Bliemer 2001, 10) Def. XXIII. 15

Dynamic Assignment

The problem of dynamic assignment is to predict the temporal evolution of the traffic flow pattern on a congested transportation network where travel demands and travel costs vary over time and space. Its solution may be represented by trajectories of arc flow rates or densities over a specified time period. (Papageorgiou 1991, 521) Def. XXIV.

Static Assignment

The problem o static traffic assignment is to predict the traffic flow pattern under the following steady-state assumptions: travel demands and costs are time-invariant; and inflow rate is equal to outflow rate on each arc at each instant. The solution of a static assignment problem can be either arc flows or path flows measured in the number of vehicles per period of analysis. It is important to note that any static traffic assignment model cannot consider the dynamic changes in traffic congestion level that are often observed on urban transportation networks during peak hours. (Papageorgiou 1991, 521) Def. XXV.

All-or-Nothing Assignment

The simplest route choice and assignment method is the all-or-nothing assignment. This method assumes that there are no congestion effects, and for a single user class that all drivers consider the same attributes for route choice and that they perceive and weigh them in the same way. The absence of congestion effects means that link costs are fixed; the assumption that all drivers perceive the same costs means that every driver from A to C must choose the same route. (Button i Hehnser 2000, 173) Def. XXVI.

Incremental Assignment

[...]modeler divides the total matrix T into number of fractional matrices by applying a set of proportional factors pn such that ∑A A = 1. the fractional matrices are then loaded, incrementally, onto successive trees, each calculated using link costs from the last accumulated flows. Def. XXVII.

Equilibrium assignment

At equilibrium there is no incentive for any trip-maker to behave other than as he actually does.[...] Under equilibrium, demand is equal to supply at the prevailing costs to the users.[...]Proponents of equilibrium theory take it as an article of faith that, given the existence of an equilibrium, there are behavioral mechanisms which push the transport system to this fixed point (Bell i Iida 1997, 4) Def. XXVIII.

Stochastic assignment

Stochastic methods of traffic assignment emphasize the variability in drivers’ perceptions of costs and the composite measure they seek to minimize (distance, travel time, generalized costs). Stochastic methods need to consider second-best routes (Button i Hehnser 2000, 174) Def. XXIX.

Accuracy of model

A crucial part of the modeling process is the evaluation of whether or not a given mathematical model describes a system accurately. This question can be difficult to answer as it involves several different types of evaluation.[...] Usually the easiest part of model evaluation is checking whether a model fits experimental measurements or other empirical data. In models with parameters, a common approach to test this fit is to split the data into two disjoint subsets: training data and verification data. The training data are used to estimate the model parameters. An accurate model will closely match the verification data even though this data was not used to set the model's parameters. This practice is referred to as cross-validation in statistics. Defining a metric to measure distances between observed and predicted data is a useful tool of assessing model fit. In statistics, decision theory, and some economic models, a loss function plays a similar role.

16

Def. XXX.

Traffic flow

Physics has two theories of light, namely wave theory and quantum theory, both of which yield useful and verifiable predictions, but are not entirely consistent with each other. So too there are two theories of traffic, hydrodynamic theory and queuing theory, both having their uses but differing in their predictions. Hydrodynamic theory treats traffic as compressible fluid. It predicts shock waves and suggests two speeds for any flow other than maximum flow and zero flow. Queuing theory quantizes traffic and concentrates on the arrival and departure processes at particular points, like stop lines, or bus stops. The theories differ in their prediction of the shape of the link cost function. According to hydrodynamic theory, the link cost function bends backwards after maximum flow is attained, suggesting two costs for any flow other than maximum flow and zero flow. In contrast queuing theory predicts monotonically increasing link costs. (Bell i Iida 1997, 6) Def. XXXI.

Free-flow traffic

We say that the traffic is unqueued (“uncongested” or “free flowing”) if small speed disturbances introduced at the location are not detected upstream of location.[…] Conversely, if changes in speed introduced at a location are felt at an upstream location we say the traffic is queued (congested).(Daganzo 1999, 105) Def. XXXII.

Congestion

Few drivers would dispute the fact that congestion is caused by bottleneck, both recurrent and non-recurrent, and that resulting queues can cause further problems if they become too long. […] From practical point of view, it is most important to have models that can predict reliably thing that matter, i.e. bottleneck behavior and queue dynamics. Models should be tested by verifying how well they can predict these performance measures (the generation of queues and their spatial evaluation), more so than the other things.(Daganzo 1999, 105) Def. XXXIII.

Car Following Model (Wiedemann)

The traffic flow model in VISSIM is a discrete, stochastic, time step based, microscopic model with drivervehicle-units as single entities. The model contains a psycho-physical car following model for longitudinal vehicle movement and a rule-based algorithm for lateral movements. The model is based on the continued work of Wiedemann. The basic idea of the Wiedemann model is the assumption that a driver can be in one of four driving modes: ► Free driving: No influence of preceding vehicles observable. In this mode the driver seeks to reach and maintain a certain speed, his individually desired speed. In reality, the speed in free driving cannot be kept constant, but oscillates around the desired speed due to imperfect throttle control. ► Approaching: The process of adapting the driver’s own speed to the lower speed of a preceding vehicle. While approaching, a driver applies a deceleration so that the speed difference of the two vehicles is zero in the moment he reaches his desired safety distance. ► Following: The driver follows the preceding car without any conscious acceleration or deceleration. He keeps the safety distance more or less constant, but again due to imperfect throttle control and imperfect estimation the speed difference oscillates around zero. ► Braking: The application of medium to high deceleration rates if the distance falls below the desired safety distance. This can happen if the preceding car changes speed abruptly, of if a third car changes lanes in front of the observed driver. For each mode, the acceleration is described as a result of speed, speed difference, distance and the individual characteristics of driver and vehicle. The driver switches from one mode to another as soon as he reaches a certain threshold that can be expressed as a combination of speed difference and distance. For example, a small speed difference can only be realized in small distances, whereas large speed differences force approaching drivers to react much earlier. The ability to perceive speed differences and to estimate distances varies among the driver population, as well as the desired speeds and safety distances. Because of the combination of psychological aspects and physiological restrictions of the driver’s perception, the model is called a psycho-physical car-following model. (PTV Vision 2009, 131)

17

Def. XXXIV.

Queuing theory in transportation context

For traffic congestion is simply queuing; that is, travelers or vehicles waiting to use some “server” such as a signalized intersection, a freeway bottleneck or a bus. (Papageorgiou 1991, 337) Def. XXXV.

Fundamental diagram of traffic flow

A homogeneous and steady flow of traffic will be considered. At low concentrations, the average speed v of the flow is usually high. Vehicles can reach their desired speed. As concentration ρ increases, the degree of interactions between vehicles becomes greater and v decreases. This suggests that v is a monotonic decreasing function of ρ. This functional relation, namely = (C corresponds to the hypothesis of fundamental diagram. Given the connection between the three variables q, ρ, and v, such a diagram completely defines the traffic characteristics of a given section of a road. The shape of this diagram is usually as shown in figure below. The first part of the curve corresponds to the free-flow traffic conditions. Flow increases with concentration up to a maximum value corresponding to the capacity of the road section; that is the maximum number of vehicles that can be driven through the section in a given period of time. If the concentration increases beyond ρc, the flow starts to decrease and vehicles interfere with one another more and more. Traffic is said to be saturated or congested. Flow tends to be unstable. There are two distinct concentration values for the same flow, according to whether traffic is free-flowing or congested. Thus, for example, zero flow can indicate that the road section is empty or, on the contrary, that concentration has reached its maximum value ρjam, as a result of a downstream blockage.

Figure 4 Fundamental diagram (Highway Capacity Manual 2000)

Figure 5 The adopted parabolic-trapezoidal fundamental diagram, expressing the relation among vehicular flow, speed and density along a given arc(PTV Vision 2009)

18

Def. XXXVI.

Simplified Theory Of Kinematic Waves

In famous paper, “On Kinematic Waves”(Lighthill i Whitham 1955) described a theory of the one-dimensional wave motion which could be applied to certain types of fluid motion or to highway traffic flow. The key postulate of the (L-W-R) theory was that there exists some functional relation between the flow q and the density (concentration) k. (G. F. Newell 1992, 281) The fundamental hypothesis of the theory is that at any point of the road, the flow q (vehicles per hour) is a function of the concentration k (vehicles per mile). […] The precise definitions of q and k, at a given point x on the roar and a given time t, are included in the following instructions for measuring them. Draw two lines across the road, a short distance dx apart, to form a slice of the road with the point x in the middle. Take averages over a time interval of moderate length τ, with the time t in the middle. The interval τ must be long enough for many vehicles to pass. Then the flow q is: = , !

where n is the number of vehicles crossing the slice in time τ. The concentration k is: D=

∑ ! , 6

where ∑ ! means the sums of the times taken by each vehicle to cross the slice. Thus k is the average number of vehicles ∑ ! /F on the slice of the road, divided by the dx length of the slice; in other words, k is the number of vehicles per unit length of the road. A third important quantity is: =

D

=

1

6

∑ !

This is the ‘space-mean speed’ of Wardrop (Wardrop 1952), being both the ratio of the flow to concentration and the ratio of length of slice to average crossing time.(Lighthill i Whitham 1955, 325)

19

Def. XXXVII.

Space-Time Extended networks (STEN)

1.Clearly timing of events, such as the arrival at bottleneck links or junctions, may affect parameters such as delay and capacity. One approach is to discretise the time and include the time dimension in the network. This leads to a space-time extended network (STEN), where links are identified not just by the locations of their start and end nodes in space, but also by their locations in time. By incorporating the time dimension into the network in this way, it is possible to apply some steady state network flow programming methods to dynamic situations[…].(Bell i Iida 1997, 35) 2. we construct the temporal expanded network G = (A, N) that corresponds to the flow conservation constraints [...].

Let GH be the length of the shortest path (shortest according to the free travel times) from the origin node ni to the node nk and let GH∗ = ) JK GH , which corresponds to the minimum time required to reach the node nk from any origin; for t < GH∗ no flow enters node nk • •

Nodes: each node ni, (k L N) of the base network is expanded to (T + 1) nodes the expanded network.

M H,

! = 0,1, … , O, (D L P of

Links: for each Link a = (nn, nk), L A, we construct, for each ! = 0,1, … , O , such that ! − F ≥ G ∗ Maximal Size of the STEN Measure

Base Network

STEN

Number of origins

O

0*T

Number of destinations

D

D

Number of links

A

(3*A + 2*0+ D)*T

Number of nodes

N

( N + O + A )*T + D

(Drissi-Kaïtouni i Hameda-Benchekroun 92) Def. XXXVIII.

Time of Departure Choice

The departure time decisions of commuters are of fundamental importance to the study of peak-period traffic congestion and to the analysis of traffic control as well as broader demand-side congestion relief measures, such as pricing and ride sharing incentives. Over the past decades, there have been very active research efforts on the departure time problem, both in econometric modeling and dynamic user equilibrium (DUE) analysis fields (Jou i Kitamura 2008)

Travelers have available to them a wide range of responses to any congestion that they encounter on their journeys. Among these, they can choose between different routes according to costs and the traffic conditions that they will encounter on each of them, and they can choose between times of departure according to the conditions at each departure time and the relative attractiveness of departing and arriving at the associated times. It is important to allow for the responses that travelers make in these respects in evaluating traffic management measures, especially evaluating congested road networks. An example is the phenomenon of peak spreading where the collective response of travelers to a reduction in network capacity leads to a peak period that has increased intensity of congestion, diversity of routes used, and duration of inflows.(Heydecker i Addison 2005)

20

3.

Software description

Writing a script for the thesis required constructing relatively complex software combination. The base for this construction was Visum, the only transport modeling software available for the author. Unfortunately, the capabilities of Visum itself were insufficient for the purpose of the thesis, that is why additional script must have been written. The Visum script interface mentioned above limited the choice of programming language to VBA script, and Python. The analysis of capabilities of both of them brought to conclusion, that Python is far more suitable due to its features mentioned in respective description in Chapter 3.3. Basic distribution of Python also happened to be insufficient for the purposes of the script, so range of various packages needed to be added in the script, and those included: • VisumPy – library of helpers for Visum script writing, • Win32com – COM extension for Python • wxGlade – software for wx graphic user interface creation, • matplotlib – package for 2D, and 3D chart plotting, • SciPy, NumPy – mathematical, and statistical packages, • Random – random variable engine • pickle, cPickle – save data to file packages, • xlwt – excel spreadsheet generator. The script was written with Eclipse IDE (Interactive Development Environment) with Python dedicated PyDev library. The following section starts with Overview of software structure followed by more detailed referenced descriptions of Visum, and then Python and its packages.

3.1.

Overview

The software was meant to be Visum add-on basing on typical Visum model. The aim was to incorporate any Visum model generated by users and execute proposed calculations. The bottom of the script that needed to be intact was the Visum model itself. Visum is used here only to download the data. When we run the script we navigate it using graphical user interface designed with WxGlade. We choose the Visum version file to be opened, i.e. Visum COM instance to be dispatched and linked with GUI (using Win32com). We download the full database containing all parameters needed for script calculation from Visum version by means of COM interface. The database is stored in Visum as a class variable. By means of NumPy, and Scipy numerical packages we generate arrays of path parameters - the base for further calculations. The main calculations are carried mostly by means of standard Python procedures. When the calculations are over, we can generate 2D, or 3D plot of the results (using Matplotlib). We can also save the results as a file (using cPickle), or as an excel report (using xlwt).

21

3.2.

PTV VISUM

This chapter brings a brief description of Visum software, which was used in a thesis. It describes general features of the software, and focuses on elements important for a thesis. Visum is software widely used for transport modeling. The best one to describe the product is the producer, who publishes on his website the following: VISUM is a comprehensive, flexible software system for transportation planning, travel demand modeling and network data management. VISUM is used on all continents for metropolitan, regional, statewide and national planning applications. Designed for multimodal analysis, VISUM integrates all relevant modes of transportation (i.e., car, car passenger, truck, bus, train, pedestrians and bicyclists) into one consistent network model. VISUM provides a variety of assignment procedures and 4-stage modeling components which include trip-end based as well as activity based approaches.(PTV AG 2010) Visum software is popular among students, also due to its availability. The educational license enables students to use PTV Software, for non-commercial issues. This thesis was done using PTV Visum under student license. The first described element is network model, being the part of supply model. Then comes a description of impedances, impedance of routes, impedances of links, turns, and nodes. Helpful to understand the impedance is description of Volume Delay (Capacity Restrain, or Speed Density) Functions, which comes next. This background allows us to describe assignment procedures, and their results – paths, which finally are the basic script input data. Scripts for Visum are the last element of description. The following description is far from being comprehensive, however it provides in author’s opinion background sufficient for understanding the idea of a script. The fully comprehensive description of Visum Software can be found in Visum Manual (PTV Vision 2009), and majority of the following chapter is quoted from the Manual.

22

Network Objects The network model differentiates basic network objects such as nodes and links, which illustrate a network structure. Network object

Description

Transport system

The transport supply consists of several transport systems. Transport systems are used for example, to allocate attributes for network objects dependent on transport systems. This is how links can be opened for a transport system bike, for the transport systems car and HGV blocked, however. Mode A mode connects one or several transport systems. In PrT a mode comprises exactly one transport system. In PuT, however, a mode can comprise several transport systems. This is how you can define a mode PuT for example, which comprises the PuT transport systems tram, bus and train.

Demand segment

A demand segment makes the connection between transport supply and traffic demand. A demand segment is assigned exactly one mode and each demand segment exactly one demand matrix. A mode can comprise several demand segments. This is how you can create a demand segment for the mode PuT, for transporting students and one for the remaining PuT.

Node

Nodes are point objects, which specify the location of intersections, merging links or points in road and rail network. They are start and end points of links. Nodes connect zones with the network (connected nodes

Turn

Turns specify, which movements are permitted at a node, that is, whether turning at a node from one link to another link is permitted. For PrT transport systems, turning time penalties and capacities can be specified which describe the influence of the intersection on the performance of the network. Turning prohibitions are taken into consideration as follows. • For public transport systems in the construction of a line route • For private transport systems in a route search Turn standard Turn standards are patterns, from which an emerging turn with standard values is allocated for their attributes Time penalty and Capacity PrT. Which turn standard is used for the allocation of turn attributes, depends on the node type, the turn type and the flow hierarchy.

Link

Links connect nodes and thus describe the structure of the road and rail network. A link has a particular direction, so that the opposite link represents a separate network object and can thus have different attribute values. Link type Link types are used as a template when inserting new links. When inserting a link, a link type has to be specified. The link then takes over the attribute permissible transport systems (TSysSet), Capacity PrT, velocities (v0-PrT, vMin-PrT, vMax-PrT and vDef-PrT), Number of lanes and the link rank as standard values.

Zone

Zones (traffic cells) describe the position of utilities in the network (for example, residential areas, commercial areas, shopping centers, schools). They are origin and destination of trips within the transport network, which means zones and the transport network are connected through connectors.

Connector

Connectors connect zones to the link network. They represent the distance to be covered between a zone’s center of gravity and the connector nodes. For public transport demand, the zone has to be connected via a stop area with

23

stop(s) allocated to a node. Main node

Several nodes can be aggregated to one main node. Each node is only allowed to be part of a main node. Using main nodes is useful, if the VISUM network is strongly aggregated and lanes are available as individual links for example and intersections therefore consist of several nodes (this situation can occur when working with navigation networks in VISUM).

Main turn

Main turns are created when using main nodes. Each movement via the main node is represented by a main turn. Main turns possess the same attributes as turns. In the assignment, the main turn replaces the node turn, which has the effect that only one turn penalty flows into the assignment for each main turn.

Main zone

Main zones group multiple zones and allow aggregated evaluations. A main zone can represent a county for example, which has multiple communities as traffic cells.

Territory

Territories are network objects, which can be used for example, to illustrate districts or counties. Based on a polygon which defines the territorial border, PrT and PuT indicators can be precisely accounted for each zone (for example the driven service kilometers within a zone).

OD Pair

OD pairs exist between all zones of the network. The values in skim matrices and demand matrices each refer to one OD pair. Compared to the other network objects, you cannot edit OD pairs interactively in the network editor, but you can filter OD pairs and display them graphically. For each OD pair you can select the skim matrix values, demand matrix values and the direct distance as attributes.

Path

For assignment calculation, paths are found between the origin and destination zone, and their volume is calculated. Paths are therefore the central result of the assignment procedure. In PrT, users can manually edit paths. This is how the assignment results could be manually imported to VISUM or the VISUM assignment results could be adjusted manually. Both the path volumes and the course of the path can be edited.

Valid day

A valid day is a freely defined set of days within the used calendar. If a weekly calendar is used, a valid day can comprise the days Monday to Sunday (for example “Monday to Friday”). If an annual calendar is used, which means that any individual days can be selected within the validity period. If no calendar is used, there is only the valid day “daily”. It is then not possible to create new valid days. In PuT: a valid day can be assigned to each vehicle journey section. In PrT: the transport supply can be time-varying for the dynamic stochastic assignment, DUE and the assignment procedure Metropolis. Time-dependant attributes are used. When using a calendar, valid days can be specified for these time-varying attributes, on which they should have an affect.

24

Impedance functions An impedance function generally measures the effort connected to a traffic process. All instances are summarized to this effort, which prevent participants from carrying out this process and therefore create an impedance. Effort examples are especially time and costs connected to the process. You can also enter subjective criteria in the impedance. Thus, the impedance of a certain connection in the PuT may increase, if certain comfort criteria are not satisfied. Impedance functions play an important role in several impact models. In the assignment, the impedance function assigns a route or connection an effort. In PrT, especially the journey time in the loaded network flows into the impedance, but it can also be additional properties such as traveling expenses and possible toll. For dynamic assignments, it is also the discrepancy between the departure time and the desired departure time. In PuT, in addition to the travel time, it is mainly the number of transfers and the fare which have an effect on the impedance. A problem for impedance functions is that completely different aspects are included and have to finally arise from conjoint evaluation in form of a number. These different aspects which are partially measured in different units, must therefore be recalculated and weighted against each other. In general, weighting of the factors for different groups of assessing personnel is different. For this reason, impedance functions for example can be defined at the assignment per demand segment and at line blocking per vehicle combination. In VISUM, impedance functions are used in the following contexts. • Assignment (User model): The impedance function assigns the effort to each path, thus depending on the type of assignment, each route or connection, which the passenger has to make, if he decides to take this path. The most natural criterion is the travel time which has the corresponding unit time [s]. Especially in PrT, the travel time of a link is not constant, but depends on the volume, the coherence is described in a VD function. • Demand models (User model): Within the framework of trip distribution, mode choice, as well as the combined procedures for trip distribution and mode choice, the impedance function assigns an OD pair or assigns the mode choice for this relation to the effort, which has to be overcome for this choice. In this context we are traditionally talking about utility functions. Although the supporting concept is identical, the benefit of it is, however, only the negative impedance of the process.

Demand model One of the main uses of VISUM is modeling demand. Demand modeling deals with traffic conditions. The most common travel forecasts analyze the daily travel behavior of people. These forecasts provide answers to the questions, when, how often, where and how do people travel.VISUM currently provides three procedures of demand modeling. • Standard Four-Stage Model • EVA • VISEM A complete demand description which can calculate an assignment, therefore first only comprises the following elements in VISUM: • the demand in form of a matrix • temporal distribution of the demand by specifying a time series Specifying a time series is, however, only necessary for dynamic PrT assignments and PuT assignments. The demand distribution is ignored in the case of static PrT assignments. • the allocation of matrices to one or more demand segments

25

Impedance of a route All assignment procedures are based on a short-route algorithm which determines low impedance routes. The impedance of a PrT-route is volume-dependent and consists of the following impedances. •

Impedances of used links (see “Impedances of links”)



Impedances of used turns, which are also defined as node impedance (see “Impedances at node”)



Impedances of the used connectors



Impedances of the used main turns



The route choices of travelers depend on objective and subjective factors. The choice of route is specially defined by the following skims.



The anticipated journey time for the route



Route length



Possible road tolls

In addition to this, a multitude of other factors can influence route choice. One can imagine, for example, that road users who know their way around will choose other routes than people who do not know the area and who mainly orient themselves according to the sign-posted traffic network. Impedance is therefore defined for each transport system and can be user-defined. It depends on the following variable by default. •

Transport system-specific travel time, in loaded network tCur [s]



Link length [m]



Transport system-specific road tolls [money units]



User-defined AddValues • Link type factor [-]

You can also define the impedance in detail. You are then provided with all direct and indirect numerical attributes of the network objects links, turns, connectors and main turns, for the definition of the impedance of a route. When composing the impedance summand, it can be differentiated between two basic components. •

Summands, which apply depending on the traffic volumes (for example value calculated tCur with a VD function )



Summands, which are not dependent on the network object volume (for example, toll or link length) The time tCur of a network object is calculated with capacity restraint functions (VD functions).

Based on the assumption that the travel time (impedance) of network objects increases with increasing traffic volume, all assignment procedures are in turn based on the assumption that travel times of network objects are a monotone incremental function of traffic volume. Thus, in case of increased traffic in the network the effect of deterrence to alternative routes can be represented (. Because the variables have different units (seconds, meters, money units), impedance cannot be written in a universally applicable unit. For a combination of the variables, travel time, and road toll, it may be convenient to express impedance in terms of money units. In this case, travel times are converted into money units using a “value of time” factor.

Impedances of links For every PrT-transport system of a link, a Tsys-specific travel time (t0_Tsys) for free flow is defined which is calculated from: •

Link length



permitted speed (v0_PrT) of the link used



maximum speed of means of transport (v0_PrTSys)

A capacity-dependent impedance function continuously adapts this basic travel time depending on the current traffic volume

26

Impedances of turns (Impedances at node) VISUM calculates turn impedances for every turn permitted at a node. A turn impedance includes an impedance time penalty t0 which increases in dependence on volume and capacity. Because the turns are positioned at the node, the impedances at turns are often described as impedances at node.

Impedances of connectors Connector impedances are regarded as follows. • Absolute connectors are regarded as being volumedependent. This means, that the Tsysspecific connector time (t0_Tsys) does not represent actual impedance which is volume independent. • For connectors defined by percentage, they are regarded as volumedependent, if the option Apply connector weights to the entire origin destination traffic is active. This means, that with increasing volume the actual connector time tCur_Tsys will exceed the connector time t0_Tsys of each connector (see “Predefined VD functions”). By combining a high value for parameter b in the VD function by applying the equilibrium procedure, a relatively exact distribution of traffic over connectors can be achieved.

Impedances of main turns Just like turn impedances, in VISUM main turn impedances are calculated for each main turn permitted at a main node based on the volume and selectively a VD function, Tmodel or ICA.

Preloaded volume When impedances are determined, preloaded volumes, can be considered. Basic volumes can either be userdefined additional values or volume values which result from the assignment of a different matrix.

Predefined VD functions Travel times for PrT are determined by the saturation of links and turns which result from the traffic volume and the capacity of these network objects. Due to this, PrT journey times vary in contrast to PuT journey times, and can only be anticipated to a certain degree before a journey. The PrT journey time of a route between two zones consists of the following components. •

Access and egress times



Travel times of links



Turning times at intersections

For free traffic flow, the travel time t0 of a link can be determined from the link length and the free-flow speed v0. For turns at an intersection, the turning time t0 is specified directly. In loaded networks, the link travel time and the turning time is determined by a so-called volume delay function (or VD function). This capacity restraint function describes the correlation between the current traffic volume q, and the capacity qMax. The result of the VD function is the travel time in the loaded network tCur: VISUM provides several function types for the volume-delay functions.

The brief description of predefined VD functions used in Visum is presented below. The variables of VD functions: variable $ !

27

$ !

!

description

Saturation; $ ! =

R

RSTU ∙W

Degree of saturation at which the linear section of the volume-function starts

! !0

Current travel time on a network object in loaded network [s] Travel time on a network object with free flow time [s] Current volume = sum of volumes of all PrT transport systems including preloaded volume [car units/time interval] Capacity [car units/time interval] User-defined parameters

X Y

, &, , , ,

1. the BPR function from the Traffic Assignment Manual of the United States Bureau of Public Roads !W>Z = ![ ∙ (1 +

∙ $ !]

2. a modified BPR2 function with a different parameter b for the saturated and unsaturated state !W>Z = ![ ∙ (1 + !W>Z = ![ ∙ (1 +

∙ $ !] ∙$ !

$ ! ≤ $ !WZ M $ ! > $ !WZ M

]

3. a modified BPR3 function, for which an additional supplement d per vehicle can be specified in the saturated state !W>Z = ![ ∙ (1 +

!W>Z = ![ ∙ (1 +

∙ $ !]

$ ! ≤ $ !WZ M

∙ $ ! ] + (q − qabc ∙ d

$ ! > $ !WZ M

4. Conical (Spiess) !W>Z = e2 + gai ∙ (1 − sat 5. Conical marginal !W>Z = r2 +

i (1

6. Exponential

i

+ bi −

∙ (1 − $ !m − b ∙ t [ where

− $ ! (1 − 2 ∙ $ ! + & i

gai ∙ (1 − sat

i

+ bi

!W>Z = ![ +

!W>Z = ![ +



∙ (1 − 2 ∙ $ !s − b ∙ t [ where

eb∙tbu b

b=

2a − 1 2a − 2 b=

2a − 1 2a − 2

$ ! ≤ $ !WZ M

eb∙tbu + d ∙ (sat − sat vwxu b

$ ! > $ !WZ M

7. INRETS: the INRETS function of the French Institut National de Recherche sur les Transports et leur Sécurité 1.1 − ∙ $ ! !W>Z = ![ ∙ $ ! ≤ $ !WZ M 1.1 − $ ! !W>Z = ![ ∙ 8. Logistic

9. Quadratic

1.1 − 0.1

!W>Z = ![ + !W>Z = ![ +

∙ sat i 1+



$ ! > $ !WZ M (]yz∙{ M

+&∙$ !+

∙ $ !i

10. Sigmoidal MMF Nodes 28

!W>Z = ![ + 11. Sigmoidal MMF Nodes

& + $ !| & + $ !|

& + $ !| & + $ !|

!W>Z = ![ ∙

12. a constant function where the capacity does not influence travel time (tCur = t0), !W>Z = ![ 13. Akcelik 3600 ∙ a ∙ € (sat − 1 + •(sat − 1 4

i

+

8 ∙ b ∙ sat ƒ d∙a

!W>Z = 3600 ∙ length ∙ € (sat − 1 + •(sat − 1

i

+

8 ∙ b ∙ sat ƒ d∙a

!W>Z = ![ + 14. Akcelik 2

15. a further modified BPR function (LOHSE) with a linear rise in the oversaturated section, in accordance with the queuing theories, in order to achieve more realistic times in the oversaturated section and a better performance in assignments since small changes to the volume do not result in disproportionate travel time changes. The function is monotonic, continuous, and differentiable even where sat = satCrit !W>Z = ![ ∙ (1 + 16. Linear bottle-neck

!W>Z = ![ ∙ (1 +

∙ $ !]

$ ! ≤ $ !WZ M

∙ $ ! ] + a ∙ b ∙ t [ ∙ sat ‡yˆ vwxu ∙ ($ ! − $ !WZ M !W>Z = ![

!W>Z = 3600 ∙ sat

$ ! > $ !WZ M

$ ! ≤ $ !WZ M

$ !WZ M =

$ ! > $ !WZ M

![ 3600

17. Note: In addition to the volume-delay functions provided in VISUM, you can also specify user-defined VD functions

29

Impedances at node Intersections are modeled as nodes or as main nodes in VISUM. Intersections of roads and/or railway tracks are bottle-necks in an urban transport network. At the intersections, conflict points have to be passed in succession by the non-compatible traffic flows. The order in which the flows traverse the conflicting areas depends on the type of control: To choose the route within an assignment procedure, the impedance on alternative routes is decisive, which results in the sum of impedances of all traversed network elements. The bottleneck effect of a node is thus displayed for all variants of the traffic control by the impedance of the turn used. The impedance of turns usually corresponds exactly to the travel time tCur, thus the time required for the node to traverse in the turning direction of the route. For calculating tCur per turns VISUM offers three different models that represent the different compromises between data entry and computing time on the one hand and accuracy and reallife situations on the other. •

Turns VD functions



Node VD functions



Intersection Capacity Analysis ICA



Comparing advantages and disadvantages is to help you choose the appropriate calculation model for your project.

Due to the reason mentioned we recommend the following for the selection. • For comprehensive models, modeling with turns or node VD functions is appropriate. ICA cannot be recommended here, because the input complexity for the detailed supply of nodes with geometry and control data is usually too high. Furthermore, the result after each acceptable computing time due to the slow 30

convergence of the assignment still contains approximation errors, which are around the same size as the accuracy gained through ICA. • ICA however, is the method of choice if you want to subsequently calculate and analyze the capacity of one or more nodes of an existing assignment result. This is how you can determine which aspects of the node contributes to a high impedance. It is therefore sufficient to only model those nodes which have to be analyzed. Within an assignment we only recommend ICA limited, due to the known convergence problems and only for small scale studies with several 100 nodes. The best results for an equilibrium assignment can be reached if you apply the Equilibrium_Lohse method, because it is sturdier against impedance differences. In most cases you will globally decide on a calculation model. You can however also combine different calculation methods within a network, (for example, Turn VD functions as standard model and ICA simply for very important nodes with complex lane location or large conflicting volumes). All calculation models are based on turn volumes in car units per hour, which are determined through the user’s settings, either from the assigned volume or from counted via a factor.

Impedance of turns from Turn VD function In the simplest calculation model tCur, the time requirement of a turning vehicle is calculated from the turning time t0 in the unloaded network and the aturation of turns using a VD function. You can use one of the predefined functional forms as VD functions or select a user-defined functional. Typical Turn VD functions make up the sum (not the product) of t0 and a saturation-dependent term. An example for this is, are the VD functions Akcelik, Exponential, Constant, Logistic, Quadratic and TMODEL_Nodes.

Impedance of turns from node VD function (Tmodel) In this model, turn delays are calculated in two steps. First, a node delay is calculated by applying a VD function to the vol/cap ratio of the node. Each turn penalty is the sum of node delay and the turn-specific time (calculated with VD function set for turns). Node delay only has an affect on turns from a non-prioritized approach. This approach links have to be marked with the attribute TmodelSpecial

Assignment VISUM provides several assignment procedures for the PrT. There are static assignment procedures without explicit time modeling as well as procedures which use a time dynamic traffic flow model. •

The Incremental assignment divides the OD matrix on a percentage basis into several partial matrices. These partial matrices are then successively assigned to the network. The route search considers the impedance which results from the traffic volume of the previous step



The Equilibrium assignment distributes demand according to Wardrop’s first principle, which is. The Equilibrium procedure distributes the demand according to Wardrop’s first principle: „Every road user selects his route in such a way, that the travel time on all alternative routes is the same, and that switching to a different route would increase personal travel time.“ The state of equilibrium is reached by multisuccessive iteration based on an incremental assignment as a starting solution. In the inner iteration step, two routes of a relation are brought into a state of equilibrium by shifting vehicles. The outer iteration step checks if new routes with lower impedance can be found as a result of the current network state .



The Equilibrium_Lohse assignment models the Equilibrium_Lohse process of road-users in the network. Starting with “all or nothing assignment”, drivers consecutively include information gained during their last journey for the next route search.



The Tribut procedure, which was developed by the French research association INRETS, is particularly suitable for modeling road tolls. Compared to the conventional procedures which is based on a constant time value, Tribut uses a concurrent distributed time value. A bicriterial multipath routing is applied for searching routes, which takes the criteria time and costs into account. Road tolls are modeled as transport system-specific road toll value, either for each VISUM route or for link sequences between user-defined nodes (non-linear toll systems).

31



The Stochastic assignment takes into account the fact that skims of individual routes (journey time, length, and costs) that are relevant for the route choice are perceived subjectively by the road users, in some cases on the basis of incomplete information. Additionally, the choice of route depends on the road user’s individual preferences, which are not shown in the model. In practice, the two effects combined result in routes being chosen which, by strict application of Wardrop’s first principle, would not be loaded, because they are suboptimal in terms of the objective skims. In the Stochastic assignment, an alternative quantity of routes is initially calculated, therefore, and the demand is distributed across the alternatives on the basis of a distribution model (e.g. Logit).



In co-operation with the University of Rome, VISUM provides the Dynamic User Equilibrium (DUE), an algorithm which contains a blocking back model. Additionally, it can regard time-varying capacities as well as road tolls and includes a departure time choice model.



The Dynamic Stochastic assignment differs from all the previously named procedures asa result of the explicit modeling of the time axis. The assignment period is divided into individual time slices, with volume and impedance separated for each such time slice. For each departure time interval, the demand is distributed across the available connections (= route + departure time) based on an assignment model as in the case of the stochastic assignment. With this modeling, temporary overload conditions in the network are displayed, a varying choice of routes results in the course of the day, and possibly a shift of departure time with respect to the desired time.

For each of the mentioned assignment procedures any number of demand matrices can be selected for assignment. •

Simple assignment: one demand matrix of one PrT transport system, for example, a car OD matrix is assigned.



Multi-class assignment (simultaneous assignment): multiple demand matrices which contain demand for one or multiple PrT transport systems, for example, a car OD matrix and a HGV OD matrix are assigned simultaneously.

Paths All assignments in VISUM in PrT as well as in PuT are path-based, meaning that possible paths are calculated for each OD pair and loaded with a demand share. All other results, especially the volumes of the different network objects and the skim matrices are derived from these loaded paths. These paths are saved with the assignment result and can be analyzed after the assignment for flow bundle calculation, for example. A path first describes the exact local course of a translocation in the network model, which means, that all traversed network objects such as nodes, links, turns, main nodes, connections, if applicable also stops, line routes and time profiles are known. If the departure time and thus the temporal course is added to the spatial course, we are taking about a connection, otherwise a route. For PuT paths, in addition to departure time for a connection compared to the route, the information on used service trips is included. If an assignment produces routes or connections depends on the type of assignment. Dynamic PrT assignments and the timetable-based PuT assignment create connections, static PrT assignments as well as the headway-based PuT assignment calculate routes. In principle, the user can select, whether internally calculated connections should be saved as such or only as routes, or not at all – respectively for PrT and PuT. If you do not save the connections, less memory is required, however, posterior analyses of the connections are no longer possible, even if a dynamic assignment procedure was applied. Network volumes are still calculated and can even be output differentiated according to analysis time intervals.

32

Blocking-back model The blocking-back model (pseudo-dynamic assignment, pa) fills the gap between merely static procedures, which do not have any temporal reference and cannot determine congestion related wait times, and dynamic procedures that require long calculating times. The procedure is much faster than any dynamic assignment, requires less memory capacity and can furthermore deliver information on congestion phenomena. The procedure can be applied in conjunction with static assignment in order to estimate queue lengths and wait times in oversaturated networks, and – in contrast to Metropolis or the dynamic-stochastic assignment - is suitable for networks with > 50000 links. The procedure requires little additional data for the temporal distribution of the demand. The general idea is to re-assign route volumes that were calculated with any static assignment at an earlier stage to the network. First stage Along a route, the demand share is passed on from link to the next until a restricting capacity has been reached. The following rules apply in this process. 1. The volume passing over a link cannot exceed the link’s capacity (PrT). The amount of traffic leaving the link counts (bottle-neck at end of link). 2. The queue on a link can never exceed the stocking capacity of the link. 3. As soon as a queue forms on a link in some direction, no traffic can pass the link even if the respective route does not lead across the bottle-neck that is causing the congestion. The fourth rule which limits the inflow of a link, directly results from this. 4. The inflow of traffic on a link is limited to the amount resulting from capacity plus queuing capacity. Second stage In this stage, the program exclusively determines wait times on congested links. New traffic is not imported, but rather the traffic saved in the local queue lengths is distributed along the routes according to the same rules as in the first stage. This is done in small time steps, where the link capacities still limit the inflow. After each step, the level of congestion is registered. The second stage ends, when all local congestion is zero and thus no traffic remains in the network. This results in a series of snap shots of the level of congestion at different times which are then used to calculate a wait time.

Scripts You can incorporate your own script files in VISUM in order to adapt the program to your needs and to automate recurring tasks. Furthermore, some scripts allow editing script parameters directly in VISUM, i.e. without using a text editor and without versed programming skills.

Python as additional script language Scripting and COM allow users adding new functions to VISUM and automating recurrent tasks. Since release 9.4, Python is supported besides VBA/VBS. Python excels in providing easy-to use functions for matrix editing. It also helps the user to easily create charts and design user interfaces. Python provides for the setup of a user guidance tailored to a particular project. Python and all additional libraries are open source programs without any confinements concerning their use. Setup Precondition is the prior installation of the Python interpreter and the PythonWin supplement providing Python with a COM functionality. The VISUM setup optionally installs a package of the Python basic system and useful additional libraries.

33

3.3.

Python

The python programming language was chosen for script writing. The main reasons to choose this particular language were: • Fully functional COM object integration ( Visum is in Windows a COM instance) • VisumPy library available with Visum as a helper module for Python script writing • Variety of additional open-source modules Python is an Open-Source programming language, which means that not all of the descriptions are written in formal language, that’s why some references below can be no formal enough for a master thesis. General description of Python is as follows: Python is an interpreted, interactive, object-oriented programming language. It incorporates modules, exceptions, dynamic typing, very high level dynamic data types, and classes. Python combines remarkable power with very clear syntax. It has interfaces to many system calls and libraries, as well as to various window systems, and is extensible in C or C++. It is also usable as an extension language for applications that need a programmable interface. Finally, Python is portable: it runs on many Unix variants, on the Mac, and on PCs under MS-DOS, Windows, Windows NT, and OS/2. (Python Programming Language - Official Website 2010) More specified description brings us following: About Python Python is a remarkably powerful dynamic programming language that is used in a wide variety of application domains. Python is often compared to Tcl, Perl, Ruby, Scheme or Java. Some of its key distinguishing features include: •

very clear, readable syntax



strong introspection capabilities



intuitive object orientation



natural expression of procedural code



full modularity, supporting hierarchical packages



exception-based error handling



very high level dynamic data types



extensive standard libraries and third party modules for virtually every task



extensions and modules easily written in C, C++ (or Java for Jython, or .NET languages for IronPython)

embeddable within applications as a scripting interface (Python Programming Language - Official Website 2010)

One of the most important features for the script was its capability to transfer data between many platforms: Python plays well with others Python can integrate with COM, .NET, and CORBA objects. For Java libraries, use Jython, an implementation of Python for the Java Virtual Machine. For .NET, try IronPython , Microsoft's new implementation of Python for .NET, or Python for .NET. Python is also supported for the Internet Communications Engine (ICE) and many other integration technologies. If you find something that Python cannot do, or if you need the performance advantage of low-level code, you can write extension modules in C or C++, or wrap existing code with SWIG or Boost.Python. Wrapped modules appear to your program exactly like native Python code. That's language integration made easy. You can also go the opposite route and embed Python in your own application, providing your users with a language they'll enjoy using. (Python Programming Language - Official Website 2010) Python copyright policy is: 34

Are there copyright restrictions on the use of Python? You can do anything you want with the source, as long as you leave the copyrights in and display those copyrights in any documentation about Python that you produce. If you honor the copyright rules, it’s OK to use Python for commercial use, to sell copies of Python in source or binary form (modified or unmodified), or to sell products that incorporate Python in some form. We would still like to know about all commercial use of Python, of course. (Python Programming Language - Official Website 2010)

3.3.1. VisumPy VisumPy is a small package of functions programmed by PTV that are useful for using Python with VISUM. VisumPy is installed with VISUM.(PTV Vision 2009) VisumPy contains functions to: 1) get and set network object attributes easily 2) get and set matrices easily 3) write data to Excel 4) convert between string and second-based versions of a time stamp 5) read and write .csv files 6) matrix calculations such as calculating intrazonals, aggregating matrices, etc 7) and other functions (PTV America Forum brak daty) VisumPy consists of many useful features, although not many of them happened to be useful for the script.

3.3.2. Win32com Python has an excellent interface to COM (also known generally as ActiveX). Although the module is still fairly new, it can be used to interface to almost any COM program (such as the MS-Office suite), write servers that can be hosted by any COM client (such as Visual Basic or C++), and has even been used to provide the core ActiveX Scripting Support. The entire package is known as "win32com"

3.3.3. Graphical User Interface (WxGlade) A graphical user interface (GUI) is a type of user interface item that allows people to interact with programs in more ways than typing such as computers [...]. A GUI offers graphical icons, and visual indicators, as opposed to text-based interfaces, typed command labels or text navigation to fully represent the information and actions available to a user. The actions are usually performed through direct manipulation of the graphical elements.(Wikipedia brak daty)

To generate of Python based Graphical User Interface python dedicated tool WxGlade was employed: wxGlade is a GUI designer written in Python with the popular GUI toolkit wxPython, that helps you create wxWidgets/wxPython user interfaces. At the moment it can generate Python, C++, Perl, Lisp and XRC (wxWidgets' XML resources) code.(WX Glade Project Official Website brak daty)

35

3.3.4. Scipy and Numpy SciPy (pronounced "Sigh Pie") is open-source software for mathematics, science, and engineering. It is also the name of a very popular conference on scientific programming with Python. The SciPy library depends on NumPy, which provides convenient and fast N-dimensional array manipulation. The SciPy library is built to work with NumPy arrays, and provides many user-friendly and efficient numerical routines such as routines for numerical integration and optimization. Together, they run on all popular operating systems, are quick to install, and are free of charge. NumPy and SciPy are easy to use, but powerful enough to be depended upon by some of the world's leading scientists and engineers. If you need to manipulate numbers on a computer and display or publish the results, give SciPy a try!(www.scipy.org brak daty)

3.3.5. Pickle The pickle module implements a fundamental, but powerful algorithm for serializing and de-serializing a Python object structure. “Pickling” is the process whereby a Python object hierarchy is converted into a byte stream, and “unpickling” is the inverse operation, whereby a byte stream is converted back into an object hierarchy.(Python Official Website brak daty)

3.3.6. xlwt xlwt is a library for generating spreadsheet files that are compatible with Excel 97/2000/XP/2003, OpenOffice.org Calc, and Gnumeric. xlwt has full support for Unicode. Excel spreadsheets can be generated on any platform without needing Excel or a COM server. The only requirement is Python 2.3 to 2.6. (xlwt package official website brak daty)

3.3.7. Matplotlib Matplotlib is a python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive environments across platforms. Matplotlib can be used in python scripts, the python and ipython shell, web application servers, and six graphical user interface toolkits. Matplotlib tries to make easy things easy and hard things possible. You can generate plots, histograms, power spectra, bar charts, error charts, scatter plots, etc, with just a few lines of code. The mplot3d toolkit adds simple 3d plotting capabilities to Matplotlib by supplying an axis object that can create a 2d projection of a 3d scene. In the end it produces a list of 2d lines and patches that are drawn by the normal Matplotlib code. Therefore the resulting graph will have the same look and feel as regular 2d plots.(Matplotlib Project Official Website brak daty)

36

4.

The script

PROBLEM II. What to focus on? Problem of the thesis was that the deeper the research went the more possibilities it shown. Every successive step deeper was like geometric progression of details that needed to be either programmed, either analyzed, either described, either evaluated. It was impossible to contain everything in the thesis, that’s why compromising choice of contents needed to be done, and this thesis is the result of arbitral author’s content choice.

This chapter describes key part of the thesis – the script. Basing on introductions of theory and software, the idea of the script presented in Chapter 1 can be detailed. The description will be done by means of flowcharts, algorithms, and code pieces (basic programming knowledge is needed). The script will be described in order of significance, and in logical consequence of elements. The user of script will carry out following steps: A. Run script

B. Open Visum

C. Set Settings

D. Precalculation

E. Main Calculation

F. Evaluate

Exit

37

4.1.

Main Window

When the script is run, the main window pops up. The window generated using wx protocol (Section 3.3.3) has several functionality buttons. The buttons are oriented from the top to the bottom, which means that typical use will require executing topmost procedures first. The window architecture, which reflects the algorithm architecture, is shown below:

MAIN WINDOW Title

A. RUN SCRIPT B. OPEN VISUM

1. Open Visum and load version file

2. Choose Demand Segment for calculation

3. Choose departure time distribution

C. SETTINGS

4. Choose travel time calculation mode

5. Data Download from Visum 6. Set rendom deparature times for journeys 7. Main Calculation

D. PRE CALCULATIONS

E. MAIN CALCULATION

8. Filter and plot Space-Time Cylinder 9. Filter and plot Network Element Characterisics 10. Generate Excel Report 11. Save/Load Database

F. EVALUATION

Figure 6 Main Window The program consists of 11 sub-procedures which can be divided into 6 logical steps(as in Figure 6). Each of the 11 sub-procedures will be described in following sections. The main flowchart of the script is presented below.

38

4.2.

Main Flowchart and Sub-procedures

The main algorithm has a linear structure; it is a sequence of successive steps. The following flowchart shows the typical expected usage of the script from the user’s point of view:

Figure 7 Main Flowchart

The segments mentioned above are general, and will be detailed in following sections.

39

4.2.1. Open Visum and load version file This first steps are easily executed thanks to clear COM interface of Visum. Pressing a button runs “open-file dialog” that filters for Visum *.ver files. When the file is chosen Visum COM instance is dispatched (which, from user’s point of view, means that the Visum is opened) and selected version file is loaded. The code for this element can be paraphrased as following: Python Program Code 1 Open Visum and load Version File

global Visum Visum=win32com.client.Dispatch("Visum.Visum.110") """adjust to Visum version """ dialog = wx.FileDialog(self, "", "*.ver*", wx.OPEN) path=dialog.GetPath() Visum.LoadVersion(path) """ Visum instance will remain opened only as long as script runs """ Visum Instance will open in background and will remain opened throughout the script running time. When Visum will be closed, script fails. Changes made in Visum version file will be downloaded to script database only when procedure 5 (section 4.2.5) is executed.

4.2.2. Select demand segment Demand segment (DSeg) selection need to be done prior the data download from version file. The paths that will be downloaded from Visum are paths of respective DSeg assignment. The DSeg is stored as a global variable throughout the script running time. Python Program Code 2 Choose Demand Segment

DSeg_Selection= DSeg_Combo.GetValue() DSeg=Visum.Net.DemandSegments.ItemByKey(DSeg_Selection)

4.2.3. Select time distribution Departure time distribution is discussed in PROBLEM III, and in Def. XXXVIII. Two journeys departure time distributions modes are available, although more detailed ones can be easily added:

Figure 8 Choose time distribution Python Program Code 3 Choose Time Distribution

if Combo.Selection==”Random”: DataBase.TimeDistribution=0 if Combo.Selection=”Evenlydistirbuted”: DataBase.TimeDistribution=1 1. The first one - Random, indicated inside script with index 0, is random distribution, i.e. each journey departure time is random number from the range of :

40

Python Program Code 4 Random Time Distribution

for l in xrange(path.volume): if DataBase.TimeDistribution==0: t=random.randint(tStart,tEnd)

2. Second mode – Evenly distributed, indicated inside script with index 1 is even distribution, i.e. time gap between journey departures is equal between each two following journeys: Python Program Code 5 Even time distribution

for l in xrange(path.volume): if DataBase.TimeDistribution==1: t=int(l*1.0/path.volume*(tEnd-tStart))

PROBLEM III. Journey departure times’ distribution: Visum assumes that all journeys take place in single instant of time. In real world, which we attempt to model, each journey has its individual departure time. The Time Of Day (TOD) Choice Problem is well defined in literature (Heydecker i Addison 2005) and (Jou i Kitamura 2008), nevertheless some problems have been encountered. I.e. 1. If we do not have any knowledge about departure times distribution, are we then eligible to assume that the distribution is random? . 2. Shall we distribute all of the journeys in one procedure (for each journey choose random time distribution of certain shape), or maybe shall we do that for each path separately. 3. What is the relation between assignment time (e.g. peak hour) and departure time. I.e. if we want to gain the information about state of the network during peak hour how long before peak hour the network loading shall start (first user enters the network). . Those problems are unsolved, and the above description of departure time distribution choice used in script is only proposition.

4.2.4. Travel Time Calculation Travel time in Visum is calculated basing on capacity restrain functions. Those functions, as described in 0, are monotonic functions of cumulative volume, they assume that each following user of element will experience worse traffic conditions, than the previous one. This assumption is doubtful in author’s opinion; therefore, three types of travel calculations are available in the script: PROBLEM IV. How should Visum tCur parameter be interpreted? Visum calculates and updates travel time based on CR functions. After each iteration of respective assignment procedure travel time is updated according to Capacity Restrain Function. The parameter that is available for user is travel time after assignment procedure is over, i.e. travel time in congested network. It does not, however, mean that it can be read as actual travel time. Each of vehicles traveling over a link experience different traffic conditions. Even in static assignments route for the journey is being assigned basing on travel time of respective iteration (latest update). The problem with this interpretation occurred when author needed to decide which travel time should be downloaded from Visum when “Constant” travel time calculation mode was chosen. It was decided to take Visum tCur, which in fact reflects worst traffic conditions experienced in network, on the other hand only other available parameter t0 reflects best traffic conditions.

41

Figure 9 Choose tCur calculation mode

1. tCur = t0

2. tCur = CR(CumVol)

3. tCur = f(Vol(t))

travel time is constant

travel time is a monotonically increasing function of cumulative volume (Capacity -Restrain function)

travel time is a function of time-varying volume (number of cars over the link)

t(1) = t(2) = t(3) = t(n) = t0

tCur (t ) = f (Vol (t ))

∀ tCur ( n ) > tCut ( n − 1) 5

time

4

tCur(t)=f(Vol(t)

tCur(2)>tCur(1)

n

2

2

tCur(1)>tCur(0)

B

0

A

1

tCur(t)=f(Vol(t)

1

A

1

tCur(0)

tCur=t0

2

tCur(t)=f(Vol(t)

3

B

0

A

B

Figure 10 Travel Time Calculation Modes

Figure 10 Travel Time Calculation Modes shows a link from node A to node B, and “space-time” diagrams for journeys. 1. In first case, we can see that each journey takes the same time, i.e. traffic conditions do not affect travel time. This state is partially assumed in Visum, where the path, link, node, and turn travel times are constant (i.e. there’s only one tCur parameter after assignment). For path of several journeys there’s only one travel time, and for link with volume greater than one, there’s only one exact travel time. 2. Second case shows, how Visum travel time is calculated. Based on capacity restrain function we can tell what the journey time is. It is different for each journey, and rises as the cumulative volume rises (0). 3. Last case shown assumes analogically to traffic flow theories (Def. XXXIII, Def. XXXIV, Def. XXXV, and Def. XXXVI) that travel time is the function of actual congestion. We can see that for the first journey the travel time is greater than for second journey, and smaller than for third journey. In script all three cases are available, however third case is not based on any empirical assumptions. The parameters for used models are not calibrated, and model is not evaluated, nevertheless the engine for this model works properly. The procedures for travel time calculations are shown in Python Program Code 6 Travel Time Calculation 42

Python Program Code 6 Travel Time Calculation

def tCur_calculate(CrNo,Sat,t0,q,qmax,Vol,type,length): """Input: CrNo - index of CR function Sat - Vol/Cap t0 - free flow travel time q - Volume, or Cumulative Volume respectively type - node, link, turn length of link in km" """ 1. TCUR=T0""" if DataBase.tCurCalcMethod==1 tCur=t0 """ 2. CR FUNCTIONS""" if DataBase.tCurCalcMethod==2 fValue=DataBase.CR.Data[CrNo][3][int(100*Sat)] """reference to respective CR multipier""" type='multi' if DataBase.Links.CR.Data[CrNo][1]=="HCM3": type='HCM3' if DataBase.Links.CR.Data[CrNo][1]=="EXPONENTIAL": type='plus' if DataBase.Links.CR.Data[CrNo][1]=="LOGISTIC": type='plus' if DataBase.Links.CR.Data[CrNo][1]=="QUADRATIC": type='plus' if DataBase.Links.CR.Data[CrNo][1]=="Akcelik": type='plus' if type=='multi': tCur=int(t0*fValue) elif type=='plus': tCur=int(t0+fValue) elif type=='HCM3': tCur=int(t0*fValue+(q-qmax)*DataBase.Links.CR.Data[CrNo][2][3])

""" 3. TRAFFIC FLOW THEORY tCur=f(Vol(t))""" Described below Example of effect of using respective travel time calculation modes is presented on Figure 11 Different Travel Time Calculation Modes Effect:

43

Figure 11 Different Travel Time Calculation Modes Effect

Graph contents will be broadly described further, but now reader can focus on the bottom graph, showing travel times. The plots for three different travel time calculation types are shown. Blue line is constant over the time, green line constantly increases, and red line varies over the time, respectively to the calculation type.

44

4.2.4.1.

Traffic flow model

PROBLEM V. Traffic flow model: Numerous different traffic flow models are described in literature. This variety brought author to the problem of choice. None of the presented models (Def. XXXIV, Def. XXXVI, Def. XXXIII, Def. XXXV) seemed better than others. Each of them has its specific applications. Unfortunately author didn’t have any advice in choice of proper model, thus the only reason of the choice was the intuition and basic knowledge. Micro-simulation model (Car Following) was too complicated and would significantly extend calculation time. Simplified Theory of Kinematic Waves concerns platoons of vehicles rather than single ones. Finally, dual model consisting of Queuing Theory for nodes and Fundamental Diagram for links was employed. The problem that remained unsolved was to parameterize chosen models properly. This hopeless attempt resulted in author’s completely a priori parameterization that can be not even close to truth. Nevertheless, the main purpose is to show, that any appropriate traffic flow model can be employed within the script. Proposed traffic flow model is described in respective section. When user chooses third travel time calculation mode travel times are calculated with traffic flow model. Author experienced problems with defining traffic model (as discussed in PROBLEM V ), but it was decided to implement traffic model mainly to present the capability of the procedure to handle such models. Presented traffic flow model is just author’s invention and should not be considered seriously. Nevertheless, the model needs description. Easier elements shall be described first and easier part of the model is travel time for nodes. Node travel time was calculated basing on turn travel times (see PROBLEM VI). It was assumed that travel time for turn is a freeflow travel time number of vehicles queuing multiplied by average waiting time (in proposed model it’s equal to free-flow travel time). To increase model realism queuing time were multiplied by random multiplier (random number from range 0.9÷1.1). See Python Program Code 7 Queuing Time Python Program Code 7 Queuing Time

def calculate_QT(t0,Queue): tCur=max(t0,t0*(Queue+1)*(1+random.random()/10-0.05)) """analytical assumption that travel times equals t0 x number of Queuing Vehicles with a 10% random variation""" return tCur Proposed model can be understood as uncongested network containing only roundabouts. When traffic is uncongested, we can assume that average time to enter roundabout is constant and waiting time is a multiple of queue length. Proposed model is unsuitable for any other signalized and not signalized junctions. For links, fundamental diagram was used. The shape of fundamental diagram is described in Figure 12 Fundamental Diagram. Travel time calculation based on fundamental diagram required some assumptions. Author used fundamental diagram description from Visum User Manual(PTV Vision 2009, 329) as shown in Python Program Code 8 Calculate Fundamental Diagram: • KJ was calculated from typical PCU (Private Car Unit) length, which usually equal 7m, • Capacity was assumed to be a function of V0, and KJ so that second stage (level line in figure) of three stages traffic flow theory could be achieved (it’s just invention) • Propagation wave speed W was assumed a third of V0 (as suggested in Visum Manual).

45

(PTV Vision 2009, 330)

X0

F(X0)

C(X0)

I

V(X0)=tgα

II

III

Figure 12 Fundamental Diagram

In Figure 12 Fundamental Diagram three basic stages of traffic flow (I, II, III) can be shown. See: (Daganzo 1999), and (Schönhof i Helbing 2009). 1) First stage is similar to CR functions – monotonically non-linear rising (parabolic shape is assumed). 2) Second stage starts when congestion reaches capacity. By then flow is constant, and speed (tgα) is decreasing (travel time is increasing). 3) Hypercritical stage III is a stage when speed falls to zero (maximum congestion is achieved). Python Program Code 8 Calculate Fundamental Diagram

def calculate_fund_diagram(Vol,length,V0): KJ=1/7.0 """ maximum density on arc a called jam density = 1 average vehicle length = 1/7""" Cap=V0*KJ/6 """Author's suggestion analytical, not empirical (just a guess!)""" W=V0/3 46

"""propagation speed of hypercritical flow states on arc a, hypercritical kinematic wave speed.""" k=Vol/length k1=2*Cap/V0 if k