Modelica example "Interaction1" not working as expected - openmodelica

I encountered the following issue when simulating the example "Interaction1" from Modelica library ("Modelica.Blocks.Examples.Interaction1") in OpenModelica: This examples contains a block "Modelica.Blocks.Interaction.Show.RealValue", thus I was expecting that the number in the respective block (in Diagram Window) would update when changing the time slider position after simulation (according to its description: "Show Real value from numberPort or from number input field in diagram layer dynamically"). However, the value stays "0.0", irrespective of the current time.
Does anybody know what might be the reason for this issue?

Use the nightly-builds, we have implemented more of the DynamicSelect.

Related

can we use multiple RegisterTransitCallback in ortools?

Does anyone know if we can use multiple RegisterTransitCallback for different dimensions in ortools vrp?
What I have noticed in my code shows that only the last RegisterTransitCallback will take effect for all the added dimensions.
I is common to have one callback for time and one for distance. This is shown in vrptw examples.
So yes.

Do I use foreach for 2 different inspection checks in activity diagram?

I am new in doing an activity and currently, I am trying to draw one based on given description.
I enter into doubt on a particular section as I am unsure if it should be 'split'.
Under the "Employee", the given description is as follows:
Employee enter in details about physical damage and cleanliness on the
machine. For the cleanliness, there must be a statement to indicate
that the problem is no longer an issue.
As such, I use a foreach as a means to describe that there should be 2 checks - physical and cleanliness (see diagram in the link), before it moves on to the next activity under the System - for the system to record the checks.
Thus, am I on the right track? Thank you in advance for any replies.
Your example is no valid UML. In order to make it proper you need to enclose the fork/join in a expansion region like so:
A fork/join does not accept any sematic labels. They just split the control flow into several parallel ones which join at the end.
However, this still seems odd since you would probably have some control for the different inspections being entered. So I'd guess there's a decision which loops through multiple inspection entries. Personally I use regions only for handling interrupts. ADs are nice to a certain level. But sometimes a tabular text (like suggested by Cockburn) is just easier to write and read. Graphical programming is not the ultimate answer (unlike 42).
First, the 'NO' branch of the decision node must lead somewhere (at the end?).
After, It differs if you want to show the process for ONE or MULTIPLE inspections. But the most logical way is to represent the diagram for an inspection, because you wrote inspection without S ! If you want represent more than one inspection, you can use decision and merge node to represent loop that stop when there is no more inspection.

Temporal logic for modelling events at discrete points in time causing states/changes over a period of time

I am looking for an appropriate formalism (i.e. a temporal logic) to model the following kind of situation
There can be events happening at discrete events in time (subject to conditions to be detailed below).
There is state. This state cannot be expressed by a fixed number of variables. However, it is possible to express it with a linear list/array, where each entry consists of a finite number of variables.
Before any events have happened, the state is fixed.
At any point in time, events are possible. They have a fixed structure (with a few variables). The possible events are constrained by the current state.
Events will cause an immediate change of the state.
Events can also cause continuous state changes. For example, a variable (of one of the entries of the array mentioned above) changes its value from 0 to 1 over some time (either immediately or after a specified delay).
It should also be possible to specify discrete points in time in the form "the earliest point in time after event E where some condition C holds", and to start a continuos state change at such a point.
Is there an existing temporal logic to model something like this?
It should also be possible to express desired conditions, like the following:
Referring to a certain point in time: The sum of a specific variables of all the entries of the array may not exceed a certain threshold.
Referring to change over time: For all possible time intervals, the value of a certain variable (again, from each entry of said array) [realistically, rather of some arithmetic expression computed for each entry] must not change faster than a given threshold.
There should exist a model checker that can check whether for all possible scenarios, all the conditions are met. If this is not the case, it should print one possible scenario and tell me which condition is not met. In other words, it should distinguish between conditions describing the possible scenarios, and conditions that have have to be fulfilled in those scenarios, and not just tell me "not possible".
You need a model checker with more flexible language. Technically speaking model checking of systems of infinite state space is open research problem and in general case algorithmically undecidable. The temporal logic is more typically related to propreties under the question.
Considering limited info you shared about your project, why do not you try Spin/Promela it is loosely inspired by C and has 'buffers' which can be considered to be arrays. At the least you might be able to simulate your system?

MKMapView showsUserLocation and load custom annotations

We are using MKMapView with showsUserLocation = YES so that we see a blue dot and accuracy ring. We've also implemented mapView:didUpdateUserLocation: to capture updates. From this method we get the users location and use that to make a web service call, the results of which end up as map annotations.
The problem
As long as showsUserLocation = YES the method mapView:didUpdateUserLocation: is periodically called. We only need to get the users location at specific times, e.g. viewDidAppear or when the user touches a button. If we set showsUserLocation to NO after the first update then we lose the blue dot which we'd like to keep.
Ideas
One idea is to check the MKUserLocation value received by mapView:didUpdateUserLocation: against the previous value to see if there has been a change, if there has then do a check to see how much of a change before deciding to load fresh data.
Another idea is to use CLLocationManager and to manually place a user pin on the map, the issue with this one is how to simulate the blue circle and accuracy ring.
Anyone know any examples? Or have thoughts on how to tackle this?
Thanks
The simplest idea is simply to ignore all callbacks after the first good one that you get. Or your first idea to check and see how far the new location is from the previous is a good one. Simulating the blue dot and the pulsating accuracy ring is much more complicated.
Approach taken was to use the first idea. As no further activity/answers, and given age of the question this will be accepted answer.

UML Sequence Diagram feedback

Hi can anyone tell me their thoughts on this sequence diagram, if it is correct or whatever needs changing.
Thankyou, your feedback would certainly help a lot.
Full Size Image: http://i.stack.imgur.com/ktPsY.jpg
There seem to be some splits in the sequences, for example there is a gap between steps 2 and 3. Keeping each sequence whole makes the diagram valid and much more readable. Here is an example of what a diagram should look like. Note how the bar for the customer goes on until the very end of the sequence.
The objects have also been chosen pretty confusingly. Aren't Register, Login and Book part of the web server? If they are, you probably should get rid of the Web Server object in this chart.
The return values should be passed back to the object that originated the call like has been correctly done in steps 11 and 12, though there is another gap in the sequence.
Some sequences are incomplete, like step 8. Now the diagram describes the Browse Shows as a call that is made by the user to the Book object, which never provides any return value.
The alternate paths 4 and 5 are incorrectly defined. An else block should be used instead.

Resources