Implement global disposal limits

This commit is contained in:
2025-09-16 11:53:32 -05:00
parent 67b1e5fd40
commit e4d4ee1cc8
14 changed files with 126 additions and 79 deletions

View File

@@ -18,6 +18,7 @@ function instance_parse_test_1()
@test p1.tr_energy == [0.12, 0.12, 0.12, 0.12]
@test p1.tr_emissions ==
Dict("CO2" => [0.052, 0.052, 0.052, 0.052], "CH4" => [0.003, 0.003, 0.003, 0.003])
@test p1.disposal_limit == [1.0, 1.0, 1.0, 1.0]
@test instance.products_by_name["P1"] === p1
p2 = instance.products[2]
p3 = instance.products[3]

View File

@@ -109,4 +109,13 @@ function model_build_test()
@test repr(model[:eq_disposal_limit]["C1", "P2", 1]) ==
"eq_disposal_limit[C1,P2,1] : z_disp[C1,P2,1] ≤ 0"
@test ("C1", "P3", 1) keys(model[:eq_disposal_limit])
# Global disposal limit
@test repr(model[:eq_disposal_limit]["P1", 1]) ==
"eq_disposal_limit[P1,1] : z_disp[C2,P1,1] ≤ 1"
@test repr(model[:eq_disposal_limit]["P2", 1]) ==
"eq_disposal_limit[P2,1] : z_disp[C1,P2,1] ≤ 2"
@test repr(model[:eq_disposal_limit]["P3", 1]) ==
"eq_disposal_limit[P3,1] : z_disp[L1,P3,1] + z_disp[C1,P3,1] ≤ 5"
@test ("P4", 1) keys(model[:eq_disposal_limit])
end