FAST: the production management problem

This tutorial was generated using Literate.jl. Download the source as a .jl file. Download the source as a .ipynb file.

An implementation of the Production Management example from FAST

using SDDP, HiGHS, Testfunction fast_production_management(; cut_type)    DEMAND = [2, 10]    H = 3    N = 2    C = [0.2, 0.7]    S = 2 .+ [0.33, 0.54]    model = SDDP.LinearPolicyGraph(;        stages = H,        lower_bound = -50.0,        optimizer = HiGHS.Optimizer,    ) do sp, t        @variable(sp, x[1:N] >= 0, SDDP.State, initial_value = 0.0)        @variables(sp, begin            s[i = 1:N] >= 0            d        end)        @constraints(sp, begin            [i = 1:N], s[i] <= x[i].in            sum(s) <= d        end)        SDDP.parameterize(sp, t == 1 ? [0] : DEMAND) do ω            fix(d, ω)            return        end        @stageobjective(sp, sum(C[i] * x[i].out for i in 1:N) - S's)    end    SDDP.train(model; cut_type = cut_type, print_level = 2, log_frequency = 5)    @test SDDP.calculate_bound(model)  -23.96 atol = 1e-2endfast_production_management(; cut_type = SDDP.SINGLE_CUT)fast_production_management(; cut_type = SDDP.MULTI_CUT)
Test Passed