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

Reader for the LINE model.json interchange (a Workflow model) into a workflow::Workflow<T> built through the programmatic builder. More...

#include <string>
#include <vector>
#include "json.hpp"
#include "line/io/network_reader.h"
#include "line/lang/lang_types.h"
#include "line/lang/workflow/workflow.h"
#include "line/util/error.h"
Include dependency graph for workflow_reader.h:

Go to the source code of this file.

Namespaces

namespace  line
namespace  line::io

Functions

template<class T>
workflow::Workflow< T > line::io::build_workflow_from_json (const detail::json &root)
 Build a workflow::Workflow<T> from a parsed model.json envelope.
template<class T>
workflow::Workflow< T > line::io::read_workflow_json (const std::string &path)
 Read a Workflow model.json off disk.

Detailed Description

Reader for the LINE model.json interchange (a Workflow model) into a workflow::Workflow<T> built through the programmatic builder.

The wire format is the one linemodel_save.m::workflow2json and the Python _workflow_to_json emit: a {format, version, model} envelope whose model.type == "Workflow" carries activities (name plus hostDemand) and precedences (preActs, postActs, preType, postType and the optional preParams / postParams). Activities and precedences are fed to the SAME add_activity / add_precedence the programmatic API uses, so a workflow that reaches C++ this way is indistinguishable from one authored in code.

WHY THIS EXISTS SEPARATELY from network_reader.h: a Workflow is not a queueing network and shares none of its node, class or routing structure. It reduces to ONE phase-type law, so it has no stations to solve. The two readers share only detail::dist_from_json, which is why this header includes network_reader.h rather than duplicating the distribution table.

WHAT IT REFUSES, and by name rather than by silent degradation: a precedence type the wire spells but this port has no composition rule for, an activity whose hostDemand names a family dist_from_json cannot reconstruct, and any unknown key at model / activity / precedence level. The last of these is the same rule network_reader.h states at length: a key carrying model semantics that no branch consumes would otherwise be dropped in silence, and to_ph() would then return a confident law for a different workflow.

The SEMANTIC checks (a loop count that is not a positive scalar, a quorum join, a graph that is not series-parallel) are NOT repeated here. They belong to Workflow::validate() and to_ph(), which every construction path runs, so duplicating them would let the two drift apart.

Definition in file workflow_reader.h.