@@ -621,16 +621,13 @@ def plot_vehicle_stats(s, orig=None, dest=None):
621621 with error bars representing the standard deviation.
622622 """
623623
624- ave_TT = []
625- std_TT = []
624+ sol_TT = []
626625 depature_time = []
627626 for vehid in s .route_log [0 ].keys ():
628627 if (s .W_sol .VEHICLES [vehid ].orig .name == orig or orig == None ) and (s .W_sol .VEHICLES [vehid ].dest .name == dest or dest == None ):
629- length = len (s .route_log )
630- ts = [s .cost_log [day ][vehid ] for day in range (int (length / 2 ), length )]
631- ave_TT .append (np .average (ts ))
632- std_TT .append (np .std (ts ))
633628 depature_time .append (s .W_sol .VEHICLES [vehid ].departure_time_in_second )
629+ r , ts = s .W_sol .VEHICLES [vehid ].traveled_route ()
630+ sol_TT .append (ts [- 1 ]- ts [0 ])
634631
635632 plt .figure ()
636633 orig_ = orig
@@ -640,8 +637,7 @@ def plot_vehicle_stats(s, orig=None, dest=None):
640637 if dest == None :
641638 dest_ = "any"
642639 plt .title (f"orig: { orig_ } , dest: { dest_ } " )
643- plt .errorbar (x = depature_time , y = ave_TT , yerr = std_TT ,
644- fmt = 'bx' , ecolor = "#aaaaff" , capsize = 0 , label = r"travel time (mean $\pm$ std)" )
640+ plt .plot (depature_time , sol_TT , "bx" , label = r"travel time (in DSO)" )
645641 plt .xlabel ("departure time of vehicle" )
646642 plt .ylabel ("travel time" )
647643 plt .legend ()
@@ -666,8 +662,12 @@ def __init__(s, func_World):
666662 s .W_sol = None #final solution
667663 s .W_intermid_solution = None #latest solution in the iterative process. Can be used when an user terminate the solution
668664 s .dfs_link = []
669-
670- #warnings.warn("DTA solver is experimental and may not work as expected. It is functional but unstable.")
665+
666+ warnings .warn (
667+ "`SolverDSO_GA` is deprecated. Please consider to use `SolverDSO_D2D`, which is much more efficient." ,
668+ DeprecationWarning
669+ )
670+
671671
672672 def solve (s , max_iter , n_routes_per_od = 10 , pop_size = 50 , elite_size = 2 , mutation_occur_rate = 0.1 , mutation_gene_rate = 0.05 , n_crossover_points = 2 , print_progress = True , initial_solution_World = None ):
673673 """
@@ -1048,6 +1048,11 @@ def __init__(s, func_World):
10481048 s .W_intermid_solution = None
10491049 s .dfs_link = []
10501050
1051+ warnings .warn (
1052+ "`SolverDSO_GA` is deprecated. Please consider to use `SolverDSO_D2D`, which is much more efficient." ,
1053+ DeprecationWarning
1054+ )
1055+
10511056 def solve (s , max_iter , n_routes_per_od = 10 , k_max = None , k_min = None , p0 = 0.2 , trials = 50 , always_accept = False , print_progress = True , initial_solution_World = None , destroy_set = None , repair_set = None ):
10521057 """
10531058 Solve Dynamic System Optimum (DSO) problem using a customized Adaptive Large Neighborhood Search (ADLS).
0 commit comments