Closed JulStraus closed 1 week ago
Looks good, this is an important step towards more unified building of models from both nodes and links.
I have thought a bit about the naming, and I currently lean towards using the same function for creating variables and constraints for nodes and links, and dispatch to different methods. Then we could get a nice top level loop that clearly communicats that we do the same for nodes and links (or where they differ), something like:
for elements ∈ (𝒩, ℒ) variables_opex(m, elements, 𝒯, 𝒫, modeltype) variables_capex(m, elements, 𝒯, modeltype) variables_capacity(m, elements, 𝒯, modeltype) variables_nodes(m, elements, 𝒯, modeltype) end
I suggest we follow that up in a separate PR.
Generally speaking, I like the design of looping through everything. We could also split flow variables into two methods to be certain regarding the application. In theory, that should not be breaking as we do not export the functions.
There are however two things I want to stress:
variables_nodes
would be slightly confusing if we iterate through with links. We should rename it. Potentially variables_elements
to be consistent?variables_node
which would be unaffected by the design. Hence, we can clean up the functions.All of the changes should in my opinion be a separate PR, but with the same versions increase. That way, we do not introduce a version which we directly change again.
This PR focuses on increasing the flexibility of
Link
s. It incorporates several different concepts for links to allow forAll introduced changes are only valid if the user specifies explicitly for their abstract or composite type that they should include them.
I did not update the documentation with additional information regarding the extension of
Link
s yet. In practice, it only includes the new variables and the docstrings, but not how one can create new links.