SIMUL8 logo

XML

SIMUL8 supports the XML standard. For full documentation on SIMUL8's XML see SIMUL8.com/XML

Quick Guide

Use the File menu, Save As option and select XML to save a SIMUL8 file as the XML format ready for editing in an XML editor or for import to another application.

Use the File Menu, Open, and select XML as the file type to import a file saved as XML.

Both the Open and Save as XML options are available under the File menu, Import and Export options.

Detailed Information

XML is a standard for creating markup languages that describe the structure of data. That is XML lets you describe a file in text using tags. The picture below shows an example of a SIMUL8 XML file.

If you know SIMUL8 you can easily interpret the file. A trial contains 5 runs, the results collection period is set to 2399.4999, antithetic random numbers are turned off and the random numbers don't automatically change on each reset.

Creating a SIMUL8 XML

  • Do File Save As and select the .xs8 or .xml option.
  • Use File Export.

You can then view it in several ways. The easiest way is to open the file using Notepad, but you can also view it using internet explorer.

To create a SIMUL8 XML from scratch is easy too. In Notepad you just need to type the lines <SIMUL8XML></SIMUL8XML> and save the file as a .xs8 or .xml file. This is enough to allow SIMUL8 to open the file, although the simulation will be blank.

XML Tags

A SIMUL8 XML file is constructed from a series of elements. An element is made up from a start tag, an end tag and content in between, like in the figure 1 below. The start tag is inside angled brackets and is given a name that describes the data inside the element, in our example <RUNS>. The end tag is also inside angled brackets and has the same text as the start tag but has a slash first, in our example </RUNS>. The content in between is text or can be another element. For example in figure 1 below the content is text, the number 5, but in figure 2 the content of the <TRIAL> element is the <RUN> element.

Figure 1 Figure 2

Key Sections

A SIMUL8 XML file has 4 key sections:

Simulation Parameters
The key settings of your simulation, for example results and shifts.

Environment
Your building environment settings. For example whether to display arrows or not and whether to display simulation assistant messages.

Simulation Objects
Describes all the simulation objects like Activities, Queues etc.

File Parameters
Records information about your SIMUL8 version and information like the SIMUL8 version required to run your simulation.

There are hundreds of SIMUL8 XML tags you can use to populate these sections. The easiest way to find the tags you need is create a simulation that uses the property you want and save it as an XML file. SIMUL8 XML is so readable that you should be able to easily locate the tags you need. Alternatively see SIMUL8's XML Schema for a full list of all the tags available.

You don't need to populate all the sections to create a valid SIMUL8 XML file. As long as you add the tags <SIMUL8XML></SIMUL8XML> SIMUL8 will use default values to create all the other elements, so you can just add the elements that are key to your simulation and SIMUL8 will do the rest.

Results from a simulation don't get stored in the main .xs8 SIMUL8 XML file, they are stored in a separate .RS8, Results SIMUL8 XML file. You can generate a .RS8 file by selecting Results / Results Save as XML from the main toolbar.

How can you use XML with SIMUL8?

XML can be used in lots of different ways, but because you can parse it as a text file its an ideal way to share information between software packages. For example we use XML to automatically turn process maps built in Microsoft Visio into SIMUL8 simulations.

You create your process map in Visio SIMUL8 then opens and reads an XML version of the map. SIMUL8 goes through the file to identify key phrases in the XML. For example Shape denotes the start of a process map object. SIMUL8 then determines from the number of in and out links the shape has whether it should be an Activity, Start Point etc. in the simulation.

Lots of other BPM software packages link with SIMUL8 in a similar way. Except instead of SIMUL8 parsing of the XML file they parse their own file and then generate a SIMUL8 XML file that SIMUL8 automatically opens.

As a SIMUL8 user there are lots of ways you can make use of SIMUL8 XML. At a really simple level a SIMUL8 XML file is an excellent starting point to creating your own file documentation. At a more powerful level you can use it to generate simulations without having to use the SIMUL8 interface. For example we have a customer who never updates their simulations in the conventional way. They have an Excel spreadsheet where they enter the parameters for the simulation. A macro then generates the relevant SIMUL8 XML file. They then use COM to tell SIMUL8 to run the simulation and save the results to an XML file. Another macro then imports the result from the SIMUL8 XML file to the spreadsheet. Download an example to see this idea in action.

See Also

logo
cleardot