Package jline.io

Class M2M

java.lang.Object
jline.io.M2M

public class M2M extends Object
Model-to-Model transformation class for converting between different queueing network model formats.

This class provides methods to transform between various queueing network modeling formats, including JMT (Java Modelling Tools) models and LINE models. It supports importing JSIM/JSIMG files and converting them to LINE Network objects, as well as exporting LINE models back to JMT-compatible formats.

Supported transformations:

  • JMT to LINE: Import JSIM/JSIMG/JSIMW files and convert to LINE Network objects
  • LQN to LINE: Import LQN/LQNX (Layered Queueing Network) files to LayeredNetwork objects
  • LINE to JSIMG: Export LINE Network models to JMT-compatible JSIMG format

Since:
1.0
Author:
LINE Development Team
  • Constructor Details

    • M2M

      public M2M()
      Creates a new instance of the M2M transformation class.
  • Method Details

    • JMT2LINE

      public Network JMT2LINE(String filename)
      Converts a JMT (Java Modelling Tools) model file to a LINE Network object.

      This method automatically detects the JMT file format based on its extension:

      • .jmva - JMVA files (not yet supported)
      • .jsim, .jsimg, .jsimw - JSIM simulation model files

      Parameters:
      filename - The path to the JMT model file to import
      Returns:
      A LINE Network object representing the imported model
      Throws:
      RuntimeException - if the file format is not supported or parsing fails
    • JMT2LINE

      public Network JMT2LINE(String filename, String modelName)
      Converts a JMT (Java Modelling Tools) model file to a LINE Network object with a custom model name.

      This method automatically detects the JMT file format based on its extension:

      • .jmva - JMVA files (not yet supported)
      • .jsim, .jsimg, .jsimw - JSIM simulation model files

      Parameters:
      filename - The path to the JMT model file to import
      modelName - The name to assign to the resulting LINE Network model
      Returns:
      A LINE Network object representing the imported model with the specified name
      Throws:
      RuntimeException - if the file format is not supported or parsing fails
    • JSIM2LINE

      public Network JSIM2LINE(String filename)
      Converts a JSIM/JSIMG file to a LINE Network object.

      This method parses the JSIM XML file and extracts the model name from the document. It then delegates to the overloaded method that accepts a model name parameter.

      Parameters:
      filename - The path to the JSIM/JSIMG file to import
      Returns:
      A LINE Network object representing the imported JSIM model
      Throws:
      AssertionError - if the XML document cannot be read
    • JSIM2LINE

      public Network JSIM2LINE(String filename, String modelName)
      Converts a JSIM/JSIMG file to a LINE Network object with a specified model name.

      This is the main implementation method that performs the actual JSIM to LINE conversion. It parses the JSIM XML structure and creates corresponding LINE objects including:

      • Nodes: Sources, Queues, Sinks, Delays, Routers, Forks, Joins, ClassSwitches, Places, Transitions
      • Job Classes: Open and Closed classes with their properties
      • Service and Arrival Distributions: Exponential, Erlang, Hyperexponential, Coxian, etc.
      • Routing Strategies: Random, Probabilistic, Round Robin, Join Shortest Queue, etc.
      • Scheduling Strategies: FCFS, LCFS, PS, DPS, GPS, Priority-based, etc.

      Parameters:
      filename - The path to the JSIM/JSIMG file to import
      modelName - The name to assign to the resulting LINE Network model
      Returns:
      A LINE Network object representing the imported JSIM model
      Throws:
      RuntimeException - if parsing fails or unsupported features are encountered
    • LQN2LINE

      public LayeredNetwork LQN2LINE(String filename)
      Converts an LQN/LQNX (Layered Queueing Network) model file to a LayeredNetwork object.

      This method parses LQN XML files that conform to the LQN schema and creates a corresponding LayeredNetwork representation in LINE. LQN models are commonly used for modeling layered software architectures and client-server systems.

      Parameters:
      filename - Path to the LQN XML file to import
      Returns:
      A LayeredNetwork object representing the imported LQN model
      Throws:
      RuntimeException - if the file cannot be parsed or is not a valid LQN file
    • LQN2LINE

      public LayeredNetwork LQN2LINE(String filename, String modelName)
      Converts an LQN/LQNX (Layered Queueing Network) model file to a LayeredNetwork object with a custom name.

      This method parses LQN XML files and allows specifying a custom name for the resulting LayeredNetwork model, overriding any name defined in the XML file.

      Parameters:
      filename - Path to the LQN XML file to import
      modelName - Custom name to assign to the LayeredNetwork model
      Returns:
      A LayeredNetwork object representing the imported LQN model with the specified name
      Throws:
      RuntimeException - if the file cannot be parsed or is not a valid LQN file
    • LINE2JSIMG

      public boolean LINE2JSIMG(Network model, String outputFileName)
      Converts a LINE Network model to JSIMG file format for use with JMT.

      This method exports a LINE Network model to the JSIMG (Java SIMulation Graphics) format, which can be opened and simulated in JMT (Java Modelling Tools). The conversion preserves all supported model elements including nodes, classes, routing, and distributions.

      Parameters:
      model - The LINE Network model to convert
      outputFileName - Path where the JSIMG file should be saved
      Returns:
      true if conversion was successful, false otherwise
    • LINE2JSIMG

      public String LINE2JSIMG(Network model)
      Converts a LINE Network model to JSIMG file format with automatic filename generation.

      This convenience method exports a LINE Network model to JSIMG format using the model's name as the base filename with a .jsimg extension. For example, a model named "MyModel" will be exported to "MyModel.jsimg".

      Parameters:
      model - The LINE Network model to convert
      Returns:
      The path to the generated JSIMG file, or null if conversion failed
    • JMVA2LINE

      public Network JMVA2LINE(String filename)
      Converts a JMVA file to a LINE Network object.

      This method parses the JMVA XML file and extracts the model name from the filename. JMVA files describe queueing models with delay stations, load-independent (LI) stations, open and closed job classes, service times, and visit ratios.

      Parameters:
      filename - The path to the JMVA file to import
      Returns:
      A LINE Network object representing the imported JMVA model
      Throws:
      RuntimeException - if the XML document cannot be read or parsing fails
    • JMVA2LINE

      public Network JMVA2LINE(String filename, String modelName)
      Converts a JMVA file to a LINE Network object with a custom model name.

      Parses the JMVA XML format which contains:

      • Stations: delaystation (infinite server), listation (load-independent)
      • Classes: openclass (with arrival rate), closedclass (with population)
      • Service times and visit ratios per station per class
      • Reference stations for closed classes

      Parameters:
      filename - The path to the JMVA file to import
      modelName - The name to assign to the resulting LINE Network model
      Returns:
      A LINE Network object representing the imported JMVA model
      Throws:
      RuntimeException - if parsing fails or unsupported features are encountered