Closed EladRa closed 4 years ago
Is there a way to run AnyLogic simulation with a command from the PyCommunicator?
No, the purpose of Pypeline is to run Python from within a running AL model. Python is only able to communicate with your model while the model is running. Every time the model starts, a new, clean Python environment is created. Every time the model stops, the Python environment (including any imports or variables you created) is destroyed.
Think of it like a child process - much like you cannot run AnyLogic without your computer's operating system, you cannot use Pypeline to have Python run an AnyLogic model.
In short: it's AL that's creating the Python environment, not the other way around.
Is there a way to provide an arguments to the simulation from PyCommunicator?
Sort of. You can set parameters when the model starts up - like this.
However, this would need to query some 'live service' or Python code that read/modifies a file to get the next value. This is because every time you start a model, the Python environment is reset - nothing from the previous runs are stored.
Is there an option to observe the simulation results when ended from the PyCommunicator?
I don't understand what you're asking to do. Anytime you can call on the PyCommunicator object, you inherently also have access to your simulation model.
I'm closing this for now, but feel free to ask follow-ups and I can re-open.
Hello,
Is there a way to run AnyLogic simulation with a command from the PyCommunicator? If yes - Is there a way to provide an arguments to the simulation from PyCommunicator?
Is there an option to observe the simulation results when ended from the PyCommunicator?
Thanks and Regards, Elad