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

Build a layered queueing network in code, as the MATLAB constructors do. More...

#include <string>
#include <vector>
#include "line/lang/lqn/lqn_reader.h"
#include "line/util/error.h"
Include dependency graph for lqn_builder.h:

Go to the source code of this file.

Classes

class  line::lqn::LqnBuilder< T >

Namespaces

namespace  line
namespace  line::lqn

Detailed Description

Build a layered queueing network in code, as the MATLAB constructors do.

Port of the Processor / Task / Entry / Activity / ActivityPrecedence API in matlab/src/lang/layered/, feeding the same lqn_finalize (getStruct) that the .lqnx reader feeds.

WHY THIS EXISTS rather than always going through a file. The .lqnx interchange is LOSSY for models a script can express. The clearest case is a think time on a non-reference task: writeXML omits it because lqns rejects the attribute there (see _kb, "lqnx cannot carry non-ref think time"), so exporting such a model and reading it back silently drops the think time and changes the answer. matlab/examples/basic/layeredModel/lqn_workflows.m is exactly that shape – its T3 has both an infinite-server discipline and a think time of 10 – so it cannot be reached through the file format at all.

ORDER MATTERS, as in the reader: element indices are assigned in declaration order (all processors, then all tasks, then all entries, then all activities), and within a task the activities are ordered by declaration. Declare in the same order as the reference script and the indices agree.

The builder validates references by name and throws on an unknown one; it does not silently create elements, because a typo that creates a second disconnected task is a model that still solves.

Definition in file lqn_builder.h.