AnyLogic supports import of Vensim® models. Now you can simply open Vensim© model and it will be converted into AnyLogic model analogous to the original Vensim® model so you can easily continue developing it in AnyLogic.
To import a Vensim© model into AnyLogic
- Choose File >>Import > From Vensim from the main menu.
- The Open dialog box will be opened. Choose Vensim® model file (.mdl) you want to import and click OK.
- You will see the first page of the Import Vensim model wizard opened. Here you can set up the converter options (they are described below).
- When finished, click Next. The next page of the wizard will be opened (already familiar to you since it looks the same as the first page of the New Model wizard). Here you can specify the model name and the folder where it will be saved. Complete the import process by clicking OK.
Finally, you will get the Vensim© model converted into AnyLogic model. Since some rarely used Vensim® features are not supported by AnyLogic, the resulting model may need some minor refactoring. All information about the inconsistency between the original Vensim® model and the resulting AnyLogic model will be listed in the Log view. There you can examine all places that need some modifications to make your model absolutely adequate to the original one. To navigate to a conversion problem, double-click the corresponding entry in the Log view.
Import Vensim model dialog enables users to configure some conversion settings:
Variable name conversion — In Vensim® names of variables may be composed from several separate words. However, in AnyLogic there is a restriction: names of elements cannot contain space symbols. Therefore AnyLogic converts compound Vensim names into valid ones by concatenating all separate words into one solid name. AnyLogic provides two ways of making the resulting names easier-to-read. The setting Variable name conversions allows you to choose one of them:
- Use camel-case (Potential adopters -> PotentialAdopters) — Initial letters of all words composing the resulting name will be capitalized.
- Use underscore (Potential adopters -> Potential_adopters) — Underscore symbols will be added between all words composing the resulting name.
- Capitalize first letters of subscript names (recommended) — If this option is selected, the initial letters of subscript names will be capitalized.
- Wrap lines in formulas. Line width ... characters — If selected, long formulas will be wrapped into lines of the specified width. You define the number of characters in a line in the edit box located to the right.
- Arrange views on model canvas — Vensim® model may contain several views (usually containing logically separated parts of a stock-and-flow diagram). Here you can choose how you want these views to be arranged on the diagram of agent type in the resulting AnyLogic model: Horizontally, Vertically, or In the square grid.
- Add view navigation buttons — If this option is selected, and the original Vensim® model contains several views, buttons allowing navigation between these views will be added onto the diagram of the resulting AnyLogic model.
- Align elements to grid — If selected, all graphical elements in the resulting AnyLogic model will be aligned to a diagram grid.
- Reset default arrow colors for arrows looking like having default Vensim colors — If this option is selected, those dependency arrows that are painted with the color that was later chosen as the default one for dependency arrows in Vensim® will be drawn with the color used as the default one in AnyLogic.
The Log view displays all problems found upon import of Vensim® models into AnyLogic.
Here is what the Log view looks like:
To show/hide the Log view
Choose View > Log from the main menu.
The view is automatically shown on the completion of the import process.
At the top of the view you can see the name of the converted model All warnings and errors listed below are related to this model.
The Log view contains a table of problems discovered upon importing the model.
The first column of the table displays an icon that denotes the type of the problem: warning. Errors are critical problems that lead to non-compiling model. Warnings indicate some non-critical inconsistencies with the original model that are recommended to fix.
The second column, Element, displays the name of the element — originator of the problem.
The column Description gives the detailed description of the problem and optionally recommends the way of solving it. If the description is too long and does not fit into the table cell, you may hover the mouse over it and wait for a second — you will see a tooltip containing the complete description.
You can open a location of any error listed in the Log view. Depending on the error, the “open” operation may result in displaying different views.
If it is an error e.g. in a formula of some stock, the properties of this particular stock will be shown in the Properties view, and the cursor will be put into the field containing the error.
If, for example, it is a graphical error, the corresponding diagram will be opened in the graphical editor with invalid shapes highlighted.
To open an error
- Double-click the corresponding row of the table in the Log view.
How can we improve this article?