LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
wfn_arc.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2012-2026, QORE Lab, Imperial College London
3 * All rights reserved.
4 */
5#ifndef LINE_API_WFN_WFN_ARC_H
6#define LINE_API_WFN_WFN_ARC_H
7
8/**
9 * @file
10 * @ingroup api_wfn
11 * An arc of a WorkflowNet, from a place to a transition or from a transition to a place.
12 *
13 * MATLAB twin: matlab/src/api/wfn/WFNArc.m
14 */
15
16#include <string>
17
20
21namespace line {
22namespace wfn {
23
24class WFNArc {
25public:
26 /** True for place -> transition, false for transition -> place. */
27 bool from_place() const { return from_place_; }
28 const WFNPlace& place() const { return *place_; }
29 const WFNTransition& transition() const { return *transition_; }
30 /** A positive integer, the tokens moved per firing. */
31 double weight() const { return weight_; }
32
33 const std::string& source_name() const { return from_place_ ? place_->name() : transition_->name(); }
34 const std::string& target_name() const { return from_place_ ? transition_->name() : place_->name(); }
35
36private:
37 friend class WorkflowNet;
38 WFNArc(bool from_place, const WFNPlace* place, const WFNTransition* transition, double weight)
39 : from_place_(from_place), place_(place), transition_(transition), weight_(weight) {}
40
41 bool from_place_;
42 const WFNPlace* place_;
43 const WFNTransition* transition_;
44 double weight_;
45};
46
47} // namespace wfn
48} // namespace line
49
50#endif // LINE_API_WFN_WFN_ARC_H
const WFNTransition & transition() const
Definition wfn_arc.h:29
double weight() const
A positive integer, the tokens moved per firing.
Definition wfn_arc.h:31
const std::string & source_name() const
Definition wfn_arc.h:33
const std::string & target_name() const
Definition wfn_arc.h:34
friend class WorkflowNet
Definition wfn_arc.h:37
bool from_place() const
True for place -> transition, false for transition -> place.
Definition wfn_arc.h:27
const WFNPlace & place() const
Definition wfn_arc.h:28
Conservation laws of a layered queueing network, enumerated from its structure.
Definition aoi_dist2ph.h:52
A place of a WorkflowNet.
A transition (task) of a WorkflowNet.