![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
model.json with type: "LayeredNetwork" -> LqnStruct, via LqnBuilder. More...
#include <map>#include <string>#include <vector>#include "line/io/network_reader.h"#include <cctype>#include <fstream>#include "line/lang/lqn/lqn_builder.h"#include "line/lang/lqn/lqn_reader.h"#include "line/lang/lqn/lqn_struct.h"#include "line/util/error.h"Go to the source code of this file.
Namespaces | |
| namespace | line |
| Conservation laws of a layered queueing network, enumerated from its structure. | |
| namespace | line::io |
Functions | |
| template<class T> | |
| lqn::LqnModel< T > | line::io::build_lqn_model_from_json (const detail::json &root) |
| Build the intermediate LqnModel<T> from a parsed model.json envelope carrying a LayeredNetwork. | |
| template<class T> | |
| lqn::LqnStruct< T > | line::io::build_lqn_from_json (const detail::json &root) |
| Build an LqnStruct<T> from a parsed model.json envelope carrying a LayeredNetwork. | |
| bool | line::io::is_layered_json_text (const std::string &text) |
| True when a DOCUMENT ALREADY IN MEMORY is a LayeredNetwork model.json. | |
| bool | line::io::is_layered_json (const std::string &path) |
| True when a file is a LayeredNetwork model.json rather than an .lqnx. | |
| template<class T> | |
| lqn::LqnModel< T > | line::io::read_lqn_json_model (const std::string &path) |
| Parse a LayeredNetwork model.json file into its intermediate LqnModel<T>. | |
| template<class T> | |
| lqn::LqnStruct< T > | line::io::read_lqn_json (const std::string &path) |
| Parse a LayeredNetwork model.json file into an LqnStruct<T>. | |
| template<class T> | |
| lqn::LqnStruct< T > | line::io::read_layered_model (const std::string &path) |
| Read a layered model from either interchange: the LINE model.json or the LQNS .lqnx. | |
model.json with type: "LayeredNetwork" -> LqnStruct, via LqnBuilder.
WHY THIS EXISTS BESIDE lqn_reader.h. The .lqnx reader covers the LQNS file format, which is what an external tool writes; this covers the LINE interchange format, which is what linemodel_save.m, save_model and the JAR LineModelIO write for a LayeredNetwork. The two are not interchangeable in either direction: .lqnx cannot carry a non-reference task's think time, a CacheTask, an ItemEntry or a SetupTask, and model.json carries all four. Without this reader a layered model could reach the C++ port only by being re-exported through XML, losing exactly those constructs.
ORDERING IS PART OF THE FORMAT. LqnBuilder assigns indices in call order, and every later array – the layer decomposition, the visit matrix, the result tables – is keyed on them. The document's own order is used throughout (hosts, then tasks, then entries, then activities), which is the order the writers emit and therefore the order MATLAB's own getStruct produced before serialization.
WHAT IS READ, following linemodel_load.m::json2layered: fan-in and fan-out (fanIn/fanOut, a map from the peer task to the count) and the named admission constraints of hosts and tasks, which lqn_finalize resolves as it does for the .lqnx reader; a host's quantum (0.001 when absent, MATLAB's default) and speedFactor; the activity thinkTime the JAR writes. An explicit-form precedence may spell its types as the JAR and the Workflow wire do (pre, post-OR), as Python's aliases (and-fork, or-join, loop) or as the enum names (PRE_SEQ); an unknown spelling is refused by name, where MATLAB would read it as pre.
Definition in file lqn_json_reader.h.