I'm currently working on a project that requires certain OWL2 XML files that describe real-life scenarios to be 'translated' to the ALP (type of XML) format of AnyLogic models, so they can be opened in the application. This translation is eventually supposed to happen automatically via another application.
The scenarios describe tourism flows in certain areas in the Netherlands. These scenarios are defined in and exported from a local Semantic MediaWiki in the RDF-OWL2 format. In AnyLogic, we have already managed to create a simulation model and scenarios that we want. Now, we want to directly 'translate' these scenarios from the MediaWiki to AnyLogic, so that simulation models are created without having to touch the AnyLogic application. The type of parameters, classes, agents etc. are all already defined by us, so it's all just a case of "the tourism area in Semantic Wiki Page A should turn into the tourism area A in AnyLogic."
For example, the a part input RDF file might look like this:
<genericTrainStation>
<name>Station Amsterdam</name>
<size>20km</size>
....
</genericTrainStation>
In AnyLogic, if I were to make the same station in the application, the output in the .alp file would be something along the line of...
<EmbeddedObject>
<stuffIrrelevant></stuffIrrelevant>
<stuffIrrelevant2></stuffIrrelevant2>
<name>Station Amsterdam></name>
<size>20km</size>
The question is if it's possible to directly translate between the input and the output, by somehow using the RDF to supplement or replace certain values in the AnyLogic ALP file.
So far, I've flirted with two ideas:
Use XSLT to try and perform the translation
Use the AnyLogic ALP format as a base, and construct a compiler surrounding that performs the translation
I've looked long and far for any resources that concern manipulating the ALP AnyLogic format, but to no avail. I'm generally looking for help concerning the overal plausibility of the two ideas, and eventual resources I can use in my task.
You can use XML files to create an AnyLogic model, but you do not want to do it via direct edits of the alp file. Instead, find a java library that reads XML files and in your startup code reason with your source XML file. Then, you can dynamically instantiate whatever objects you want in your model - walls, stations, delays, etc.
If you simply modified the alp file, that would force people to have to open AnyLogic, since the alp file is the source code, not the compiled model. If you instantiate your objects on initialization, then the compiled AnyLogic model can be called by the command line or other applications (read the end user agreement about AnyLogic models on server based applications & reach out to them to discuss further, if needed).
Also, the alp file was not designed for direct edits (although I have done that from time to time when merging versions via source control). Given that you are looking at something outside the intended use, new versions of AnyLogic would likely not be backwards compatible to what you are trying to do.
I have found that dynamically building the space markup items can be more cumbersome than the basic objects, so be prepared to spend some time there. You also need to be prepared to invest time in error trapping bad inputs. Since you are crossing over into a file building your model, you will need to make sure that the file does not have items that would cause the model to crash or violate underlying assumptions.