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

The workflow analyzer: detect every pattern, collapse them, report the two complexities and the recommendations that follow. More...

#include <cstddef>
#include <map>
#include <set>
#include <string>
#include <utility>
#include <vector>
#include "line/api/wf/wf_branch_detector.h"
#include "line/api/wf/wf_link_matrix.h"
#include "line/api/wf/wf_loop_detector.h"
#include "line/api/wf/wf_parallel_detector.h"
#include "line/api/wf/wf_pattern_updater.h"
#include "line/api/wf/wf_sequence_detector.h"
#include "line/lang/distribution.h"
#include "line/lang/lang_types.h"
#include "line/lang/qn/network_struct.h"
#include "line/num/number.h"
#include "line/util/error.h"
#include "line/util/matrix.h"
Include dependency graph for wf_analyzer.h:

Go to the source code of this file.

Classes

struct  line::wf::WorkflowRepresentation< T >
 The workflow in matrix form: the reference's WorkflowRepresentation. More...
struct  line::wf::DetectedPatterns< T >
 Everything the four detectors found. More...
struct  line::wf::WorkflowComplexity< T >
 The reference's complexity map, for either the original or the collapsed graph. More...
struct  line::wf::WorkflowStatistics< T >
 The statistics block of WorkflowAnalysis. More...
struct  line::wf::WorkflowAnalysis< T >
 What analyze_workflow returns. More...

Namespaces

namespace  line
namespace  line::wf

Functions

template<class T>
DetectedPatterns< T > line::wf::detect_all_patterns (const WorkflowRepresentation< T > &w)
 Run the four detectors on one representation.
template<class T>
WorkflowComplexity< T > line::wf::workflow_complexity (const WorkflowRepresentation< T > &w)
 Complexity of the workflow as declared.
template<class T>
WorkflowComplexity< T > line::wf::optimized_complexity (const UpdatedWorkflow< T > &w)
 Complexity of the collapsed workflow.
template<class T>
WorkflowAnalysis< T > line::wf::analyze_workflow (const WorkflowRepresentation< T > &w)
 Detect, collapse, and report.
template<class T>
std::vector< std::string > line::wf::get_optimization_recommendations (const WorkflowAnalysis< T > &a)
 The reference's recommendation strings, in its order.
template<class T>
bool line::wf::validate_analysis (const WorkflowAnalysis< T > &a)
 The collapsed workflow is consistent and every detected pattern validates.
template<class T>
WorkflowRepresentation< T > line::wf::wf_from_struct (const qn::NetworkStruct< T > &sn)
 Build a workflow representation from a NetworkStruct.

Detailed Description

The workflow analyzer: detect every pattern, collapse them, report the two complexities and the recommendations that follow.

Templated port of the native Python line_solver/api/wf/analyzer.py, cross-checked against jar/src/main/java/jline/api/wf/Wf_analyzer.java. There is no MATLAB counterpart; api/wf exists in the JAR and in Python only, and Python is the reference for the same reason it is in wf_pattern_updater.h (the JAR's convolutions are stubs, so its "optimized" workflow carries the first branch's service law).

THE NETWORK CONVERSION IS THE ONE PART THAT CANNOT BE COPIED. Both references walk their own object model – Python asks type(node).__name__ and reads getLinkedRoutingMatrix, the JAR walks jline.lang.Network – and neither shape exists here. wf_from_struct does the same job from a NetworkStruct: the link matrix is the class-aggregated rtnodes above the zero tolerance, and the node classification follows NodeType, Queue and Delay being service, Fork and Join their own kinds, Router and ClassSwitch control. The service laws come from sn.service rather than from Python's placeholder unit exponential, which is strictly more information and changes no structure.

analyze_workflow on a representation the caller built by hand is the entry both references really exercise, and it is byte-for-byte their algorithm.

ARITHMETIC: field, plus whatever the branch entropy needs – the diversity report is gated inside wf_branch_detector.h, not here.

Definition in file wf_analyzer.h.