Package jline.io

Class LQN2MATLAB

java.lang.Object
jline.io.LQN2MATLAB

public final class LQN2MATLAB extends Object
Writes the MATLAB script that rebuilds a LayeredNetwork, the Java port of MATLAB's LQN2MATLAB.

The script reads the model OBJECTS rather than the struct, and declares the hosts, tasks, entries and activities in model order through the constructors a user would write (Processor, Task, CacheTask, SetupTask, FunctionTask, Entry, ItemEntry, Activity, ActivityPrecedence), so the regenerated model has the same LayeredNetworkStruct indexing. Numbers are written at the shortest spelling that reads back bit for bit (%d for integers, else %.15g to %.17g). Blocks: 1 processors, 2 tasks, 3 entries, 4 activities, 5 replies, 6 precedences; no solver lines.

Differences forced by the JAR object model: a class or joint dependence handle is a Java lambda and is refused by name; fan-out targets are written in name order (the JAR keeps them in a hash map); entry replies follow activity order; a Coxian is always written in its vector form; and an Immediate think, setup or delay-off time is treated as the constructor default, since the JAR does not distinguish the numeric and object paths there.

  • Method Details

    • generate

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

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

      public static void write(LayeredNetwork 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(LayeredNetwork model, String modelName, Writer out)
      Writes the generated script to a writer, which is flushed but not closed.
    • write

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