SIMUL8 Corp


 
support.SIMUL8.com
  Back Issues
Learning Zone
Cafe
Templates
Components
Training
Register


Welcome to this month's newsletter! In this issue you'll find:


XML and SIMUL8 by Frances Collins

Almost everybody has heard the phrase XML. But most people don't know what it is and almost nobody knows its one of the easiest to use and most powerful features in SIMUL8.

What is XML?

XML is short for eXtensible Markup Language. Its a standard for creating markup languages that describe the structure of data. That's a fancy way of saying XML lets you describe a file in text using tags. The tags aren't predefined so developers can define their own XML for their application. For example the picture below shows an example of a SIMUL8 XML file.

SIMUL8 XML

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.

Writing SIMUL8 XML

Creating a SIMUL8 XML file for an existing simulation is easy, you just need to do a File Save As and select the .xs8 option. You can also 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 or using a XML development tool like XML Spy.

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 file. This is enough to allow SIMUL8 to open the file, although the simulation will be blank.

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.

XML Tag
Figure 1

SIMUL8 XML
Figure 2

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 Work Centers, Storage Bins 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 check out 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.

Solution XML

SolutionXML lets you store your own additional data inside SIMUL8’s XML. You just insert the element <SolutionXML> anywhere after the <SIMUL8XML> element and add the content you want to store. See the picture below for an example.

SIMUL8 XML

SIMUL8 preserves your data when XML files are open, read, saved etc. SIMUL8 also saves your SolutionXML data and tags inside S8 file types. This means you can also use SolutionXML with COM applications that don’t use XML files. The COM Objects S8Simulation and S8SimObject have read/write properties SolutionXML. You can use these properties from COM or ActiveX to read or write the SolutionXML that has been read from a SIMUL8 XML file. If the user clicks SAVE (or you use SAVE from COM) the changed SolutionXML will be written back to the current simulation file.

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 a Work Center, Work Entry 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 which 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.

While you might not want to go to this extreme unless you have a suite of simulations you use on a regular basis, or you want to create your own mini application, there are still ways to use SIMUL8 XML to enhance your simulations. For example you could use it load distributions and their parameters into a simulation or you could create a Excel or Word results template file for all your simulations, the possibilities are endless!


Free Downloads

New Service Pack for SIMUL8 2005 Build 949
A new service pack for SIMUL8 2005 has been released. It fixes a few issues and adds some new Visual Logic commands.
Download the Service Pack | Full Details of What's in the Service Pack


Jobs at SIMUL8

Business Modeling Consultant

On the strength of continuing business growth and a number of associated new product developments, a challenging opportunity has arisen for an accomplished OR/Business Modeling professional to fulfil a key role involving both client consultancy delivery and product sales support in our European office. With overall responsibility for building relationships with existing clients, your wide ranging brief will include:

  • Apply business modeling and related process improvement skills to assist clients in optimizing their resources
  • Provision of modeling support expertise associated with the overall sales cycle, working closely with both colleagues and key client contacts
  • Implement high value decision support solutions to both new and existing clients, through use of the SIMUL8 product suite
  • Help build strong relationships with clients to both compliment product implementation and enhance future on-sell opportunities

For more details see our website.

Research Post

A UK Academic Researcher is required for a joint Warwick University-SIMUL8 Corporation research project funded by UK Research Council.

The project will develop an automated system for simulation output analysis and will start in January 2006 lasting 3 years. It will be supervised by Professor Stewart Robinson.

You should have an academic background with a strong element of statistics and be willing to use software tools for developing statistical algorithms. An MSc, and preferably a PhD, in Operational Research or a related field is required. If you don't have a PhD, then you must have a demonstrable track record in research relevant to the project.

For informal enquiries and more details of the project, contact Stewart Robinson on +44 2476-522132 or email stewart.robinson@warwick.ac.uk .


If you have any questions generated from, or comments about this newsletter then email Newsletter@SIMUL8.com

You are receiving this e-mail because you subscribed or are a registered SIMUL8 user. To unsubscribe click here.