Keep AnyLogic Export simulation settings - anylogic

my model starts at a certain time (01.07.2022), but when I export it into the AnyLogic Cloud, the simulation starts at the real time date (01.02.2023). Is there a way to keep the settings from the Simulation?

Sure. You need to setup your RunConfiguration accordingly.
(AnyLogic experiments are NOT uploaded to the cloud at all.)
Instead, you use the RunConfiguration for that:

Related

Missing features in Grafana

I am using grafana to visualize some data from my InfluxDB-database, that collects data from some sensors. That said, it's the first time for my working with both grafana and InfluxDB, also I'm pretty new to coding so my knowledge is very limited.
As I scroll through threads and forums on the web trying to find guidance, I find a lot of tutorials mostly 2-4 years old that seem to use features in grafana that are simply not available vor me.
For example I tried to set an alert which tells me when my sensor is delivering flawed values (values that I my case cannot physically be true) too often. But when I'm using avg() from the classic condition operations, I can't select a time frame in which I want the average value monitored.
My expression part of the alert settings
Is it a problem that has to be configured via grafana.ini? Is it because these features cannot be used with InfluxDB?
For some background information, I'm using a Ubuntu Server via VirtualBox to run both the database and the grafana server. I'm using a little python script to distribute the sensor data into the database.
If someone could help me out soon that would be great!

Connecting CAD model (Solidworks, AutoCAD or CATIA) with realtime measurements from Raspbery Pi or Arduino Sensor

To present my question I will simplify my example.
I will connect a sprocket on a step motor and measure acceleration with an accelerometer. The data will be captured by using either an Arduino or Raspberry pi sensor setup. The measurements will then be stored in a cloud-based environment or somehow similar and be send to the CAD model (that's the idea).
Basically what I would like to achieve is to:
connect the movement of the step motor with the SW/CATIA/AutoCAD model (if the physical sprocket is spinning, so is the one in the CAD model),
in case that the measurements identify a problem in the assembly, the critical/weak component would be somehow highlighted inside the CAD model.
Has anyone an idea how this could be done or if it is even possible?
I think is definitely possible (and quite easy) in CATIA (which is the only one I know).
CATIA has COM Automation exposed (i.e. you can interact with it like you do with MS Office apps) and naturally you would to it writing VBA project in the same fashion .
But VBA projects have a lot of limitations, and I think it would be almost impossible to have a background, constantly running process such as the one you describe.
If you switch to Python, you'll be able to:
access all python functionalities, in the scope you describe I think you'll have endless possibilities in getting data from a sensor and handle them, then send to the CAD.
run the script whenever you want, totally independently from VBA editor and CATIA macro related stuff. It will just send commands to CATIA and it will instantly execute.
have everything in real time, because if you enable Automatic Update in CATIA, each command sent via COM will be immediately executed and the Part or Product updated accordingly
I already translated a complex project from VBA to Python with success, it interacts seamlessly with CATIA and Excel at the same time and transfer data between them.
It is definitely possible, look what has already been done with Solidworks and MS Kinect.
All you need to do is identify the component that you want to affect, calculate new transform based on your sensor input and assign that transform to the component.
To highlight you can either change color of the body or use built it Highlight method.
That being said I wouldn't recommend this as your first Solidworks project.

Apache Airflow scheduling with a time bound and triggering

I'm using airflow with celery Executor. Now I'm planning to develop user interaction for a task to decide to select branch using BranchOperator in a DAG. Its working by running continuous loop to checking value in database. But I feel it is not the good way of approach. Is there any alternative to do this?
And I want to wait for this interaction up-to particular time otherwise I want to stop. Is it possible to do this in airflow? And if is possible then is the any possibility to change this time bound dynamically?
Thank you in advance.
You shouldn't be using a BranchOperator for this. If you want to proceed in your dag based on some value in the db, you should use a Sensor. There are some off the shelf sensors in airflow and you could also look at some of those to create your own. Sensors basically poll for a certain criteria and timeout after a configurable period of time. From your question it seems this is exactly what you need.

Can I to know if ipad was rebooted?

I am developing an application that must work online and also offline. This application should sync informations with our server. For this, we need that the device utilize the server clock.
I found a lot of information, and I get the following idea:
When the user logins online I will force him to get the server clock time. In this moment he obrigatory must have internet connection, so it is ok.
When I get the clock server time, I get the systemUptime information that says the interval that the device is turned on, and I store it. I can get systemUptime like this:
[NSProcessInfo processInfo].systemUptime
When the user to create a new local file, I will know the current interval based on systemUptime function, so I know the current time, and I don't depend the iOS system clock.
The problem is: Everytime that device is rebooted, or turned off, the systemUptime is reseted. Until here OK, I can solve it forcing the user to login again, and getting the server clock time again. My problem is to know when the device was rebooted. Can you help me? Thank you guys!
My advice would be to not refer to the device time at all. Get the the files from the server and have the server also answer the server time that the files are retrieved. You can store this in the file, in the file name, or separately on the device.
At some point in the future ask the server if there's a file newer than the server time you recorded earlier.
In this sense, the time isn't really a time at all, it's a version number, and you could make that explicit with the server too, using just an integer from the server that indicates progressing sequence of versions.
If it's important that your app be strong in this way, your only choice is to remain independent of device time. Otherwise, there are too many ways it can break (including small time errors due to latency on the time check, or device factory resets or malicious actions by a user). It's better to remain independent of device time if you can.
When you get the systemUptime the first time, subtract it from the current (iOS) date and time. That's the time the system was last brought up.
Then recalculate this value whenever necessary. If the "time the system was last brought up" has changed, then you know it's time to log in again.
However, as suggested by another commenter, I suspect there's a better way to tackle this from scratch.

Is it possible to have an "internal" cron in mysql5?

The other day a friend suggested to play a web browser game called OGame. If you don't know it I'll tell you what it is:an rts game where you have to build things like mining factories, barracks and so on. The interesting thing that every building has a build time and you can log off while it's building because it will keep going.
Something like this I would believe is managed via dbms. I have my records where I have the end time of a costruction. How do I check when to update a building? Do I need an external application that checks every seconds what record needs to be updated? Is it possible with mysql5 to have an internal scheduler that launches a procedure on this table? And if so, is it a best practice?
I have built a similar game and I stored the construction end times (and other events to be fired) in an events table. I wrote a PHP daemon which regularly checks the events table for expired records and acts on them accordingly.
I couldn't find a way to do it in the database itself (and if I later wanted to migrate to another DB it would need rewriting). A cron'd script may overlap. A daemon can keep track of everything all the time, and output debug information if events are queuing faster than they're being processed. I also added a cron to check periodically that my daemon is still running, otherwise start it.
Creating a daemon in PHP (if you're using PHP)
Hope that helps.