-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Users are currently prevented from creating dependency loops between commodities (see #519), where one commodity is necessary for the production of another -- directly or indirectly -- which produces the original commodity. For example, you may have a hydrogen power plant which produces electricity but also requires electricity as an input in order to operate. @ahawkes has reported that such dependency loops are quite common in the real world. Apparently MUSE1 supports this functionality, though according to @tsmbland the results are often surprising, so we may not want to imitate the MUSE1 approach (insofar as this would be possible anyway, given that the model is different).
We would presumably want to adopt some kind of iterative approach where, to go back to the previous example, we would first run dispatch to calculate the electricity demand of the hydrogen plant, then rerun dispatch to see the effect of the new generation of electricity on the system. We should figure out what to do in the case that the system doesn't converge on a stable state (probably just have an upper limit on number of iterations).
On the technical side, we use the petgraph crate for representing and analysing the dependencies between commodities (in addition to checking for loops, it is also used for checking other invariants to do with commodities hold). We do a topological sort to figure out the order in which investment should be performed, which also checks for cycles in the process. We'd have to figure out how to adapt this code (petgraph seems pretty comprehensive, so I'm sure there's a way).
Metadata
Metadata
Assignees
Labels
Type
Projects
Status