5#ifndef LINE_LANG_QN_FEATURE_SET_H
6#define LINE_LANG_QN_FEATURE_SET_H
57#include <initializer_list>
80#define LINE_QN_FEATURE_LIST(X) \
140 X(MultivariateNormal) \
144 X(StatelessClassSwitcher) \
145 X(CacheClassSwitcher) \
165 X(RoutingStrategy_PROB) \
166 X(RoutingStrategy_RAND) \
167 X(RoutingStrategy_RROBIN) \
168 X(RoutingStrategy_WRROBIN) \
169 X(RoutingStrategy_JSQ) \
170 X(RoutingStrategy_SQ) \
171 X(RoutingStrategy_SDR) \
172 X(SchedStrategy_INF) \
173 X(SchedStrategy_FCFS) \
174 X(SchedStrategy_FCFSPR) \
175 X(SchedStrategy_FCFSPI) \
176 X(SchedStrategy_FCFSPRIO) \
177 X(SchedStrategy_FCFSPRPRIO) \
178 X(SchedStrategy_FCFSPIPRIO) \
179 X(SchedStrategy_LCFS) \
180 X(SchedStrategy_LCFSPR) \
181 X(SchedStrategy_LCFSPI) \
182 X(SchedStrategy_LCFSPRIO) \
183 X(SchedStrategy_LCFSPRPRIO) \
184 X(SchedStrategy_LCFSPIPRIO) \
185 X(SchedStrategy_SEPT) \
186 X(SchedStrategy_LEPT) \
187 X(SchedStrategy_SJF) \
188 X(SchedStrategy_LJF) \
189 X(SchedStrategy_SRPT) \
190 X(SchedStrategy_SRPTPRIO) \
191 X(SchedStrategy_PSJF) \
192 X(SchedStrategy_FB) \
193 X(SchedStrategy_LRPT) \
194 X(SchedStrategy_SETF) \
195 X(SchedStrategy_FSP) \
196 X(SchedStrategy_PAS) \
197 X(SchedStrategy_OI) \
198 X(SchedStrategy_PS) \
199 X(SchedStrategy_DPS) \
200 X(SchedStrategy_GPS) \
201 X(SchedStrategy_PSPRIO) \
202 X(SchedStrategy_DPSPRIO) \
203 X(SchedStrategy_GPSPRIO) \
204 X(SchedStrategy_SIRO) \
205 X(SchedStrategy_HOL) \
206 X(SchedStrategy_EXT) \
207 X(SchedStrategy_POLLING) \
208 X(SchedStrategy_EDD) \
209 X(SchedStrategy_EDF) \
210 X(SchedStrategy_LPS) \
211 X(ReplacementStrategy_RR) \
212 X(ReplacementStrategy_FIFO) \
213 X(ReplacementStrategy_SFIFO) \
214 X(ReplacementStrategy_LRU) \
215 X(ReplacementStrategy_HLRU) \
216 X(ReplacementStrategy_CLIMB) \
217 X(ReplacementStrategy_QLRU) \
220 X(SelfLoopingClass) \
223 X(SignalType_NEGATIVE) \
224 X(SignalType_REPLY) \
225 X(SignalType_CATASTROPHE) \
226 X(SignalBatchRemoval) \
227 X(SignalRemovalPolicy) \
232 X(GlobalDependence) \
234 X(ServerParallelism) \
240 X(DepartureDiscipline) \
249 X(ActivityPrecedence_PRE_SEQ) \
250 X(ActivityPrecedence_POST_SEQ) \
251 X(ActivityPrecedence_PRE_AND) \
252 X(ActivityPrecedence_POST_AND) \
253 X(ActivityPrecedence_PRE_OR) \
254 X(ActivityPrecedence_POST_OR) \
255 X(SchedStrategy_REF) \
264 X(ActivityPrecedence_POST_CACHE) \
274 X(ForkFanoutVector) \
275 X(ForkFanoutRandom) \
276 X(ForkBranchProbability) \
308 X(SchedStrategy_RR) \
315 X(RetrialNonPersistent) \
320#define LINE_QN_FEATURE_ENUM(id) id,
322#undef LINE_QN_FEATURE_ENUM
332#define LINE_QN_FEATURE_NAME(id) \
336#undef LINE_QN_FEATURE_NAME
350 case Feature::Region:
return "a Finite Capacity Region";
351 case Feature::Fork:
return "a Fork node";
352 case Feature::Join:
return "a Join node";
353 case Feature::Forker:
return "a fork output section";
354 case Feature::ForkFanoutVector:
355 return "a fork whose tasks per link differ by destination or by class";
356 case Feature::ForkFanoutRandom:
357 return "a fork whose tasks per link are drawn from a distribution";
358 case Feature::ForkBranchProbability:
359 return "a fork whose branches fire only with a probability";
360 case Feature::Joiner:
return "a join input section";
361 case Feature::Cache:
return "a Cache node";
362 case Feature::CacheRetrieval:
return "a delayed-hit cache retrieval system";
363 case Feature::CacheItemSize:
return "per-item storage costs with per-list cost caps";
364 case Feature::ClassSwitch:
return "a ClassSwitch node";
365 case Feature::Router:
return "a Router node";
366 case Feature::Logger:
return "a Logger node";
367 case Feature::Source:
return "a Source node";
368 case Feature::Sink:
return "a Sink node";
369 case Feature::Place:
return "an SPN Place";
370 case Feature::QueueingPlace:
return "a queueing SPN Place";
371 case Feature::Transition:
return "an SPN Transition";
372 case Feature::Inhibiting:
return "an SPN inhibitor arc";
373 case Feature::FluidPlace:
return "an FSPN fluid place or fluid arc";
374 case Feature::PollingTable:
return "a polling table (Queue.setPollingTable)";
375 case Feature::PollingOrder:
return "a load-dependent polling order (Queue.setPollingOrder)";
376 case Feature::PollingTimer:
return "a time-limited polling visit (Queue.setPollingTimer)";
377 case Feature::Retrial:
return "a retrial orbit";
378 case Feature::RetrialNonPersistent:
return "non-persistent retrial customers (set_orbit_persistence)";
379 case Feature::OrbitalSearch:
return "orbital search at a retrial station (set_orbital_search)";
380 case Feature::Balking:
return "job balking";
381 case Feature::Reneging:
return "job reneging";
382 case Feature::Breakdown:
return "server breakdowns";
383 case Feature::SetupDelayOff:
return "server setup and delay-off times";
384 case Feature::LoadDependence:
return "load-dependent service rates";
385 case Feature::ClassDependence:
return "class-dependent service rates";
386 case Feature::JointDependence:
return "joint-dependent service rates";
387 case Feature::GlobalDependence:
return "globally state-dependent (Whittle) service rates";
388 case Feature::BatchArrival:
return "batch arrivals";
389 case Feature::OpenSignal:
return "an open G-network signal class";
390 case Feature::ClosedSignal:
return "a closed G-network signal class";
391 case Feature::SignalBatchRemoval:
return "a signal batch-removal distribution";
392 case Feature::SignalRemovalPolicy:
return "a non-random signal removal policy";
393 case Feature::OpenClass:
return "an open job class";
394 case Feature::ClosedClass:
return "a closed job class";
395 case Feature::SelfLoopingClass:
return "a self-looping job class";
396 case Feature::Queue:
return "a Queue station";
398 case Feature::DelayStation:
return "a Delay station";
401 case Feature::MultiServer:
return "a multi-server station";
402 case Feature::FiniteCapacity:
return "a finite station or per-class buffer that binds";
406 const std::size_t us = nm.find(
'_');
407 if (us != std::string::npos) {
408 const std::string head = nm.substr(0, us), tail = nm.substr(us + 1);
409 if (head ==
"SchedStrategy")
return "the " + tail +
" scheduling discipline";
410 if (head ==
"RoutingStrategy")
return "the " + tail +
" routing strategy";
411 if (head ==
"ReplacementStrategy")
return "the " + tail +
" cache replacement policy";
412 if (head ==
"SignalType")
return tail +
" signals";
413 if (head ==
"ActivityPrecedence")
return "the " + tail +
" activity precedence";
415 return "the " + nm +
" feature";
428 if (f !=
Feature::COUNT) bits_[
static_cast<std::size_t
>(f)] =
true;
436 if (f !=
Feature::COUNT) bits_[
static_cast<std::size_t
>(f)] =
false;
443 std::vector<Feature>
list()
const {
444 std::vector<Feature> out;
445 for (std::size_t i = 0; i < bits_.size(); ++i)
446 if (bits_[i]) out.push_back(
static_cast<Feature>(i));
450 for (std::size_t i = 0; i < bits_.size(); ++i)
451 if (bits_[i])
return false;
456 std::vector<bool> bits_;
481 case Feature::Cox2:
return Feature::Coxian;
486 case Feature::Trace:
return Feature::Replayer;
509 if (!used.
has(f) || declared.
has(f))
continue;
516 if (r.
missing.empty())
return r;
520 ", which this solver does not support";
522 r.
reason = solver +
": this model uses features which this solver does not support: ";
523 for (std::size_t i = 0; i < r.
missing.size(); ++i) {
556 case ProcessType::EXP:
return Feature::Exp;
557 case ProcessType::ERLANG:
return Feature::Erlang;
558 case ProcessType::HYPEREXP:
return Feature::HyperExp;
559 case ProcessType::PH:
return Feature::PH;
560 case ProcessType::APH:
return Feature::APH;
561 case ProcessType::MAP:
return Feature::MAP;
562 case ProcessType::UNIFORM:
return Feature::Uniform;
563 case ProcessType::DET:
return Feature::Det;
564 case ProcessType::COXIAN:
return Feature::Coxian;
565 case ProcessType::GAMMA:
return Feature::Gamma;
566 case ProcessType::PARETO:
return Feature::Pareto;
567 case ProcessType::MMPP2:
return Feature::MMPP2;
568 case ProcessType::REPLAYER:
return Feature::Replayer;
569 case ProcessType::COX2:
return Feature::Cox2;
570 case ProcessType::WEIBULL:
return Feature::Weibull;
571 case ProcessType::LOGLOGISTIC:
return Feature::LogLogistic;
572 case ProcessType::MASSATORIGIN:
return Feature::MassAtOrigin;
573 case ProcessType::DEFECTIVE:
return Feature::Defective;
574 case ProcessType::LOGNORMAL:
return Feature::Lognormal;
575 case ProcessType::DUNIFORM:
return Feature::DiscreteUniform;
576 case ProcessType::BERNOULLI:
return Feature::Bernoulli;
577 case ProcessType::BINOMIAL:
return Feature::Binomial;
578 case ProcessType::POISSON:
return Feature::Poisson;
579 case ProcessType::GEOMETRIC:
return Feature::Geometric;
580 case ProcessType::BMAP:
return Feature::BMAP;
581 case ProcessType::ME:
return Feature::ME;
582 case ProcessType::RAP:
return Feature::RAP;
583 case ProcessType::DISCRETESAMPLER:
return Feature::DiscreteSampler;
584 case ProcessType::ZIPF:
return Feature::Zipf;
585 case ProcessType::DMAP:
return Feature::DMAP;
586 case ProcessType::MMAP:
return Feature::MMAP;
587 case ProcessType::EMPIRICALCDF:
return Feature::EmpiricalCdf;
591 case ProcessType::PRIOR:
return Feature::Prior;
592 case ProcessType::NHPP:
return Feature::NHPP;
593 case ProcessType::NNPP:
return Feature::NNPP;
594 case ProcessType::MAPT:
return Feature::MAPt;
595 case ProcessType::PHT:
return Feature::PHt;
596 case ProcessType::MPH:
return Feature::MPH;
597 case ProcessType::MMAPT:
return Feature::MMAPt;
598 case ProcessType::MPHT:
return Feature::MPHt;
599 case ProcessType::BMMAPT:
return Feature::BMMAPt;
610 case SchedStrategy::INF:
return Feature::SchedStrategy_INF;
611 case SchedStrategy::FCFS:
return Feature::SchedStrategy_FCFS;
612 case SchedStrategy::FCFSPR:
return Feature::SchedStrategy_FCFSPR;
613 case SchedStrategy::FCFSPI:
return Feature::SchedStrategy_FCFSPI;
614 case SchedStrategy::FCFSPRPRIO:
return Feature::SchedStrategy_FCFSPRPRIO;
615 case SchedStrategy::FCFSPIPRIO:
return Feature::SchedStrategy_FCFSPIPRIO;
616 case SchedStrategy::LCFS:
return Feature::SchedStrategy_LCFS;
617 case SchedStrategy::LCFSPR:
return Feature::SchedStrategy_LCFSPR;
618 case SchedStrategy::LCFSPI:
return Feature::SchedStrategy_LCFSPI;
619 case SchedStrategy::LCFSPRIO:
return Feature::SchedStrategy_LCFSPRIO;
620 case SchedStrategy::LCFSPRPRIO:
return Feature::SchedStrategy_LCFSPRPRIO;
621 case SchedStrategy::LCFSPIPRIO:
return Feature::SchedStrategy_LCFSPIPRIO;
622 case SchedStrategy::SEPT:
return Feature::SchedStrategy_SEPT;
623 case SchedStrategy::LEPT:
return Feature::SchedStrategy_LEPT;
624 case SchedStrategy::SJF:
return Feature::SchedStrategy_SJF;
625 case SchedStrategy::LJF:
return Feature::SchedStrategy_LJF;
626 case SchedStrategy::SRPT:
return Feature::SchedStrategy_SRPT;
627 case SchedStrategy::SRPTPRIO:
return Feature::SchedStrategy_SRPTPRIO;
628 case SchedStrategy::PSJF:
return Feature::SchedStrategy_PSJF;
629 case SchedStrategy::FB:
return Feature::SchedStrategy_FB;
630 case SchedStrategy::LRPT:
return Feature::SchedStrategy_LRPT;
631 case SchedStrategy::SETF:
return Feature::SchedStrategy_SETF;
632 case SchedStrategy::FSP:
return Feature::SchedStrategy_FSP;
633 case SchedStrategy::PAS:
return Feature::SchedStrategy_PAS;
634 case SchedStrategy::OI:
return Feature::SchedStrategy_OI;
637 case SchedStrategy::RR:
return Feature::SchedStrategy_RR;
638 case SchedStrategy::PS:
return Feature::SchedStrategy_PS;
639 case SchedStrategy::DPS:
return Feature::SchedStrategy_DPS;
640 case SchedStrategy::GPS:
return Feature::SchedStrategy_GPS;
641 case SchedStrategy::PSPRIO:
return Feature::SchedStrategy_PSPRIO;
642 case SchedStrategy::DPSPRIO:
return Feature::SchedStrategy_DPSPRIO;
643 case SchedStrategy::GPSPRIO:
return Feature::SchedStrategy_GPSPRIO;
644 case SchedStrategy::SIRO:
return Feature::SchedStrategy_SIRO;
645 case SchedStrategy::HOL:
return Feature::SchedStrategy_HOL;
646 case SchedStrategy::EXT:
return Feature::SchedStrategy_EXT;
647 case SchedStrategy::POLLING:
return Feature::SchedStrategy_POLLING;
648 case SchedStrategy::EDD:
return Feature::SchedStrategy_EDD;
649 case SchedStrategy::EDF:
return Feature::SchedStrategy_EDF;
650 case SchedStrategy::LPS:
return Feature::SchedStrategy_LPS;
651 case SchedStrategy::REF:
return Feature::SchedStrategy_REF;
662 case RoutingStrategy::PROB:
return Feature::RoutingStrategy_PROB;
663 case RoutingStrategy::RAND:
return Feature::RoutingStrategy_RAND;
664 case RoutingStrategy::RROBIN:
return Feature::RoutingStrategy_RROBIN;
665 case RoutingStrategy::WRROBIN:
return Feature::RoutingStrategy_WRROBIN;
666 case RoutingStrategy::JSQ:
return Feature::RoutingStrategy_JSQ;
667 case RoutingStrategy::SQ:
return Feature::RoutingStrategy_SQ;
668 case RoutingStrategy::SDR:
return Feature::RoutingStrategy_SDR;
676 case ReplacementStrategy::RR:
return Feature::ReplacementStrategy_RR;
677 case ReplacementStrategy::FIFO:
return Feature::ReplacementStrategy_FIFO;
678 case ReplacementStrategy::SFIFO:
return Feature::ReplacementStrategy_SFIFO;
679 case ReplacementStrategy::LRU:
return Feature::ReplacementStrategy_LRU;
680 case ReplacementStrategy::HLRU:
return Feature::ReplacementStrategy_HLRU;
681 case ReplacementStrategy::CLIMB:
return Feature::ReplacementStrategy_CLIMB;
682 case ReplacementStrategy::QLRU:
return Feature::ReplacementStrategy_QLRU;
698 case SchedStrategy::PS:
699 case SchedStrategy::DPS:
700 case SchedStrategy::GPS:
701 case SchedStrategy::PSPRIO:
702 case SchedStrategy::DPSPRIO:
703 case SchedStrategy::GPSPRIO:
704 case SchedStrategy::LPS:
return Feature::SharedServer;
705 case SchedStrategy::INF:
return Feature::InfiniteServer;
706 case SchedStrategy::LCFSPR:
707 case SchedStrategy::LCFSPRPRIO:
708 case SchedStrategy::LCFSPI:
709 case SchedStrategy::LCFSPIPRIO:
710 case SchedStrategy::FCFSPR:
711 case SchedStrategy::FCFSPRPRIO:
712 case SchedStrategy::FCFSPI:
713 case SchedStrategy::FCFSPIPRIO:
716 default:
return Feature::Server;
767 const std::size_t R =
sn.classes.size();
769 for (std::size_t r = 0; r < R; ++r) {
770 u.
set(
sn.classes[r].type == JobClassType::CLOSED ? Feature::ClosedClass
771 : Feature::OpenClass);
776 if (
sn.classes[r].self_looping) u.
set(Feature::SelfLoopingClass);
777 if (r <
sn.issignal.size() &&
sn.issignal[r]) {
781 u.
set(
sn.classes[r].type == JobClassType::CLOSED ? Feature::ClosedSignal
782 : Feature::OpenSignal);
783 if (r <
sn.signaltype.size()) {
784 switch (
sn.signaltype[r]) {
788 u.
set(Feature::SignalType_CATASTROPHE);
792 if (r <
sn.signalremdist.size() && !
sn.signalremdist[r].empty())
793 u.
set(Feature::SignalBatchRemoval);
794 if (r <
sn.signalrempolicy.size() &&
796 u.
set(Feature::SignalRemovalPolicy);
803 if (
static_cast<bool>(
sn.gdscaling)) u.
set(Feature::GlobalDependence);
805 if (!
sn.regions.empty()) u.
set(Feature::Region);
806 if (
sn.sourceIdx != 0) u.
set(Feature::Source);
807 if (
sn.sinkNode != 0) u.
set(Feature::Sink);
808 if (!
sn.fj.empty()) u.
set({Feature::Fork, Feature::Forker, Feature::Join, Feature::Joiner});
810 for (std::size_t i = 0; i <
sn.nodes.size(); ++i) {
812 const std::size_t ind = i + 1;
813 const std::size_t ist = nd.
station;
816 case NodeType::Queue:
817 case NodeType::Delay: {
818 u.
set({nd.
nodetype == NodeType::Delay ? Feature::Delay : Feature::Queue,
819 Feature::Buffer, Feature::Dispatcher});
823 bool any_class =
false;
824 for (std::size_t r = 0; r < R; ++r) {
827 if (ist - 1 <
sn.disabled.size() && r <
sn.disabled[ist - 1].size() &&
828 sn.disabled[ist - 1][r])
831 if (ist - 1 <
sn.service.size() && r <
sn.service[ist - 1].size())
837 if (
static_cast<bool>(st.
cdscaling)) u.
set(Feature::ClassDependence);
838 if (
static_cast<bool>(st.
jdscaling)) u.
set(Feature::JointDependence);
845 for (std::size_t r = 0; r < R; ++r) {
848 : Feature::Reneging);
850 u.
set(Feature::Reneging);
857 u.
set(Feature::RetrialNonPersistent);
859 u.
set(Feature::OrbitalSearch);
862 u.
set(Feature::Balking);
866 if (n > 1) { u.
set(Feature::ServerParallelism);
break; }
869 case NodeType::Source: {
870 u.
set({Feature::Source, Feature::RandomSource, Feature::ServiceTunnel,
871 Feature::Dispatcher});
874 if (ist == 0 || ist - 1 >=
sn.service.size())
break;
875 for (std::size_t r = 0; r < R && r <
sn.service[ist - 1].size(); ++r)
879 for (
const Distrib<T>& b :
sn.stations[ist - 1].arrival_batch)
880 if (!b.disabled) { u.
set(Feature::BatchArrival);
break; }
884 u.
set(Feature::Sink);
886 case NodeType::Router: {
900 for (std::size_t r = 0; r < R && r < nd.
routing.size(); ++r)
904 case NodeType::ClassSwitch:
905 u.
set({Feature::ClassSwitch, Feature::StatelessClassSwitcher, Feature::Buffer,
906 Feature::Dispatcher});
908 case NodeType::Cache: {
909 u.
set({Feature::Cache, Feature::CacheClassSwitcher, Feature::Buffer,
910 Feature::Dispatcher});
911 auto it =
sn.nodeparam.find(ind);
912 if (it ==
sn.nodeparam.end())
break;
914 if (it->second.retrieval_capacity > 0 || !it->second.retrieval_classes.empty())
915 u.
set(Feature::CacheRetrieval);
916 if (!it->second.costcap.empty()) u.
set(Feature::CacheItemSize);
919 case NodeType::Fork: {
920 u.
set({Feature::Fork, Feature::Forker, Feature::Buffer, Feature::ServiceTunnel});
927 const double tpl =
sn.nodes[i - 1].tasks_per_link;
928 bool vector_valued =
false, random_valued =
false, probabilistic =
false;
929 for (std::size_t k = 0; k < fp->
fan_out_link.rows(); ++k)
930 for (std::size_t r = 0; r < fp->
fan_out_link.cols(); ++r) {
932 if (p == 0.0)
continue;
933 if (p != 1.0) probabilistic =
true;
935 vector_valued =
true;
936 if (!fp->
fan_out_dist[k][r].disabled) random_valued =
true;
938 if (vector_valued) u.
set(Feature::ForkFanoutVector);
939 if (random_valued) u.
set(Feature::ForkFanoutRandom);
940 if (probabilistic) u.
set(Feature::ForkBranchProbability);
945 u.
set({Feature::Join, Feature::Joiner, Feature::Dispatcher,
946 Feature::ServiceTunnel});
948 case NodeType::Logger:
949 u.
set({Feature::Logger, Feature::LogTunnel, Feature::Buffer, Feature::Dispatcher});
951 case NodeType::Place:
952 u.
set({Feature::Place, Feature::Storage, Feature::Linkage,
953 Feature::ServiceTunnel});
962 u.
set(Feature::QueueingPlace);
965 if (
sn.is_fluid_node(ind)) u.
set(Feature::FluidPlace);
967 case NodeType::Transition: {
968 u.
set({Feature::Transition, Feature::Enabling, Feature::Timing, Feature::Firing});
969 auto it =
sn.transparam.find(ind);
970 if (it ==
sn.transparam.end())
break;
973 for (
const auto& row : it->second.inhibiting) {
975 for (std::size_t p = 0; p < row.rows() && !finite; ++p)
976 for (std::size_t r = 0; r < row.cols(); ++r)
981 if (finite) { u.
set(Feature::Inhibiting);
break; }
984 if (it->second.has_fluid_arcs()) u.
set(Feature::FluidPlace);
987 case NodeType::Region:
988 u.
set(Feature::Region);
995 if (!
sn.csmatrix.empty())
996 u.
set({Feature::ClassSwitch, Feature::StatelessClassSwitcher, Feature::Buffer,
997 Feature::Dispatcher});
999 if (!
sn.retrialparam.empty()) u.
set(Feature::Retrial);
1004 if (!
sn.breakdownparam.empty()) u.
set(Feature::Breakdown);
1005 if (!
sn.setupparam.empty()) u.
set(Feature::SetupDelayOff);
1009 for (
const auto& kv :
sn.joindecl)
1014 for (
const auto& row :
sn.droprule)
1016 if (d == DropStrategy::RETRIAL || d == DropStrategy::RETRIAL_WITH_LIMIT)
1017 u.
set(Feature::Retrial);
1023 if (
sn.has_multi_server()) u.
set(Feature::MultiServer);
1027 if (st.
sched != SchedStrategy::POLLING)
continue;
1071 const std::string& resolved_method =
"") {
1072 const bool upgraded = !resolved_method.empty() && resolved_method != requested_method;
1073 const std::string label = upgraded ? solver +
"'s '" + resolved_method +
"' method" : solver;
1080 std::ostringstream os;
1099 return is_open_class ?
"Use SolverCTMC, SolverJMT or SolverLDES"
1100 :
"Use SolverCTMC, SolverSSA or SolverLDES";
1113 if (nd.
nodetype == NodeType::Cache)
return std::string();
1115 double totaljobs = 0.0;
1116 bool any_open =
false;
1119 if (std::isinf(c.
population)) any_open =
true;
1123 if (st.
nodetype == NodeType::Source || st.
nodetype == NodeType::Sink)
continue;
1124 if (std::isfinite(st.
cap) && st.
cap >= 0.0 && st.
cap < totaljobs)
1125 return solver +
": finite station capacity (setCapacity=" +
capacity_str(st.
cap) +
1126 ") at station '" + st.
name +
1127 "' is not supported by this solver, which has no "
1128 "representation of a finite buffer and would return the "
1129 "unconstrained answer. " +
1131 const std::size_t n = std::min(st.
classcap.size(),
sn.classes.size());
1132 for (std::size_t r = 0; r < n; ++r)
1135 return solver +
": finite per-class capacity (classCap=" +
1137 ") at station '" + st.
name +
1138 "' is not supported by this solver, which has no representation of a "
1139 "finite buffer and would return the unconstrained answer. " +
1142 return std::string();
A refusal: the feature, method or analysis is not covered: LINE:unsupported:<kind>.
UnsupportedError(const std::string &what)
A subset of the registry: MATLAB's SolverFeatureSet, whose list is a flag per field.
FeatureSet & set(Feature f)
FeatureSet & set(std::initializer_list< Feature > fs)
std::vector< Feature > list() const
The features held, in registry order.
FeatureSet & unset(Feature f)
bool has(Feature f) const
A network plus its refreshed NetworkStruct.
The exception types the port throws.
#define LINE_QN_FEATURE_LIST(X)
SolverFeatureSet.fields, in its order, as an X-list.
#define LINE_QN_FEATURE_ENUM(id)
#define LINE_QN_FEATURE_NAME(id)
Enumerations and the minimal distribution descriptor shared by the model layer of the C++ port.
SchedStrategy
Scheduling disciplines, with the values of MATLAB SchedStrategy.
DropStrategy
Blocking and loss rules, with the values of MATLAB DropStrategy.
@ REPLY
completes a synchronous call, releasing a held server
@ NEGATIVE
removes a batch of jobs (Gelenbe's negative customer)
@ CATASTROPHE
removes EVERY job at the station
@ CYCLIC
fixed cyclic order (or the polling table)
RoutingStrategy
Routing strategies, with the values of MATLAB RoutingStrategy.
DepartureDiscipline
When a Place releases a served token, MATLAB DepartureDiscipline.
@ RANDOM
uniform over waiting AND in-service jobs
ProcessType
Distribution kinds, with the values of MATLAB ProcessType.
ReplacementStrategy
Cache replacement policies, with the values of MATLAB ReplacementStrategy.
Feature feature_of_server_section(SchedStrategy s)
The SERVER section a Queue gets for a discipline, MATLAB Queue.m:79-108.
FeatureSet used_lang_features(const NetworkStruct< T > &sn)
Feature feature_generalization(Feature f)
The registry name a specialization falls back to when it is not declared.
Feature
One language feature.
void check_binding_capacity(const std::string &solver, const NetworkStruct< T > &sn)
NetworkSolver.checkBindingCapacity (NetworkSolver.m:1172-1228): the shared structural gate for finite...
std::string feature_phrase(Feature f)
A human-readable phrase for the reason string, e.g.
std::string capacity_str(double v)
g for a capacity, so the message reads 2 and not 2.000000.
bool has_binding_capacity(const NetworkStruct< T > &sn)
getUsedLangFeatures: the features the MODEL uses.
Feature feature_of_process(ProcessType p)
The feature name of a distribution, MATLAB serviceProcess{r}{3}.name.
Feature feature_of_routing(RoutingStrategy r)
RoutingStrategy.toFeature.
Feature feature_of_replacement(ReplacementStrategy s)
ReplacementStrategy.toFeature.
UnsupportedError feature_refusal(const SupportResult &r)
The refusal a failed gate raises: LINE:unsupported:<kind>, where the kind is the FIRST missing featur...
SupportResult feature_set_supports(const std::string &solver, const FeatureSet &declared, const FeatureSet &used)
SolverFeatureSet.supports: is every feature the model uses declared?
std::string capacity_fallback_advice(bool is_open_class)
Which solvers to point at when a finite capacity is refused.
void feature_gate(const std::string &solver, const FeatureSet &declared, const NetworkStruct< T > &sn, const std::string &requested_method="", const std::string &resolved_method="")
runAnalyzerChecks: refuse a model the solver does not declare, by name.
constexpr std::size_t feature_count()
The number of registered features, MATLAB numel(SolverFeatureSet.fields).
Feature feature_of_sched(SchedStrategy s)
SchedStrategy.toFeature.
const char * feature_name(Feature f)
The canonical registry name, byte for byte the MATLAB field name.
std::string binding_capacity_reason(const std::string &solver, const NetworkStruct< T > &sn)
The refusal check_binding_capacity raises, as a string, or empty when no buffer binds.
Conservation laws of a layered queueing network, enumerated from its structure.
A queueing network and its refreshed NetworkStruct.
The <kind> part of a LINE:<category>:<kind> identifier (see _kb/17-error-vocabulary....
Variable forking levels, the twin of MATLAB sn.nodeparam{f}.fanOutLink / .fanOutProb / ....
std::vector< std::vector< lang::Distrib< T > > > fan_out_dist
One job class of the network.
double population
infinite for an open class
std::vector< RoutingStrategy > routing
sn.routing, per class.
One station of the network.
std::vector< Distrib< T > > orbit_impatience
Queue.setOrbitImpatience(class, dist): abandonment from the RETRIAL ORBIT, which is a different popul...
double cap
Station capacity in Kendall's K, as setCapacity sets it.
std::vector< BalkingParam > balking
std::vector< std::size_t > server_parallelism
Queue.setServerParallelism(class, n): the servers a job seizes for the whole of its service,...
T orbit_join_of(std::size_t r) const
orbit_join[r] with the default 1 for a missing slot (0-based r).
CdScaling< T > jdscaling
sn.jdscaling for this station: MATLAB's Station.ljdScaling, the JOINT dependence map eta_i(n),...
std::vector< T > lldscaling
sn.lldscaling for this station: the multiplier at population 1, 2, ... Empty when the station is not ...
std::vector< lang::ImpatienceType > impatience
lang::PollingOrder polling_order
std::vector< std::size_t > polling_table
The polling extensions (Queue.setPollingTable, setPollingOrder, setPollingTimer).
CdScaling< T > cdscaling
sn.cdscaling for this station: the class-dependence map, empty when unset.
std::vector< double > classcap
Per-class buffer from setChainCapacity; infinite where unset.
std::vector< lang::DepartureDiscipline > departure_discipline
Place.departureDiscipline, per class.
lang::PollingTimer polling_timer_scope
T orbit_search_of(std::size_t r) const
orbit_search[r] with the default 0 for a missing slot (0-based r).
std::vector< ServerType > server_types
T orbit_persist_of(std::size_t r) const
orbit_persist[r] with the default 1 for a missing slot (0-based r).
The outcome of the gate: the verdict, the offending features, the message.
std::vector< Feature > missing
used but not declared, in registry order
std::string reason
empty when ok