LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
wfn_resource.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_RESOURCE_H
6#define LINE_API_WFN_WFN_RESOURCE_H
7
8/**
9 * @file
10 * @ingroup api_wfn
11 * A resource shared by the tasks of a WorkflowNet that name it, and by every case.
12 *
13 * MATLAB twin: matlab/src/api/wfn/WFNResource.m
14 */
15
16#include <string>
17
19#include "line/util/error.h"
20
21namespace line {
22namespace wfn {
23
25public:
26 WFNResource(const std::string& name, double servers = 1.0,
28 : name_(name), scheduling_(scheduling) {
30 }
31
32 const std::string& name() const { return name_; }
33 double servers() const { return servers_; }
34 lang::SchedStrategy scheduling() const { return scheduling_; }
35
36 void set_name(const std::string& name) { name_ = name; }
37 void set_servers(double servers) {
38 if (!(servers >= 1))
39 throw InputError(ErrorKind("Argument"), "Number of servers must be at least 1.");
40 servers_ = servers;
41 }
43
44private:
45 std::string name_;
46 double servers_ = 1.0;
47 lang::SchedStrategy scheduling_;
48};
49
50} // namespace wfn
51} // namespace line
52
53#endif // LINE_API_WFN_WFN_RESOURCE_H
InputError(const std::string &what)
Definition error.h:105
void set_scheduling(lang::SchedStrategy scheduling)
WFNResource(const std::string &name, double servers=1.0, lang::SchedStrategy scheduling=lang::SchedStrategy::FCFS)
lang::SchedStrategy scheduling() const
void set_servers(double servers)
const std::string & name() const
void set_name(const std::string &name)
double servers() const
The exception types the port throws.
Enumerations and the minimal distribution descriptor shared by the model layer of the C++ port.
SchedStrategy
Scheduling disciplines, with the values of MATLAB SchedStrategy.
Definition lang_types.h:185
Conservation laws of a layered queueing network, enumerated from its structure.
Definition aoi_dist2ph.h:52
ErrorKind(std::string n)
Definition error.h:39