Package jline.io

Class M2M

  • All Implemented Interfaces:

    
    public class M2M
    
                        

    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

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      M2M() Creates a new instance of the M2M transformation class.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      Network JMT2LINE(String filename) Converts a JMT (Java Modelling Tools) model file to a LINE Network object.
      Network JMT2LINE(String filename, String modelName) Converts a JMT (Java Modelling Tools) model file to a LINE Network object with a custom model name.
      Network JSIM2LINE(String filename) Converts a JSIM/JSIMG file to a LINE Network object.
      Network JSIM2LINE(String filename, String modelName) Converts a JSIM/JSIMG file to a LINE Network object with a specified model name.
      LayeredNetwork LQN2LINE(String filename) Converts an LQN/LQNX (Layered Queueing Network) model file to a LayeredNetwork object.
      LayeredNetwork LQN2LINE(String filename, String modelName) Converts an LQN/LQNX (Layered Queueing Network) model file to a LayeredNetwork object with a custom name.
      boolean LINE2JSIMG(Network model, String outputFileName) Converts a LINE Network model to JSIMG file format for use with JMT.
      String LINE2JSIMG(Network model) Converts a LINE Network model to JSIMG file format with automatic filename generation.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • M2M

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

      • JMT2LINE

         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

      • JMT2LINE

         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

      • JSIM2LINE

         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

      • JSIM2LINE

         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

      • LQN2LINE

         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

      • LQN2LINE

         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

      • LINE2JSIMG

         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

         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