Implement first version of multi-period simulations

This commit is contained in:
2020-05-05 19:08:09 -05:00
parent f970dca68d
commit 9f6bfef327
10 changed files with 334 additions and 237 deletions

View File

@@ -8,7 +8,7 @@ using ReverseManufacturing
basedir = dirname(@__FILE__)
instance = ReverseManufacturing.load("$basedir/../instances/samples/s1.json")
graph = ReverseManufacturing.build_graph(instance)
process_node_by_location_name = Dict(n.plant.location_name => n
process_node_by_location_name = Dict(n.location.location_name => n
for n in graph.process_nodes)
@test length(graph.plant_shipping_nodes) == 8
@@ -20,19 +20,19 @@ using ReverseManufacturing
@test length(node.incoming_arcs) == 0
@test length(node.outgoing_arcs) == 2
@test node.outgoing_arcs[1].source.location.name == "C1"
@test node.outgoing_arcs[1].dest.plant.plant_name == "F1"
@test node.outgoing_arcs[1].dest.plant.location_name == "L1"
@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
node = process_node_by_location_name["L1"]
@test node.plant.plant_name == "F1"
@test node.plant.location_name == "L1"
@test node.location.plant_name == "F1"
@test node.location.location_name == "L1"
@test length(node.incoming_arcs) == 10
@test length(node.outgoing_arcs) == 2
node = process_node_by_location_name["L3"]
@test node.plant.plant_name == "F2"
@test node.plant.location_name == "L3"
@test node.location.plant_name == "F2"
@test node.location.location_name == "L3"
@test length(node.incoming_arcs) == 2
@test length(node.outgoing_arcs) == 2