The simulation module creates an xml file with a collection of snapshots. Each of the snapshots contain the time on which the snapshot is made and the states of all machines on that time.

This human readable xml file can be used to analyse the control system according to a performance criterion of choice. Following paragraphs illustrate how to analyse the logfile measuring the lead time for every order present in the logfile. The analysis can be done by importing the xml into a program of choice. Following paragraphs show one option to do this : filter the logfile with xslt (step 1), read the logfile into Java with Castor (Step 2), analyse the logfile with a Java program (Step 3)

For convenience purposes one can easily test the analysis process by simply running the "runme.bat" (or "" for linux) file. (this will display the lead time for the different orders on the console) (files can be downloaded at the bottom of this page)

note : Java 1.5 runtime environment is required



Step 1 :: Filter the logfile with xslt

Before the logfile is imported into a Java program, it is filtered with xslt. This way the logfile only contains the necessary information for measuring lead-time. The original xml file (ScenesHumanReadable.xml) is processed with use of Saxon ( (Any xslt processor can be used for this). The xslt filter used in this example registers the time of every snapshot and the orders present in the snapshot. For every order in a snapshot, the name of processingunit (in which the order resides) is registered. The command to run this step is :

java -jar saxon.jar -o LogFileFilteredForLeadTime.xml ScenesHumanReadable.xml LeadTimeFilter/LeadTimeFilter.xsl



Step 2 :: Read the filtered logfile

Th filtered logfile is read into Java with Castor Castor ( is a Java library which is able to convert xml files into Java objects. In order to translate the xml data into objects, Castor uses a mapping file (in this example it is "JavaLeadTimeCalculation/mapping.xml"). The mapping file describes the translation of the data structure in the xml file and the Java classes. In order to import the filtered logfile (which is "LogFileFilteredForLeadTime.xml") into Java we first create the necessary Java classes (see the JavaLeadTimeCalculation/JavaFiles subdirectory). Next we import the xml file with help of the "unmarshall" method of Castor (see JavaLeadTimeCalculation/JavaFiles/



Step 3 :: Analyse the logfile with a Java program

In this final step the imported xml file is analysed with help of a simple Java program. The main method of this program is the LeadTimeCalculator.calculateLeadTimes() method. This method simply iterates over all snapshots and collects the earliest and latest moment an order is spotted in a processingunit. The difference of these timestamps is the lead-time for each order. The java program can be executed as follows (current directory is JavaLeadTimeCalculation/JavaFiles):

java -classpath .:../lib/castor-0.9.9.jar:../lib/xerces-J_1.4.0.jar:../lib/commons-logging.jar LeadTimeCalculator


Result files