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

Fluid analysis of a stochastic Petri net: one simultaneous algebraic solve per active set. More...

#include <algorithm>
#include <cmath>
#include <cstddef>
#include <limits>
#include <map>
#include <set>
#include <string>
#include <vector>
#include "line/solvers/fluid/fluid_moments.h"
#include "line/solvers/fluid/fluid_petri_system.h"
#include "line/solvers/fluid/fluid_petri_terms.h"
#include "line/util/error.h"
#include "line/util/linalg.h"
#include "line/util/matrix.h"
#include "line/util/ode.h"
#include "line/util/svd.h"
Include dependency graph for fluid_petri.h:

Go to the source code of this file.

Classes

struct  line::fluid::petri::PetriConservation
 The conserved quantities of a net, as equations. More...
struct  line::fluid::petri::PetriConstraints
 Every finite place capacity as a linear row A x <= b. More...
struct  line::fluid::petri::PetriImmediate
 The active set of the immediate modes and the equations pinning their flows. More...
struct  line::fluid::petri::PetriImmediate::Row
struct  line::fluid::petri::PetriVerdict
 Whether the fluid Petri route can answer this model, and why not. More...
struct  line::fluid::petri::PetriReport
 What the Petri route computes that the station table has no column for. More...
struct  line::fluid::petri::PetriSolution
 Everything solver_fluid_petri returns. More...
struct  line::fluid::petri::PetriOptions
 Tuning of the outer solve. More...

Namespaces

namespace  line
namespace  line::fluid
namespace  line::fluid::petri

Functions

PetriConservation line::fluid::petri::petri_conservation (const PetriTerms &t)
 The conserved quantities, as equations: u'D = 0 implies u'x is constant.
template<class T>
PetriConstraints line::fluid::petri::petri_constraints (const qn::NetworkStruct< T > &sn, const PetriTerms &t)
 THE GATE IS A LOSS ON THE DEPOSIT: LINE loses the tokens a firing would push past a place's capacity, so the fluid analogue scales the DEPOSIT leg of every event adding mass to the capped place and leaves the removal leg alone.
void line::fluid::petri::petri_immediate (const PetriTerms &t, const std::vector< double > &x, PetriImmediate &imm)
 An immediate transition has no rate: its fluid limit is a FLOW, an algebraic unknown pinned by the constraint that its binding input place holds no mass,.
template<class T>
PetriVerdict line::fluid::petri::petri_applicable (const qn::NetworkStruct< T > &sn)
 A QUEUEING STATION IS THE ONE STRUCTURAL EXCLUSION: a net whose tokens also visit a Queue or a Delay is two formalisms at once, and LINE has no reference semantics for the hand-off.
template<class T>
PetriSolution line::fluid::petri::solver_fluid_petri (const qn::NetworkStruct< T > &sn, const PetriOptions &opt=PetriOptions())
 Fluid analysis of a stochastic Petri net.

Detailed Description

Fluid analysis of a stochastic Petri net: one simultaneous algebraic solve per active set.

Port of matlab/src/solvers/FLD/solver_fluid_petri.m, together with fluid_petri_conservation.m, fluid_petri_constraints.m, fluid_petri_immediate.m and fluid_petri_applicable.m. Cross-checked against jar/src/main/java/jline/solvers/fluid/petri/PetriSolver.java and the python solver_fld/methods/petri.py.

A net's fluid limit is NOT the queueing drift with places in place of stations. Its immediate transitions have no rate at all: their limit is a FLOW, an algebraic unknown pinned by the constraint that the input place they bind holds no mass. The marking, the diffusion covariance, those flows, the multi-server phase latches and the capacity gates therefore solve SIMULTANEOUSLY, as one algebraic system per active set, rather than by integrating an ODE to its fixed point.

THE ACTIVE SET IS WHAT ITERATES. A pass solves the system for a fixed choice of which immediate modes fire, which coordinate each pins, and which capacities bind; the answer says whether that choice was right (a negative flow, a negative marking, a violated or a released capacity), and the next pass makes ONE move. The moves are ordered so that a failure of each invalidates the next.

Definition in file fluid_petri.h.