Switch from Euclidean to approximate driving distance

This commit is contained in:
2022-12-15 09:49:38 -06:00
parent 23b3b33146
commit 48bd3c403f
9 changed files with 109 additions and 15 deletions

View File

@@ -21,7 +21,7 @@ using RELOG
@test node.outgoing_arcs[1].source.location.name == "C1"
@test node.outgoing_arcs[1].dest.location.plant_name == "F1"
@test node.outgoing_arcs[1].dest.location.location_name == "L1"
@test node.outgoing_arcs[1].values["distance"] == 1095.62
@test node.outgoing_arcs[1].values["distance"] == 1695.364
node = process_node_by_location_name["L1"]
@test node.location.plant_name == "F1"

25
test/graph/dist_test.jl Normal file
View File

@@ -0,0 +1,25 @@
# RELOG: Reverse Logistics Optimization
# Copyright (C) 2020, UChicago Argonne, LLC. All rights reserved.
# Released under the modified BSD license. See COPYING.md for more details.
using RELOG
@testset "KnnDrivingDistance" begin
# Euclidean distance between Chicago and Indianapolis
@test RELOG._calculate_distance(
41.866,
-87.656,
39.764,
-86.148,
RELOG._EuclideanDistance(),
) == 265.818
# Approximate driving distance between Chicago and Indianapolis
@test RELOG._calculate_distance(
41.866,
-87.656,
39.764,
-86.148,
RELOG._KnnDrivingDistance(),
) == 316.43
end

View File

@@ -11,6 +11,7 @@ using Test
end
@testset "Graph" begin
include("graph/build_test.jl")
include("graph/dist_test.jl")
end
@testset "Model" begin
include("model/build_test.jl")