LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
line::wf Namespace Reference

Classes

struct  BenchmarkRow
 One row of the benchmark table. More...
struct  BranchAlternative
 One alternative of a branch: the node and its probability. More...
struct  BranchDiversity
 Mirrors the Java calculateBranchDiversity map. More...
struct  BranchPattern
 Mirrors the Java BranchPattern. More...
struct  BranchStats
 Mirrors the Java getBranchStats map. More...
struct  ComplexityReport
 The complexity report, one band per pattern family plus the overall score. More...
struct  DetectedPatterns
 Everything the four detectors found. More...
struct  ExpectedIterations
 1/(1-p), with the p >= 1 divergence reported rather than encoded. More...
struct  ExtendedSolverRecommendation
 What the recommendation returns: the choice and why. More...
struct  LoopStats
 Mirrors the Java getLoopStats map. More...
struct  OptimizationInsights
 The advisory text the reference's getOptimizationInsights assembles. More...
struct  ParallelStats
 Mirrors the Java getParallelStats map. More...
struct  PatternComplexityEntry
 Per-pattern-family complexity, one entry of the report's patternComplexity. More...
struct  SequenceStats
 Mirrors the Java getSequenceStats map. More...
struct  ServiceParameters
 A phase-type-shaped service law: entry vector and transient generator. More...
struct  UpdatedWorkflow
 The collapsed link matrix and the service law of every surviving node. More...
struct  UpdateStats
 Statistics of one update pass; the Java getUpdateStats map. More...
struct  WfModelFacts
 The four model facts the base recommendation reads, i.e. More...
struct  WorkflowAnalysis
 What analyze_workflow returns. More...
struct  WorkflowAnalysisResult
 Everything analyze_workflow_full returns, i.e. More...
struct  WorkflowComplexity
 The reference's complexity map, for either the original or the collapsed graph. More...
struct  WorkflowFeatures
 The flat feature vector the recommendation reads. More...
struct  WorkflowPerformanceMetrics
 The four efficiency scores plus the two headline numbers. More...
struct  WorkflowRepresentation
 The workflow in matrix form: the reference's WorkflowRepresentation. More...
struct  WorkflowStatistics
 The statistics block of WorkflowAnalysis. More...
struct  WorkflowValidation
 What validate_workflow reports. More...

Enumerations

enum class  WfSolver {
  MVA = 0 , NC , SSA , FLUID ,
  JMT , CTMC , AUTO
}
 The solvers the reference chooses among. More...
enum class  WfExportFormat { Json = 0 , Csv , Summary }
 The export formats the facade offers. More...

Functions

template<class T>
DetectedPatterns< T > detect_all_patterns (const WorkflowRepresentation< T > &w)
 Run the four detectors on one representation.
template<class T>
WorkflowComplexity< T > workflow_complexity (const WorkflowRepresentation< T > &w)
 Complexity of the workflow as declared.
template<class T>
WorkflowComplexity< T > optimized_complexity (const UpdatedWorkflow< T > &w)
 Complexity of the collapsed workflow.
template<class T>
WorkflowAnalysis< T > analyze_workflow (const WorkflowRepresentation< T > &w)
 Detect, collapse, and report.
template<class T>
std::vector< std::string > get_optimization_recommendations (const WorkflowAnalysis< T > &a)
 The reference's recommendation strings, in its order.
template<class T>
bool validate_analysis (const WorkflowAnalysis< T > &a)
 The collapsed workflow is consistent and every detected pattern validates.
template<class T>
WorkflowRepresentation< T > wf_from_struct (const qn::NetworkStruct< T > &sn)
 Build a workflow representation from a NetworkStruct.
std::string wf_solver_name (WfSolver s)
 The reference's own spelling of each choice.
template<class T>
WfModelFacts< T > wf_model_facts (const qn::NetworkStruct< T > &sn)
 Read the base facts off a NetworkStruct.
template<class T>
WfSolver wf_base_recommendation (const WfModelFacts< T > &f)
 The AUTO heuristic before the workflow features amend it.
template<class T>
WorkflowFeatures< T > extract_workflow_features (const WorkflowAnalysis< T > &a)
 Flatten the analysis into the feature vector the heuristic reads.
template<class T>
ExtendedSolverRecommendation< T > enhance_recommendation_with_workflow (WfSolver base, const WorkflowFeatures< T > &f, const WorkflowAnalysis< T > &a)
 Amend the base recommendation with what the workflow analysis found.
template<class T>
ExtendedSolverRecommendation< T > recommend_solver_with_workflow_analysis (const qn::NetworkStruct< T > &sn)
 The entry point: analyse the workflow, then let it amend the base choice.
template<class T>
WfSolver create_optimal_solver (const qn::NetworkStruct< T > &sn)
 The chosen solver alone, i.e.
template<class T>
std::vector< std::string > generate_pattern_insights (const DetectedPatterns< T > &p)
 Pattern-level advice; the strings are the reference's, verbatim.
template<class T>
std::vector< std::string > generate_performance_predictions (const WorkflowAnalysis< T > &a)
 Solve-time advice keyed off the collapse ratio and the pattern mix.
template<class T>
OptimizationInsights get_optimization_insights (const qn::NetworkStruct< T > &sn)
 All three advisory blocks for one model.
template<class T>
bool validate_workflow_enhancement (const qn::NetworkStruct< T > &sn)
 The reference's self-check: a usable recommendation over a valid analysis.
template<class T>
std::vector< BranchPattern< T > > detect_branches (const Matrix< T > &linkMatrix, const std::vector< int > &serviceNodes, const std::vector< int > &joinNodes)
template<class T>
bool validate_branch_pattern (const BranchPattern< T > &pattern, const Matrix< T > &linkMatrix)
 Probabilities sum to one within 1e-2 and every alternative is a fork successor.
template<class T>
BranchDiversity< T > calculate_branch_diversity (const BranchPattern< T > &pattern)
 Shannon entropy of the branch probabilities, the same entropy normalized by log(n), the Gini coefficient of the probability vector, and the reciprocal of the largest probability.
template<class T>
BranchStats< T > get_branch_stats (const std::vector< BranchPattern< T > > &patterns)
 Count, total, mean/max/min alternatives, and the mean entropy and balance.
template<class T>
BranchAlternative< T > find_most_probable_branch (const BranchPattern< T > &pattern)
 The alternative with the largest probability.
template<class T>
BranchAlternative< T > find_least_probable_branch (const BranchPattern< T > &pattern)
 The alternative with the smallest probability.
template<class T>
std::vector< int > detect_loops (const Matrix< T > &linkMatrix, const std::vector< int > &serviceNodes, const std::vector< int > &routerNodes, const std::vector< int > &joinNodes=std::vector< int >())
template<class T>
get_loop_probability (int serviceNode, const Matrix< T > &linkMatrix, const std::vector< int > &routerNodes)
 Probability on the router-to-service edge that closes the loop, 0 when the node is not on a simple loop.
template<class T>
bool validate_loop_pattern (int loopNode, const Matrix< T > &linkMatrix, const std::vector< int > &routerNodes)
 True when the node still has the service -> router -> service structure.
template<class T>
ExpectedIterations< T > get_expected_loop_iterations (const T &loopProbability)
 Mean number of visits of a geometric loop, 1/(1-p).
template<class T>
LoopStats< T > get_loop_stats (const std::vector< int > &loopNodes, const Matrix< T > &linkMatrix, const std::vector< int > &routerNodes)
 Count and moments of the loop probabilities and iteration counts.
template<class T>
std::vector< std::vector< int > > detect_parallel (const Matrix< T > &linkMatrix, const std::vector< int > &serviceNodes, const std::vector< int > &forkNodes, const std::vector< int > &joinNodes)
template<class T>
bool validate_parallel_pattern (const std::vector< int > &pattern, const Matrix< T > &linkMatrix, const std::vector< int > &forkNodes, const std::vector< int > &joinNodes)
 A pattern is valid when its nodes have exactly one common fork predecessor and exactly one common join successor.
template<class T>
ParallelStats< T > get_parallel_stats (const std::vector< std::vector< int > > &patterns)
 Count, total, mean and maximum degree of parallelism.
template<class T>
ServiceParameters< T > convolve_sequence (const std::vector< ServiceParameters< T > > &params)
 Convolution of the durations, i.e.
template<class T>
ServiceParameters< T > convolve_parallel (const std::vector< ServiceParameters< T > > &params)
 Maximum of the durations, i.e.
template<class T>
ServiceParameters< T > convolve_loop (const ServiceParameters< T > &params, const T &loopProb)
 Geometric repetition: the exit flow re-enters through alpha with probability loopProb.
template<class T>
ServiceParameters< T > convolve_branches (const std::vector< ServiceParameters< T > > &params, const std::vector< T > &probsIn)
 Probabilistic choice among the alternatives, on a block-diagonal generator.
template<class T>
bool find_fork_join_for_parallel (const Matrix< T > &, const std::vector< int > &, int *, int *)
 The fork and join bracketing a parallel pattern.
template<class T>
UpdatedWorkflow< T > update_patterns (const Matrix< T > &linkMatrix, const std::vector< int > &serviceNodes, const std::vector< int > &forkNodes, const std::vector< int > &joinNodes, const std::vector< int > &routerNodes, const std::map< int, ServiceParameters< T > > &serviceParams)
 Collapse the four pattern families in the reference's order: sequences, parallels, loops, branches.
template<class T>
bool validate_updated_workflow (const UpdatedWorkflow< T > &w)
 Every node the collapsed matrix still references carries a service law.
template<class T>
UpdateStats< T > get_update_stats (const Matrix< T > &originalMatrix, const UpdatedWorkflow< T > &w)
 How much the collapse shrank the link matrix.
template<class T>
std::vector< std::vector< int > > detect_sequences (const Matrix< T > &linkMatrix, const std::vector< int > &serviceNodes)
template<class T>
bool validate_sequence (const std::vector< int > &sequence, const Matrix< T > &linkMatrix)
 Every consecutive pair of the chain must be an edge of the workflow.
template<class T>
SequenceStats< T > get_sequence_stats (const std::vector< std::vector< int > > &sequences)
 Count, total, mean, maximum and minimum chain length.
double calculate_sequence_efficiency (const std::vector< std::vector< int > > &sequences)
 avg sequence length capped at 5, the reference's saturation point.
double calculate_parallel_efficiency (const std::vector< std::vector< int > > &parallels)
 Efficiency falls linearly past two-way parallelism, floored at 0.1.
double calculate_loop_efficiency (const std::vector< int > &loops)
 The reference's placeholder: any loop at all costs half the efficiency.
template<class T>
double calculate_branch_efficiency (const std::vector< BranchPattern< T > > &branches)
 The mean NORMALIZED entropy over the branches, i.e.
template<class T>
double calculate_complexity_score (std::size_t nodes, std::size_t links, const DetectedPatterns< T > &p)
 The weighted size-plus-pattern score behind the complexity level.
template<class T>
WorkflowPerformanceMetrics calculate_performance_metrics (const WorkflowAnalysis< T > &a, const ExtendedSolverRecommendation< T > &r)
 The six metrics of the analysis result.
template<class T>
WorkflowAnalysisResult< T > analyze_workflow_full (const qn::NetworkStruct< T > &sn)
 The facade's headline call: analysis, recommendation, insights, metrics.
template<class T>
DetectedPatterns< T > get_pattern_analysis (const qn::NetworkStruct< T > &sn)
 The patterns alone.
template<class T>
std::vector< std::string > get_workflow_recommendations (const qn::NetworkStruct< T > &sn)
 The recommendation strings alone.
template<class T>
ComplexityReport< T > generate_complexity_report (const qn::NetworkStruct< T > &sn)
 The complexity report, with the reference's four bands on the score.
template<class T>
std::vector< std::pair< WfSolver, BenchmarkRow > > benchmark_solvers (const std::vector< WfSolver > &solvers, const std::function< Matrix< T >(WfSolver)> &runner)
 Time each solver and aggregate its queue lengths.
std::vector< WfSolverdefault_benchmark_solvers ()
 The reference's default benchmark set.
template<class T>
WorkflowValidation validate_workflow (const qn::NetworkStruct< T > &sn)
 The model is well formed and both analyses validate.
template<class T>
std::string export_analysis (const WorkflowAnalysisResult< T > &a, WfExportFormat format=WfExportFormat::Summary)
 Render the analysis.
template<class T>
std::string quick_analysis (const qn::NetworkStruct< T > &sn)
 The reference's one-call summary.
template<class T>
WfSolver get_optimal_solver (const qn::NetworkStruct< T > &sn)
 The chosen solver without the rest of the report.

Enumeration Type Documentation

◆ WfExportFormat

enum class line::wf::WfExportFormat
strong

The export formats the facade offers.

Enumerator
Json 
Csv 
Summary 

Definition at line 125 of file workflow_manager.h.

◆ WfSolver

enum class line::wf::WfSolver
strong

The solvers the reference chooses among.

Enumerator
MVA 
NC 
SSA 
FLUID 
JMT 
CTMC 
AUTO 

Definition at line 63 of file wf_auto_integration.h.

Function Documentation

◆ analyze_workflow()

◆ analyze_workflow_full()

◆ benchmark_solvers()

template<class T>
std::vector< std::pair< WfSolver, BenchmarkRow > > line::wf::benchmark_solvers ( const std::vector< WfSolver > & solvers,
const std::function< Matrix< T >(WfSolver)> & runner )

Time each solver and aggregate its queue lengths.

Parameters
solversthe solvers to try, in order
runnerruns one solver and returns its QN; it may throw, and a throw becomes a failed row exactly as the Java's catch does

Definition at line 284 of file workflow_manager.h.

References benchmark_solvers().

Referenced by benchmark_solvers().

◆ calculate_branch_diversity()

template<class T>
BranchDiversity< T > line::wf::calculate_branch_diversity ( const BranchPattern< T > & pattern)

◆ calculate_branch_efficiency()

template<class T>
double line::wf::calculate_branch_efficiency ( const std::vector< BranchPattern< T > > & branches)

The mean NORMALIZED entropy over the branches, i.e.

how evenly they split.

Definition at line 176 of file workflow_manager.h.

References calculate_branch_diversity(), and calculate_branch_efficiency().

Referenced by calculate_branch_efficiency(), and calculate_performance_metrics().

◆ calculate_complexity_score()

template<class T>
double line::wf::calculate_complexity_score ( std::size_t nodes,
std::size_t links,
const DetectedPatterns< T > & p )

◆ calculate_loop_efficiency()

double line::wf::calculate_loop_efficiency ( const std::vector< int > & loops)
inline

The reference's placeholder: any loop at all costs half the efficiency.

It assumes a loop probability of 0.5 and never reads the link matrix, which its own comment calls "Simplified". Ported as written – a caller comparing the two codebases compares this number.

Definition at line 169 of file workflow_manager.h.

References calculate_loop_efficiency().

Referenced by calculate_loop_efficiency(), and calculate_performance_metrics().

◆ calculate_parallel_efficiency()

double line::wf::calculate_parallel_efficiency ( const std::vector< std::vector< int > > & parallels)
inline

Efficiency falls linearly past two-way parallelism, floored at 0.1.

Definition at line 154 of file workflow_manager.h.

References calculate_parallel_efficiency().

Referenced by calculate_parallel_efficiency(), and calculate_performance_metrics().

◆ calculate_performance_metrics()

◆ calculate_sequence_efficiency()

double line::wf::calculate_sequence_efficiency ( const std::vector< std::vector< int > > & sequences)
inline

avg sequence length capped at 5, the reference's saturation point.

Definition at line 145 of file workflow_manager.h.

References calculate_sequence_efficiency().

Referenced by calculate_performance_metrics(), and calculate_sequence_efficiency().

◆ convolve_branches()

template<class T>
ServiceParameters< T > line::wf::convolve_branches ( const std::vector< ServiceParameters< T > > & params,
const std::vector< T > & probsIn )

Probabilistic choice among the alternatives, on a block-diagonal generator.

Definition at line 274 of file wf_pattern_updater.h.

References line::wf::ServiceParameters< T >::alpha, convolve_branches(), line::Matrix< T >::Matrix(), and line::wf::ServiceParameters< T >::T_.

Referenced by convolve_branches(), and update_patterns().

◆ convolve_loop()

template<class T>
ServiceParameters< T > line::wf::convolve_loop ( const ServiceParameters< T > & params,
const T & loopProb )

Geometric repetition: the exit flow re-enters through alpha with probability loopProb.

Outside (0,1) the law is returned unchanged, as in the reference.

Definition at line 261 of file wf_pattern_updater.h.

References convolve_loop(), and line::wf::ServiceParameters< T >::T_.

Referenced by convolve_loop(), and update_patterns().

◆ convolve_parallel()

template<class T>
ServiceParameters< T > line::wf::convolve_parallel ( const std::vector< ServiceParameters< T > > & params)

Maximum of the durations, i.e.

a fork whose join waits for every branch.

Definition at line 214 of file wf_pattern_updater.h.

References line::wf::ServiceParameters< T >::alpha, convolve_parallel(), and line::wf::ServiceParameters< T >::T_.

Referenced by convolve_parallel(), and update_patterns().

◆ convolve_sequence()

template<class T>
ServiceParameters< T > line::wf::convolve_sequence ( const std::vector< ServiceParameters< T > > & params)

Convolution of the durations, i.e.

the service laws run one after another.

Definition at line 183 of file wf_pattern_updater.h.

References line::wf::ServiceParameters< T >::alpha, convolve_sequence(), and line::wf::ServiceParameters< T >::T_.

Referenced by convolve_sequence(), and update_patterns().

◆ create_optimal_solver()

template<class T>
WfSolver line::wf::create_optimal_solver ( const qn::NetworkStruct< T > & sn)

The chosen solver alone, i.e.

the reference's createOptimalSolver.

Definition at line 337 of file wf_auto_integration.h.

References create_optimal_solver(), and recommend_solver_with_workflow_analysis().

Referenced by create_optimal_solver(), and get_optimal_solver().

◆ default_benchmark_solvers()

std::vector< WfSolver > line::wf::default_benchmark_solvers ( )
inline

The reference's default benchmark set.

Definition at line 317 of file workflow_manager.h.

References default_benchmark_solvers(), FLUID, MVA, NC, and SSA.

Referenced by default_benchmark_solvers().

◆ detect_all_patterns()

◆ detect_branches()

template<class T>
std::vector< BranchPattern< T > > line::wf::detect_branches ( const Matrix< T > & linkMatrix,
const std::vector< int > & serviceNodes,
const std::vector< int > & joinNodes )

◆ detect_loops()

template<class T>
std::vector< int > line::wf::detect_loops ( const Matrix< T > & linkMatrix,
const std::vector< int > & serviceNodes,
const std::vector< int > & routerNodes,
const std::vector< int > & joinNodes = std::vector<int>() )
Parameters
linkMatrix(nedges x 3) edge list
serviceNodesids of the service nodes
routerNodesids of the router nodes
joinNodesids of the join nodes; empty disables the SCC search, matching the two-argument Java overload
Returns
the service nodes that sit on a loop, in detection order, distinct

Definition at line 142 of file wf_loop_detector.h.

References detect_loops(), and line::Matrix< T >::rows().

Referenced by detect_all_patterns(), detect_loops(), and update_patterns().

◆ detect_parallel()

template<class T>
std::vector< std::vector< int > > line::wf::detect_parallel ( const Matrix< T > & linkMatrix,
const std::vector< int > & serviceNodes,
const std::vector< int > & forkNodes,
const std::vector< int > & joinNodes )
Parameters
linkMatrix(nedges x 3) edge list
serviceNodesids of the service nodes
forkNodesids of the fork nodes
joinNodesids of the join nodes
Returns
one list of parallel service nodes per detected fork-join pair

Definition at line 149 of file wf_parallel_detector.h.

References detect_parallel().

Referenced by detect_all_patterns(), detect_parallel(), and update_patterns().

◆ detect_sequences()

template<class T>
std::vector< std::vector< int > > line::wf::detect_sequences ( const Matrix< T > & linkMatrix,
const std::vector< int > & serviceNodes )
Parameters
linkMatrix(nedges x 3) edge list
serviceNodesids of the service nodes
Returns
the detected chains, each as an ordered list of node ids

Definition at line 120 of file wf_sequence_detector.h.

References detect_sequences(), and line::Matrix< T >::rows().

Referenced by detect_all_patterns(), detect_sequences(), and update_patterns().

◆ enhance_recommendation_with_workflow()

template<class T>
ExtendedSolverRecommendation< T > line::wf::enhance_recommendation_with_workflow ( WfSolver base,
const WorkflowFeatures< T > & f,
const WorkflowAnalysis< T > & a )

◆ export_analysis()

template<class T>
std::string line::wf::export_analysis ( const WorkflowAnalysisResult< T > & a,
WfExportFormat format = WfExportFormat::Summary )

Render the analysis.

The three layouts are byte-for-byte the reference's, including the header rule, the blank lines and the one-based numbering of the reasoning list: a consumer that parses this text is parsing a contract.

Definition at line 369 of file workflow_manager.h.

References line::wf::DetectedPatterns< T >::branches, Csv, export_analysis(), Json, line::wf::DetectedPatterns< T >::loops, line::wf::DetectedPatterns< T >::parallels, line::wf::WorkflowAnalysisResult< T >::patternAnalysis, line::wf::DetectedPatterns< T >::sequences, line::wf::WorkflowAnalysisResult< T >::solverRecommendation, Summary, and wf_solver_name().

Referenced by export_analysis(), and quick_analysis().

◆ extract_workflow_features()

template<class T>
WorkflowFeatures< T > line::wf::extract_workflow_features ( const WorkflowAnalysis< T > & a)

Flatten the analysis into the feature vector the heuristic reads.

Definition at line 157 of file wf_auto_integration.h.

References line::wf::WorkflowFeatures< T >::avgBranchEntropy, line::wf::WorkflowFeatures< T >::avgBranches, line::wf::WorkflowFeatures< T >::avgLoopProbability, line::wf::WorkflowFeatures< T >::avgParallelism, line::wf::WorkflowFeatures< T >::avgSequenceLength, line::wf::DetectedPatterns< T >::branches, calculate_branch_diversity(), line::wf::WorkflowAnalysis< T >::detectedPatterns, extract_workflow_features(), line::wf::WorkflowFeatures< T >::hasBranchPatterns, line::wf::WorkflowFeatures< T >::hasLoopPatterns, line::wf::WorkflowFeatures< T >::hasParallelPatterns, line::wf::WorkflowFeatures< T >::hasSequencePatterns, line::wf::DetectedPatterns< T >::loops, line::wf::WorkflowFeatures< T >::maxBranches, line::wf::WorkflowFeatures< T >::maxLoopProbability, line::wf::WorkflowFeatures< T >::maxParallelism, line::wf::WorkflowFeatures< T >::maxSequenceLength, line::wf::WorkflowFeatures< T >::numBranches, line::wf::WorkflowFeatures< T >::numLoops, line::wf::WorkflowFeatures< T >::numParallels, line::wf::WorkflowFeatures< T >::numSequences, line::wf::WorkflowFeatures< T >::optimizedLinkCount, line::wf::WorkflowFeatures< T >::optimizedNodeCount, line::wf::WorkflowFeatures< T >::originalLinkCount, line::wf::WorkflowFeatures< T >::originalNodeCount, line::wf::DetectedPatterns< T >::parallels, line::wf::DetectedPatterns< T >::sequences, and line::wf::WorkflowAnalysis< T >::statistics.

Referenced by extract_workflow_features(), and recommend_solver_with_workflow_analysis().

◆ find_fork_join_for_parallel()

template<class T>
bool line::wf::find_fork_join_for_parallel ( const Matrix< T > & ,
const std::vector< int > & ,
int * ,
int *  )

The fork and join bracketing a parallel pattern.

BOTH references return "none" unconditionally, so the parallel arm of update_patterns never fires. Reproduced deliberately; see the header note.

Definition at line 315 of file wf_pattern_updater.h.

References find_fork_join_for_parallel().

Referenced by find_fork_join_for_parallel(), and update_patterns().

◆ find_least_probable_branch()

◆ find_most_probable_branch()

◆ generate_complexity_report()

◆ generate_pattern_insights()

template<class T>
std::vector< std::string > line::wf::generate_pattern_insights ( const DetectedPatterns< T > & p)

◆ generate_performance_predictions()

template<class T>
std::vector< std::string > line::wf::generate_performance_predictions ( const WorkflowAnalysis< T > & a)

Solve-time advice keyed off the collapse ratio and the pattern mix.

Definition at line 370 of file wf_auto_integration.h.

References line::wf::WorkflowAnalysis< T >::detectedPatterns, generate_performance_predictions(), and line::wf::WorkflowAnalysis< T >::statistics.

Referenced by generate_performance_predictions(), and get_optimization_insights().

◆ get_branch_stats()

◆ get_expected_loop_iterations()

template<class T>
ExpectedIterations< T > line::wf::get_expected_loop_iterations ( const T & loopProbability)

Mean number of visits of a geometric loop, 1/(1-p).

Definition at line 219 of file wf_loop_detector.h.

References get_expected_loop_iterations(), line::wf::ExpectedIterations< T >::infinite, and line::wf::ExpectedIterations< T >::value.

Referenced by get_expected_loop_iterations(), and get_loop_stats().

◆ get_loop_probability()

template<class T>
T line::wf::get_loop_probability ( int serviceNode,
const Matrix< T > & linkMatrix,
const std::vector< int > & routerNodes )

Probability on the router-to-service edge that closes the loop, 0 when the node is not on a simple loop.

Definition at line 192 of file wf_loop_detector.h.

References get_loop_probability(), and line::Matrix< T >::rows().

Referenced by get_loop_probability(), get_loop_stats(), and update_patterns().

◆ get_loop_stats()

◆ get_optimal_solver()

template<class T>
WfSolver line::wf::get_optimal_solver ( const qn::NetworkStruct< T > & sn)

The chosen solver without the rest of the report.

Definition at line 417 of file workflow_manager.h.

References create_optimal_solver(), and get_optimal_solver().

Referenced by get_optimal_solver().

◆ get_optimization_insights()

◆ get_optimization_recommendations()

template<class T>
std::vector< std::string > line::wf::get_optimization_recommendations ( const WorkflowAnalysis< T > & a)

The reference's recommendation strings, in its order.

They are user-facing text, so they are reproduced verbatim rather than paraphrased: a caller that greps them would otherwise see different output from the same analysis in two codebases.

Definition at line 206 of file wf_analyzer.h.

References line::wf::DetectedPatterns< T >::branches, calculate_branch_diversity(), line::wf::WorkflowAnalysis< T >::detectedPatterns, get_optimization_recommendations(), line::wf::DetectedPatterns< T >::loops, line::wf::DetectedPatterns< T >::parallels, line::wf::DetectedPatterns< T >::sequences, and line::wf::WorkflowAnalysis< T >::statistics.

Referenced by get_optimization_insights(), get_optimization_recommendations(), and get_workflow_recommendations().

◆ get_parallel_stats()

template<class T>
ParallelStats< T > line::wf::get_parallel_stats ( const std::vector< std::vector< int > > & patterns)

◆ get_pattern_analysis()

template<class T>
DetectedPatterns< T > line::wf::get_pattern_analysis ( const qn::NetworkStruct< T > & sn)

The patterns alone.

Definition at line 229 of file workflow_manager.h.

References analyze_workflow(), get_pattern_analysis(), and wf_from_struct().

Referenced by get_pattern_analysis().

◆ get_sequence_stats()

template<class T>
SequenceStats< T > line::wf::get_sequence_stats ( const std::vector< std::vector< int > > & sequences)

◆ get_update_stats()

◆ get_workflow_recommendations()

template<class T>
std::vector< std::string > line::wf::get_workflow_recommendations ( const qn::NetworkStruct< T > & sn)

The recommendation strings alone.

Definition at line 235 of file workflow_manager.h.

References analyze_workflow(), get_optimization_recommendations(), get_workflow_recommendations(), and wf_from_struct().

Referenced by get_workflow_recommendations().

◆ optimized_complexity()

template<class T>
WorkflowComplexity< T > line::wf::optimized_complexity ( const UpdatedWorkflow< T > & w)

Complexity of the collapsed workflow.

The reference reports only three of the six fields here, so the rest stay at their defaults rather than being invented: after the collapse there is no service/control split left to report, the node kinds having been merged.

Definition at line 169 of file wf_analyzer.h.

References line::wf::WorkflowComplexity< T >::connectedNodes, line::wf::UpdatedWorkflow< T >::linkMatrix, optimized_complexity(), line::wf::UpdatedWorkflow< T >::serviceParameters, line::wf::WorkflowComplexity< T >::totalLinks, and line::wf::WorkflowComplexity< T >::totalNodes.

Referenced by analyze_workflow(), and optimized_complexity().

◆ quick_analysis()

template<class T>
std::string line::wf::quick_analysis ( const qn::NetworkStruct< T > & sn)

The reference's one-call summary.

Definition at line 411 of file workflow_manager.h.

References analyze_workflow_full(), export_analysis(), quick_analysis(), and Summary.

Referenced by quick_analysis().

◆ recommend_solver_with_workflow_analysis()

template<class T>
ExtendedSolverRecommendation< T > line::wf::recommend_solver_with_workflow_analysis ( const qn::NetworkStruct< T > & sn)

◆ update_patterns()

template<class T>
UpdatedWorkflow< T > line::wf::update_patterns ( const Matrix< T > & linkMatrix,
const std::vector< int > & serviceNodes,
const std::vector< int > & forkNodes,
const std::vector< int > & joinNodes,
const std::vector< int > & routerNodes,
const std::map< int, ServiceParameters< T > > & serviceParams )

◆ validate_analysis()

◆ validate_branch_pattern()

template<class T>
bool line::wf::validate_branch_pattern ( const BranchPattern< T > & pattern,
const Matrix< T > & linkMatrix )

Probabilities sum to one within 1e-2 and every alternative is a fork successor.

Definition at line 194 of file wf_branch_detector.h.

References line::wf::BranchPattern< T >::branchNodes, line::wf::BranchPattern< T >::forkNode, line::num_abs(), line::wf::BranchPattern< T >::probabilities, and validate_branch_pattern().

Referenced by validate_analysis(), and validate_branch_pattern().

◆ validate_loop_pattern()

template<class T>
bool line::wf::validate_loop_pattern ( int loopNode,
const Matrix< T > & linkMatrix,
const std::vector< int > & routerNodes )

True when the node still has the service -> router -> service structure.

Definition at line 210 of file wf_loop_detector.h.

References validate_loop_pattern().

Referenced by validate_analysis(), and validate_loop_pattern().

◆ validate_parallel_pattern()

template<class T>
bool line::wf::validate_parallel_pattern ( const std::vector< int > & pattern,
const Matrix< T > & linkMatrix,
const std::vector< int > & forkNodes,
const std::vector< int > & joinNodes )

A pattern is valid when its nodes have exactly one common fork predecessor and exactly one common join successor.

Definition at line 182 of file wf_parallel_detector.h.

References line::Matrix< T >::rows(), and validate_parallel_pattern().

Referenced by validate_analysis(), and validate_parallel_pattern().

◆ validate_sequence()

template<class T>
bool line::wf::validate_sequence ( const std::vector< int > & sequence,
const Matrix< T > & linkMatrix )

Every consecutive pair of the chain must be an edge of the workflow.

Definition at line 155 of file wf_sequence_detector.h.

References line::Matrix< T >::rows(), and validate_sequence().

Referenced by validate_analysis(), and validate_sequence().

◆ validate_updated_workflow()

template<class T>
bool line::wf::validate_updated_workflow ( const UpdatedWorkflow< T > & w)

Every node the collapsed matrix still references carries a service law.

The two references test OPPOSITE implications: Python asks that every referenced node have a law (ported here), the JAR that every law belong to a referenced node. Python's is the one that catches the failure mode the collapse can actually produce – a node left in the matrix whose law was erased with its pattern.

Definition at line 457 of file wf_pattern_updater.h.

References line::wf::UpdatedWorkflow< T >::linkMatrix, line::wf::UpdatedWorkflow< T >::serviceParameters, and validate_updated_workflow().

Referenced by validate_analysis(), and validate_updated_workflow().

◆ validate_workflow()

◆ validate_workflow_enhancement()

template<class T>
bool line::wf::validate_workflow_enhancement ( const qn::NetworkStruct< T > & sn)

The reference's self-check: a usable recommendation over a valid analysis.

The Java swallows every exception and returns false; here the analysis is total over a well-formed struct, so a throw is a defect and is left to propagate rather than being reported as a failed validation.

Definition at line 402 of file wf_auto_integration.h.

References analyze_workflow(), line::wf::ExtendedSolverRecommendation< T >::confidence, line::wf::ExtendedSolverRecommendation< T >::reasoning, recommend_solver_with_workflow_analysis(), validate_analysis(), validate_workflow_enhancement(), and wf_from_struct().

Referenced by validate_workflow(), and validate_workflow_enhancement().

◆ wf_base_recommendation()

◆ wf_from_struct()

◆ wf_model_facts()

template<class T>
WfModelFacts< T > line::wf::wf_model_facts ( const qn::NetworkStruct< T > & sn)

Read the base facts off a NetworkStruct.

The job total SKIPS the infinite entries, which is how the Java avoids (int) Double.POSITIVE_INFINITY becoming MAX_VALUE and swamping the count: an open class contributes nothing to a population-based threshold.

Definition at line 132 of file wf_auto_integration.h.

References line::wf::WfModelFacts< T >::avgJobsPerChain, line::wf::WfModelFacts< T >::hasMultiChain, line::wf::WfModelFacts< T >::hasProductForm, line::wf::WfModelFacts< T >::hasSingleChain, line::wf::WfModelFacts< T >::totalJobs, and wf_model_facts().

Referenced by recommend_solver_with_workflow_analysis(), and wf_model_facts().

◆ wf_solver_name()

std::string line::wf::wf_solver_name ( WfSolver s)
inline

The reference's own spelling of each choice.

Definition at line 66 of file wf_auto_integration.h.

References CTMC, FLUID, JMT, MVA, NC, SSA, and wf_solver_name().

Referenced by export_analysis(), and wf_solver_name().

◆ workflow_complexity()