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

@@ -21,7 +21,7 @@ using ReverseManufacturing
@test centers[1].latitude == 7
@test centers[1].latitude == 7
@test centers[1].longitude == 7
@test centers[1].amount == 934.56
@test centers[1].amount == [934.56, 934.56]
@test centers[1].product.name == "P1"
@test length(plants) == 6
@@ -32,40 +32,40 @@ using ReverseManufacturing
@test plant.input.name == "P1"
@test plant.latitude == 0
@test plant.longitude == 0
@test plant.opening_cost == 500
@test plant.fixed_operating_cost == 30
@test plant.variable_operating_cost == 30
@test plant.opening_cost == [500, 500]
@test plant.fixed_operating_cost == [30, 30]
@test plant.variable_operating_cost == [30, 30]
@test plant.base_capacity == 250
@test plant.max_capacity == 1000
@test plant.expansion_cost == 1
@test plant.expansion_cost == [1, 1]
p2 = product_name_to_product["P2"]
p3 = product_name_to_product["P3"]
@test length(plant.output) == 2
@test plant.output[p2] == 0.2
@test plant.output[p3] == 0.5
@test plant.disposal_limit[p2] == 1
@test plant.disposal_limit[p3] == 1
@test plant.disposal_cost[p2] == -10
@test plant.disposal_cost[p3] == -10
@test plant.disposal_limit[p2] == [1, 1]
@test plant.disposal_limit[p3] == [1, 1]
@test plant.disposal_cost[p2] == [-10, -10]
@test plant.disposal_cost[p3] == [-10, -10]
plant = location_name_to_plant["L3"]
@test plant.location_name == "L3"
@test plant.input.name == "P2"
@test plant.latitude == 25
@test plant.longitude == 65
@test plant.opening_cost == 3000
@test plant.fixed_operating_cost == 50
@test plant.variable_operating_cost == 50
@test plant.opening_cost == [3000, 3000]
@test plant.fixed_operating_cost == [50, 50]
@test plant.variable_operating_cost == [50, 50]
@test plant.base_capacity == 1e8
@test plant.max_capacity == 1e8
@test plant.expansion_cost == 0
@test plant.expansion_cost == [0, 0]
p4 = product_name_to_product["P4"]
@test plant.output[p3] == 0.05
@test plant.output[p4] == 0.8
@test plant.disposal_limit[p3] == 0.0
@test plant.disposal_limit[p4] == 0.0
@test plant.disposal_limit[p3] == [0, 0]
@test plant.disposal_limit[p4] == [0, 0]
end
end