How to run exported Parameters Variation experiment in a headless environment automatically? - anylogic

I would like to run an exported Parameters Variation experiment on my Linux machine. Although there is a way for setting a Simulation experiment to start automatically running the batch file (or .sh file for Linux) once the file is opened, I cannot find a similar option for Parameters Variation in which I am running 40 different replications of the same model. In Windows, you need to open the file and manually click the Run button for this.
Considering Linux OS, which is a headless environment, how can I make the model start automatically once I run the command ./mySimulationModel_linux.sh?
Currently when I run this command, the model does nothing. Any help will be appreciated.

The best option would be to add some code to your "Initial Experiment setup:" section to get it to run without any user input
just add run();
Of course, you can add any of other code as well there.

Related

VSCode Test Explorer Pytest Inject Environment Variables using AWS Parameter Store

I am currently Using Pytest though the Python Test Explorer (see screen). I would like to pass my tests some environment variables at runtime. However, I currently get my AWS Parameter Store BEFORE I run tests. Meaning, I run a command in BASH that loads my environment variables into my current terminal session. Then I can run my test from the command line using pytest exampletest.py, and it finds the environment variable perfectly.
Trying to run exampletest.py from the integrated VSCode Test Explorer results in an error telling me that it could not find my environment variable. This means that whatever environment that is used when you hit the "Play Button" on the Test Explorer is not the same terminal session that I set my environment variables in.
The conventional way of setting environment variables such that they can be accessed when using the Test Explorer in VSCode is by either using an ini file or a .env file. The only caveat there is that you must hardcode the key value pair. I would not like to hardcode anything, as I would just like to inject them in at runtime from aws Parameter Store.
I really would like to continue using the Test Explorer to run my tests, as it has been great in the past, but if I cannot find a way to somehow get the Test Explorer to use my environment variables without using an ini or a .env file, I may have to abandon it.
Some questions:
When you click the play button on the Test Explorer to execute a test or suite of tests, what exactly happens? Does it open a Terminal session? Can you access that terminal session before runtime?
How does the Test Explorer set environment variables. When I raise Exception(os.environ), I can see all the environment variables that are quite different from the ones that I get when I run from the command line.
Is there a way to say "Hey Test Explorer, please run the tests inside of this specified Terminal window that is already running"
Perhaps a virtual environment is a way to go (not really a question more of a thought). Doing some cursory research reveals more headaches to come if I pursue this route I believe.
Do you have any further reading about that VsCode Test Explorer that goes beyond the official documentation. I feel like I can make some changes to it's source code or something, but I feel like documentation on it is a bit lacking.
Let me know your thoughts on this matter, and thanks in advance.
I have the same question. The only way I could make it work was by this unwieldy series of steps before running the tests via the vscode UI:
Execute your script or command in a terminal to set the env
variables.
Copy those env variables into your .env file (placed at the root of your project/vscode-workspace). I usually do :
env | grep AWS_ or whatever you want and you'll see them as name-value pairs. I then copy and paste those entries at the bottom of the .env file each time I run the test via the UI.
Now execute your tests via the vscode UI (the test 'beaker'/flask). The testing UI/flask seems to execute the .env file every time before it runs the tests and hence picks up those env variables.
I know, it's not preferable - you would want it to just pick it up from the env values you see in your integrated terminal but so far that is not happening.

Eclipse: Need to update some register prior to downloading bin file

I'm using Eclipse Oxygen (4.7.3a) for an embedded C work project. There are multiple processors and I'd like to configure some registers prior to downloading the binary image. Eclipse/Debug Configuration/Startup has a Run/Restart Command area which allows commands (like register writes) to be run. I cannot find what this script register write format is.
I have tried:
monitor memU32 0x22002222=0x0005A5AF
It then error with: invalid command name "memU32". Is there a description of what the expected format is? I found this script in a different project, but it doesn't seem to work.
My goal is to be able to set a register to a value, prior to downloading the binary image to RAM.
The 'set' command can be used to set register values. The Debugger Command window appears to link to the GDB, therefore the GDB commands are used here.
set *((int *) 0x22002222)=0x0005A5AF

Running Alteryx flows from command line

I'm trying to figure out if I can launch a pre-built Alteryx workflow without launching the Designer - and without having Alteryx Server.
I came across a helpful post on Alteryx uses by #Runonthespot that, among other things, addressed running workflows from the command line, but doesn't go into detail. That discussion is here: https://stackoverflow.com/a/30469848/4313331. I don't have the rep to comment on his post and the question is closed.
He writes:
"Flows are runnable from the commandline on a server, and easiest way I've found (besides using Alteryx's own scheduler) is to save as an "App", and then run from the command line using the Alteryx engine executable, passing it parameters via xml file. You can save a sample xml parameter file from your flow by hitting the magic wand button (after saving the flow as a .yxwz (app)) This brings up a panel that lets you set the variables, and that panel has a handy "save" button which generates an xml file in the right format."
So, I'm looking for more info on this process. Is it simply a question of using Alteryx Server? Or is this a more interesting work around?
Thanks.
Yes, you can run a workflow (used generally to refer to a workflow, macro, or analytical app) without launching the Designer. You'll first need to understand how to run the workflow from the command line. The AlteryxEngineCmd.exe executable runs a workflow. It is located in the Alteryx install path in the bin subfolder. Here is where mine is located:
C:\Program Files\Alteryx\bin
It allows an additional parameter of an XML file with interface values. This is documented for analytical apps ONLY though it does work for macros as well. This is based on my extensive use of this undocumented feature.
Below are two examples:
AlteryxEngineCmd.exe MyWorkflow.yxmd
AlteryxEngineCmd.exe MyAnalyticApp.yxwz AppValues.xml
You can see a post here:
Alteryx Command Line Help
I prefer to wrap the command in a batch file and execute that for more control.
Now that you understand how to run the workflow from the command line, you can execute it anytime you want without launching Designer. Furthermore, you can use Windows Scheduler or a third-party tool to run the command or the batch file on a schedule.
Finally, you do need a license which enables API & Command Line w/ Scheduler. This is less expensive than Alteryx Server.
Have you tried C:\Program Files\Alteryx\bin\AlteryxEngineCmd.exe? It doesn't require server.
https://help.alteryx.com/2019.1/Command_Line.htm
If restrained by budget, you don't need a scheduler license (enables the AlteryxEnginecmd.exe), you can use a windows mouse clicker or even Powershell, to run the Designer though, without manual intervention.

How to run system command in Cake build?

I couldn't find any information related with running custom system command on this site: cakebuild.net/dsl
How can I do it?
The real command I want to run is 'upx mproject.exe'
If I have understood you correctly, then what you are looking for is the Process Aliases that exist within Cake:
http://cakebuild.net/dsl/process/
These allow you to start any arbitrary process from within your Cake script.
Another option, would be to create a Cake Addin that wraps the tool that you are trying to execute.

how to include run as configurations in exported eclipse product

I am exporting eclipse rcp application using "eclipse product export wizard". I want to redirect console logs into a file.
I am doing the below, which is working fine when I run as a eclipse application. It is not reflecting after export.
The Run configurations cover how to run something, i.e. they are the part external(ish)* to your application.
In particular, the Output File and Standard Input and Output settings are ways in the Eclipse development environment to handle redirects of the application.
A quick rundown would be to run the console application like this:
$ path/to/app -application com.example.yourname > file.log
If the shell you are using is Bash, there is a long bit in the manual with further options. Powershell and cmd on windows have similar options.
Of course, if you want your program to write to a file all the time (with a possible command line argument to specify file), you probably will want to code that yourself.
* The reason I put "ish" on external is that some of the settings, like Configuration and Plug-ins are part of what you export, but Arguments, Tracing and Environment are not.