﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
1730	problems with variability of records and warnings that its values are not assigned.	Michael Wetter	Michael Wetter	"If the model below is simulated using
loadModel(TestRecord);
simulate(TestRecord.myModelInstance);
getErrorString();

then the following error occurs:
   messages = ""Simulation failed for model: TestRecord.myModelInstance
   [/home/mwetter/proj/ldrd/bie/modeling/bie/branches/mwetter/openmodelica/TestRecord.mo:11:5-11:60:writable] Error: Component mymodel.p of variability PARAM has binding mytwo of higher variability VAR.

Since mymodel.p is a record in which all members are parameters, my interpretation is that its variability should also be PARAM as opposed to VAR.

If the line
    TestRecord.myRecords.myTwo mytwo;
is changed to
    parameter TestRecord.myRecords.myTwo mytwo;
then the model simulates, and computes the correct result mymodel.x=2. However, the warning 
   Warning: Parameter mymodel.p.r has neither value nor start value, and is fixed during initialization (fixed=true)
occurs despite that r is assigned the value 2 in the declaration of myTwo.
{{{
//////////////////////////////////////
within ;
package TestRecord
  package myRecords
    record myTwo = myRecords.BaseRecord(r = 2);
    record BaseRecord
      parameter Real r;
    end BaseRecord;
  end myRecords;

  model myModel
    replaceable parameter TestRecord.myRecords.BaseRecord p;
    Real x;
  equation
    x=p.r;
  end myModel;

  model myModelInstance
    TestRecord.myRecords.myTwo mytwo;
    TestRecord.myModel mymodel(p = mytwo);
  end myModelInstance;

  annotation(uses(Modelica(version = ""3.1"")));

end TestRecord;
//////////////////////////////////////
}}}"	defect	closed	high	1.19.0	New Instantiation		fixed		Michael Wetter
