Closed uvchik closed 5 years ago
Another option would be to loop only if variable costs are set:
for i, o in m.FLOWS if m.flows[i, o].variable_costs[0] is not None:
for t in m.TIMESTEPS:
# bla
We could also use hasattr()
to check this.
Another option would be to loop only if variable costs are set:
That's what I meant with "However, we should check for variable_costs before the time-loop.".
But it is still inconsistent because for all constraints we build sets and loop over the sets, so maybe we should keep this way for all loops.
Another option would be to loop only if variable costs are set: That's what I meant with "However, we should check for variable_costs before the time-loop.".
But it is still inconsistent because for all constraints we build sets and loop over the sets, so maybe we should keep this way for all loops.
I agree but wouldn't spend time on this task speaking for myself.
I guess it's enough for now to not create a new set, I will move the if condition a few lines up.
Of course it is enough but it is still confusing.
Is there a reason why we sometimes create a set and sometimes not?
Hello everyone I am new here and unfortunately it is not possible to contact you with a private message. My issue is a little of the topic, but has to do with the objective function. How can I contact you?
Actually it is possible to contact us if you visit our website. But for questions like this we have a forum and I would therefore ask you to copy your question there as it really does not belong to this issue.
https://forum.openmod-initiative.org/tags/c/qa/oemof
We will try to help you there 😄
By the way cost are not necessarily monetary costs but can also be emissions or exergy factors. We just had to find a naming but it also could something like "weight".
It is not urgent, but I would like to understand which way is better and why we use sets in some cases and if statements in other cases. Therefore I will postpone it.
If you are ok, I will postpone again. Or rather close?
Relates to internal refactoring...nothing important for now, as functionality works fine. Postpone is the right way I think.
I will try to check it on Friday otherwise I will postpone it to v0.3.1
If this is not important enough to be tackled, I would suggest to add the "wontfix" tag and close the issue.
As this seems not to be important enough to be tackled, I suggest to be so honest to add the wontfix tag and close this issue.
If a flow does not have the
variable_costs
defined it does not make sense to add it to the objective function. Nevertheless we loop through every time step.Wouldn't it be consistent to create a set with all flows with costs set as we do it with the constraint definition?
However, we should check for
variable_costs
before the time-loop.@oemof/oemof-solph Do you agree, or did I forget something?