Package jline.io
Class LineModelIO
-
- All Implemented Interfaces:
public class LineModelIOProvides save/load functionality for LINE queueing network models to/from JSON format.
Supports both Network (queueing network) and LayeredNetwork (layered queueing network) models. The JSON format follows the line-model.schema.json specification.
Usage:
// Save a Network model LineModelIO.save(model, "mymodel.json"); // Save a LayeredNetwork model LineModelIO.save(lqnModel, "mylqn.json"); // Load any model Object model = LineModelIO.load("mymodel.json"); if (model instanceof Network) { ... } if (model instanceof LayeredNetwork) { ... }
-
-
Constructor Summary
Constructors Constructor Description LineModelIO()
-
Method Summary
Modifier and Type Method Description static JsonObjecttoJsonObject(Network model)Builds a JsonObject representation of a Network model. static voidsave(Network model, String filename)Saves a Network model to a JSON file. static JsonObjecttoJsonObject(LayeredNetwork model)Builds a JsonObject representation of a LayeredNetwork model. static voidsave(LayeredNetwork model, String filename)Saves a LayeredNetwork model to a JSON file. static voidsave(Workflow model, String filename)Saves a Workflow model to a JSON file. static voidsave(Environment env, String filename)Saves an Environment model to a JSON file. static Objectload(String filename)Loads a model from a JSON file. -
-
Method Detail
-
toJsonObject
static JsonObject toJsonObject(Network model)
Builds a JsonObject representation of a Network model.
- Parameters:
model- the queueing network model to serialize- Returns:
the JSON document representing the model
-
save
static void save(Network model, String filename)
Saves a Network model to a JSON file.
- Parameters:
model- the queueing network model to savefilename- the output file path (should end with .
-
toJsonObject
static JsonObject toJsonObject(LayeredNetwork model)
Builds a JsonObject representation of a LayeredNetwork model.
- Parameters:
model- the layered queueing network model to serialize- Returns:
the JSON document representing the model
-
save
static void save(LayeredNetwork model, String filename)
Saves a LayeredNetwork model to a JSON file.
- Parameters:
model- the layered queueing network model to savefilename- the output file path (should end with .
-
save
static void save(Workflow model, String filename)
Saves a Workflow model to a JSON file.
- Parameters:
model- the workflow model to savefilename- the output file path (should end with .
-
save
static void save(Environment env, String filename)
Saves an Environment model to a JSON file.
- Parameters:
env- the environment model to savefilename- the output file path (should end with .
-
load
static Object load(String filename)
Loads a model from a JSON file.
- Parameters:
filename- the input file path- Returns:
a Network or LayeredNetwork depending on the model type
-
-
-
-