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

Activities belonging to each branch of an AND-join. More...

#include <cstddef>
#include <vector>
#include "line/num/number.h"
#include "line/util/error.h"
#include "line/util/matrix.h"
Include dependency graph for fj_branch_members.h:

Go to the source code of this file.

Classes

struct  line::fj::LqnBranchView< T >
 The four LayeredNetworkStruct fields fj_branch_members reads. More...

Namespaces

namespace  line
namespace  line::fj

Enumerations

enum  line::fj::ActivityPrecedenceCode {
  line::fj::APC_PRE_SEQ = 1 , line::fj::APC_PRE_AND = 2 , line::fj::APC_PRE_OR = 3 , line::fj::APC_POST_SEQ = 11 ,
  line::fj::APC_POST_AND = 12 , line::fj::APC_POST_OR = 13 , line::fj::APC_POST_LOOP = 14 , line::fj::APC_POST_CACHE = 15
}
 MATLAB's ActivityPrecedenceType codes, as stored in lqn.actposttype. More...

Functions

template<class T>
std::vector< std::vector< std::size_t > > line::fj::fj_branch_members (const LqnBranchView< T > &lqn, std::size_t joinaidx)
 Branch membership of an AND-join.

Detailed Description

Activities belonging to each branch of an AND-join.

Templated port of matlab/src/api/fj/fj_branch_members.m. Each immediate predecessor of the join activity is the tail of one branch; the branch is recovered by walking backwards along the activity graph until an activity marked POST_AND is reached, that one being the head the AND-fork spawned. Branches between a fork and its join are disjoint paths, so the walk is unambiguous, and the guard on the number of steps bounds it by the activity count.

SCOPE. The reference takes a LayeredNetworkStruct, but it reads only four plain numeric fields of it – graph, ashift, nacts, actposttype – and no LayeredNetwork object, no cell array of processes and no derived index map. Those four are taken here as explicit arguments, in a small view struct, so the algorithm is ported in full without pulling the LQN object layer into this tree. Nothing is stubbed: the walk, the activity-range test, the merge/start stop condition and the guard are all as written.

INDEXING. The reference is 1-based and its indices are absolute LQN element indices, activities occupying (ashift, ashift + nacts]. The port keeps that convention exactly, so an index that appears in the result can be compared against a MATLAB one without a shift: joinIdx, ashift and every returned index are 1-based absolute indices.

ARITHMETIC. Only the test graph(i, j) > 0 touches the number type, so this is a structural algorithm and is instantiated at T = Rational as well.

Definition in file fj_branch_members.h.