Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#6030 closed defect (fixed)

Resimulate doesn't read the updated value from resource file

Reported by: Adeel Asghar Owned by: Karim Adbdelhak
Priority: blocker Milestone: 1.16.0
Component: Run-time Version:
Keywords: Cc:

Description

  • Load the attached package in OMEdit
  • Simulate model ParametersTest.M
  • Update the value of parameter a from 5 to 3 in the Resources/parameters.txt file.
  • Resimulate the model.

This is working fine in 1.14 so its a regression.

Attachments (3)

ParametersTest.zip (1.6 KB ) - added by Adeel Asghar 5 years ago.
test.mos (431 bytes ) - added by Karim Adbdelhak 5 years ago.
test with two different parameter values
test_2.mos (642 bytes ) - added by Karim Adbdelhak 5 years ago.
actual failing mos

Download all attachments as: .zip

Change History (12)

by Adeel Asghar, 5 years ago

Attachment: ParametersTest.zip added

comment:1 by Adeel Asghar, 5 years ago

Owner: changed from Lennart Ochel to Karim Adbdelhak
Status: newassigned

by Karim Adbdelhak, 5 years ago

Attachment: test.mos added

test with two different parameter values

comment:2 by Karim Adbdelhak, 5 years ago

Works perfectly fine for me (see attached file test.mos to reproduce). It gives me follwing output:

true
""
true
""
true
""
record SimulationResult
    resultFile = "/home/kab/Repo/FH/promotion/modelicaLibs/ticketTests/6030_resimulate/ParametersTest/ParametersTest.M_res.mat",
    simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'ParametersTest.M', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
    messages = "LOG_SUCCESS       | info    | The initialization finished successfully without homotopy method.
LOG_SUCCESS       | info    | The simulation finished successfully.
",
    timeFrontend = 0.319610634,
    timeBackend = 0.005402797,
    timeSimCode = 0.006130322000000001,
    timeTemplates = 0.0067082,
    timeCompile = 0.70830842,
    timeSimulation = 0.015158859,
    timeTotal = 1.061422651
end SimulationResult;
""
5.0
""
true
""
record SimulationResult
    resultFile = "/home/kab/Repo/FH/promotion/modelicaLibs/ticketTests/6030_resimulate/ParametersTest/ParametersTest.M_res.mat",
    simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'ParametersTest.M', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
    messages = "LOG_SUCCESS       | info    | The initialization finished successfully without homotopy method.
LOG_SUCCESS       | info    | The simulation finished successfully.
",
    timeFrontend = 0.330398854,
    timeBackend = 0.002453019,
    timeSimCode = 0.00507403,
    timeTemplates = 0.005688008,
    timeCompile = 0.726595409,
    timeSimulation = 0.014970361,
    timeTotal = 1.085277973
end SimulationResult;
""
3.0
""

Is this not what you would expect?

Tested on Ubuntu 18.04 with latest omc OMCompiler v1.16.0-dev.438+g65a42873ff.

comment:3 by Karim Adbdelhak, 5 years ago

Ah i see now. You resimulate from the variable Browser in OMEdit right?

comment:4 by Adeel Asghar, 5 years ago

Your script calls simulate which is not really a resimulate as it calls the translation of model again.

by Karim Adbdelhak, 5 years ago

Attachment: test_2.mos added

actual failing mos

comment:5 by Karim Adbdelhak, 5 years ago

I added test_2.mos script which showcases the problem. This is due to NF evaluating the function which reads the file.

Model after new Frontend:

class ParametersTest.M
  constant String config.paramFile = "/home/kab/Repo/FH/promotion/modelicaLibs/ticketTests/6030_resimulate/ParametersTest/Resources/Parameters.txt";
  parameter Real config.a = 3.0;
end ParametersTest.M;

in reply to:  5 comment:6 by Per Östlund, 5 years ago

Replying to Karim.Abdelhak:

I added test_2.mos script which showcases the problem. This is due to NF evaluating the function which reads the file.

Fixed in 0c5b95d.

comment:7 by Karim Adbdelhak, 5 years ago

Resolution: fixed
Status: assignedclosed

Thanks @Per!

comment:8 by Francesco Casella, 5 years ago

Thank you folks! If we keep on fixing tickets at this pace, in a couple years the backlog will be gone :)

in reply to:  8 comment:9 by Karim Adbdelhak, 5 years ago

Replying to casella:

Thank you folks! If we keep on fixing tickets at this pace, in a couple years the backlog will be gone :)

Nah don't be scared, i am already brewing up the next bugs. ;)

Note: See TracTickets for help on using tickets.