Magic Model Analyst includes several scripting languages out of the box :
- BeanShell
- Built-in Math
- Groovy
- JavaScript Nashorn (deprecated)
- JavaScript Rhino (default)
- Python (Jython): you can call an external Python library (*.py), e.g., from lib1 import fc1, fc2, in two ways:
- Use import sys and sys.path commands to get the working directory of Python. Then copy the *.py file to the returned directory prior to calling the library.
Use import sys and sys.path.append(pathOfFile) prior to calling the library.
import sys sys.path.append(pathOfFile) // e.g. "C:\Python\Test" from lib1 import fc1, fc2
These languages can be used as the language of any OpaqueExpression or OpaqueAction anywhere in the model.
When MSI is integrated with external Math engines (e.g. MATLAB or Mathematica), corresponding languages are also added into the supported language list.
Additionally, you can download and install any other JSR-223 standard compatible language.