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

A Workflow Net (WF-net) model for performance analysis. More...

#include <algorithm>
#include <cmath>
#include <cstddef>
#include <cstdio>
#include <deque>
#include <limits>
#include <map>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "line/api/wfn/soundness_report.h"
#include "line/api/wfn/wfn_arc.h"
#include "line/api/wfn/wfn_place.h"
#include "line/api/wfn/wfn_resource.h"
#include "line/api/wfn/wfn_transition.h"
#include "line/io/pnml.h"
#include "line/lang/distributions.h"
#include "line/lang/lang_types.h"
#include "line/lang/workflow/workflow.h"
#include "line/solvers/solver.h"
#include "line/util/error.h"
#include "line/util/expm.h"
#include "line/util/lu.h"
#include "line/util/matrix.h"
Include dependency graph for workflow_net.h:

Go to the source code of this file.

Classes

struct  line::wfn::CycleTimeAnalysis
 The full single-case analysis of get_cycle_time_analysis. More...
struct  line::wfn::CycleTimeAnalysis::Firings
struct  line::wfn::CycleTimeAnalysis::PlaceTime
struct  line::wfn::ResourceLoads
 The table of get_resource_loads. More...
struct  line::wfn::CaseMetrics
 Case-level metrics of get_case_metrics. More...
struct  line::wfn::CaseMetrics::Resources
struct  line::wfn::CaseMetrics::Tasks
 RespT at its station for the fork-join target, InService tokens for the SPN one. More...
struct  line::wfn::CaseMetrics::Places
 Mean tokens per place, SPN target only. More...
class  line::wfn::ElementRef
 A place, a transition, or the name of either, where an argument may be any of them. More...
class  line::wfn::WorkflowNet
struct  line::wfn::WorkflowNet::Compiled::Task
struct  line::wfn::WorkflowNet::Compiled::Res
struct  line::wfn::WorkflowNet::Compiled::Busy

Namespaces

namespace  line
 Conservation laws of a layered queueing network, enumerated from its structure.
namespace  line::wfn

Detailed Description

A Workflow Net (WF-net) model for performance analysis.

A WF-net (van der Aalst, 1997/98) is a Petri net with exactly one source place i (no incoming arcs), exactly one sink place o (no outgoing arcs), and every place and transition on a directed path from i to o. A case is one token put in i; it is complete when one token reaches o.

WorkflowNet has no solver of its own. It checks that the net is a WF-net and that it is sound, and then either analyses one case exactly or compiles the net into an ordinary Network:

validate() structural WF-net conditions check_soundness(k) k-soundness on the reachability graph get_cycle_time() exact phase-type law of the duration of one case without contention (any sound net, PH timing) get_cycle_time_analysis() moments, CDF, percentiles, expected firings per transition and expected token-time per place get_resource_loads(lambda) per-resource load of an open stream of cases to_workflow() equivalent Workflow, for block-structured nets to_network("forkjoin") fork-join queueing network, block-structured nets to_network("spn") stochastic Petri net with a case-counter place, any sound net get_case_metrics(solver) case throughput, WIP, cycle time and resource utilisation from a solver of a compiled network

TIMING. A timed transition fires after a phase-type delay (Exp, Erlang, HyperExp, Coxian, Cox2, APH, PH) under race semantics with enabling memory: a transition disabled by a conflicting firing loses its progress. An immediate transition fires in zero time; among the enabled immediate transitions only those of the highest priority fire, chosen in proportion to their weights.

SEMANTICS OF THE TWO NETWORK TARGETS WITH MANY CASES. The fork-join target keeps case identity, since LINE joins only synchronise siblings of the same job. The SPN target uses uncoloured tokens, so an AND-join may pair tokens of different cases; its case-counter place gives the mean number of cases in the system and, by Little's law, the exact mean cycle time under that semantics. Percentiles are not available from it.

wfn::WorkflowNet net("SimpleWFN");
net.add_place("i"); net.add_place("p"); net.add_place("o");
net.add_transition("Task1", Exp(1.0));
net.add_transition("Task2", Exp(2.0));
net.add_arc("i", "Task1"); net.add_arc("Task1", "p");
net.add_arc("p", "Task2"); net.add_arc("Task2", "o");
const wfn::SoundnessReport rep = net.check_soundness();
const Dist ph = net.get_cycle_time();   // hypoexponential, mean 1.5

References: W.M.P. van der Aalst, "The Application of Petri Nets to Workflow Management", J. Circuits, Systems and Computers 8(1), 1998.

MATLAB twin (reference): matlab/src/api/wfn/WorkflowNet.m

Definition in file workflow_net.h.