Package jline.io

Class QN2MATLAB

java.lang.Object
jline.io.QN2MATLAB

public final class QN2MATLAB extends Object
Generates a MATLAB script that rebuilds a Network with the LINE MATLAB API.

Port of matlab/src/io/QN2MATLAB.m: the script defines model, the cell arrays node and jobclass, and a routing cell array P read from sn.rtnodes, in the same three blocks and with the same comments as the MATLAB generator. Processes are written from their first two moments by the same rules as QN2JAVA.

Differences from the MATLAB text, each made so the script rebuilds the same model: a number that MATLAB's %f or %d would round is printed in full; a scheduling weight other than 1 (DPS, GPS and their priority variants) is passed to setService, as QN2JAVA.m already does; a Fork's tasks-per-link other than 1 is restored through setTasksPerLink. Node types MATLAB would silently omit (Cache, Logger, Place, Transition) are refused by name instead.

  • Method Details

    • generate

      public static String generate(Network model)
      Returns the generated script for a model named after model.getName().
    • generate

      public static String generate(Network model, String modelName)
      Returns the generated script.
    • write

      public static void write(Network model, String modelName, PrintStream out)
      Writes the generated script to a stream (e.g. System.out), which is flushed but not closed.
    • write

      public static void write(Network model, String modelName, Writer out)
      Writes the generated script to a writer, which is flushed but not closed.
    • write

      public static void write(Network model, String modelName, String filename)
      Writes the generated script to filename, overwriting it.