Opened 5 years ago
Closed 5 years ago
#5782 closed discussion (fixed)
Failure to instantiate EletricalEnergyStorage Libray
Reported by: | John Tinnerholm | Owned by: | Per Östlund |
---|---|---|---|
Priority: | low | Milestone: | 1.16.0 |
Component: | New Instantiation | Version: | v1.14.0 |
Keywords: | Translation | Cc: |
Description
When attempting to initialize the EletricalEnergyStorage the initialization fails with the following message:
[2] 17:50:33 Translation Error [ElectricalEnergyStorage: 1058:11-1060:26]: Function parameter aging was not given by the function call, and does not have a default value. [3] 17:50:33 Translation Error [ElectricalEnergyStorage: 1058:11-1060:26]: Function parameter temperature was not given by the function call, and does not have a default value.
The translation, however, works fine with the old frontend.
I guess the issue is that the library is not compliant with the standard. I keep this open if anyone has time to verify.
Change History (8)
comment:1 by , 5 years ago
follow-up: 3 comment:2 by , 5 years ago
@perost, I'm not 100% sure what the specification says about this, but I always gave it for granted that if you instantiate a record parameter with default bindings, you get those parameter values by default. Having to re-type those values explicitly as modifiers would seem impractical for me from an end-user perspective.
BTW, in the text you mention record parameter but in the sample code I see time-varying variables. Do I miss something?
follow-up: 4 comment:3 by , 5 years ago
Replying to casella:
@perost, I'm not 100% sure what the specification says about this, but I always gave it for granted that if you instantiate a record parameter with default bindings, you get those parameter values by default. Having to re-type those values explicitly as modifiers would seem impractical for me from an end-user perspective.
Yes, there are clearly default arguments in this case, the question is mostly how to implement it internally in the compiler.
BTW, in the text you mention record parameter but in the sample code I see time-varying variables. Do I miss something?
Sorry, I was talking about record constructors. So parameter = function input parameter, not parameter variability.
comment:4 by , 5 years ago
Replying to perost:
Sorry, I was talking about record constructors. So parameter = function input parameter, not parameter variability.
Aha.
Could it be that this issue is the cause of some of the errors we get with libraries such as Buildings?
comment:5 by , 5 years ago
Component: | *unknown* → Frontend |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:6 by , 5 years ago
Owner: | changed from | to
---|
comment:7 by , 5 years ago
Component: | Frontend → New Instantiation |
---|---|
Milestone: | Future → 1.16.0 |
comment:8 by , 5 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Fixed in 091047e1. Half the models in the library now works as well as with the old frontend, the other half needs a bit more work it seems.
The issue seems to be that the OF adds default arguments to record parameters when generating record constructors, while the NF doesn't. I.e.:
results in the OF generating the constructor:
while the NF generates:
The NF probably needs to emulate the OF in this case. Here's a minimal model that replicates the issue: