uxsim.DTAsolvers.SolverDUE

class uxsim.DTAsolvers.SolverDUE(func_World)[source]

Solve quasi Dynamic User Equilibrium (DUE) problem using day-to-day dynamics. WIP

Parameters:

func_World (function) – function that returns a World object with nodes, links, and demand specifications

Notes

This function computes a near dynamic user equilibrium state as a steady state of day-to-day dynamical routing game.

Specifically, on day i, vehicles choose their route based on actual travel time on day i-1 with the same departure time. If there are shorter travel time route, they will change with probability swap_prob. This process is repeated until max_iter day. It is expected that this process eventually reach a steady state. Due to the problem complexity, it does not necessarily reach or converge to Nash equilibrium or any other stationary points. However, in the literature, it is argued that the steady state can be considered as a reasonable proxy for Nash equilibrium or dynamic equilibrium state. There are some theoretical background for it; but intuitively speaking, the steady state can be considered as a realistic state that people’s rational behavior will reach.

This method is based on the following literature: Ishihara, M., & Iryo, T. (2015). Dynamic Traffic Assignment by Markov Chain. Journal of Japan Society of Civil Engineers, Ser. D3 (Infrastructure Planning and Management), 71(5), I_503-I_509. (in Japanese). https://doi.org/10.2208/jscejipm.71.I_503 Iryo, T., Urata, J., & Kawase, R. (2024). Traffic Flow Simulator and Travel Demand Simulators for Assessing Congestion on Roads After a Major Earthquake. In APPLICATION OF HIGH-PERFORMANCE COMPUTING TO EARTHQUAKE-RELATED PROBLEMS (pp. 413-447). https://doi.org/10.1142/9781800614635_0007 Iryo, T., Watling, D., & Hazelton, M. (2024). Estimating Markov Chain Mixing Times: Convergence Rate Towards Equilibrium of a Stochastic Process Traffic Assignment Model. Transportation Science. https://doi.org/10.1287/trsc.2024.0523

__init__(func_World)[source]

Solve quasi Dynamic User Equilibrium (DUE) problem using day-to-day dynamics. WIP

Parameters:

func_World (function) – function that returns a World object with nodes, links, and demand specifications

Notes

This function computes a near dynamic user equilibrium state as a steady state of day-to-day dynamical routing game.

Specifically, on day i, vehicles choose their route based on actual travel time on day i-1 with the same departure time. If there are shorter travel time route, they will change with probability swap_prob. This process is repeated until max_iter day. It is expected that this process eventually reach a steady state. Due to the problem complexity, it does not necessarily reach or converge to Nash equilibrium or any other stationary points. However, in the literature, it is argued that the steady state can be considered as a reasonable proxy for Nash equilibrium or dynamic equilibrium state. There are some theoretical background for it; but intuitively speaking, the steady state can be considered as a realistic state that people’s rational behavior will reach.

This method is based on the following literature: Ishihara, M., & Iryo, T. (2015). Dynamic Traffic Assignment by Markov Chain. Journal of Japan Society of Civil Engineers, Ser. D3 (Infrastructure Planning and Management), 71(5), I_503-I_509. (in Japanese). https://doi.org/10.2208/jscejipm.71.I_503 Iryo, T., Urata, J., & Kawase, R. (2024). Traffic Flow Simulator and Travel Demand Simulators for Assessing Congestion on Roads After a Major Earthquake. In APPLICATION OF HIGH-PERFORMANCE COMPUTING TO EARTHQUAKE-RELATED PROBLEMS (pp. 413-447). https://doi.org/10.1142/9781800614635_0007 Iryo, T., Watling, D., & Hazelton, M. (2024). Estimating Markov Chain Mixing Times: Convergence Rate Towards Equilibrium of a Stochastic Process Traffic Assignment Model. Transportation Science. https://doi.org/10.1287/trsc.2024.0523

Methods

__init__(func_World)

Solve quasi Dynamic User Equilibrium (DUE) problem using day-to-day dynamics.

plot_convergence()

Plots convergence metrics for a Dynamic Traffic Assignment (DTA) solution.

plot_link_stats()

Generate two plots to visualize the evolution of link-level traffic statistics across iterations.

plot_vehicle_stats([orig, dest])

Plot travel time statistics for vehicles based on their origin and destination.

solve(max_iter[, n_routes_per_od, ...])

Solve quasi Dynamic User Equilibrium (DUE) problem using day-to-day dynamics.

plot_convergence()[source]

Plots convergence metrics for a Dynamic Traffic Assignment (DTA) solution. This function creates three separate plots: 1. Total travel time across iterations 2. Number of route changes (swaps) across iterations 3. Travel time gap between chosen routes and minimum cost routes across iterations

Generate two plots to visualize the evolution of link-level traffic statistics across iterations. The first plot shows traffic volume changes for each link over iterations. The second plot shows average travel time changes for each link over iterations.

plot_vehicle_stats(orig=None, dest=None)[source]

Plot travel time statistics for vehicles based on their origin and destination. This function visualizes the average travel time and standard deviation for vehicles matching the specified origin and destination criteria. The data is plotted against the departure time of each vehicle.

Parameters:
  • orig (str, optional) – Filter vehicles by origin. If None, vehicles from all origins are included.

  • dest (str, optional) – Filter vehicles by destination. If None, vehicles to all destinations are included.

Notes

  • The function uses the second half of the available data (from length/2 to length) from the cost_log to compute statistics.

  • The plot shows departure time on the x-axis and average travel time on the y-axis, with error bars representing the standard deviation.

solve(max_iter, n_routes_per_od=10, swap_prob=0.05, print_progress=True)[source]

Solve quasi Dynamic User Equilibrium (DUE) problem using day-to-day dynamics. WIP

Parameters:
  • max_iter (int) – maximum number of iterations

  • n_routes_per_od (int) – number of routes to enumerate for each OD pair

  • swap_prob (float) – probability of route swap

  • print_progress (bool) – whether to print the information

Returns:

W – World object with quasi DUE solution (if properly converged)

Return type:

World

Notes

self.W_sol is the final solution. self.W_intermid_solution is a latest solution in the iterative process. Can be used when an user terminate the solution algorithm.