Class LQN2MATLAB
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 Summary
Modifier and TypeMethodDescriptionstatic Stringgenerate(LayeredNetwork model) Returns the generated script for a model named aftermodel.getName().static Stringgenerate(LayeredNetwork model, String modelName) Returns the generated script.static voidwrite(LayeredNetwork model, String modelName, PrintStream out) Writes the generated script to a stream (e.g.static voidwrite(LayeredNetwork model, String modelName, Writer out) Writes the generated script to a writer, which is flushed but not closed.static voidwrite(LayeredNetwork model, String modelName, String filename) Writes the generated script tofilename, overwriting it.
-
Method Details
-
generate
Returns the generated script for a model named aftermodel.getName(). -
generate
Returns the generated script. -
write
Writes the generated script to a stream (e.g.System.out), which is flushed but not closed. -
write
Writes the generated script to a writer, which is flushed but not closed. -
write
Writes the generated script tofilename, overwriting it.
-