LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
jmva_reader.h File Reference

Port of matlab/src/io/JMVA2LINE.m (and jline.io.M2M.JMVA2LINE): a JMT .jmva product-form model read into a qn::Network, the inverse of jmva_writer.h. More...

#include <cstdlib>
#include <memory>
#include <string>
#include <vector>
#include "line/lang/lang_types.h"
#include "line/lang/qn/network_builder.h"
#include "line/num/number.h"
#include "line/util/error.h"
#include "line/util/xml.h"
Include dependency graph for jmva_reader.h:

Go to the source code of this file.

Classes

struct  line::io::jmva_detail::Element

Namespaces

namespace  line
 Conservation laws of a layered queueing network, enumerated from its structure.
namespace  line::io
namespace  line::io::jmva_detail

Functions

double line::io::jmva_detail::to_double_strict (const std::string &s, const std::string &what)
 Strict decimal parse: the whole (trimmed) text must be a number.
const Element * line::io::jmva_detail::child (const Element *e, const std::string &tag)
 The first direct child with the given tag, or null.
const Element * line::io::jmva_detail::by_class (const Element *parent, const std::string &tag, const std::string &cls)
 The entry of tag under parent whose customerclass is cls, or null.
std::vector< double > line::io::jmva_detail::split_demands (const std::string &s)
 str2double(strsplit(s, ';')) (or ','), NaN entries dropped as the reference does.
std::string line::io::jmva_detail::file_stem (const std::string &path)
 Basename without directory or extension, MATLAB's [~,fname] = fileparts.
template<class T>
qn::Network< T > line::io::jmva2line (const std::string &path, const std::string &name=std::string())
 Port of JMVA2LINE(filename, modelName).

Detailed Description

Port of matlab/src/io/JMVA2LINE.m (and jline.io.M2M.JMVA2LINE): a JMT .jmva product-form model read into a qn::Network, the inverse of jmva_writer.h.

WHAT A JMVA DOCUMENT CAN SAY IS LESS THAN A NETWORK. It carries service times and visit ratios per station and class, not routing, so the model is rebuilt the way the reference rebuilds it: each station's service becomes an exponential of mean servicetime * visits (the DEMAND), and each class is routed serially through the stations it visits, in document-type order (delay stations, then load-independent, then load-dependent), open classes from a Source to a Sink. Every station-level mean of the product-form solution depends on the demands alone, so this is exact for what the format carries; per-visit response times are those of a visit ratio of one.

STATION ORDER IS BY TYPE, NOT BY DOCUMENT POSITION, as in the reference: <delaystation> elements first, then <listation>, then <ldstation>.

LOAD-DEPENDENT STATIONS follow MATLAB, not the JAR (which refuses them). The per-class <servicetimes customerclass=...> body is the semicolon (or comma) separated list d(1);d(2);... of per-population service times, with a leading d(0) = 0 dropped when present. The station is served at d(1) * visits and load-scaled by alpha(n) = d(1) / d(n), which is how jmva_writer.h encodes a multiserver queue. The servers attribute becomes the server count. A <servicetime> scalar under an <ldstation>, the spelling lqn2ps -Ojmva emits for a multiserver station, is read as d(1) alone: servers servers and no load dependence.

TWO DELIBERATE READINGS where the reference indexes by position:

  • servicetime and visit entries are matched to a class by their customerclass attribute, not by position. The reference takes the r-th <visit> for the class named by the r-th <servicetime>, which agrees wherever both lists are in class order and is wrong otherwise.
  • a numeric attribute or body that does not parse (a SPEX variable such as population="$N") is refused by name. The reference's Str2Num leaves it a string and then fails later in arithmetic with no mention of where.

REFERENCE STATION. The reference reads <ReferenceStation> and then ignores it, giving every closed class the FIRST station created; the JAR does the same. This port reproduces that, so system-level metrics agree across the codebases on the same file.

Definition in file jmva_reader.h.