5#ifndef LINE_IO_NETWORK_WRITER_H
6#define LINE_IO_NETWORK_WRITER_H
120 throw UnsupportedError(
"network_writer: a patience block with no impatience type");
165 throw UnsupportedError(
"network_writer: unnamed heterogeneous scheduling policy");
179 for (std::size_t i = 0; i < out.size(); ++i)
180 out[i] =
static_cast<char>(std::toupper(
static_cast<unsigned char>(out[i])));
186json mat_to_json(
const Matrix<T>& M) {
187 json rows = json::array();
188 for (std::size_t i = 0; i < M.rows(); ++i) {
189 json row = json::array();
190 for (std::size_t j = 0; j < M.cols(); ++j)
191 row.push_back(num_traits<T>::to_double(M(i, j)));
198json vec_to_json(
const std::vector<T>& v) {
199 json a = json::array();
200 for (
const T& x : v) a.push_back(num_traits<T>::to_double(x));
218inline void wire_nonfinite(json& j) {
219 if (j.is_object() || j.is_array()) {
220 for (json::iterator it = j.begin(); it != j.end(); ++it) wire_nonfinite(*it);
223 if (!j.is_number_float())
return;
224 const double v = j.get<
double>();
227 else if (std::isinf(v))
228 j = json(v > 0.0 ?
"Infinity" :
"-Infinity");
239inline json discrete_support(std::size_t n) {
240 json a = json::array();
241 for (std::size_t i = 1; i <= n; ++i) a.push_back(
static_cast<double>(i));
254json dist_to_json(
const lang::Distrib<T>& d) {
258 const std::vector<T>& p = d.params;
259 auto need = [&](std::size_t n,
const char* who) {
261 throw InputError(std::string(
"network_writer: a ") + who +
" carries " +
262 std::to_string(p.size()) +
" parameters, and " + std::to_string(n) +
263 " are needed to write it back");
266 case ProcessType::DISABLED:
267 case ProcessType::IMMEDIATE:
269 case ProcessType::EXP:
271 j[
"params"][
"lambda"] = num_traits<T>::to_double(p[0]);
273 case ProcessType::DET:
274 j[
"params"][
"value"] = num_traits<T>::to_double(d.mean);
276 case ProcessType::ERLANG:
278 j[
"params"][
"lambda"] = num_traits<T>::to_double(p[0]);
279 j[
"params"][
"k"] =
static_cast<long>(std::lround(num_traits<T>::to_double(p[1])));
281 case ProcessType::HYPEREXP: {
285 json pv = json::array(), lv = json::array();
287 pv.push_back(num_traits<T>::to_double(p[0]));
288 pv.push_back(1.0 - num_traits<T>::to_double(p[0]));
289 lv.push_back(num_traits<T>::to_double(p[1]));
290 lv.push_back(num_traits<T>::to_double(p[2]));
292 const std::size_t n = p.size() / 2;
293 for (std::size_t i = 0; i < n; ++i) pv.push_back(num_traits<T>::to_double(p[i]));
294 for (std::size_t i = 0; i < n; ++i) lv.push_back(num_traits<T>::to_double(p[n + i]));
296 j[
"params"][
"p"] = pv;
297 j[
"params"][
"lambda"] = lv;
300 case ProcessType::COXIAN:
301 case ProcessType::COX2: {
302 const std::size_t n = p.size() / 2;
303 json mu = json::array(), phi = json::array();
304 for (std::size_t i = 0; i < n; ++i) mu.push_back(num_traits<T>::to_double(p[i]));
305 for (std::size_t i = 0; i < n; ++i) phi.push_back(num_traits<T>::to_double(p[n + i]));
308 j[
"type"] =
"Coxian";
309 j[
"params"][
"mu"] = mu;
310 j[
"params"][
"phi"] = phi;
313 case ProcessType::PH:
314 case ProcessType::APH:
315 case ProcessType::ME: {
316 json alpha = json::array();
317 for (
const T& v : p) alpha.push_back(num_traits<T>::to_double(v));
318 if (d.type == ProcessType::ME) {
319 j[
"params"][
"alpha"] = alpha;
320 j[
"params"][
"A"] = mat_to_json(d.D0);
322 j[
"ph"][
"alpha"] = alpha;
323 j[
"ph"][
"T"] = mat_to_json(d.D0);
327 case ProcessType::MAP:
328 j[
"map"][
"D0"] = mat_to_json(d.D0);
329 j[
"map"][
"D1"] = mat_to_json(d.D1);
331 case ProcessType::RAP:
332 j[
"params"][
"H0"] = mat_to_json(d.D0);
333 j[
"params"][
"H1"] = mat_to_json(d.D1);
335 case ProcessType::DMAP:
336 j[
"params"][
"D0"] = mat_to_json(d.D0);
337 j[
"params"][
"D1"] = mat_to_json(d.D1);
339 case ProcessType::MMPP2: {
343 if (d.D0.rows() != 2)
344 throw InputError(
"network_writer: an MMPP2 must be of order two");
345 j[
"params"][
"lambda0"] = num_traits<T>::to_double(d.D1(0, 0));
346 j[
"params"][
"lambda1"] = num_traits<T>::to_double(d.D1(1, 1));
347 j[
"params"][
"sigma0"] = num_traits<T>::to_double(d.D0(0, 1));
348 j[
"params"][
"sigma1"] = num_traits<T>::to_double(d.D0(1, 0));
351 case ProcessType::MPH: {
357 const std::size_t H = d.D0.rows();
358 std::vector<double> alpha(H, 0.0);
359 for (std::size_t i = 0; i < H; ++i) {
361 for (std::size_t q = 0; q < H; ++q) row += num_traits<T>::to_double(d.D1(i, q));
363 for (std::size_t q = 0; q < H; ++q)
364 alpha[q] = num_traits<T>::to_double(d.D1(i, q)) / row;
368 j[
"mph"][
"alpha"] = alpha;
369 j[
"mph"][
"S"] = mat_to_json(d.D0);
370 json exits = json::array();
371 for (
const Matrix<T>& Dk : d.Dmark) {
372 std::vector<double> sk(H, 0.0);
373 for (std::size_t i = 0; i < H; ++i)
374 for (std::size_t q = 0; q < H; ++q)
375 sk[i] += num_traits<T>::to_double(Dk(i, q));
378 j[
"mph"][
"exit"] = exits;
381 case ProcessType::MMAP: {
382 j[
"mmap"][
"D0"] = mat_to_json(d.D0);
383 json blocks = json::array();
384 for (
const Matrix<T>& Dk : d.Dmark) blocks.push_back(mat_to_json(Dk));
385 j[
"mmap"][
"D1k"] = blocks;
388 case ProcessType::BMAP: {
389 json blocks = json::array();
390 blocks.push_back(mat_to_json(d.D0));
391 for (
const Matrix<T>& Dk : d.Dmark) blocks.push_back(mat_to_json(Dk));
392 j[
"params"][
"D"] = blocks;
395 case ProcessType::UNIFORM:
397 j[
"params"][
"a"] = num_traits<T>::to_double(p[0]);
398 j[
"params"][
"b"] = num_traits<T>::to_double(p[1]);
400 case ProcessType::PARETO:
402 j[
"params"][
"alpha"] = num_traits<T>::to_double(p[0]);
403 j[
"params"][
"scale"] = num_traits<T>::to_double(p[1]);
405 case ProcessType::GAMMA:
407 j[
"params"][
"alpha"] = num_traits<T>::to_double(p[0]);
408 j[
"params"][
"beta"] = num_traits<T>::to_double(p[1]);
410 case ProcessType::WEIBULL:
414 j[
"params"][
"alpha"] = num_traits<T>::to_double(p[0]);
415 j[
"params"][
"beta"] = num_traits<T>::to_double(p[1]);
417 case ProcessType::LOGNORMAL:
418 need(2,
"Lognormal");
419 j[
"params"][
"mu"] = num_traits<T>::to_double(p[0]);
420 j[
"params"][
"sigma"] = num_traits<T>::to_double(p[1]);
422 case ProcessType::DUNIFORM:
423 need(2,
"DiscreteUniform");
424 j[
"params"][
"min"] = num_traits<T>::to_double(p[0]);
425 j[
"params"][
"max"] = num_traits<T>::to_double(p[1]);
427 case ProcessType::BERNOULLI:
428 need(1,
"Bernoulli");
429 j[
"params"][
"p"] = num_traits<T>::to_double(p[0]);
431 case ProcessType::BINOMIAL:
433 j[
"params"][
"n"] =
static_cast<long>(std::lround(num_traits<T>::to_double(p[0])));
434 j[
"params"][
"p"] = num_traits<T>::to_double(p[1]);
436 case ProcessType::POISSON:
438 j[
"params"][
"lambda"] = num_traits<T>::to_double(p[0]);
440 case ProcessType::GEOMETRIC:
441 need(1,
"Geometric");
442 j[
"params"][
"p"] = num_traits<T>::to_double(p[0]);
444 case ProcessType::ZIPF:
446 j[
"params"][
"s"] = num_traits<T>::to_double(p[0]);
447 j[
"params"][
"n"] =
static_cast<long>(std::lround(num_traits<T>::to_double(p[1])));
449 case ProcessType::DISCRETESAMPLER:
450 j[
"params"][
"p"] = vec_to_json(p);
451 if (!d.trace.empty()) j[
"params"][
"x"] = vec_to_json(d.trace);
453 case ProcessType::EMPIRICALCDF:
454 j[
"params"][
"x"] = vec_to_json(d.trace);
455 j[
"params"][
"F"] = vec_to_json(p);
457 case ProcessType::REPLAYER:
464 if (!d.trace_file.empty()) j[
"params"][
"fileName"] = d.trace_file;
465 j[
"params"][
"mean"] = num_traits<T>::to_double(d.mean);
466 if (d.trace_file.empty())
467 j[
"params"][
"scv"] = num_traits<T>::to_double(d.scv);
469 case ProcessType::MMAPT:
470 case ProcessType::MPHT: {
471 j[
"params"][
"breakpoints"] = vec_to_json(d.sched_bp);
472 j[
"params"][
"cyclic"] = d.sched_cyclic;
473 json A = json::array();
474 for (
const Matrix<T>& M : d.sched_D0) A.push_back(mat_to_json(M));
475 json blocks = json::array();
476 for (
const std::vector<Matrix<T> >& per_mark : d.sched_Dmark) {
477 json segs = json::array();
478 for (
const Matrix<T>& M : per_mark) segs.push_back(mat_to_json(M));
479 blocks.push_back(segs);
486 j[
"params"][
"D0"] = A;
487 j[
"params"][
"D1k"] = blocks;
490 case ProcessType::BMMAPT: {
495 j[
"params"][
"breakpoints"] = vec_to_json(d.sched_bp);
496 j[
"params"][
"cyclic"] = d.sched_cyclic;
497 json A = json::array();
498 for (
const Matrix<T>& M : d.sched_D0) A.push_back(mat_to_json(M));
499 json blocks = json::array();
500 for (
const std::vector<std::vector<Matrix<T> > >& per_mark : d.sched_Dbatch) {
501 json per_batch = json::array();
502 for (
const std::vector<Matrix<T> >& batch : per_mark) {
503 json segs = json::array();
504 for (
const Matrix<T>& M : batch) segs.push_back(mat_to_json(M));
505 per_batch.push_back(segs);
507 blocks.push_back(per_batch);
509 j[
"params"][
"D0"] = A;
510 j[
"params"][
"D1kb"] = blocks;
518 case ProcessType::NHPP:
519 case ProcessType::MAPT:
520 case ProcessType::PHT: {
521 j[
"params"][
"breakpoints"] = vec_to_json(d.sched_bp);
522 j[
"params"][
"cyclic"] = d.sched_cyclic;
523 if (d.type == ProcessType::NHPP) {
525 json rates = json::array();
526 for (
const Matrix<T>& D1 : d.sched_D1)
527 rates.push_back(num_traits<T>::to_double(D1(0, 0)));
528 j[
"params"][
"rates"] = rates;
531 json A = json::array(), B = json::array();
532 for (
const Matrix<T>& M : d.sched_D0) A.push_back(mat_to_json(M));
533 for (
const Matrix<T>& M : d.sched_D1) B.push_back(mat_to_json(M));
537 j[
"params"][
"D0"] = A;
538 j[
"params"][
"D1"] = B;
541 case ProcessType::PRIOR:
543 "network_writer: a Prior is a set of alternative MODELS rather than one law; save "
544 "the design point SolverUQ built, not the design");
548 throw UnsupportedError(std::string(
"network_writer: distribution family '") +
561std::vector<int> lattice_cutoffs(
const qn::NetworkStruct<T>& sn) {
562 std::vector<int> cut(sn.classes.size(), 10);
563 for (std::size_t r = 0; r < sn.classes.size(); ++r)
565 std::isfinite(sn.classes[r].population))
566 cut[r] =
static_cast<int>(std::lround(sn.classes[r].population));
572void for_each_lattice_point(
const std::vector<int>& cut,
const F& visit) {
573 std::size_t total = 1;
574 for (
int c : cut) total *=
static_cast<std::size_t
>(c + 1);
575 const std::size_t K = cut.size();
576 for (std::size_t i = 0; i < total; ++i) {
577 std::vector<int> cnt(K, 0);
579 for (std::size_t d = 0; d < K; ++d) {
580 cnt[d] =
static_cast<int>(li %
static_cast<std::size_t
>(cut[d] + 1));
581 li /=
static_cast<std::size_t
>(cut[d] + 1);
585 for (std::size_t d = 0; d < K; ++d) {
587 key += std::to_string(cnt[d]);
590 if (tot == 0)
continue;
607 const std::size_t K =
sn.classes.size();
608 const std::vector<int> cut = detail::lattice_cutoffs(
sn);
611 model[
"type"] =
"Network";
612 model[
"name"] =
sn.name;
615 if (!
sn.log_path.empty()) model[
"logPath"] =
sn.log_path;
618 json classes = json::array();
619 for (std::size_t r = 0; r < K; ++r) {
626 const bool sig = r <
sn.issignal.size() &&
sn.issignal[r];
628 cj[
"type"] =
"Signal";
635 if (
sn.signaltarget[r] >= 1 &&
sn.signaltarget[r] <= K)
636 cj[
"targetClass"] =
sn.classes[
sn.signaltarget[r] - 1].name;
640 if (!
sn.signalremdist[r].empty()) {
641 json pv = json::array();
643 json xv = json::array();
649 for (std::size_t b = 0; b < pv.size(); ++b) xv.push_back(
static_cast<double>(b));
651 rd[
"type"] =
"DiscreteSampler";
652 rd[
"params"][
"p"] = pv;
653 rd[
"params"][
"x"] = xv;
654 cj[
"removalDistribution"] = rd;
664 if (std::isfinite(pop) && pop == std::floor(pop) && std::fabs(pop) < 9.0e15)
665 cj[
"population"] =
static_cast<long long>(pop);
667 cj[
"population"] = pop;
670 "' names no reference station, which a closed class must have");
671 cj[
"refNode"] =
sn.nodes[
sn.station_to_node[c.
refstat - 1] - 1].name;
673 if (c.
prio != 0) cj[
"priority"] = c.
prio;
674 if (c.
immfeed) cj[
"immediateFeedback"] =
true;
677 if (c.
spawn >= 1 && c.
spawn <= K) cj[
"spawnClass"] =
sn.classes[c.
spawn - 1].name;
678 if (r <
sn.syncreply.size() &&
sn.syncreply[r] >= 1 &&
sn.syncreply[r] <= K)
679 cj[
"replySignalClass"] =
sn.classes[
sn.syncreply[r] - 1].name;
680 classes.push_back(cj);
682 model[
"classes"] = classes;
685 json nodes = json::array();
686 for (std::size_t i = 0; i <
sn.nodes.size(); ++i) {
688 const std::size_t ind = i + 1, ist = nd.
station;
690 nj[
"name"] = nd.
name;
707 json by_dest = json::array(), by_prob = json::array(), by_dist = json::array();
708 for (std::size_t k = 0; k < fp->
fan_out_link.rows(); ++k)
709 for (std::size_t r = 0; r < fp->
fan_out_link.cols() && r < K; ++r) {
711 if (p == 0.0)
continue;
713 rec[
"dest"] =
sn.nodes[k].name;
714 rec[
"class"] = r + 1;
716 by_dest.push_back(rec);
719 pr[
"dest"] =
sn.nodes[k].name;
722 by_prob.push_back(pr);
727 dr[
"dest"] =
sn.nodes[k].name;
729 json pv = json::array(), xv = json::array();
730 for (std::size_t e = 0; e < d.
params.size(); ++e) {
732 xv.push_back(d.
trace.empty()
733 ?
static_cast<double>(e + 1)
738 by_dist.push_back(dr);
741 if (!by_dest.empty()) nj[
"fanOutByDest"] = by_dest;
742 if (!by_prob.empty()) nj[
"fanOutProb"] = by_prob;
743 if (!by_dist.empty()) nj[
"fanOutDist"] = by_dist;
751 typename std::map<std::size_t, std::pair<std::size_t, std::size_t> >::const_iterator
fj;
752 for (std::size_t f = 0; f <
sn.fj.size(); ++f)
753 if (
sn.fj[f].second == ind)
754 nj[
"forkNode"] =
sn.nodes[
sn.fj[f].first - 1].name;
755 typename std::map<std::size_t, typename SN::JoinDecl>::const_iterator jd =
756 sn.joindecl.find(ind);
757 if (jd !=
sn.joindecl.end()) {
759 nj[
"joinStrategy"] =
"PARTIAL";
760 if (jd->second.quorum > 0) nj[
"joinQuorum"] = jd->second.quorum;
764 typename std::map<std::size_t, Matrix<T> >::const_iterator cs =
sn.csmatrix.find(ind);
765 if (cs !=
sn.csmatrix.end()) {
767 for (std::size_t r = 0; r < K; ++r) {
769 for (std::size_t s = 0; s < K; ++s) {
771 if (v != 0.0) row[
sn.classes[s].name] = v;
773 if (!row.empty()) csm[
sn.classes[r].name] = row;
775 nj[
"classSwitchMatrix"] = csm;
779 typename std::map<std::size_t, qn::CacheParam<T> >::const_iterator cp =
780 sn.nodeparam.find(ind);
781 if (cp !=
sn.nodeparam.end()) {
783 nj[
"numItems"] = c.
nitems;
784 nj[
"itemLevelCap"] = c.
itemcap;
785 nj[
"replacementStrategy"] = detail::replacement_to_json(c.
replacestrat);
791 else nj[
"costCaps"] = c.
costcap;
793 json pop, hit, miss, itemcls;
794 for (std::size_t r = 0; r < K && r < c.
pread.size(); ++r) {
795 if (c.
pread[r].empty())
continue;
797 pj[
"type"] =
"DiscreteSampler";
798 pj[
"params"][
"p"] = detail::vec_to_json(c.
pread[r]);
799 pj[
"params"][
"x"] = detail::discrete_support(c.
pread[r].size());
800 pop[
sn.classes[r].name] = pj;
802 for (std::size_t r = 0; r < K && r < c.
hitclass.size(); ++r)
804 hit[
sn.classes[r].name] =
sn.classes[c.
hitclass[r] - 1].name;
805 for (std::size_t r = 0; r < K && r < c.
missclass.size(); ++r)
807 miss[
sn.classes[r].name] =
sn.classes[c.
missclass[r] - 1].name;
808 for (std::size_t r = 0; r < K && r < c.
classitem.size(); ++r)
810 itemcls[
sn.classes[r].name] =
static_cast<double>(c.
classitem[r]);
811 if (!pop.empty()) nj[
"popularity"] = pop;
812 if (!hit.empty()) nj[
"hitClass"] = hit;
813 if (!miss.empty()) nj[
"missClass"] = miss;
814 if (!itemcls.empty()) nj[
"itemClass"] = itemcls;
816 json ap = json::array();
818 json row = json::array();
820 row.push_back(g.rows() == 0 ? json::array() : detail::mat_to_json(g));
823 nj[
"accessProb"] = ap;
832 json qs = json::array();
833 for (std::size_t q : kv.second) qs.push_back(
sn.nodes[q - 1].name);
834 entry[
"queues"] = qs;
839 items[std::to_string(it)] =
841 entry[
"items"] = items;
842 by[
sn.classes[kv.first].name] = entry;
845 nj[
"retrievalSystem"] = rs;
850 typename std::map<std::size_t, std::vector<T> >::const_iterator im =
851 sn.initmarking.find(ind);
852 if (im !=
sn.initmarking.end()) nj[
"initialState"] = detail::vec_to_json(im->second);
853 typename std::map<std::size_t, std::vector<T> >::const_iterator sp =
854 sn.stateprior.find(ind);
855 typename std::map<std::size_t, Matrix<T> >::const_iterator ss =
sn.statespace.find(ind);
856 if (sp !=
sn.stateprior.end() && ss !=
sn.statespace.end()) {
857 nj[
"stateSpace"] = detail::mat_to_json(ss->second);
858 nj[
"statePrior"] = detail::vec_to_json(sp->second);
866 nj[
"scheduling"] = detail::sched_to_json(st.
sched);
874 if (std::isfinite(st.
cap) && st.
cap > 0) nj[
"buffer"] = st.
cap;
876 json svc, cc, dr, sp, imf;
877 for (std::size_t r = 0; r < K; ++r) {
878 if (ist - 1 <
sn.service.size() && r <
sn.service[ist - 1].size() &&
879 !
sn.service[ist - 1][r].disabled)
880 svc[
sn.classes[r].name] = detail::dist_to_json(
sn.service[ist - 1][r]);
888 dr[
sn.classes[r].name] =
894 for (std::size_t r = 0; r < K && r < st.
schedparam.size(); ++r)
896 if (!svc.empty()) nj[
"service"] = svc;
897 if (!cc.empty()) nj[
"classCap"] = cc;
898 if (!dr.empty()) nj[
"dropRule"] = dr;
899 if (!sp.empty()) nj[
"schedParams"] = sp;
900 if (!imf.empty()) nj[
"immediateFeedback"] = imf;
904 ld[
"type"] =
"loadDependent";
905 ld[
"scaling"] = detail::vec_to_json(st.
lldscaling);
906 nj[
"loadDependence"] = ld;
910 for (
int kind = 0; kind < 2; ++kind) {
912 if (!
static_cast<bool>(fun))
continue;
914 blk[
"type"] = kind == 0 ?
"classDependent" :
"jointDependent";
915 blk[
"cutoffs"] = cut;
916 detail::for_each_lattice_point(cut, [&](
const std::vector<int>& cnt,
917 const std::string& key) {
919 for (std::size_t r = 0; r < K; ++r)
921 tbl[key] = detail::vec_to_json(fun(n));
923 blk[
"scaling"] = tbl;
925 nj[kind == 0 ?
"classDependence" :
"jointDependence"] = blk;
928 typename std::map<std::size_t, typename SN::PasParam>::const_iterator pas =
929 sn.pasparam.find(ist);
930 if (pas !=
sn.pasparam.end() &&
static_cast<bool>(pas->second.svc_rate_fun)) {
932 detail::for_each_lattice_point(
933 cut, [&](
const std::vector<int>& cnt,
const std::string& key) {
934 std::vector<std::size_t> micro;
935 for (std::size_t r = 0; r < K; ++r)
936 for (
int c = 0; c < cnt[r]; ++c) micro.push_back(r + 1);
939 nj[
"oiServiceRate"] = tbl;
940 nj[
"oiCutoffs"] = cut;
941 bool any_swap =
false;
942 for (
const std::vector<bool>& row : pas->second.swap_graph)
943 for (
bool v : row) any_swap = any_swap || v;
945 json sg = json::array();
946 for (
const std::vector<bool>& row : pas->second.swap_graph) {
947 json rj = json::array();
948 for (
bool v : row) rj.push_back(v ? 1 : 0);
951 nj[
"swapGraph"] = sg;
956 nj[
"pollingType"] = detail::polling_to_json(st.
polling_type[0]);
963 json so = json::array();
964 for (std::size_t r = 0; r < K && r < st.
switchover.size(); ++r) {
967 e[
"from"] =
sn.classes[r].name;
968 e[
"distribution"] = detail::dist_to_json(st.
switchover[r]);
972 for (std::size_t c = 0; c < K && c < st.
switchover_pair[r].size(); ++c) {
975 e[
"from"] =
sn.classes[r].name;
976 e[
"to"] =
sn.classes[c].name;
980 if (!so.empty()) nj[
"switchoverTimes"] = so;
983 typename std::map<std::size_t, qn::SetupDelayOffParam<T> >::const_iterator sd =
984 sn.setupparam.find(ist);
985 if (sd !=
sn.setupparam.end()) {
987 for (std::size_t r = 0; r < K && r < sd->second.setup.size(); ++r) {
988 if (sd->second.setup[r].disabled)
continue;
989 su[
sn.classes[r].name] = detail::dist_to_json(sd->second.setup[r]);
990 doff[
sn.classes[r].name] = detail::dist_to_json(sd->second.delayoff[r]);
993 nj[
"setupTime"] = su;
994 nj[
"delayOffTime"] = doff;
1003 typename std::map<std::size_t, qn::BreakdownParam<T> >::const_iterator bd =
1004 sn.breakdownparam.find(ist);
1005 if (bd !=
sn.breakdownparam.end()) {
1007 bj[
"failure"] = detail::dist_to_json(bd->second.failure);
1008 bj[
"repair"] = detail::dist_to_json(bd->second.repair);
1010 for (std::size_t r = 0; r < K && r < bd->second.down_service_rates.size(); ++r) {
1013 if (!(rate > 0.0))
continue;
1014 ds[
sn.classes[r].name] = detail::dist_to_json(
1017 if (!ds.empty()) bj[
"downService"] = ds;
1018 nj[
"breakdown"] = bj;
1022 typename std::map<std::size_t, qn::RetrialParam<T> >::const_iterator rt =
1023 sn.retrialparam.find(ist);
1024 if (rt !=
sn.retrialparam.end()) {
1026 for (std::size_t r = 0; r < K && r < rt->second.retrial_proc.size(); ++r) {
1027 if (rt->second.retrial_proc[r].disabled)
continue;
1029 e[
"delay"] = detail::dist_to_json(rt->second.retrial_proc[r]);
1030 e[
"maxAttempts"] = rt->second.max_attempts[r];
1031 rj[
sn.classes[r].name] = e;
1033 if (!rj.empty()) nj[
"retrial"] = rj;
1037 json pat, orb, brp, blk;
1038 for (std::size_t r = 0; r < K; ++r) {
1041 e[
"distribution"] = detail::dist_to_json(st.
patience[r]);
1044 e[
"impatienceType"] = detail::impatience_to_json(st.
impatience[r]);
1045 pat[
sn.classes[r].name] = e;
1055 e[
"strategy"] = detail::balking_to_json(st.
balking[r].strategy);
1056 json ths = json::array();
1060 tj[
"minJobs"] = th.min_jobs;
1061 tj[
"maxJobs"] = th.max_jobs;
1065 e[
"thresholds"] = ths;
1066 blk[
sn.classes[r].name] = e;
1069 if (!pat.empty()) nj[
"patience"] = pat;
1070 if (!orb.empty()) nj[
"orbitImpatience"] = orb;
1071 if (!brp.empty()) nj[
"batchRejectProb"] = brp;
1072 if (!blk.
empty()) nj[
"balking"] = blk;
1075 json sts = json::array();
1078 tj[
"name"] = t.
name;
1079 tj[
"count"] = t.
count;
1081 json cn = json::array();
1082 for (std::size_t r = 0; r < K && r < t.
compatible.size(); ++r)
1084 tj[
"compatibleClasses"] = cn;
1087 for (std::size_t r = 0; r < K && r < t.
service.size(); ++r)
1089 sv[
sn.classes[r].name] = detail::dist_to_json(t.
service[r]);
1090 if (!sv.empty()) tj[
"service"] = sv;
1093 nj[
"serverTypes"] = sts;
1095 nj[
"heteroSchedPolicy"] = detail::hetero_to_json(st.
hetero_policy);
1102 if (!par.empty()) nj[
"serverParallelism"] = par;
1106 for (std::size_t r = 0; r < K && r < st.
arrival_batch.size(); ++r)
1109 if (!ab.empty()) nj[
"arrivalBatch"] = ab;
1111 json
mc = json::array();
1113 nj[
"markedClasses"] =
mc;
1118 dd[
sn.classes[r].name] =
"FIFO";
1119 if (!dd.empty()) nj[
"departureDiscipline"] = dd;
1124 typename std::map<std::size_t, qn::TransitionParam<T> >::const_iterator tp =
1125 sn.transparam.find(ind);
1126 if (tp !=
sn.transparam.end()) {
1127 json modes = json::array();
1128 for (std::size_t m = 0; m < tp->second.nmodes; ++m) {
1130 mj[
"name"] = tp->second.modenames[m];
1131 mj[
"timingStrategy"] =
1134 if (!tp->second.firingproc[m].disabled)
1135 mj[
"distribution"] = detail::dist_to_json(tp->second.firingproc[m]);
1136 mj[
"numServers"] = tp->second.nmodeservers[m];
1137 mj[
"firingPriority"] = tp->second.firingprio[m];
1139 const char* kArcKey[3] = {
"enablingConditions",
"inhibitingConditions",
1141 for (
int which = 0; which < 3; ++which) {
1142 const Matrix<T>& row = which == 0 ? tp->second.enabling[m]
1143 : which == 1 ? tp->second.inhibiting[m]
1144 : tp->second.firing[m];
1145 json arcs = json::array();
1146 for (std::size_t q = 0; q < row.rows(); ++q)
1147 for (std::size_t r = 0; r < row.cols(); ++r) {
1152 if (which == 1 ? !std::isfinite(v) : v == 0.0)
continue;
1154 a[
"node"] =
sn.nodes[q].name;
1161 a[
"class"] =
sn.classes[r].name;
1165 if (!arcs.empty()) mj[kArcKey[which]] = arcs;
1173 if (m < tp->second.firingdep.size() && tp->second.firingdep[m]) {
1174 const Matrix<T>& enab = tp->second.enabling[m];
1175 json slots = json::array();
1176 std::vector<std::size_t> slot_node;
1177 std::vector<long> caps;
1185 for (std::size_t q = 0; q < enab.
rows(); ++q) {
1186 std::size_t rq = enab.
cols();
1187 for (std::size_t r = 0; r < enab.
cols(); ++r)
1189 if (rq == enab.
cols())
continue;
1191 sm[
"node"] =
sn.nodes[q].name;
1192 sm[
"class"] =
sn.classes[rq].name;
1193 slots.push_back(sm);
1194 slot_node.push_back(q);
1198 const std::size_t sq =
sn.nodes[q].station;
1199 const double pc = sq == 0 ? std::numeric_limits<double>::infinity()
1200 :
sn.stations[sq - 1].cap;
1201 caps.push_back(std::isfinite(pc) ? std::lround(pc) : 10L);
1203 if (!slots.empty()) {
1205 frm[
"slots"] = slots;
1206 frm[
"cutoffs"] = caps;
1208 std::size_t total = 1;
1209 for (std::size_t s = 0; s < caps.size(); ++s)
1210 total *=
static_cast<std::size_t
>(caps[s]) + 1;
1212 for (std::size_t li = 0; li < total; ++li) {
1213 std::size_t rem = li;
1215 for (std::size_t s = 0; s < caps.size(); ++s) {
1216 const std::size_t shp =
static_cast<std::size_t
>(caps[s]) + 1;
1217 const std::size_t c = rem % shp;
1220 static_cast<long>(c));
1222 key += std::to_string(c);
1226 scaling[key] = std::isfinite(v) ? v : 0.0;
1228 for (std::size_t s = 0; s < slot_node.size(); ++s)
1230 frm[
"scaling"] = scaling;
1231 mj[
"firingRateDependence"] = frm;
1234 modes.push_back(mj);
1236 nj[
"modes"] = modes;
1239 nodes.push_back(nj);
1241 model[
"nodes"] = nodes;
1245 for (
const auto& kv :
sn.P) {
1246 const std::size_t r = kv.first.first, s = kv.first.second;
1248 for (std::size_t a = 0; a < kv.second.rows(); ++a) {
1250 for (std::size_t b = 0; b < kv.second.cols(); ++b) {
1252 if (p != 0.0) row[
sn.nodes[b].name] = p;
1254 if (!row.empty()) from_to[
sn.nodes[a].name] = row;
1256 if (!from_to.empty())
1257 matrix[
sn.classes[r - 1].name +
"," +
sn.classes[s - 1].name] = from_to;
1260 routing[
"type"] =
"matrix";
1261 routing[
"matrix"] = matrix;
1262 model[
"routing"] = routing;
1264 json strategies, weights, params;
1265 for (std::size_t i = 0; i <
sn.nodes.size(); ++i) {
1267 json per_class, per_class_w, per_class_p;
1268 for (std::size_t r = 0; r < K && r < nd.
routing.size(); ++r) {
1271 per_class[
sn.classes[r].name] = detail::routing_to_json(nd.
routing[r]);
1274 for (
const auto& kv : nd.
routing_weights[r]) dw[
sn.nodes[kv.first - 1].name] = kv.second;
1275 per_class_w[
sn.classes[r].name] = dw;
1280 per_class_p[
sn.classes[r].name] = pj;
1283 if (!per_class.empty()) strategies[nd.
name] = per_class;
1284 if (!per_class_w.empty()) weights[nd.
name] = per_class_w;
1285 if (!per_class_p.empty()) params[nd.
name] = per_class_p;
1287 if (!strategies.empty()) model[
"routingStrategies"] = strategies;
1288 if (!weights.empty()) model[
"routingWeights"] = weights;
1289 if (!params.empty()) model[
"routingParams"] = params;
1296 if (!
sn.sdr_nodes.empty()) {
1298 std::size_t cls = 0;
1299 for (std::size_t r = 0; r < K && cls == 0; ++r)
1300 if (
sn.nodes[sd.
entry].routing.size() > r &&
1304 throw InputError(
"network_writer: the model declares state-dependent routing at node '" +
1305 sn.nodes[sd.
entry].name +
"' but no class routes SDR there");
1307 sdr[
"entry"] =
sn.nodes[sd.
entry].name;
1309 sdr[
"class"] =
sn.classes[cls - 1].name;
1310 json branches = json::array();
1311 for (std::size_t b = 0; b < sd.
branch.size(); ++b) {
1312 json bn = json::array();
1313 for (std::size_t q = 0; q < sd.
branch[b].size(); ++q)
1314 bn.push_back(
sn.nodes[sd.
branch[b][q]].name);
1315 branches.push_back(bn);
1317 sdr[
"branches"] = branches;
1318 json level = json::array(), Cs = json::array(), dm = json::array();
1319 for (std::size_t b = 0; b < sd.
level.size(); ++b)
1320 level.push_back(
static_cast<double>(sd.
level[b]));
1321 for (std::size_t t = 0; t < sd.
C.size(); ++t) Cs.push_back(sd.
C[t]);
1322 for (std::size_t t = 0; t < sd.
d.
rows(); ++t) {
1323 json row = json::array();
1324 for (std::size_t b = 0; b < sd.
d.
cols(); ++b) row.push_back(sd.
d(t, b));
1327 sdr[
"level"] = level;
1330 model[
"stateDepRouting"] = sdr;
1334 if (!
sn.regions.empty()) {
1335 json fcr = json::array();
1336 for (std::size_t g = 0; g <
sn.regions.size(); ++g) {
1337 const typename SN::Region& rg =
sn.regions[g];
1339 rj[
"name"] = rg.name.empty() ?
"Region" + std::to_string(g + 1) : rg.name;
1340 json stations = json::array();
1341 double global = -1.0, globalmem = -1.0;
1342 json class_cap, class_size, class_weight;
1343 for (std::size_t m = 0; m < rg.members.size(); ++m) {
1344 if (!rg.members[m])
continue;
1346 sj[
"node"] =
sn.nodes[
sn.station_to_node[m] - 1].name;
1347 stations.push_back(sj);
1348 global = rg.cap[m][K];
1354 if (m < rg.maxmem.size()) globalmem = rg.maxmem[m];
1355 for (std::size_t r = 0; r < K; ++r)
1356 if (rg.cap[m][r] != -1.0) class_cap[
sn.classes[r].name] = rg.cap[m][r];
1358 rj[
"stations"] = stations;
1359 if (global != -1.0) rj[
"globalMaxJobs"] = global;
1360 if (globalmem != -1.0) rj[
"globalMaxMemory"] = globalmem;
1361 if (!class_cap.empty()) rj[
"classMaxJobs"] = class_cap;
1363 for (std::size_t r = 0; r < K && r < rg.rule.size(); ++r)
1364 rule[
sn.classes[r].name] = detail::drop_to_json(rg.rule[r]);
1365 rj[
"dropRule"] = rule;
1366 for (std::size_t r = 0; r < K; ++r) {
1375 if (!class_size.empty() || !class_weight.empty())
1376 for (json& sj : rj[
"stations"]) {
1377 if (!class_size.empty()) sj[
"classSize"] = class_size;
1378 if (!class_weight.empty()) sj[
"classWeight"] = class_weight;
1380 if (rg.lincon_A.rows() > 0) {
1381 rj[
"constraintA"] = detail::mat_to_json(rg.lincon_A);
1382 rj[
"constraintB"] = detail::vec_to_json(rg.lincon_b);
1386 model[
"finiteCapacityRegions"] = fcr;
1397 if (
static_cast<bool>(
sn.gdscaling)) {
1398 const std::size_t M =
sn.nstations, K =
sn.nclasses;
1399 const std::vector<double> njobs =
sn.njobs();
1400 const int wcut =
sn.gdscalingcutoff;
1401 std::vector<std::size_t> slot_st, slot_cl;
1402 std::vector<int> cuts;
1403 for (std::size_t i = 0; i < M; ++i) {
1405 for (std::size_t r = 0; r < K; ++r) {
1406 const double cap =
sn.classcap[i][r];
1407 if (!(cap > 0))
continue;
1408 int c = std::isfinite(njobs[r]) ?
static_cast<int>(std::lround(njobs[r])) : wcut;
1409 if (std::isfinite(cap)) c = std::min(c,
static_cast<int>(std::lround(cap)));
1410 slot_st.push_back(i);
1411 slot_cl.push_back(r);
1412 cuts.push_back(c > 0 ? c : 0);
1415 const std::size_t P = cuts.size();
1416 std::size_t total = 1;
1417 for (std::size_t d = 0; d < P; ++d) {
1418 total *=
static_cast<std::size_t
>(cuts[d] + 1);
1419 if (total > 200000u)
1421 "the global dependence lattice exceeds the wire limit of 200000 points; lower "
1422 "the wireCutoff argument of set_global_dependence, or solve the model "
1426 json blk, slots, tbl;
1427 blk[
"type"] =
"globalDependent";
1428 std::vector<std::string> station_names(M), class_names(K);
1429 for (std::size_t i = 0; i < M; ++i)
1430 station_names[i] =
sn.nodes[
sn.station_to_node[i] - 1].name;
1431 for (std::size_t r = 0; r < K; ++r) class_names[r] =
sn.classes[r].name;
1432 blk[
"stations"] = station_names;
1433 blk[
"classes"] = class_names;
1434 slots = json::array();
1435 for (std::size_t d = 0; d < P; ++d) {
1437 sm[
"station"] = station_names[slot_st[d]];
1438 sm[
"class"] = class_names[slot_cl[d]];
1439 slots.push_back(sm);
1441 blk[
"slots"] = slots;
1442 blk[
"cutoffs"] = cuts;
1443 blk[
"cutoff"] = wcut;
1445 for (std::size_t li = 0; li < total; ++li) {
1446 std::size_t rem = li;
1447 std::vector<int> cnt(P, 0);
1448 for (std::size_t d = 0; d < P; ++d) {
1449 cnt[d] =
static_cast<int>(rem %
static_cast<std::size_t
>(cuts[d] + 1));
1450 rem /=
static_cast<std::size_t
>(cuts[d] + 1);
1453 for (std::size_t d = 0; d < P; ++d)
1455 const std::vector<T> v =
sn.gdscaling(n);
1456 std::vector<double> flat(M * K, 1.0);
1457 for (std::size_t i = 0; i < M; ++i)
1458 for (std::size_t r = 0; r < K; ++r) {
1463 flat[i * K + r] = std::isfinite(x) ? x : 0.0;
1466 if (P == 0) key =
"0";
1468 for (std::size_t d = 0; d < P; ++d) {
1470 key += std::to_string(cnt[d]);
1474 blk[
"scaling"] = tbl;
1475 std::vector<double> pk(M * K, 1.0);
1476 for (std::size_t j = 0; j < pk.size() && j <
sn.gdscalingpeak.size(); ++j)
1479 model[
"globalDependence"] = blk;
1494 std::map<std::string, json> by_name;
1495 for (
const typename SN::Reward& rw :
sn.reward) {
1496 if (rw.kind.empty() || rw.node == 0)
continue;
1498 rj[
"name"] = rw.name;
1499 rj[
"type"] = rw.kind;
1500 rj[
"node"] =
sn.nodes[rw.node - 1].name;
1501 if (rw.cls != 0) rj[
"class"] =
sn.classes[rw.cls - 1].name;
1502 by_name[rw.name] = rj;
1504 json rewards = json::array();
1505 for (
const std::pair<const std::string, json>& kv : by_name) rewards.push_back(kv.second);
1506 if (!rewards.empty()) model[
"rewards"] = rewards;
1515 root[
"format"] =
"line-model";
1516 root[
"version"] =
"1.0";
1518 detail::wire_nonfinite(root);
1525 std::ofstream out(path.c_str());
1526 if (!out)
throw InputError(
"network_writer: cannot open " + path +
" for writing");
UnsupportedError(const std::string &what)
A network plus its refreshed NetworkStruct.
What refreshProcessRepresentations and refreshLST compute FROM a distribution: the (D0,...
The exception types the port throws.
Enumerations and the minimal distribution descriptor shared by the model layer of the C++ port.
detail::json network_to_json(const qn::NetworkStruct< T > &sn)
qn::NetworkStruct -> the model.json model object.
detail::json network_json_envelope(const qn::NetworkStruct< T > &sn)
The complete model.json envelope: {format, version, model}.
void write_network_json(const qn::NetworkStruct< T > &sn, const std::string &path)
Write a model.json file, indented as the reference writers indent it.
SchedStrategy
Scheduling disciplines, with the values of MATLAB SchedStrategy.
DropStrategy
Blocking and loss rules, with the values of MATLAB DropStrategy.
@ IMMEDIATE
fires with zero delay, resolved by weight and priority
BalkingStrategy
Balking rules, with the values of MATLAB BalkingStrategy.
SignalType
G-network signal classes, with the values of MATLAB SignalType.
@ REPLY
completes a synchronous call, releasing a held server
@ CATASTROPHE
removes EVERY job at the station
RoutingStrategy
Routing strategies, with the values of MATLAB RoutingStrategy.
@ SDR
Krzesinski (1987) product-form state-dependent routing.
RemovalPolicy
Which job a negative signal removes, with the values of MATLAB RemovalPolicy.
@ FCFS
the oldest waiting job; servers only once nobody waits
@ RANDOM
uniform over waiting AND in-service jobs
HeteroSchedPolicy
How a heterogeneous station picks among its server types, MATLAB HeteroSchedPolicy.
PollingType
Polling service disciplines, with the values of MATLAB PollingType.
@ KLIMITED
serve at most K per visit (K in pollingPar)
@ EXHAUSTIVE
serve until the queue empties
@ GATED
serve exactly the jobs present at the polling instant
@ DECREMENTING
serve until the queue is one shorter than at arrival
ProcessType
Distribution kinds, with the values of MATLAB ProcessType.
const char * sched_to_text(SchedStrategy s)
const char * process_to_text(ProcessType p)
The MATLAB ProcessType name, as sn.procid prints it.
std::function< std::vector< T >(const std::vector< T > &)> CdScaling
A class-dependent scaling map, sn.cdscaling.
NodeType
Node kinds, with the values of MATLAB NodeType.
ReplacementStrategy
Cache replacement policies, with the values of MATLAB ReplacementStrategy.
@ HLRU
h-LRU / LRU(m): h lists, promote i -> i+1 on a hit
@ CLIMB
move up one position on a hit (transposition rule)
@ QLRU
q-LRU: LRU with probabilistic admission on a miss
@ FIFO
first in, first out
ImpatienceType
Impatience kinds, with the values of MATLAB ImpatienceType.
Conservation laws of a layered queueing network, enumerated from its structure.
Reader for the LINE model.json interchange (a Network model) into a qn::Network<T> built through the ...
A queueing network and its refreshed NetworkStruct.
Number-type abstraction for the templated API port.
static Distrib exp_rate(const T &r)
std::vector< T > params
Constructor arguments, in MATLAB getParam order.
std::vector< T > trace
Replayer / Trace samples; empty for every other type.
Topology and coefficients of a state-dependent routing subnetwork.
std::vector< std::size_t > level
level[b] is the unique t with B_b in V_t - V_{t+1}; level[0] is unused.
Matrix< double > d
Coefficients d_tb of eq.
std::vector< double > C
Coefficients C_t of eq.
std::size_t departure
Departure centre d of Q(V,V); may equal entry.
std::vector< std::vector< std::size_t > > branch
branch[b] holds the centres of branch b, b >= 1; branch[0] is unused.
std::size_t entry
Entry centre e of Q(V,V).
T qlru
Delayed-hit retrieval system (Cache.setRetrievalSystem).
std::vector< T > initstate
The DECLARED initial contents of the cache, as the reference dumps the node's state row: the per-clas...
std::vector< int > itemsize
Per-item storage cost (size) and per-list cap on the total cost of the resident items (ton21cache Sec...
std::vector< int > costcap
std::map< std::size_t, std::vector< std::size_t > > retrieval_queues
read class(0-based)->nodes
std::vector< std::vector< Matrix< T > > > accost
(u) x (n) of (h+1)x(h+1), or empty
std::vector< std::vector< std::size_t > > retrieval_classes
(nitems x nclasses), 1-based
std::vector< int > itemcap
std::vector< std::size_t > missclass
std::vector< std::size_t > hitclass
lang::ReplacementStrategy replacestrat
std::vector< std::size_t > classitem
Item read by each per-item class of a cache network (MATLAB Cache.setItemReadClasses,...
std::vector< std::vector< T > > pread
(u) x (n), empty row = NaN
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.
std::size_t refstat
1-based reference station
double deadline
sn.classdeadline(r): the soft deadline EDD and EDF order by, and the tardiness JMT reports.
double population
infinite for an open class
bool immfeed
Class-level immediate feedback, ORed with the station's own setting into sn.immfeed.
std::size_t spawn
sn.classspawn(r): the 1-based class injected at the SAME station on every completion of this class,...
bool self_looping
A SelfLoopingClass: a closed class that perpetually cycles at its reference station.
bool is_ref_class
marks the chain's reference class
std::string file_name
base name, no directory
std::vector< int > routing_param
The scalar parameter of a parameterized dispatcher, per class: the d of a power-of-d (SQ) choice.
std::vector< std::map< std::size_t, double > > routing_weights
The per-destination weights of a WRROBIN dispatcher, per class: a map from 1-based destination NODE i...
bool queue_object
Declared as a Queue although its INF discipline makes nodetype Delay (Network::add_queue).
std::vector< RoutingStrategy > routing
sn.routing, per class.
double tasks_per_link
Fork.output.tasksPerLink == MATLAB sn.nodeparam{f}.fanOut: how many tasks a fork emits per outgoing l...
One balking threshold: with min_jobs <= n <= max_jobs at the station, an arriving job of the class re...
A heterogeneous server pool: count servers that serve only compatible classes, each with its own serv...
std::vector< bool > compatible
per class; empty = every class
std::vector< Distrib< T > > service
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< T > jdscalingpeak
sn.jdscalingpeak for this station: the declared peak joint-dependent scaling per class.
std::vector< BalkingParam > balking
std::vector< T > batch_reject
Queue.setBatchRejectProbability: per-class rejection of a whole batch.
std::vector< Distrib< T > > patience
Queue.setPatience(class, dist): the abandonment timer of a WAITING job, with impatience[r] naming whi...
std::vector< std::size_t > server_parallelism
Queue.setServerParallelism(class, n): the servers a job seizes for the whole of its service,...
std::vector< int > droprule
Per-class blocking rule as an INT, with 0 meaning "not set".
std::vector< std::vector< Distrib< T > > > switchover_pair
Queue.setSwitchover(fromClass, toClass, distrib): the walk the server takes when it turns from servin...
double nservers
may be infinite (a Delay, or an inf-scheduled task)
std::vector< lang::PollingType > polling_type
Polling parameters for a POLLING station, MATLAB's pollingType, switchoverTime and pollingPar on the ...
CdScaling< T > jdscaling
sn.jdscaling for this station: MATLAB's Station.ljdScaling, the JOINT dependence map eta_i(n),...
std::vector< T > cdscalingpeak
sn.cdscalingpeak for this station: the DECLARED peak rate scaling per class, empty when the station i...
std::vector< std::size_t > marked_classes
Source.markedClasses: the 1-based class of each mark of an MMAP arrival.
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
std::vector< T > schedparam
sn.schedparam, per class: the DPS / GPS weight, or the SEPT / LEPT rank.
lang::HeteroSchedPolicy hetero_policy
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.
std::vector< Distrib< T > > arrival_batch
Source.setArrivalBatch(class, dist): the batch-size law released at each arrival epoch.
std::vector< Distrib< T > > switchover
std::vector< bool > immfeed
Node-level immediate feedback, per class; empty when the station sets none.
std::vector< ServerType > server_types