5.4 Transitioning between continuum and agent-based models
5.4.3 Coupling
The interfaces between the continuum and discrete regions that are found in the net- works can be characterized in two ways: continuum flowing into discrete, and discrete flowing in to continuum. The method must account for how ‘upstream’ regions affect the ‘downstream’ regions they flow into, and vise versa.
However, traffic is an isotropic phenomena — vehicles are strongly biased towards
moving forward — and these two configurations must be dealt with separately: vehicles passing from one regime to another must be converted to the representation used in the destination regime, and the flow of traffic in each region must affect the region that precedes it.
The processes described in Sections 5.4.1 and 5.4.2 describe how one can instanta- neously convert one type of region to the other, but part of the challenge here is that
conversion must be performed dynamically. As I shall show, much of the previously de- veloped material will be useful, but key modifications must be made to properly describe the transfer of vehicles.
discrete traffic is made to influence the upstream continuum. Section 5.4.3.2 describes the discrete-to-continuum arrangement: how I adapt the car averaging procedure from Section 5.4.1 to handle discrete vehicles that flow into macroscopic regions, and how discrete vehicles determine their behavior from the continuum they flow into.
5.4.3.1 Flux capacitors
Given two adjacent cells in a continuum lane, the methods described in Chapter 4 are used to solve the Riemann problem at the interface between these two cells; doing so computes the value of the unknowns at the interface: q0. Substituting this into f from
Equation (4.7) gives the flux between the cells. When a continuum lane flows into a
discrete one, flux can be used to convert density flowing out of the continuum region into discrete vehicles entering the microscopic lane, and to imbue these vehicles with velocity.
Outflow boundary conditions To compute the flux at the outflow boundary of a continuum region — which is used to create discrete vehicles leaving the region — I use a ‘virtual’ cell of continuum data based on vehicles near the start of the adjoining microscopic region. Precisely, temporary cell of length ∆x is created at the start of the microscopic region and apply Equations (5.5) and (5.6) from Section 5.4.1. This temporary cell is used for qr when solving the Riemann problem at the end of the
continuum lane, and the resulting flux is used to send discrete vehicles into the following microscopic region.
Accumulating density In the dimensionless interval between the end of a continuum region and the start of a discrete one, I monitor the flux of vehicles and accumulate density until a sufficient quantity has been retained that a vehicle can be emitted — I call this aflux capacitor. Formally, the accumulated cars Vtot at a flux capacitor at time
t is given by the following: Vtot = Z t 0 ρ0(τ)u0(τ) l dτ (5.15)
where ρ0u0 is the ρ-component of the flux of the intermediate state as computed in
the Riemann problem (computed from q0 = [ρ0, y0]T, found as per Section 4.3.3.4, and
substituted into f of Equation (4.7)). l is vehicle length; this term is necessary to scale the integrand from cars per car length (ρ) times meters per second (u) to cars per second. Because q0 is considered to be constant during a timestep, Equation (5.15) simplifies
to: Vtot = n−2 X i=0 Z ti+1 ti ρ0(τ)u0(τ) l dτ = 1 l n−2 X i=0 ρ0(ti)u0(ti) (ti+1−ti) (5.16)
given a (nonuniform) sequence of n distinct timesteps [t0 = 0, t1, . . . , tn−1].
Incremental flux accumulation Of course, rather than simply count their number, I wish to introduce these ‘accumulated’ vehicles as they occur. To this end, I maintain a Vacc that is updated each at the end of each timestep ti by
∆Vacc= 1lρ0(ti)u0(ti) (ti+1−ti) (5.17)
Then, if Vacc ≥ 1, emit a vehicle and set Vacc = {Vacc}, where {x} is the sawtooth
function {x}=x− bxc.
This vehicle begins with its rearmost point (the rear bumper) aligned with the start of the macroscopic lane, and its velocity is set to beu0 during the timestep of the interval
wherein the vehicle was emitted.
Preventing multiple-vehicle emission The procedure above does not account for situations where ∆Vacc >1; in this case, the method may be obligated to emit multiple
vehicles in a single timestep. To do so, it is necessary to emit the vehicles at some reasonable distance from one another, and this brings of issue of locality — one or more
of the emitted vehicles would start well into the microscopic region, and it is difficult to ensure that there is sufficient space to avoid overlapping vehicles.
It is necessary to have ∆Vacc ≤1; to get a better idea of this value, Equation (5.17)
can be simplified using what is known aboutti+1−ti = ∆ti, which is computed according
to Equation (4.6). ∆ti is the smallest ratio of the cell spacing ∆xto the maximum speed λmax across all lanes; and u0 ≤ λmax, because u is a wave speed (See Equation 4.14).
Putting it all together results in following rough upper bound for ∆Vacc:
∆Vacc≤ ∆lxρ0(ti) (5.18)
This has an intuitive explanation; ∆x/l is the number of cars that can possibly fit in a cell in the current region, and ρ0 is how ‘full’ of vehicles such a cell is. Given that
∆x >> lin general (the cell spacing is approximately some multiple of the vehicle length
l), ∆Vacc is certainly not restricted to be ≤1.
To ensure that no more than one vehicle may be emitted per flux capacitor in a timestep, I add an additional restriction to that given in Equation (4.6):
∆t < min j∈L,k∈FC ∆xj λmaxj, l ∆xkρ0,ku0,k (5.19) where L is the set of all continuum lanes andFC is the set of all flux capacitors.
In practice, the additional restriction imposed on ∆t in Equation (5.19) will rarely result in a ∆tsmaller than that produced by from the conventional stability requirements given in Equation (4.6); there is a relationship betweenρ0 andu0 given by Equation (4.9)
that limits the maximum flux ρu that can be achieved for a given γ. 5.4.3.2 Flow averaging
and how to account for the downstream microscopic region’s effect on the upstream continuum region Now, I describe the converse: how vehicles in discrete regions that flow into continuum regions may be converted into the appropriate macroscopic quan-
tities, and how the state of this continuum region can be accounted for in the upstream microscopic region.
Finding leaders in continuum regions I have discussed how a vehicle at the end of a discrete lane locates the leading vehicle that dictates its acceleration in Section5.3.6.2. Should one encounter a continuum lane in the search, a suitable distance and velocity must be provided — the qualities of a hypothetical leading vehicle. This mechanism will allow microscopic regions that flow into continuum ones to account for the downstream dynamics.
I use the vehicle instantiation procedure described in Section 5.4.2.5, except that it now terminates after finding just one vehicle This vehicle’s velocity is determined by the continuum data at its location, and it is position and velocity are reported back as per the algorithm described in Section 5.3.6.2.
Not that this vehicle is not persistent; one simply uses the instantiation algorithm to determine the position and velocity of the first vehicle in the lane, report it to the leader-locating algorithm, and discard the temporary vehicle’s information.
Transfer of discrete vehicles into continuum regions When discrete regions flow into continuum ones, one must convert discrete vehicles into continuum data as they pass into the new regime. I achieve this in a similar fashion to how I account for downstream discrete vehicles affect the outflow of continuum regions in Section 5.4.3.1.
A single ‘virtual’ grid cell at the end of the microscopic region is filled according to the averaging procedure in Section 5.4.1; this is then used as the left grid cell qr when solving the Riemann problem associated the start of the continuum lane.
(a) Overlapping regions (b)Ordered regions (L,[a, b))< (L,[b, c))
(c) Adjacent regions
(d)Merging and splitting regions
(e) Divvying regions
Figure 5.7: Region operations
simply remove it from the simulation; the vehicle is already accounted for in the contin- uum representation and flux computation just described.