Working with files

Working with files

Opening and saving models

When you save a model, Simile will try to save all the information required to get back to what you were doing when you open it again. If the model is running, Simile will save the executable code and the run information (execution time, integration method and the rest) and the model will start running again as soon as it is opened. If you do not want this to happen, close the model run environment, or select 'Abort execution' under the Model menu, before saving.

In Simile version 7 and later, when you save a model, the file will include the information required to re-create the parameter scenario, the visualization tool setup and the experiment setup, if they exist. Opening the file later will restore all of these. (Note that raw data in .csv and image files is not saved with the model; this must either be present in the same location relative to the model file as when it was saved, or explicitly incorporated into the scenario). Separate scenario, visualization tool and experiment setup files can still be saved and loaded after the model file is opened.

In earlier versions, if a scenario file has been associated with the model (either by loading one or by saving one) the saved model will include a reference to this file, so the parameters will be reloaded without further action when the model is opened. Similarly, if a helper setup file has been associated with the model, the saved model will include a reference to this too, and the helper setup will be restored as soon as it is opened. When opening the model, the files must be in the same location relative to it as when it was saved.

To open an existing file from disk, click the "Open" button on the toolbar or select the "Open" command from the "File" menu. The "Open" command will load a model (using the normal file dialogue box) into a new window, unless your existing window is blank, in which case it will be used for the opened model.

To save the model you are working on, click the "Save" button on the toolbar or select the "Save" or "Save As" commands from the "File" menu. If you have not already saved your model, the effect of these commands is the same. If you have already saved your model, the "Save As" command allows you to select a new file name for this revision. The "Save" command and the "Save" button on the toolbar will use the same name as before.

The "New" button on the toolbar has the effect of re-using the existing window for a new model. Note the difference from the behaviour of the "New" command on the "File" menu, which creates a new empty window.

The "Close" command will close your model (prompting you to save it, if it has changed) and also close the current window. If the current window was the last window open, closing it will exit Simile (except on the Mac, where Simile keeps running with no windows). The "Exit" command will close all your models (with prompts to save any modifications) and windows, and exit Simile.

Double-clicking on a Simile model in Windows Explorer, Finder on the Mac or most Linux file managers will open the model in a new Simile window. Dragging a Simile model file icon to the Simile icon will open the model in a new window.

On building a model, when multiple windows are open, a run control is presented as usual. If multiple models are built, then multiple run controls will be presented. Each run control is associated with one particular model window, and you can use the "Go to model window" and "Go to run control" toolbar buttons to move back and forth between the pair.

Model file formats

New major versions of Simile may use a new model file format. Information on this, and the relationship between it and previous file format is given for advanced users.

Exporting model information

Prolog-format model declarations

C++ source code and compiled libraries

Save model diagram as vector graphics

Reporting problems

Understanding Simile's error reporting tool

In: Contents

Working with files : Model file format

Model file format

Version 5.0 saves models as 'packages' by default. This was an optional feature in version 4.0 onwards, but had problems because any automatic save of a model would not include the extras that made it a package. This made it easy for the execution parameters and other package information to get lost. With Simile 5.0 and up, if you do not want a model to start running wen you open it, you must close the execution window before saving it.

Version 3.0 uses a new file format for the express purpose of making it quicker and simpler to move large models between multiple computers. In the past, the *.sml (or *.sim) file contained the Prolog-format model declarations. This file contains the minimum required to display, edit and run the model. In order to speed things up however, a number of other files were also created. These include the canvas file (*.cnv ), which contains drawing instructions and the compiled model (*.dll or *.tcl) in C++ or Tcl code. These files were stored in several different locations, including temporary folders and the "sim_bits" folder.

This caused a certain amount of confusion. In particular moving a model from one computer to another, or even from one folder to another, required Simile to re-build its supporting files. This can be a lengthy process.

In v3.0, the *.sml file now contains all the supporting information as well. Although this means it is larger than before, it is not much larger than the total size of all the files it is replacing.

One final point is also important. In order to preserve the benefit of having a plain-text representation of the declarative model, the file format is a simple multi-part MIME that bundles together all these files. This is exactly the format used when sending an email containing attached files. There are many tools available for manipulating multi-part MIME files. For example, to use Outlook Express, simply change the *.sml extension to *.eml

In summary, when you move a model file to a new location it will:

  • draw quickly when it is first loaded; and
  • build instantly, if it has not changed since it was last built.

To save a model in the old pre-3.0 format, export "Model declarations" as described in the following section.

In: Contents >> Working with files

Working with files : Export PostScript or SVG graphics

Export PostScript graphics

To export the diagram in the current window in PostScript graphics format, use the "Export" command on the "File" menu and select the option "PostScript graphics" in the sub-menu that appears. A wide range of other graphics programs and printers can interpret PostScript files. On the Linux and SunOS / Solaris operating systems, this is the only way to print model diagrams.


Export SVG image

To export the diagram in the current window in SVG (scalable vector graphics) format, use the "Export" command on the "File" menu and select the option "SVG Image" in the sub-menu that appears. SVG images are encoded in an XML based language and are suitable for including in web pages.

In: Contents >> Working with files



Working with files : Reporting problems

Reporting problems

In order to direct our efforts to solving the problems that affect users the most, Simile includes an error reporting tool to send information on problems to Simulistics over the Internet. In order to use the tool, you must have a connection to the Internet, and your model must not be confidential. The data sent to Simulistics includes parts of the model file, as well as information on the logical commands that were being executed at the immediately before the problem. Although we use the data you send only to help improve Simile, we would not wish to receive parts of models that you consider confidential.

All data are collected anonymously. If you wish to receive technical support for a particular problem, please contact us directly.

In: Contents >> Working with files

Working with files : Export C++ program

Export C++ program & executables

When building a model, the generated C++ source code and the compiled library (*.dll or *.so) are stored in temporary files. If you wish to modify the source code, or if you wish to use the model library in another program, you can use the "Export" command on the "File" menu and select the "C++ program & executables" to save these files in a location of your choice.

For details of the exported functions in the compiled library, please contact Simulistics.

In: Contents >> Working with files

Working with files : Export model declarations

Export model declarations

To save the model in a Prolog-format text file, use the "Export" command on the "File" menu, and select the "Model declarations" item. The default file extension is *.pl (Prolog), but you can enter a file name with a *.sml extension if you wish. This format contains all the information necessary to define the model, and it can be used instead of the usual format. The advantage is that the files are much smaller than usual, and, if you are familiar with the Prolog language, you can edit the file yourself or write programs to reason with it. This is the file format used in versions of Simile prior to v3.0.

You can open models saved in this format, using the usual "Open" command on the "File" menu.

In: Contents >> Working with files