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

The Petri-net layer of the native LDES engine: Places and Transitions. More...

#include <algorithm>
#include <cstddef>
#include <functional>
#include <limits>
#include <vector>
#include "line/lang/lang_types.h"
Include dependency graph for ldes_spn.h:

Go to the source code of this file.

Classes

struct  line::ldes::engine::SpnMode
 One mode of a transition, resolved to what the event loop needs. More...
struct  line::ldes::engine::SpnTransition
 One Transition node. More...

Namespaces

namespace  line
namespace  line::ldes
namespace  line::ldes::engine

Functions

bool line::ldes::engine::spn_enabled (const SpnMode &m, const std::vector< double > &tok)
 True when m is enabled by the marking tok, which is indexed the same way as the mode's own vectors – (place slot, class), flattened.
double line::ldes::engine::spn_rate (const SpnMode &m, const std::vector< double > &tok)
 The rate of a timed mode under the current marking.
void line::ldes::engine::spn_fire (const SpnMode &m, std::vector< double > &tok)
 Move the tokens of one firing: consume the enabling counts, deposit the firing ones.
int line::ldes::engine::spn_pick_immediate (const std::vector< SpnMode > &modes, const std::vector< double > &tok, double u)
 Pick among the enabled IMMEDIATE modes: the highest priority first (lowest value), then weighted at random among the ties.

Detailed Description

The Petri-net layer of the native LDES engine: Places and Transitions.

A PLACE holds tokens per class and a TRANSITION moves them. A mode of a transition is ENABLED when every input place holds at least its enabling count and no inhibiting count is met; firing consumes the enabling tokens and deposits the firing counts.

IMMEDIATE MODES FIRE BEFORE ANY TIMED ONE, and among themselves in priority order, weighted at equal priority. That is not an optimization: an immediate transition takes zero time, so a marking that enables one is not a marking the net ever rests in, and letting a timed mode fire from it would visit a state the model does not have.

THE FIRING RATE MAY DEPEND ON THE MARKING. firingdep multiplies the mode's nominal rate by g(marking), and the clock has to be RESAMPLED whenever the marking changes, not merely scaled: an exponential clock drawn under one rate and left to run carries the old rate into the new marking.

Definition in file ldes_spn.h.