Skip to content

Commit

Permalink
Merge pull request #3 from sisl/jkg/parallel
Browse files Browse the repository at this point in the history
Parallelize travel time estimate computation
  • Loading branch information
Shushman authored Mar 26, 2020
2 parents b77c653 + 51cc0a7 commit 290316b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/preprocessing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,16 @@ function compute_all_pairs_estimates(env::MAPFTransitEnv, n_halton_points::Int64

travel_time_estimates = zeros(n_halton_points, n_halton_points)

for i = 1:n_halton_points
@sync for i = 1:n_halton_points
println("From point $i:")
for j = 1:n_halton_points

if i != j
orig_str = string("d-", i)
goal_str = string("d-", j)

travel_time_estimates[i, j] = get_depot_to_site_travel_time!(env, weight, orig_str, goal_str)
envcp = deepcopy(env)
Threads.@spawn travel_time_estimates[i, j] = get_depot_to_site_travel_time!(envcp, weight, orig_str, goal_str)
end
end
end
Expand Down

0 comments on commit 290316b

Please sign in to comment.