Opened 9 years ago
Closed 5 years ago
#4012 closed defect (fixed)
replace structure parameter
| Reported by: | Vitalij Ruge | Owned by: | somebody | 
|---|---|---|---|
| Priority: | high | Milestone: | 1.16.0 | 
| Component: | New Instantiation | Version: | |
| Keywords: | Cc: | Per Östlund | 
Description
Follwing example don't replace structure parameter.
loadString("
package redeclareStrucParameter model base replaceable parameter Integer N = 3; Real[N] x(each start = 1.0); equation for i in 1:N loop der(x[i]) = 0; end for; end base; model B extends base(redeclare parameter Integer N = 5); end B; end redeclareStrucParameter;
");
instantiateModel(redeclareStrucParameter.B);
return
"class redeclareStrucParameter.B parameter Integer N = 3; Real x[1](start = 1.0); Real x[2](start = 1.0); Real x[3](start = 1.0); equation der(x[1]) = 0.0; der(x[2]) = 0.0; der(x[3]) = 0.0; end redeclareStrucParameter.B;
I would accepted N=5.
Change History (3)
comment:1 by , 9 years ago
| Component: | *unknown* → Frontend | 
|---|
comment:2 by , 9 years ago
comment:3 by , 5 years ago
| Component: | Frontend → New Instantiation | 
|---|---|
| Milestone: | Future → 1.16.0 | 
| Resolution: | → fixed | 
| Status: | new → closed | 
The new frontend gives:
class redeclareStrucParameter.B final parameter Integer N = 5; Real x[1](start = 1.0); Real x[2](start = 1.0); Real x[3](start = 1.0); Real x[4](start = 1.0); Real x[5](start = 1.0); equation der(x[1]) = 0.0; der(x[2]) = 0.0; der(x[3]) = 0.0; der(x[4]) = 0.0; der(x[5]) = 0.0; end redeclareStrucParameter.B;
  Note:
 See   TracTickets
 for help on using tickets.
    
Can we add a better error-message?