0

I've created a model with Uppaal in which several integer variables change over the course of time. Now I would like to save the values of the variables during the modelling process somewhere (best in xml or a text file). In the Uppaal documentation (https://www.it.uu.se/research/group/darts/uppaal/documentation.shtml) I found the method in point 13 (How do I export and interpret the traces from Uppaal?) and tried the Java API way already, in the hope that it can output the variables as well as the traces. Unfortunately this method seems to be limited to traces. Does anyone know a method to save the variable values from Uppaal?

Hopeful greetings,

Josi

Josi
  • 5
  • 2
  • If you want to save the trajectory of the variable values over time, then try simulate query, then open the plot, right-click and choose export CSV. – mariusm Dec 10 '20 at 18:46
  • @mariusm thank you very much. It seems to be exactly what I need. Unfortunately I didn't manage to implement your suggestion: if I understood correctly, the command simulate query must be entered in the _verifier_. I found the following line which I thought should fit: **simulate 1 [<=300] { Train(0).Cross, Train(5).Cross, Gate.len}** . But when I enter it in _query_ I get: **All channels must be broadcast**. This seems strange to me, as I am trying to run the train-gate example from uppaal-4.1.19 and the simulation runs fine. Did I misunderstand something in the tutorial? – Josi Dec 15 '20 at 12:17
  • try the example from `demo/smc/train-gate-stat.xml` -- it has been changed to fit SMC requirements to have broadcast channels. – mariusm Dec 16 '20 at 15:06
  • great, thank you very much that worked – Josi Dec 18 '20 at 07:20

1 Answers1

0

Solution from the comments.

to export the variable value tractory over time, one may use SMC query in the verifier.

For example:

  1. Typeset the following query: simulate 1 [<=300] { Gate.len }
  2. Click Check
  3. Right-click on the query, and from the popup menu choose Simulations (1)
  4. Observe a new window popup with a plot
  5. Right-click on the plot and choose Export Comma Separated Values
  6. Follow the save file dialog and observe the resulting file to contain time and value sequence.

Note that SMC assumes that all channels are broadcast and there are no deadlocks.

mariusm
  • 1,483
  • 1
  • 11
  • 26