Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b87a359
the configuration templates that use the bundle are written for the B…
dmeoli Sep 18, 2026
b869624
release notes
dmeoli Sep 18, 2026
0f4d4a9
the Lagrangian dual of a two-stage stochastic problem can be taken do…
dmeoli Sep 21, 2026
3cf6936
a template for the BendersDecompositionSolver on the Benders form of …
dmeoli Sep 21, 2026
079b5b3
the template of the BendersDecompositionSolver evaluates the subprobl…
dmeoli Sep 21, 2026
f09970c
the template of the BendersDecompositionSolver says that tssb_solver …
dmeoli Sep 21, 2026
79a6b74
the templates of the thermal family are the configurations the compar…
dmeoli Sep 21, 2026
71831db
the templates follow the rules of the reviews: one-line release notes…
dmeoli Sep 21, 2026
3e5104c
the InvestmentBlock over a TSSB or an MSSB gets its templates, and th…
dmeoli Sep 22, 2026
79dbf97
the three Lagrangian duals of the TSSB also with a ParallelBundleSolv…
dmeoli Sep 22, 2026
31c82bd
the continuous relaxation of a TSSB gets its templates, with Gurobi a…
dmeoli Sep 22, 2026
2145301
the thermal units of the TSSB templates are written in the 3bin formu…
dmeoli Sep 22, 2026
8b099f7
the templates as measured: BDS tolerates the relaxed binaries of an i…
dmeoli Sep 26, 2026
41a6b1c
the master of the bundle templates is solved by HiGHS in MPBCfg.txt, …
dmeoli Sep 25, 2026
c7d26c5
the InvestmentFunction of the templates writes no file, which the tes…
dmeoli Sep 26, 2026
5df0f60
the threads of the BendersDecompositionSolver template are intMaxThre…
dmeoli Sep 26, 2026
6d5250b
the SDDPBlock templates are those of the sddp_solver of SMS++, the La…
dmeoli Sep 26, 2026
c8a3288
the nested forms have their templates: BDS whose subproblems are solv…
dmeoli Sep 27, 2026
71beaef
the feasible solution comes from the configuration: strRecoveryBSC in…
dmeoli Sep 27, 2026
3f053e7
the BDS with a bundle master recovers the feasible solution too, at t…
dmeoli Sep 27, 2026
93d04cd
the MILP of the TSSB templates separates nothing: no Block of these n…
dmeoli Sep 27, 2026
a7cc5c3
the tests count the arcs of a HydroUnitBlock among the generators of …
dmeoli Sep 28, 2026
ac6965d
Merge branch 'main' into feature/bundlesolver-2.0-templates
davide-f Sep 28, 2026
3c684d7
the SDDPBlock templates name the hard components with vstrNoEasy, and…
dmeoli Sep 28, 2026
793cdf9
an integer design, e.g., the modules of a modular asset, is solved by…
dmeoli Oct 1, 2026
d149b14
the InvestmentBlock over a stochastic Block asks its bundle for dblNZ…
dmeoli Oct 1, 2026
c91864b
the integer masters ask HiGHS for an integrality tolerance of 1e-10: …
dmeoli Oct 2, 2026
5115bb6
the InvestmentBlock bundle has the balancing long-term t-strategy, an…
dmeoli Oct 2, 2026
15e16c9
the MILP of the TSSB templates keeps intCutSepPar 7: its callback mak…
dmeoli Oct 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@

### Minor Changes and Bug Fixes

*
* Write the templates that use the BundleSolver for the BundleSolver 2.0, whose master is configured by the new `MPBCfg.txt` (HiGHS) or `MPBCfg_grb.txt` (Gurobi). See [PR #116](https://github.com/SPSUnipi/pySMSpp/pull/116)

* Add templates for the two-stage instances whose scenario is a unit commitment: the MILP (`TSSBSCfg-IP.txt`), the Lagrangian dual of the scenarios (`TSSBSCfg-LD-IP.txt`), the chain of two duals (`TSSBSCfg-LDLD.txt`), the recursive Lagrangian dual (`TSSBSCfg-LDrec.txt`) and the PrimalProximalHeur, which gives a feasible solution (`TSSBSCfg-PPH.txt`), the three duals also with a ParallelBundleSolver (`-par`), and the continuous relaxation with Gurobi (`TSSBSCfg-LP.txt`) and with PIPS-IPM++ (`TSSBSCfg-PIPS.txt`). See [PR #116](https://github.com/SPSUnipi/pySMSpp/pull/116)

* Add the templates of the BendersDecompositionSolver for the Benders form of a two-stage problem (`TSSBSCfg-BDS.txt`, `BDSMCfg.txt`, `BDSSCfg.txt`), and of the InvestmentBlock over a TSSB or an MSSB (`TSSBSCfg-IB.txt`, `BSCfg-IB.txt`). The Solver of the block inside an InvestmentBlock is given by its OBlockConfig (`IBOCfg.txt`, `IFCfg.txt`) through the `InvestmentBlock` entry of `InnerBCfg.txt`, which `smspp_investmentblock_solver` reads by default, in `InvestmentBlock/` and in `TSSBlock/`. See [PR #116](https://github.com/SPSUnipi/pySMSpp/pull/116)


## Version v0.0.14
Expand Down
1 change: 1 addition & 0 deletions pysmspp/data/blocks/InvestmentBlock.csv
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ InvestmentBlock,DisinvestmentCost,Variable,Variable,double,-|NumAssets,-,,requir
InvestmentBlock,LowerBound,Variable,Variable,double,-|NumAssets,-,,optional,Minimum capacity of each asset
InvestmentBlock,UpperBound,Variable,Variable,double,-|NumAssets,-,,optional,Maximum capacity of each asset
InvestmentBlock,InstalledQuantity,Variable,Variable,double,-|NumAssets,-,,optional,Installed capacity of each asset
InvestmentBlock,Integer,Variable,Variable,int,-|NumAssets,-,,optional,Nonzero if the design of the asset is integer (e.g. the number of its modules)
InvestmentBlock,Constraints_LowerBound,Variable,Variable,double,-|NumConstraints,-,,optional,Lower bound of each constraint
InvestmentBlock,Constraints_UpperBound,Variable,Variable,double,-|NumConstraints,-,,optional,Upper bound of each constraint
InvestmentBlock,Constraints_A,Variable,Variable,double,-|NumConstraints-NumAssets,-,,optional,Coefficients of matrix of the linear constraints
Expand Down
16 changes: 6 additions & 10 deletions pysmspp/data/configs/InvestmentBlock/BSCfg_grb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
#
# Gurobi variant of BSCfg.txt: a BlockSolverConfig for the inner UCBlock-style
# block of an InvestmentBlock, to be solved by GRBMILPSolver as the LP
# relaxation (intRelaxIntVars 1) of the underlying MIP. Presolve is disabled
# for reproducibility (it can transform the model and shift the optimal vertex
# on degenerate LPs), and NumericFocus is raised because the InvestmentBlock
# inner LPs are badly scaled (capacities, snapshot-weighted costs and VOLL span
# many orders of magnitude), which makes HiGHS fail on some iterates.
#
# Antonio Frangioni, Donato Meoli
# relaxation (intRelaxIntVars 1) of the underlying MIP, with the presolve and
# the numerical focus of Gurobi left at their default: the inner LP is solved
# at every evaluation of the InvestmentFunction, and with Presolve 0 and
# NumericFocus 3 each evaluation cost 2.5 times as much, which the badly
# scaled LPs that make HiGHS fail (see BSCfg.txt) do not need with Gurobi.
#
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# BlockSolverConfig - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Expand All @@ -33,16 +31,14 @@ ComputeConfig # exact type of the ComputeConfig object
1 # f_diff == 0 ==> all non-provided parameters are set to the default value
# f_diff == 1 ==> all non-provided parameters are not changed

5 # number of integer parameters
3 # number of integer parameters

# now all the integer parameters
intLogVerb 0 # LogVerb, log verbosity of the MILPSolver
intRelaxIntVars 1 # nonzero if the continuous relaxation is solved
intCutSepPar 7 # separate user cuts + lazy constraints

# All specific GUROBI parameter
Presolve 0 # disable presolve for reproducibility
NumericFocus 3 # maximum numerical precision focus

0 # number of double parameters

Expand Down
72 changes: 72 additions & 0 deletions pysmspp/data/configs/InvestmentBlock/BSPar-int.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# - - - - - - - - - - - - - - - BSPar-int.txt - - - - - - - - - - - - - - -
#
# A BlockSolverConfig for an InvestmentBlock whose design is integer, e.g.,
# the number of modules of a modular asset: the BundleSolver of BSPar.txt
# keeping it integer, with a trust region of radius 1 and a master that is a
# mixed-integer linear problem [see intIntVars].
#
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

BlockSolverConfig # exact type of the Configuration object

1 # the BlockSolverConfig is a "differential" one

1 # number of (the names of) Solver in this BlockSolverConfig
# now all the names of the Solver - - - - - - - - - - - - - - - - - - - - - -
BundleSolver # name of Solver

1 # number of ComputeConfig in this BlockSolverConfig

# now all the ComputeConfig
# 1st ComputeConfig - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# ComputeConfig of the BundleSolver

*BundleCfg.txt +

1 # f_diff == 1 ==> only the entries below are changed

5 # number of integer parameters

# now all the integer parameters
intIntVars 1 # the integer design, e.g., the modules, stay integer
intMPPrimal 1 # the primal master, where the design is the Variable
intMPV2Form 1 # raw form: the Variable of the master are the design itself
intMPStbl 4 # 4 = trust region || x - x_bar ||_inf <= t, a MILP master
intRstAlg 2 # parameter to handle the reset of the algorithm

1 # number of double parameters

# now all the double parameters
dbltInit 1 # radius of the trust region, in modules

1 # number of string parameters

# now all the string parameters
strMPBSolverCfg MPBCfg-IP.txt # the master, which keeps the integers

0 # number of vector-of-int parameters

# now all the vector-of-int parameters
# [none]

0 # number of vector-of-double parameters

# now all the vector-of-double parameters
# [none]

0 # number of vector-of-string parameters

# now all the vector-of-string parameters
# [none]

# pointer to the "extra" Configuration
* # [none]

# end of 1st ComputeConfig- - - - - - - - - - - - - - - - - - - - - - - - - -

# end of BlockSolverConfig- - - - - - - - - - - - - - - - - - - - - - - - - -

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# - - - - - - - - - - - - - - END BSPar-int.txt - - - - - - - - - - - - - -
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
97 changes: 5 additions & 92 deletions pysmspp/data/configs/InvestmentBlock/BSPar.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# - - - - - - - - - - - - - - - - BSPar.txt - - - - - - - - - - - - - - - - -
# - - - - - - - - - - - - - - - - BSPar.txt - - - - - - - - - - - - - - - -
#
# A txt description of a BlockSolverConfig for an InvestmentBlock to be
# solved by a BundleSolver
# A BlockSolverConfig for an InvestmentBlock to be solved by a
# BundleSolver [see BundleCfg.txt].
#
# Antonio Frangioni
#
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

BlockSolverConfig # exact type of the Configuration object
Expand All @@ -21,93 +18,9 @@ BundleSolver # name of Solver

# now all the ComputeConfig
# 1st ComputeConfig - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# ComputeConfig of the LagrangianDualSolver; it mostly is the
# ComputeConfig of the inner Solver, which is a [Parallel]BundleSolver

ComputeConfig # exact type of the ComputeConfig object

1 # f_diff == 0 ==> all non-provided parameters are set to the default value
# f_diff == 1 ==> all non-provided parameters are not changed

23 # number of integer parameters

# now all the integer parameters
intDoEasy 0 # do easy components for (some) LagBFunction
intMaxIter 10000 # max number of iterations for each call
intMaxThread 6 # MaxThread, max number of new tasks to spawn
intLogVerb 16 # log verbosity of main Bundle algorithm
intWZNorm 2 # which norm to use in the norm-based stopping condition
intBPar1 20 # discard items when they have been useless for <this> iterations
intBPar2 1000 # max bundle size per component
intBPar3 1 # max n. of items to fetch from Fi() at each iteration
intBPar4 1 # min n. of items to fetch from Fi() at each iteration
intBPar6 0 # second parameter for dynamic max n. of items per iteration
intBPar7 15 # how to deal with the global pools
intMnSSC 0 # min number of consecutive SS with the same t for a t increase
intMnNSC 3 # min number of consecutive NS with the same t for a t decrease
inttSPar1 0 # long-term t-strategy (0 = none, 4 = soft, 8 = hard, 12 = balancing)
intMaxNrEvls 2 # maximum number of function evaluations at each iteration
intMPName 8 # MP solver: 0 = QPP, 7 = Cplex/Gurobi with quadratic stabilization
# + 8 = check for duplicate linearizations

# QPPenalty's parameters :- - - - - - - - - - - - - - - - - - - - - - - - - -

intMPlvl 20 # log verbosity of Master Problem
intQPmp1 0 # MxAdd, how many variables can be added to the base at each
# iteration in BMinQuad (0 = at will)
intQPmp2 0 # MxRmv, how many variables can be removed from the base at each
# iteration in BMinQuad (0 = at will)

# OSIMPSolver's parameters :- - - - - - - - - - - - - - - - - - - - - - - - -

intOSImp1 1 # Osi(Cpx/Grb)Solver algorithm (0 = auto (default), 1 = primal, 2 = dual, 3 = network, 4 = barrier, 5 = sifting, 6 = concurrent)
intOSImp2 1 # pre-processing (reduction)
intOSImp3 1 # threads
intRstAlg 2 # parameter to handle the reset of the algorithm

16 # number of double parameters

# now all the double parameters
dblRelAcc 1e-4 # relative accuracy required to solution
dblNZEps 1e-4 # stopping parameter: threshold to declare 0 the || residual ||
dbltStar -100 # stopping parameter: multiplied to || residual || to estimate gap
dblBPar5 4 # first parameter for dynamic max n. of items per iteration
dblm1 -0.30 # a NS is possible if (~) Fi( Lambda1 ) >= Fi( Lambda ) + | m1 | v*
dblm2 0.90 # a SS is possible if Fi( Lambda1 ) <= Fi( Lambda ) + ( 1 - m2 ) v*
dblm3 0.99 # a NR is computed if \sigma^* < - t * m3 * || z* ||
dblmxIncr 10 # max increase of t
dblmnIncr 1.5 # min increase of t (each time it is increased)
dblmxDecr 0.1 # max decrease of t
dblmnDecr 0.66 # min decrease of t (each time it is decreased)
dbltMaior 1e+6 # maximum value for t
dbltMinor 1e-10 # minimum value for t
dbltInit 1e+0 # initial value for t
dbltSPar2 1e-2 # parameter for the long-term t-strategy
dblCtOff 0.01 # cut-off factor for pricing in MinQuad

0 # number of string parameters

# now all the string parameters
#str_LagBF_BSCfg LPBSCfg.txt # BlockSolverConfig for the LagBFunctions
# not needed if intDoEasy >= 1 && USE_BundleSolver > 0, this is done "by hand"

0 # number of vector-of-int parameters

# now all the vector-of-int parameters
# [none]

0 # number of vector-of-double parameters

# now all the vector-of-double parameters
# [none]

0 # number of vector-of-string parameters

# now all the vector-of-string parameters
# [none]
# ComputeConfig of the BundleSolver

# pointer to the "extra" Configuration
* # [none]
*BundleCfg.txt

# end of 1st ComputeConfig- - - - - - - - - - - - - - - - - - - - - - - - - -

Expand Down
82 changes: 82 additions & 0 deletions pysmspp/data/configs/InvestmentBlock/BundleCfg.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# - - - - - - - - - - - - - - - BundleCfg.txt - - - - - - - - - - - - - - -
#
# The ComputeConfig of the BundleSolver that solves an InvestmentBlock,
# shared by BSPar.txt and BSPar-int.txt.
#
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

ComputeConfig # exact type of the ComputeConfig object

1 # f_diff == 0 ==> all non-provided parameters are set to the default value
# f_diff == 1 ==> all non-provided parameters are not changed

17 # number of integer parameters

# now all the integer parameters
intMPStbl 0 # stabilization: 0 = proximal, 1 = level, 2 = doubly
intDoEasy 0 # do easy components for (some) LagBFunction
intMaxIter 10000 # max number of iterations for each call
intMaxThread 6 # MaxThread, max number of new tasks to spawn
intLogVerb 16 # log verbosity of main Bundle algorithm
intWZNorm 2 # which norm to use in the norm-based stopping condition
intBPar1 20 # discard items when they have been useless for <this>
intBPar2 1000 # max bundle size per component
intBPar3 1 # max n. of items to fetch from Fi() at each iteration
intBPar4 1 # min n. of items to fetch from Fi() at each iteration
intBPar6 0 # second parameter for dynamic max n. of items per
intBPar7 15 # how to deal with the global pools
intMnSSC 0 # min number of consecutive SS with the same t for a t
intMnNSC 3 # min number of consecutive NS with the same t for a t
inttSPar1 12 # long-term t-strategy (0 = none, 4 = soft, 8 = hard, 12 =
intMaxNrEvls 2 # maximum number of function evaluations at each iteration

intRstAlg 2 # parameter to handle the reset of the algorithm

15 # number of double parameters

# now all the double parameters
dblRelAcc 1e-4 # relative accuracy required to solution
dblNZEps 1e-4 # stopping parameter: threshold to declare 0 the ||
dbltStar -100 # stopping parameter: multiplied to || residual || to
dblBPar5 4 # first parameter for dynamic max n. of items per iteration
dblm1 -0.30 # a NS is possible if (~) Fi( Lambda1 ) >= Fi( Lambda ) + |
dblm2 0.90 # a SS is possible if Fi( Lambda1 ) <= Fi( Lambda ) + ( 1 -
dblm3 0.99 # a NR is computed if \sigma^* < - t * m3 * || z* ||
dblmxIncr 10 # max increase of t
dblmnIncr 1.5 # min increase of t (each time it is increased)
dblmxDecr 0.1 # max decrease of t
dblmnDecr 0.66 # min decrease of t (each time it is decreased)
dbltMaior 1e+6 # maximum value for t
dbltMinor 1e-10 # minimum value for t
dbltInit 1e+0 # initial value for t
dbltSPar2 1e-2 # parameter for the long-term t-strategy

1 # number of string parameters

# now all the string parameters
#str_LagBF_BSCfg LPBSCfg.txt # BlockSolverConfig for the LagBFunctions
# not needed if intDoEasy >= 1 && USE_BundleSolver > 0, this is done "by
strMPBSolverCfg MPBCfg.txt # BlockSolverConfig for the MasterProblemBlock's

0 # number of vector-of-int parameters

# now all the vector-of-int parameters
# [none]

0 # number of vector-of-double parameters

# now all the vector-of-double parameters
# [none]

0 # number of vector-of-string parameters

# now all the vector-of-string parameters
# [none]

# pointer to the "extra" Configuration
* # [none]

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# - - - - - - - - - - - - - - END BundleCfg.txt - - - - - - - - - - - - - -
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
54 changes: 54 additions & 0 deletions pysmspp/data/configs/InvestmentBlock/IBOCfg.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# - - - - - - - - - - - - - - - - IBOCfg.txt - - - - - - - - - - - - - - - -
#
# The OBlockConfig of an InvestmentBlock: it reformulates the bounds on the
# investment, and gives the InvestmentFunction its ComputeConfig [see
# IFCfg.txt], which holds the BlockSolverConfig of the inner Block.
#
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

OBlockConfig # exact type of the Configuration object

1 # the BlockConfig is a "differential" one

2 # version of the BlockConfig format

# the Configuration for the structure, i.e., the tree of sub-Block
* # [none]

# static_constraints: the bounds l <= x <= u on the investment are
# reformulated as 0 <= x <= u - l, the only form BundleSolver handles
SimpleConfiguration<int>
1

# dynamic_constraints
* # [none]

# static_variables
* # [none]

# dynamic_variables
* # [none]

# objective
* # [none]

# is_feasible
* # [none]

# is_optimal
* # [none]

# solution
* # [none]

# extra
* # [none]

# the ComputeConfig of the Objective, i.e., of the InvestmentFunction
*IFCfg.txt

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# - - - - - - - - - - - - - - - END IBOCfg.txt - - - - - - - - - - - - - - -
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Loading
Loading