![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
A queueing network under construction. More...
#include <line/lang/qn/network_builder.h>
Public Member Functions | |
| Network (const std::string &nm) | |
| std::size_t | add_queue (const std::string &nm, SchedStrategy sched=SchedStrategy::FCFS) |
| A queueing station. | |
| std::size_t | add_delay (const std::string &nm) |
| An infinite-server station (a Delay, MATLAB's Delay / DelayStation). | |
| std::size_t | add_source (const std::string &nm) |
| The external arrival station. | |
| std::size_t | add_sink (const std::string &nm) |
| The external departure node. | |
| std::size_t | add_router (const std::string &nm) |
| A stateless routing node. | |
| std::size_t | add_logger (const std::string &nm, const std::string &log_file=std::string()) |
| A Logger node: a pass-through that records every job crossing it. | |
| void | set_log_path (const std::string &path) |
| Network.setLogPath: the directory every Logger of this model writes into. | |
| std::size_t | add_class_switch (const std::string &nm, const Matrix< T > &C) |
| A ClassSwitch node carrying the (nclasses x nclasses) switching matrix. | |
| std::size_t | add_class_switch (const std::string &nm) |
| A ClassSwitch node whose matrix is installed LATER, by set_class_switch_matrix. | |
| void | set_class_switch_matrix (std::size_t node, const Matrix< T > &C) |
| Install the switching matrix of a ClassSwitch created without one. | |
| std::size_t | add_fork (const std::string &nm, double tasks_per_link=1.0) |
| A Fork node. | |
| void | set_fork_tasks_per_link (std::size_t fork_node, std::size_t jobclass, double tasks, std::size_t dest_node=0) |
| Variable forking levels on an existing Fork, the twin of MATLAB Fork.setTasksPerLink(jobclass, n), Fork.setTasksPerLinkDistribution(jobclass, dist [, destNode]) and Fork.setBranchProbability(jobclass, destNode, p). | |
| void | set_fork_tasks_per_link_dist (std::size_t fork_node, std::size_t jobclass, const lang::Distrib< T > &dist, std::size_t dest_node=0) |
| A random jobs-per-link degree, redrawn per link and per forked job. | |
| void | set_fork_branch_probability (std::size_t fork_node, std::size_t jobclass, std::size_t dest_node, double prob) |
| A branch that fires only with probability prob. | |
| std::size_t | add_join (const std::string &nm, std::size_t fork_node) |
| A Join node, which IS a station: it serves at an infinite rate, and the synchronisation delay is supplied by the fork-join transform. | |
| std::size_t | add_join_unbound (const std::string &nm) |
| The Join station on its own, with the fork left to bind_join. | |
| void | bind_join (std::size_t join_node, std::size_t fork_node) |
| Record which Fork a Join created by add_join_unbound closes. | |
| std::size_t | add_place (const std::string &nm) |
| A Place: an SPN token container. | |
| std::size_t | add_transition (const std::string &nm, const TransitionParam< T > &par) |
| A Transition: the firing rules of an SPN, as Transition in MATLAB. | |
| void | set_retrial (std::size_t node, std::size_t cls, const Distrib< T > &proc, const T &rate, int max_attempts=0) |
| Queue.setRetrial(...): a station with an ORBIT instead of a waiting line. | |
| void | set_patience (std::size_t node, std::size_t cls, const Distrib< T > &dist, lang::ImpatienceType kind=lang::ImpatienceType::RENEGING) |
| Queue.setPatience(class, dist, type): the abandonment timer of a job WAITING at the station, and which impatience rule the timer belongs to. | |
| void | set_orbit_impatience (std::size_t node, std::size_t cls, const Distrib< T > &dist) |
| Queue.setOrbitImpatience(class, dist): abandonment from the retrial orbit. | |
| void | set_batch_reject (std::size_t node, std::size_t cls, const T &p) |
| Queue.setBatchRejectProbability(class, p). | |
| void | set_balking (std::size_t node, std::size_t cls, lang::BalkingStrategy strategy, const std::vector< typename Station< T >::BalkingThreshold > &thresholds) |
| Queue.setBalking(class, strategy, thresholds): an arrival that refuses to JOIN, on the state it finds. | |
| void | add_server_type (std::size_t node, const typename Station< T >::ServerType &stype) |
| Queue.addServerType(...): one heterogeneous server pool of the station. | |
| void | set_server_parallelism (std::size_t node, std::size_t cls, std::size_t n) |
| Queue.setServerParallelism(class, n): the servers a job seizes for the whole of its service. | |
| void | set_hetero_sched_policy (std::size_t node, lang::HeteroSchedPolicy policy) |
| Queue.setHeteroSchedPolicy(...): how the server pools are picked among. | |
| void | set_arrival_batch (std::size_t node, std::size_t cls, const Distrib< T > &dist) |
| Source.setArrivalBatch(class, dist): the batch-size law released at each arrival epoch. | |
| void | set_marked_classes (std::size_t node, const std::vector< std::size_t > &classes) |
| Source.markedClasses: the 1-based class carried by each mark of an MMAP. | |
| void | set_departure_discipline (std::size_t node, std::size_t cls, lang::DepartureDiscipline rule) |
| Place.setDepartureDiscipline(class, rule). | |
| void | set_initial_marking (std::size_t node, const std::vector< T > &tokens) |
| Place.setState(marking): the initial token count of the place, per class. | |
| void | set_state_prior (std::size_t node, const Matrix< T > &space, const std::vector< T > &prior) |
| StatefulNode.setStatePrior(space, prior): a distribution over the rows of a DECLARED state space. | |
| void | set_join_strategy (std::size_t node, lang::JoinStrategy strategy, double quorum=0.0) |
| Join.setStrategy(...): STD waits for every sibling, PARTIAL for a quorum. | |
| void | set_routing_weights (std::size_t node, std::size_t cls, const std::map< std::size_t, double > &weights) |
| The per-destination weights of a WRROBIN dispatcher, per (node, class). | |
| void | set_routing_param (std::size_t node, std::size_t cls, int d) |
| The d of a power-of-d (SQ) dispatcher, per (node, class). | |
| void | set_setup_delayoff (std::size_t node, std::size_t cls, const Distrib< T > &setup, const Distrib< T > &delayoff) |
| Queue.setDelayOff(class, setupTime, delayoffTime): the station powers down after sitting idle for the delay-off time, and the next arrival pays the setup time before service. | |
| void | set_breakdown (std::size_t node, const Distrib< T > &failure, const Distrib< T > &repair, const std::vector< Distrib< T > > &down_service=std::vector< Distrib< T > >()) |
| Queue.setBreakdown(failure, repair, downService): the server alternates up and down on the two clocks. | |
| std::size_t | add_cache (const std::string &nm, const CacheParam< T > &par) |
| A Cache node with its item population, list capacities and popularity. | |
| void | set_item_read_classes (std::size_t cache_node, const std::vector< std::size_t > &read_classes, const std::vector< std::size_t > &hit_classes) |
| Cache.setItemReadClasses(readClasses, hitClasses): declare that read_classes[i] is the request stream for item i at this cache. | |
| std::vector< std::size_t > | set_miss_cache (std::size_t cache_node, std::size_t next_cache, const std::vector< std::size_t > &hit_classes_at_next) |
| Cache.setMissCache(readClass, nextCache, hitClassAtNext): send this cache's misses to next_cache preserving item identity, by minting one class per item there and making the miss class of item i here its read class for item i. | |
| void | set_item_miss_class (std::size_t cache_node, const std::vector< std::size_t > &miss_classes) |
| Cache.setItemMissClass(readClass, missClasses): terminate a cache network, every per-item class of this cache reporting a miss as the matching entry of miss_classes, which the caller routes onward. | |
| void | set_retrieval_system (std::size_t cache_node, std::size_t read_class, std::size_t miss_class, const std::vector< std::size_t > &queue_nodes) |
| Cache.setRetrievalSystem(readClass, missClass, queues): a delayed-hit cache whose misses are fetched by circulating a per-item retrieval class through queue_nodes and back to the cache. | |
| std::size_t | add_closed_class (const std::string &nm, double njobs, std::size_t refstat_node, int prio=0) |
| A closed class of the given population, referencing a station node. | |
| std::size_t | add_open_class (const std::string &nm, int prio=0) |
| An open class. | |
| std::size_t | add_self_looping_class (const std::string &nm, double njobs, std::size_t refstat_node, int prio=0) |
| SelfLoopingClass(model, name, njobs, refstat, prio): a closed class whose jobs perpetually cycle at their reference station. | |
| void | set_reference_class (std::size_t cls) |
| JobClass.setReferenceClass(true): sn.refclass(c) picks this class. | |
| void | set_class_deadline (std::size_t cls, double due) |
| JobClass.deadline: the soft deadline EDD, EDF and JMT's tardiness use. | |
| void | set_class_spawn (std::size_t cls, std::size_t spawn_cls) |
| JobClass.spawnClass (sn.classspawn): the class injected at the same station on every completion of cls. | |
| void | set_class_patience (std::size_t cls, const Distrib< T > &dist, lang::ImpatienceType kind=lang::ImpatienceType::RENEGING) |
| JobClass.setPatience(kind, dist): the CLASS-WIDE abandonment law. | |
| void | set_reply_signal_class (std::size_t call_cls, std::size_t reply_cls) |
| JobClass.setReplySignalClass(reply) (sn.syncreply), plus the sn.replyblock the state layer needs. | |
| void | set_service (std::size_t node, std::size_t cls, const Distrib< T > &d) |
| station.setService(class, dist). | |
| void | set_arrival (std::size_t node, std::size_t cls, const Distrib< T > &d) |
| source.setArrival(class, dist): the same table, at the Source. | |
| void | set_number_of_servers (std::size_t node, double n) |
| queue.setNumberOfServers(n). | |
| void | set_capacity (std::size_t node, double k) |
| station.setCapacity(k), the K of Kendall's notation. | |
| void | set_class_capacity (std::size_t node, std::size_t cls, double k) |
| station.setChainCapacity(class, k). | |
| void | set_immediate_feedback (std::size_t node, std::size_t cls) |
| queue.setImmediateFeedback(class): a completing job of that class is fed straight back into service, HOLDING THE SERVER, rather than being routed out and re-queued. | |
| void | set_class_immediate_feedback (std::size_t cls) |
| jobclass.setImmediateFeedback(): the same property, class-wide. | |
| void | set_drop_rule (std::size_t node, std::size_t cls, DropStrategy rule) |
| station.setDropRule(class, rule). | |
| void | set_service_rate_function (std::size_t node, const std::function< T(const std::vector< std::size_t > &)> &muFun, const Matrix< T > &swap_graph=Matrix< T >()) |
| Queue.setServiceRateFunction(muFun): the TOTAL service rate of a PAS or OI station as a function of the ordered microstate, a 1-based list of class indices in queue order. | |
| void | set_polling_type (std::size_t node, lang::PollingType rule, int par=0) |
| Queue.setPollingType(rule, par): the polling discipline of a POLLING station, identical across all class buffers as the reference assumes. | |
| void | set_switchover (std::size_t node, std::size_t cls, const Distrib< T > &so) |
| Queue.setSwitchover(jobclass, distrib): the switchover time of a class. | |
| void | set_sched_param (std::size_t node, std::size_t cls, const T &weight) |
| The DPS / GPS weight of a class at a station. | |
| void | set_load_dependence (std::size_t node, const std::vector< T > &alpha) |
| station.setLoadDependence(alpha): the rate multiplier at population 1, 2, ... The vector is indexed from population one, as sn.lldscaling is, so entry 0 is the multiplier of a station holding one job. | |
| void | set_class_dependence (std::size_t node, const CdScaling< T > &fun, const std::vector< T > &peak=std::vector< T >()) |
| station.setClassDependence(beta, peakRatePerClass). | |
| void | set_joint_dependence (std::size_t node, const CdScaling< T > &fun, const std::vector< T > &peak) |
| station.setJointDependence(eta, peakRatePerClass): MATLAB's Station.ljdScaling / ljdScalingPeak. | |
| void | set_global_dependence (const GdScaling< T > &fun, const std::vector< T > &peak) |
| model.setGlobalDependence(phi, peak): MATLAB's Network.gdScaling. | |
| void | set_global_dependence (const GdScaling< T > &fun, const std::vector< T > &peak, int wire_cutoff) |
| As above, with an explicit per-slot OPEN-class truncation used when phi is materialized onto the JSON wire (closed classes are tabulated up to their own population). | |
| void | set_routing (std::size_t node, std::size_t cls, RoutingStrategy rs) |
| node.setRouting(class, strategy). | |
| void | set_state_dep_routing (std::size_t entry, std::size_t departure, const std::vector< std::vector< std::size_t > > &branches, const std::vector< std::size_t > &level, const std::vector< double > &C, const Matrix< double > &d, std::size_t cls=0) |
| node.setStateDepRouting(class, departure, branches, level, C, d). | |
| RoutingMatrix< T > | init_routing_matrix () const |
| An empty routing matrix, MATLAB's model.initRoutingMatrix. | |
| void | link (const RoutingMatrix< T > &Pm) |
| model.link(P): install the routing. | |
| const NetworkStruct< T > & | get_struct () |
| The refreshed struct, MATLAB's model.getStruct(). | |
| NetworkStruct< T > & | raw_struct () |
| The struct WITHOUT refreshing it, for a caller that is still building. | |
| void | set_pas (std::size_t node, const std::function< T(const std::vector< std::size_t > &)> &mu, const std::vector< std::vector< bool > > &swap_graph=std::vector< std::vector< bool > >()) |
| Queue.setService(@(c) ...) for a pass-and-swap / order-independent station: the total service rate mu(c) of an ordered list of 1-based class indices, and the swap graph saying which class may take another's place. | |
| void | pas_mirror (std::size_t ist, const std::function< T(const std::vector< std::size_t > &)> &mu, const Matrix< T > &swap_graph) |
| Copy a PAS/OI declaration into sn.pasparam, the form the state-space layer reads. | |
| void | set_polling (std::size_t node, lang::PollingType ptype, const std::vector< Distrib< T > > &switchover=std::vector< Distrib< T > >(), std::size_t pk=1) |
| Queue.setPollingType(...): the polling discipline of a POLLING station and the switchover walks between its buffers. | |
| void | set_sync_reply (std::size_t node, std::size_t call_cls, std::size_t reply_cls) |
| Declare a SYNCHRONOUS call: a job of call_cls leaving node keeps its server until a job of the REPLY class reply_cls arrives back here. | |
| std::size_t | add_region (const std::vector< std::size_t > &nodes, const std::vector< double > &class_max_jobs, double global_max_jobs=-1.0, const std::vector< DropStrategy > &rule=std::vector< DropStrategy >(), const std::vector< double > &class_max_memory=std::vector< double >(), const std::vector< T > &class_size=std::vector< T >(), double global_max_memory=-1.0, const std::string &name=std::string()) |
| FiniteCapacityRegion(model, nodes): a cap on the jobs held ACROSS a set of stations. | |
| void | set_region_weights (std::size_t region, const std::vector< T > &weight) |
| FiniteCapacityRegion.setClassWeight: the per-class weight the region's global cap counts a job against, defaulting to 1. | |
| void | set_region_constraint (std::size_t region, const Matrix< T > &A, const std::vector< T > &b) |
| The optional linear constraint A n <= b a region may carry beyond its caps. | |
| void | set_reward (const std::string &nm, const std::function< T(const std::vector< T > &)> &fn, const std::string &kind=std::string(), std::size_t node=0, std::size_t cls=0) |
| model.setReward(name, fn): a named reward evaluated on the AGGREGATE state row, the per-(station, class) job counts in (ist-1)*K + k order. | |
| void | set_signal (std::size_t cls, lang::SignalType type, lang::RemovalPolicy policy=lang::RemovalPolicy::RANDOM, std::size_t target=0, const std::vector< T > &remdist=std::vector< T >()) |
| Declare a class to be a G-network SIGNAL rather than a job. | |
| std::size_t | station_index (std::size_t node) const |
A queueing network under construction.
The object owns a NetworkStruct and hands out a refreshed reference to it. get_struct() runs the whole refresh chain each time it is called, because every setter can have moved a quantity the chain derives; a caller that changes nothing and asks twice pays for the second refresh, which is the same bargain MATLAB's hasStruct cache makes on the other side.
Definition at line 96 of file network_builder.h.
|
inlineexplicit |
Definition at line 98 of file network_builder.h.
|
inline |
A Cache node with its item population, list capacities and popularity.
Definition at line 659 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
A ClassSwitch node whose matrix is installed LATER, by set_class_switch_matrix.
FOR A FILE READER, which meets the nodes before the classes. A .jsimg and a .lqnx both list their nodes first, and a closed class names its reference STATION, so neither order can be satisfied without deferring one of the two – MATLAB's own ClassSwitch constructor stores the matrix without checking it against a class list that does not exist yet, which is the same deferral by another name.
THE MATRIX IS LEFT EMPTY, not filled with an identity: an identity is a valid switching matrix (every class keeps its own), so a caller who forgot to install the real one would get a plausible model instead of an error.
Definition at line 233 of file network_builder.h.
|
inline |
A ClassSwitch node carrying the (nclasses x nclasses) switching matrix.
The classes must exist before the node, since the matrix is indexed by them; that is also the order a MATLAB script writes.
Definition at line 207 of file network_builder.h.
Referenced by line::io::build_network_from_json(), and line::io::read_jsim().
|
inline |
A closed class of the given population, referencing a station node.
Definition at line 864 of file network_builder.h.
Referenced by line::io::build_network_from_json(), line::fes::fes_aggregate(), line::api::infer_mlps(), line::io::pnml_load(), line::io::read_jsim(), and line::api::sn_aggregate_chains().
|
inline |
An infinite-server station (a Delay, MATLAB's Delay / DelayStation).
Definition at line 131 of file network_builder.h.
Referenced by line::io::build_network_from_json(), line::fes::fes_aggregate(), line::api::infer_mlps(), line::io::read_jsim(), and line::api::sn_aggregate_chains().
|
inline |
A Fork node.
It holds no jobs and is removed by the stochastic complement. tasks_per_link (Fork.output.tasksPerLink) defaults to 1.
Definition at line 256 of file network_builder.h.
Referenced by line::io::build_network_from_json(), and line::io::read_jsim().
|
inline |
A Join node, which IS a station: it serves at an infinite rate, and the synchronisation delay is supplied by the fork-join transform.
Definition at line 330 of file network_builder.h.
Referenced by line::io::read_jsim().
|
inline |
The Join station on its own, with the fork left to bind_join.
A Join IS a station, so creating it late shifts every station index after it, and the result document is indexed by station row. A reader that has to see the Fork first therefore declares the Join here, in the position the model gives it, and binds the pair once the Fork exists.
Definition at line 344 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
A Logger node: a pass-through that records every job crossing it.
It holds no jobs and changes no routing probability, so it is eliminated by the same stochastic complement that removes a Router; what makes it a distinct node type is that used_lang_features emits Logger/LogTunnel from it, so a solver with no logging refuses the model by name rather than silently dropping the trace the user asked for.
Definition at line 186 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
An open class.
Its reference station is the Source, which must exist: an open class with no arrival station has no reference for its visits.
Definition at line 883 of file network_builder.h.
Referenced by line::io::build_network_from_json(), line::io::read_jsim(), and line::api::sn_aggregate_chains().
|
inline |
A Place: an SPN token container.
Modelled as an INF-scheduled station so the marginal machinery treats its tokens as "in service", which is the encoding State.toMarginal folds the buffer slot back into.
Definition at line 373 of file network_builder.h.
Referenced by line::io::build_network_from_json(), line::io::pnml_load(), and line::io::read_jsim().
|
inline |
A queueing station.
The default discipline is FCFS, as in MATLAB.
INF SCHEDULING BUILDS A DELAY. MATLAB's Queue constructor sets numberOfServers = Inf on that branch and getNodeTypes then reports the station as NodeType.Delay (the JAR does both with Integer.MAX_VALUE), and the analyzers partition the stations on those two fields: sn_get_product_form_chain_params splits by NODETYPE, so a Queue node left at one server was handed to the linearizer as a finite-server queue and reported utilization 1 and a saturated response time where the reference reports a delay (2.4494/19.5506 against 0.1253/21.8747 on a two-station closed model with 22 jobs).
Definition at line 117 of file network_builder.h.
Referenced by line::io::build_network_from_json(), line::fes::fes_aggregate(), line::api::infer_mlps(), line::io::read_jsim(), and line::api::sn_aggregate_chains().
|
inline |
FiniteCapacityRegion(model, nodes): a cap on the jobs held ACROSS a set of stations.
class_max_jobs[r] and global_max_jobs are -1 for unbounded, the reference's sentinel; the per-class cap is additionally tightened by floor(class_max_memory[r] / class_size[r]) when a memory budget is set, because a class whose footprint exceeds the budget cannot have as many jobs resident as its job cap alone would allow.
| nodes | 1-based node indices; each must be a station |
| class_max_jobs | (K) per-class job cap inside the region, -1 for unbounded |
| global_max_jobs | cap on the total jobs inside the region, -1 for unbounded |
| rule | (K) per-class drop strategy applied when the cap is reached |
| class_max_memory | (K) per-class memory budget, -1 for unbounded |
| class_size | (K) per-job memory footprint of each class |
| global_max_memory | cap on the total memory inside the region, -1 for unbounded |
Definition at line 1736 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
A stateless routing node.
Definition at line 171 of file network_builder.h.
Referenced by line::io::build_network_from_json(), line::io::read_jsim(), and line::api::sn_aggregate_chains().
|
inline |
SelfLoopingClass(model, name, njobs, refstat, prio): a closed class whose jobs perpetually cycle at their reference station.
Built as a closed class because that is all it is – the self-loop is in the routing, and SelfLoopingClass.m adds no state – with the subclass recorded so the wire type survives a round trip.
Definition at line 906 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
Queue.addServerType(...): one heterogeneous server pool of the station.
Definition at line 476 of file network_builder.h.
Referenced by line::Station::add_server_type(), and line::io::build_network_from_json().
|
inline |
The external departure node.
It is NOT a station and holds no jobs.
Definition at line 162 of file network_builder.h.
Referenced by line::io::build_network_from_json(), line::io::read_jsim(), and line::api::sn_aggregate_chains().
|
inline |
The external arrival station.
It IS a station – its "service" process is the arrival process – with the EXT discipline and one server, exactly as MATLAB's Source is built.
Definition at line 148 of file network_builder.h.
Referenced by line::io::build_network_from_json(), line::io::read_jsim(), and line::api::sn_aggregate_chains().
|
inline |
A Transition: the firing rules of an SPN, as Transition in MATLAB.
A transition has MODES, not classes: each mode has its own enabling and inhibiting conditions over the places, its own firing effect, and its own firing process. The parameters are transcribed from the reference's refreshPetriNetNodes.m, so State.fromMarginal finds the fields it reads instead of a node it cannot decode.
Definition at line 393 of file network_builder.h.
Referenced by line::io::build_network_from_json(), line::io::pnml_load(), and line::io::read_jsim().
|
inline |
Record which Fork a Join created by add_join_unbound closes.
Definition at line 357 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
The refreshed struct, MATLAB's model.getStruct().
Definition at line 1602 of file network_builder.h.
Referenced by line::uq::SolverUq< T >::analyze(), line::NetworkSolver::avg_table(), line::SolverBA::bounds_table(), line::io::build_environment_from_json(), line::io::build_network_from_json(), line::SolverCTMC::cdf_respt(), line::SolverFLD::cdf_respt(), line::opt::closed_sensitivities(), find_solver_report(), line::SolverCTMC::generator(), line::api::infer_mlps(), line::NetworkSolver::list_valid_methods(), main(), line::SolverCTMC::marg_aggr(), line::opt::open_sensitivities(), line::SolverCTMC::prob_aggr(), line::io::qn2lqn(), line::SolverCTMC::state_space(), line::SolverFLD::tran_avg(), and line::uq::uq_interval_run().
|
inline |
An empty routing matrix, MATLAB's model.initRoutingMatrix.
Definition at line 1397 of file network_builder.h.
|
inline |
model.link(P): install the routing.
The probabilities are stored as given. A node whose strategy is RAND needs only the CONNECTIONS – any positive entry marks one – and the refresh replaces them by the uniform split.
Definition at line 1406 of file network_builder.h.
Referenced by line::opt::ClassServiceMapping::apply(), line::io::build_network_from_json(), line::fes::fes_aggregate(), line::api::infer_mlps(), line::io::pnml_load(), line::io::read_jsim(), and line::api::sn_aggregate_chains().
|
inline |
Copy a PAS/OI declaration into sn.pasparam, the form the state-space layer reads.
The (R x R) swap adjacency crosses as a boolean matrix because that is the shape after_event's swap walk indexes.
Definition at line 1651 of file network_builder.h.
|
inline |
The struct WITHOUT refreshing it, for a caller that is still building.
Definition at line 1616 of file network_builder.h.
Referenced by line::opt::ClassPriority::apply(), line::opt::ClassServiceMapping::apply(), line::opt::JobPopulation::apply(), line::opt::RoutingProbabilities::apply(), line::opt::ServerAllocation::apply(), line::opt::ServiceRate::apply(), line::opt::StationReplicas::apply(), line::io::build_network_from_json(), and line::api::sn_aggregate_chains().
|
inline |
source.setArrival(class, dist): the same table, at the Source.
Definition at line 1002 of file network_builder.h.
Referenced by line::io::build_network_from_json(), line::uq::SolverUq< T >::expand(), line::io::read_jsim(), line::Source::set_arrival(), and line::api::sn_aggregate_chains().
|
inline |
Source.setArrivalBatch(class, dist): the batch-size law released at each arrival epoch.
The arrival process itself only spaces the epochs.
Definition at line 514 of file network_builder.h.
Referenced by line::io::build_network_from_json(), and line::Source::set_arrival_batch().
|
inline |
Queue.setBalking(class, strategy, thresholds): an arrival that refuses to JOIN, on the state it finds.
Distinct from reneging, which abandons a job that has already joined.
Definition at line 467 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
Queue.setBatchRejectProbability(class, p).
Definition at line 456 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
Queue.setBreakdown(failure, repair, downService): the server alternates up and down on the two clocks.
BOTH CLOCKS ARE REQUIRED. A server that fails and is never repaired is a different model – an absorbing one – and the reference declines to infer it from a missing repair time rather than treating it as infinite.
down_service is per class and OPTIONAL; an entry left disabled means the class gets no service while the server is down, which is the ordinary reading. A declared one must be EXPONENTIAL: a phase-type degraded service would need its own phase block in the joint chain and no codebase builds one, so it is refused by name rather than approximated by its mean.
Definition at line 627 of file network_builder.h.
Referenced by line::io::build_network_from_json(), and line::Station::set_breakdown().
|
inline |
station.setCapacity(k), the K of Kendall's notation.
Definition at line 1036 of file network_builder.h.
Referenced by line::io::build_network_from_json(), line::fes::fes_aggregate(), line::io::read_jsim(), line::Station::set_capacity(), and line::api::sn_aggregate_chains().
|
inline |
station.setChainCapacity(class, k).
Definition at line 1041 of file network_builder.h.
Referenced by line::io::build_network_from_json(), line::io::read_jsim(), and line::Station::set_class_capacity().
|
inline |
JobClass.deadline: the soft deadline EDD, EDF and JMT's tardiness use.
Definition at line 919 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
station.setClassDependence(beta, peakRatePerClass).
The peak is a scalar broadcast across the classes, or one value per class; it is the declared max_n beta_r(n) that utilization is normalized by, and the reference makes it mandatory because it cannot be recovered from beta without sweeping the whole lattice – a sweep that needs a bound the handle does not carry, and an open class has none.
An empty peak is accepted HERE and refused where it is READ, matching getLimitedClassDependencePeak. That contract is only worth anything if every reader honours it, and they do: SolverCTMC, solver_mva_run_analyzer, solver_nc_conv, both SSA engines and the LDES engine each throw by name. SolverMVA was the exception until 2026-08-19, silently writing a column of ZEROS into U instead. set_joint_dependence below takes the peak as a REQUIRED argument and refuses at declaration; both shapes end in an error.
Definition at line 1174 of file network_builder.h.
Referenced by line::io::build_network_from_json(), and line::fes::fes_aggregate().
|
inline |
jobclass.setImmediateFeedback(): the same property, class-wide.
Definition at line 1062 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
JobClass.setPatience(kind, dist): the CLASS-WIDE abandonment law.
The reference has no class-indexed patience in sn: refreshStruct reads it through Queue.getPatience, which falls back to the class setting wherever the station declares none, so the class-level law is materialized onto every Queue and Delay here for exactly that reason. A station-level setPatience therefore wins, as it does in MATLAB.
Definition at line 943 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
JobClass.spawnClass (sn.classspawn): the class injected at the same station on every completion of cls.
Definition at line 927 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
Install the switching matrix of a ClassSwitch created without one.
Definition at line 241 of file network_builder.h.
Referenced by line::ClassSwitch::ClassSwitch(), line::io::read_jsim(), and line::ClassSwitch::set_class_switching_matrix().
|
inline |
Place.setDepartureDiscipline(class, rule).
Definition at line 526 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
station.setDropRule(class, rule).
Definition at line 1067 of file network_builder.h.
Referenced by line::io::build_network_from_json(), line::io::read_jsim(), and line::Station::set_drop_rule().
|
inline |
A branch that fires only with probability prob.
Definition at line 312 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
Variable forking levels on an existing Fork, the twin of MATLAB Fork.setTasksPerLink(jobclass, n), Fork.setTasksPerLinkDistribution(jobclass, dist [, destNode]) and Fork.setBranchProbability(jobclass, destNode, p).
The block is allocated lazily and only on a fork that actually declares an override, so a plain fork has no sn.forkparam entry at all and every consumer can tell the classic case from the variable one by asking sn.fork_param_of(f) for a null.
dest_node 0 means every outgoing link of that class. Classes and nodes are 1-based, as everywhere in this port.
An override is RECORDED and replayed when the routing is installed, so these may be called in either order with respect to link() – as the MATLAB, Java and Python setters may, which store the override on the Forker section and materialise it at refresh time. Recording rather than writing is what buys that: dest_node = 0 means "every link this class takes", a set that does not exist until the routing does.
Definition at line 284 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
A random jobs-per-link degree, redrawn per link and per forked job.
Definition at line 296 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
model.setGlobalDependence(phi, peak): MATLAB's Network.gdScaling.
Declares a globally state-dependent rate scaling phi(n) whose argument is the FULL (nstations x nclasses) population matrix, row-major, rather than one station's slice. This is the Whittle primitive: when phi satisfies phi_s(n) phi_t(n-e_s) = phi_t(n) phi_s(n-e_t) the chain is reversible with pi(n) ~ Phi(n) prod rho_s^n_s and is insensitive; it also expresses bandwidth sharing, where a route holds several links at once.
phi returns one scalar (broadcast), one entry per station, or one entry per (station, class) in row-major order. The peak is MANDATORY for the same reason as set_class_dependence: utilization is reported as T*S/peak. Only SolverCTMC honours the handle.
Definition at line 1234 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
As above, with an explicit per-slot OPEN-class truncation used when phi is materialized onto the JSON wire (closed classes are tabulated up to their own population).
It plays no part in solving, and exists because a handle cannot cross a language boundary: the writer needs to know how far the lattice extends. Set it to the cutoff the model is solved at.
Definition at line 1245 of file network_builder.h.
|
inline |
Queue.setHeteroSchedPolicy(...): how the server pools are picked among.
Definition at line 506 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
queue.setImmediateFeedback(class): a completing job of that class is fed straight back into service, HOLDING THE SERVER, rather than being routed out and re-queued.
Node-scoped. set_class_immediate_feedback is the class-wide spelling; sn.immfeed is the OR of the two, as refreshStruct computes it.
Definition at line 1055 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
Place.setState(marking): the initial token count of the place, per class.
Definition at line 534 of file network_builder.h.
Referenced by line::io::build_network_from_json(), line::io::pnml_load(), line::io::read_jsim(), and line::Place::set_initial_marking().
|
inline |
Cache.setItemMissClass(readClass, missClasses): terminate a cache network, every per-item class of this cache reporting a miss as the matching entry of miss_classes, which the caller routes onward.
Definition at line 773 of file network_builder.h.
|
inline |
Cache.setItemReadClasses(readClasses, hitClasses): declare that read_classes[i] is the request stream for item i at this cache.
Use at the cache the exogenous requests enter, where the per-item classes are the caller's own; item popularity is then carried by the per-class request rates rather than by a popularity the cache draws from. This is what keeps a cache network free of arc-level class switching, so no class acquires a default route into the cache the model never intended. hit_classes is either one class shared by every item or one per item.
Definition at line 676 of file network_builder.h.
Referenced by line::Cache::set_item_read_classes().
|
inline |
Join.setStrategy(...): STD waits for every sibling, PARTIAL for a quorum.
Definition at line 558 of file network_builder.h.
Referenced by line::io::build_network_from_json(), and line::Join::set_strategy().
|
inline |
station.setJointDependence(eta, peakRatePerClass): MATLAB's Station.ljdScaling / ljdScalingPeak.
The peak is MANDATORY, exactly as in Station.setJointDependence, and for the same reason as setClassDependence: utilization at a dependent station is reported as T*S/peak, and max_n eta_i(n) is not recoverable from the handle without sweeping the whole lattice.
Definition at line 1200 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
station.setLoadDependence(alpha): the rate multiplier at population 1, 2, ... The vector is indexed from population one, as sn.lldscaling is, so entry 0 is the multiplier of a station holding one job.
Definition at line 1152 of file network_builder.h.
Referenced by line::io::build_network_from_json(), and line::Station::set_load_dependence().
|
inline |
Network.setLogPath: the directory every Logger of this model writes into.
Definition at line 199 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
Source.markedClasses: the 1-based class carried by each mark of an MMAP.
Definition at line 521 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
Cache.setMissCache(readClass, nextCache, hitClassAtNext): send this cache's misses to next_cache preserving item identity, by minting one class per item there and making the miss class of item i here its read class for item i.
Returns the minted classes. The cache-to-cache arc itself is registered here and injected by link(), so the caller routes only its own topology.
Definition at line 711 of file network_builder.h.
|
inline |
queue.setNumberOfServers(n).
IT IS A NO-OP ON AN INF-SCHEDULED STATION, which is what MATLAB does: the method switches on the discipline and ignores the request for SchedStrategy.INF. Lowering the multiplicity onto the station instead looks harmless and is not – utilization at a finite-server station is divided by the server count, so an inf-scheduled station would report a utilization a factor n too small.
Definition at line 1024 of file network_builder.h.
Referenced by line::opt::ServerAllocation::apply(), line::opt::StationReplicas::apply(), line::io::build_network_from_json(), line::fes::fes_aggregate(), line::api::infer_mlps(), line::io::read_jsim(), line::Station::set_number_of_servers(), and line::api::sn_aggregate_chains().
|
inline |
Queue.setOrbitImpatience(class, dist): abandonment from the retrial orbit.
Definition at line 449 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
Queue.setService(@(c) ...) for a pass-and-swap / order-independent station: the total service rate mu(c) of an ordered list of 1-based class indices, and the swap graph saying which class may take another's place.
An OI station is the special case of an empty swap graph.
Definition at line 1624 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
Queue.setPatience(class, dist, type): the abandonment timer of a job WAITING at the station, and which impatience rule the timer belongs to.
Definition at line 439 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
Queue.setPollingType(...): the polling discipline of a POLLING station and the switchover walks between its buffers.
switchover[r-1] is the walk the server takes when LEAVING buffer r. An Immediate walk is folded rather than represented, so it costs no state.
Definition at line 1671 of file network_builder.h.
|
inline |
Queue.setPollingType(rule, par): the polling discipline of a POLLING station, identical across all class buffers as the reference assumes.
Only K-limited carries a parameter; every other rule ignores it.
Definition at line 1121 of file network_builder.h.
Referenced by line::io::build_network_from_json(), and line::Station::set_polling_type().
|
inline |
JobClass.setReferenceClass(true): sn.refclass(c) picks this class.
Definition at line 914 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
The optional linear constraint A n <= b a region may carry beyond its caps.
Definition at line 1803 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
FiniteCapacityRegion.setClassWeight: the per-class weight the region's global cap counts a job against, defaulting to 1.
A weight of 2 makes one job of the class consume two of the region's slots.
Definition at line 1794 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
JobClass.setReplySignalClass(reply) (sn.syncreply), plus the sn.replyblock the state layer needs.
The reference derives the block rather than being told it (refreshLocalVars.m:340-386): a server is held at every non-Source, non-INF station the REPLY class can be routed INTO, and every such station must be FCFS because a held server is encoded as a per-class counter. That derivation needs the routing, so it runs in finalize(); this only records the binding.
Definition at line 971 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
Queue.setRetrial(...): a station with an ORBIT instead of a waiting line.
An arrival finding every server busy joins the orbit and re-attempts at rate; a completion does NOT promote from the orbit, so the state is an (in-service, orbit) split rather than an ordered buffer.
Definition at line 411 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
Cache.setRetrievalSystem(readClass, missClass, queues): a delayed-hit cache whose misses are fetched by circulating a per-item retrieval class through queue_nodes and back to the cache.
Creates one retrieval class per item, each inheriting the read class's service at every retrieval queue (call set_service(queue, readClass, ...) first); the routing among the cache and the queues is inherited from the read class in link(). Records the retrieval capacity (nitems - total cache capacity), the queue node list, and the item -> retrieval-class map that cache_retrieval_inputs reads. Must be called after the read/miss classes and the cache exist.
Definition at line 800 of file network_builder.h.
|
inline |
model.setReward(name, fn): a named reward evaluated on the AGGREGATE state row, the per-(station, class) job counts in (ist-1)*K + k order.
Redeclaring a name REPLACES it rather than adding a second reward under the same name, so a caller refining a definition does not end up with two answers labelled identically.
Definition at line 1820 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
node.setRouting(class, strategy).
Definition at line 1290 of file network_builder.h.
Referenced by line::io::build_network_from_json(), line::io::read_jsim(), and line::Node::set_routing().
|
inline |
The d of a power-of-d (SQ) dispatcher, per (node, class).
Definition at line 582 of file network_builder.h.
Referenced by line::io::build_network_from_json(), and line::io::read_jsim().
|
inline |
The per-destination weights of a WRROBIN dispatcher, per (node, class).
Definition at line 570 of file network_builder.h.
Referenced by line::io::build_network_from_json(), line::io::read_jsim(), and line::Node::set_routing_weights().
|
inline |
The DPS / GPS weight of a class at a station.
Definition at line 1141 of file network_builder.h.
Referenced by line::io::build_network_from_json(), line::io::read_jsim(), and line::Station::set_sched_param().
|
inline |
Queue.setServerParallelism(class, n): the servers a job seizes for the whole of its service.
The station then serves at most floor(c/n) such jobs at a time.
Definition at line 490 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
station.setService(class, dist).
A Prior gets its MIXTURE moments here, where a Markovian family gets the moments of its (D0,D1): both are the "what does the struct report before anything solves" question, and leaving a Prior at mean 0 would make a struct dump read as an Immediate.
Definition at line 992 of file network_builder.h.
Referenced by line::opt::ServiceRate::apply(), line::io::build_network_from_json(), line::uq::SolverUq< T >::expand(), line::fes::fes_aggregate(), line::api::infer_mlps(), line::io::read_jsim(), line::Station::set_service(), and line::api::sn_aggregate_chains().
|
inline |
Queue.setServiceRateFunction(muFun): the TOTAL service rate of a PAS or OI station as a function of the ordered microstate, a 1-based list of class indices in queue order.
Only PAS and OI take one, and the reference errors on any other discipline. As Queue.setServiceRateFunction does, this ALSO installs a representative per-class service distribution Exp(mu([r])), so that the ordinary rate/procid machinery stays consistent; the authoritative description of the station remains mu(c). A class whose mu([r]) is not positive and finite is disabled there, again as the reference does.
swap_graph is sn.nodeparam{ind}.swapGraph, empty (all zero) for a genuinely order-independent station.
Definition at line 1088 of file network_builder.h.
|
inline |
Queue.setDelayOff(class, setupTime, delayoffTime): the station powers down after sitting idle for the delay-off time, and the next arrival pays the setup time before service.
The pair is set together because a setup with no delay-off never fires and a delay-off with no setup is free.
Definition at line 598 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
Declare a class to be a G-network SIGNAL rather than a job.
A signal never joins a station: it removes jobs already there and is annihilated. target is the 1-based class it may remove, or 0 for the classic untargeted Gelenbe customer. remdist is the batch-size pmf indexed by batch size 0,1,2,...; empty means "remove exactly one".
Definition at line 1849 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
node.setStateDepRouting(class, departure, branches, level, C, d).
Declares entry the entry centre e of a subnetwork Q(V,V) served by the product-form state-dependent routing of A. E. Krzesinski, "Multiclass Queueing Networks with State-Dependent Routing", Performance Evaluation 7(2):125-143, 1987.
All node indices are 1-based, as elsewhere in the builder. departure may equal entry in a central server model. branches follows the paper's own indexing: branches[0] must be empty because branch index 1 denotes the complement M-V, and branches[b] lists the nodes of branch b with its entry centre first and its departure centre last. level[b] is the index t of the subnetwork with B_b in V_t - V_{t+1}, and level[0] is ignored. C holds the T coefficients C_t and d the T by B coefficients d_tb, read for 1 <= t <= level[b].
Negative C_t and positive d_tb make the routing prefer the least congested branches and impose the population bounds m_b <= d_tb/(-C_t) and v_t <= D_tt/(-C_t). The residual probability returns the customer to the departure centre, the busy form of waiting of Sec. 2.5, so the entry node needs a self-loop when entry and departure coincide.
Definition at line 1319 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
StatefulNode.setStatePrior(space, prior): a distribution over the rows of a DECLARED state space.
The two are set together because a prior indexes that space and means nothing without it.
Definition at line 547 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
Queue.setSwitchover(jobclass, distrib): the switchover time of a class.
Definition at line 1132 of file network_builder.h.
Referenced by line::io::build_network_from_json(), and line::Station::set_switchover().
|
inline |
Declare a SYNCHRONOUS call: a job of call_cls leaving node keeps its server until a job of the REPLY class reply_cls arrives back here.
The block is one nvars column per (node, calling class), so it stays zero-width – and every other model's state width unchanged – unless a model actually declares a reply. node is checked here and marked, but refresh_replyblock re-derives the whole block from the routing on every refresh, exactly as the reference does; naming a node is therefore an assertion about this model, not the definition of the block.
Definition at line 1697 of file network_builder.h.
|
inline |
Definition at line 1870 of file network_builder.h.
Referenced by line::Station::get_station_index().