I am trying to train other people at my organization to work on the Energy Policy Simulator model. As with most modern software, the model is tracked in a version control system (specifically Git / GitHub). We've run into an issue with the format Vensim uses to store display code inside the .mdl file that makes merging changes made by different modelers almost impossible.
- Simply going to an existing sheet and panning around to look at different parts of the sheet, or zooming in and out, creates many changes in Vensim’s display code for that sheet. It is pretty much impossible to avoid doing these things while working on the model. Even if a developer is confining his/her new work to a new sheet, to avoid editing any old sheets, he/she still needs to at least be able to examine old sheets without causing changes in their display code when the .mdl file is next saved.
- Editing one variable on a sheet or simply adding a comment to a sheet using the "Comment" tool can change hundreds of lines of display code for the variables and comments already on that sheet. This means that two people can't work on different parts of the same sheet, even if they don't edit any of the same variables as each other. (Even work on different sheets isn't safe because you are likely using shadow variables from other sheets, and renaming them will rename them across all sheets, changing the display code on all sheets.)
- Even in the simplest possible case where two developers put their work on two different, brand new sheets and don't pan, zoom, or otherwise look at any existing sheet, the success of the merge of the two .mdl files depends on the Git client you use. The client "Fork" wasn't able to merge files successfully because Vensim expected the following two lines to be repeated above the title of every new sheet:
Code: Select all
\\\---/// Sketch information - do not modify anything except names
V300 Do not put anything below this section - it will be ignored
Code: Select all
*Cost Outputs
I'd like to request that Ventana Systems strongly consider adopting a new format for the display code that enables multiple people to truly collaborate in the same .mdl file. I would suggest the following changes:
1. Most importantly, each visible thing (such as a variable or comment) would be fully defined on a single line of code (giving its coordinates, color, arrow connections, etc.) and would not be affected when other variables change, even if those other variables are on the same sheet.
2. There should be no changes to any code in the .mdl file if a user simply views the existing model structure (such as by panning, zooming, or clicking on variables, or producing graphs or tables). Only actual changes to the model such as moving, adding, recoloring, or deleting variables, arrows, or comments should cause changes to the display code.
3. The following lines should not be required, or if required, should only be required once at the beginning of the display code section and not before each sheet name:
Code: Select all
\\\---/// Sketch information - do not modify anything except names
V300 Do not put anything below this section - it will be ignored
I know this might seem to be asking for a lot, but being able to work together with others on a single model is a very important capability. Besides, the display code format Vensim currently uses doesn't make much sense anyway, since there shouldn't be dozens or hundreds of changed lines every time a user pans/zooms existing sheets or adds a variable to an existing sheet. A clean, modern display code format that only pays attention to true changes to the model and isolates each variable/comment/etc. to a single line would be so wonderful and important for making Vensim a tool teams can use together.
If you do create new display code along the lines above and need someone to test it, I can run a set of tests for you and report any parts of the code that fail to merge correctly and why. I'm happy to help.
-Jeff