uxsim.DTAsolvers.SolverDSO_D2D

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

Solve quasi Dynamic System Optimum (DSO) problem using day-to-day dynamics.

Parameters:

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

Notes

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

This is a modification of Iryo’s DUE algorithm, in which each traveler minimize marginal travel time (i.e., private cost + externality) instead of private cost as in DUE. Since the externality (i.e., the total system cost without the ego vehicle) is costly to compute directly, it is estimated based on the queueing principle of the traffic flow model. Apart from these point, this algorithm is almost the same to SolverDUE and thus expected to have the desirable properties discussed in the papers cited above.

This algorithm is a loose generalization of “DSO game” of the following paper. - Satsukawa, K., Wada, K., & Watling, D. (2022). Dynamic system optimal traffic assignment with atomic users: Convergence and stability. Transportation Research Part B: Methodological, 155, 188-209. In this paper, it is theoretically guaranteed that their DSO game algorithm converges to the global optimal DSO state. However, it may take long time. This SolverDSO_D2D speeds up the solution process significantly, but it weaken the convergence guarantee.

__init__(func_World)[source]

Solve quasi Dynamic System Optimum (DSO) problem using day-to-day dynamics.

Parameters:

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

Notes

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

This is a modification of Iryo’s DUE algorithm, in which each traveler minimize marginal travel time (i.e., private cost + externality) instead of private cost as in DUE. Since the externality (i.e., the total system cost without the ego vehicle) is costly to compute directly, it is estimated based on the queueing principle of the traffic flow model. Apart from these point, this algorithm is almost the same to SolverDUE and thus expected to have the desirable properties discussed in the papers cited above.

This algorithm is a loose generalization of “DSO game” of the following paper. - Satsukawa, K., Wada, K., & Watling, D. (2022). Dynamic system optimal traffic assignment with atomic users: Convergence and stability. Transportation Research Part B: Methodological, 155, 188-209. In this paper, it is theoretically guaranteed that their DSO game algorithm converges to the global optimal DSO state. However, it may take long time. This SolverDSO_D2D speeds up the solution process significantly, but it weaken the convergence guarantee.

Methods

__init__(func_World)

Solve quasi Dynamic System Optimum (DSO) 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 DSO 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, swap_num=None, print_progress=True)[source]

Solve quasi DSO problem using day-to-day dynamics.

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.