Opened 13 years ago

Last modified 13 years ago

#1488 closed defect (fixed)

final prefix not set for record elements

Reported by: Frenkel TUD Owned by: Frenkel TUD
Priority: high Milestone:
Component: Version:
Keywords: Cc: Frenkel TUD, adrpo

Description

The final prefix is not set for record elements.

record R 
  Real b;
end R;

model A 
  final parameter R r = R(1); 
end A;

./ omc +d=dumpdaelow A.mo


Variables (1) 
========= 
1:  $dummy:STATE(fixed = true )  type: Real  indx = -1 

Known Variables (constants) (1) 
============================= 
1:  r.b:PARAM(final = false )  = 1.0 A, R type: Real (final = false )  indx = -1 

External Objects (0) 

The final prefix is important for optimisation of equations. See Modelica Spec 3.2 Chapter 7.2.6

Setting the value of a parameter in an experiment environment is conceptually treated as a modification. 
This implies that a final modification equation of a parameter cannot be changed in a simulation environment.

Change History (2)

comment:1 Changed 13 years ago by adrpo

I'll look into this. The front-end doesn't seem to set the final attribute.

adrpo@ida-liu050 ~/dev/OpenModelicaBackend/build/bin/final
$ ../omc A.mo 
function R "Automatically generated record constructor for R"
input Real b;
output R res;
end R;

class A
  parameter Real r.b = 1.0;
end A;

comment:2 Changed 13 years ago by adrpo

fixed in revsion 8675 (see SCM Commits tab).

Note: See TracTickets for help on using tickets.