How can you get a Path - String - File reference to where the Anylogic model is located in the disk from one of the Java code input windows?
I fear it might not be possible because the execution takes place from a produced BUILD folder that contains the classes generated by AL, but there might be a way to pass this information down through a variable for it to be available at runtime...
So far I have only managed to get the folder where this classes produced by AL are located by doing (from the main agent):
traceln(this.getClass().getProtectionDomain().getCodeSource().getLocation());
Just use System.getProperty("user.dir"), since the ALP file's location is the working directory for the model as a Java application.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With