Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#6030 closed defect (fixed)

Resimulate doesn't read the updated value from resource file

Reported by: adeas31 Owned by: Karim.Abdelhak
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 adeas31 4 years ago.
test.mos (431 bytes) - added by Karim.Abdelhak 4 years ago.
test with two different parameter values
test_2.mos (642 bytes) - added by Karim.Abdelhak 4 years ago.
actual failing mos

Download all attachments as: .zip

Change History (12)

Changed 4 years ago by adeas31

comment:1 Changed 4 years ago by adeas31

  • Owner changed from lochel to Karim.Abdelhak
  • Status changed from new to assigned

Changed 4 years ago by Karim.Abdelhak

test with two different parameter values

comment:2 Changed 4 years ago by Karim.Abdelhak

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 Changed 4 years ago by Karim.Abdelhak

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

comment:4 Changed 4 years ago by adeas31

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

Changed 4 years ago by Karim.Abdelhak

actual failing mos

comment:5 follow-up: Changed 4 years ago by Karim.Abdelhak

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;

comment:6 in reply to: ↑ 5 Changed 4 years ago by perost

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 Changed 4 years ago by Karim.Abdelhak

  • Resolution set to fixed
  • Status changed from assigned to closed

Thanks @Per!

comment:8 follow-up: Changed 4 years ago by casella

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

comment:9 in reply to: ↑ 8 Changed 4 years ago by Karim.Abdelhak

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.