Repository navigation
Conversation
…s by default, linearizes the PolyhedralFunctionBlock A UCBlock with a PolyhedralFunctionBlock, e.g., the future value of the water of a HydroSystemUnitBlock, could not be solved from the UCBlock templates, since a MILPSolver needs the function in its linearized form and the folder gave no BlockConfig asking for it. The map has that entry only, so the other sub-Blocks keep the formulation they are deserialized with and the instances without such a function are solved as before.
…re had left out of the previous commit
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
smspp_ucblock_solverreads, when no-Bis given, the BlockConfigInnerBCfg.txtfrom the-cfolder, which pySMSpp sets to the folder of the BlockSolverConfig; theUCBlockfolder had none, so a UCBlock with a PolyhedralFunctionBlock (e.g., the future value of the water of the HydroSystemUnitBlock that pypsa2smspp writes withhydro_system=True) was solved with the function in its natural form, which a :MILPSolver cannot handle, and the tool failed.The folder now ships
InnerBCfg.txt, a map from classname to BlockConfig whose only entry puts the PolyhedralFunctionBlock in its linearized form (PFBCfg.txt, the same file as in theTSSBlockfolder of #116). Every other sub-Block keeps the formulation it is deserialized with, so the instances without a PolyhedralFunctionBlock are solved as before: the 23 cases oftest_ucblock.pyof pypsa2smspp without hydro units pass with and without the file, and the 2 hydro cases withhydro_system=Truepass with the default template (with the optimum of PyPSA, 2.9533401e10 and 1.5550488e9) and fail without it. The new test checks that the folder carries the file with that entry only.The two-stage case needs no change here:
smspp_tssb_solverreadsTSSBCfg.txtby default, and theTSSBlock/InnerBCfg.txtof #116 already has the PolyhedralFunctionBlock entry, to be given withB="InnerBCfg.txt".