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

Post-MMT node visits of a fork-join model. More...

#include <cstddef>
#include <string>
#include <vector>
#include "line/lang/qn/network_struct.h"
#include "line/num/number.h"
#include "line/solvers/mva/fj_mmt.h"
#include "line/util/matrix.h"
Include dependency graph for sn_fj_nodevisits_mmt.h:

Go to the source code of this file.

Namespaces

namespace  line
namespace  line::api

Functions

template<class T>
void line::api::sn_fj_nodevisits_mmt (qn::NetworkStruct< T > &sn)
 Rewrite sn.nodevisits with the MMT correction.

Detailed Description

Post-MMT node visits of a fork-join model.

Port of the fork block of matlab/src/lang/@MNetwork/refreshStruct.m (twins: the sn.fj.any() && !isFJAugmented tail of Network.java:refreshStruct, and network.py:_refresh_fork_join_nodevisits).

WHY THE ROUTING ANSWER IS NOT THE ANSWER. sn_refresh_visits solves one traffic equation per chain, so a job that a Fork splits into siblings is counted once: its blunt fork correction leaves every visited node at 1 and a Join at its in-degree. That is the visit vector of ONE token, not of the work the fork actually releases. The reference recovers the rest from the MMT transformation, whose auxiliary open classes ARE the siblings: for every auxiliary chain the transformed layer grows, the original class's node visits become

V_orig(:,r) <- tasksPerLink * ( V_orig(:,r) + V_aux(:,r) )

with V_aux read off the auxiliary chain and the transformed layer's own Source, Sink and Fork rows zeroed (they carry the auxiliary arrival, not a visit of the original class). On the two-branch closed fork-join this turns (Think,F,Q1,Q2,J) = (1,1,1,1,2) into (1,2,1.5,1.5,3), which is what MATLAB, the JAR and native Python all report.

V_orig ON THE RIGHT IS THE PRE-CORRECTION SNAPSHOT, and the reference is a value-semantics MATLAB struct where that happens for free: it reads sn and writes self.sn. Two forks feeding the same class therefore do not compound – the last auxiliary chain wins, over the same untouched snapshot – so this port keeps the snapshot explicitly rather than accumulating in place.

NOT APPLIED to a struct that came out of fj_tag (isfjaugmented): there the Fork nodes are already resolved into tagged classes, and the reference skips the correction for exactly that reason.

ARITHMETIC: field. One multiplication and one addition per entry.

Definition in file sn_fj_nodevisits_mmt.h.