In this section, we describe the procedure followed when attempting to obtain an accurate O-D matrix for the city of Valencia, Spain, where nowadays such essential data still remain unavailable. Notice that many of the cities around the world rely on this method and often lack any other sources of data beyond it. The most critical data for simulation experiments to be representative is the number of vehicles that are injected into the network and their destination (O-D matrix). In this regard, the DFROUTER tool is able to generate data encompassing routes and the number of vehicles associated with each route. Although not strictly an O-D matrix, such a matrix can be generated based on these data.
Below we describe the methodology followed to accomplish our goal of obtaining realistic traffic flow data, starting with an analysis of DFROUTER’s output, followed by the proposed heuristic, gradually reducing the number of vehicles passing through the induction loops and re-adjusting the number of vehicles to be injected in each segment until approaching the reference traffic, which is then validated against real data.
4.2. Proposed Iterative Heuristic
Considering the mismatch between DFROUTER’s output and real data described in the previous section, we now propose an adjustment heuristic to compensate this error and make the number of vehicles in our simulation environment as realistic as possible.
To achieve our goal, we propose a heuristic called “iterative” that regulates global traffic by affecting all streets in a proportional manner, thereby allowing one to adjust the traffic volume according to the reference data. In particular, since there are dependencies between induction counts on different streets and the traffic injected, the iterative process is required to find the best fit. The proposed heuristic is shown in Algorithm 1.
As input data, we have the information concerning vehicular traffic at a specific time, available as detector counts, and the associated street segment ID.
An initial run of DFROUTER is required for obtaining routes and the O-D matrix using the reference induction loop data as input. The outcome of this first run returns an excess of 138.9% in terms of traffic volume, a value that is then refined using our proposed heuristic. In particular, it will adjust iteratively the number of vehicles injected in every street as provided to DFROUTER so that, when the output converges, the total number of vehicles accounted in the output of DFROUTER approaches the reference value. For this purpose, given a maximum number of iterations
and a maximum admissible error
, we will build a succession of intervals
of traffic flow adjustment factors, with
and
, as well as a succession
with
, so that, for each iteration
n, we will modify the number of vehicles injected on every street
s as input to DFROUTER, and denoted by
, by relying on Equation (
1):
where
is the smallest number of vehicles detected among all segments of the street
s,
is the number of segments that conform to street
s and
represents the largest integer number less than
x. This formula ensures that the load corresponding to a street, according to our induction loop data, is evenly distributed among the different segments on that street. Then, we apply the traffic flow adjustment factor
to each street segment of that street.
Algorithm 1 Iterative heuristic. |
- Require:
Road Network, flow, detectors files, and - Ensure:
Vehicle-Street-Segment-info file - 1:
calculate reference number of vehicles - 2:
,, - 3:
Process input files with DFROUTER - 4:
- 5:
Vehicle count per street ID - 6:
- 7:
- 8:
Create a file with information about vehicles, segments and streets - 9:
Apply to all street IDs () - 10:
, - 11:
while and do - 12:
Process input files with DFROUTER - 13:
- 14:
Vehicle count per street ID - 15:
if then - 16:
if then - 17:
, - 18:
else if then - 19:
, - 20:
end if - 21:
- 22:
to all street IDs () - 23:
end if - 24:
end while
|
As the initial step in our iterative algorithm, we assign initial values to the different variables involved as detailed in Equation (
2):
Then, a relationship between the number of vehicles per street ID and the reference value (
) is calculated according to Equation (
3):
where
is the real number of total vehicles passing through all street IDs (reference value) and
is the simulated number of total vehicles passing through all street IDs, as provided by the initial execution of DFROUTER. In our case,
409,499,
978,339, and therefore,
(see
Table 1). Note that we will always have
, although the value of
should converge to
.
For the iterations that follow (
), the following equation applies:
We then proceed to execute DFROUTER in a loop by successfully refining the input values and obtain as output the total number of vehicles per street ID (
. The process continues converging until the error is close to zero by obtaining a sequence of values for
and
based on the relationship between
and
, so that, if
, we consider that
, and in the opposite case, if
, we instead consider that
. Then, a new
value is obtained for the next iteration using Equation (
5):
A new value of
(see Equation (
1)) can then be derived and used as input to DFROUTER. The new
value following each iteration
n, denoted as
, will be considered final when the error (
) is below
, or the maximum number of iterations is reached, as stated in Equation (
6):
Experimental results in
Table 1 show that, initially, the value of
will fluctuate between positive and negative values, until convergence near zero is achieved, as illustrated in
Figure 2. For instance, from
Table 1, we have that the DFROUTER output value
is 439,738, which is greater than
, and
. Since we want a small error, from interval
and
= 0.41857, the heuristic creates interval
and value
= 0.20928.
Convergence is guaranteed in the scope of the proposed iterative heuristic, as we prove next:
On the one hand, we have that:
Therefore,
which implies that:
On the other hand,
. Consequently, applying the sandwich criterion, we have that:
which in turn implies that:
Note that values must be integers because they represent numbers of vehicles. Therefore, the existence of the above limits implies that such that and . That is, from iteration , the input data to DFROUTER are always the same, and as DFROUTER is deterministic, its output data will also be always the same. This guarantees the existence of , which does not necessarily coincide with because both and the limit are integer values, but according to the construction of the successions in the algorithm, it must be very close to . Hence, given a reasonable upper bound to the number of iterations and a reasonable error , it is expected that for some , . Otherwise, the algorithm will stop in value .
When the execution of Algorithm 1 ends, we generate two files that contain traffic information associated with the various street segment IDs. The first one is composed by a tuple of two elements, where each tuple includes: (1) street segment ID and (2) the number of vehicles per segment ID. The second file aggregates different street segment IDs belonging to the same street, and it includes a set of three elements: (1) street ID, (2) associated segment ID and (3) segment ID with the lowest number of vehicles, where the latter corresponds to the number of vehicles injected that start on that particular street.