![]() |
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_place (const std::string &nm, SchedStrategy sched) |
| A Place whose EMBEDDED QUEUE is served under sched: the QUEUEING PLACE of a queueing Petri net, Place(model, name, schedStrategy) in MATLAB. | |
| 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. | |
| std::size_t | add_transition (const std::string &nm) |
| A Transition with NO modes yet: Transition(model, name) as MATLAB, the JAR and Python spell it, with the modes declared afterwards. | |
| std::size_t | add_mode (std::size_t node, const std::string &nm) |
| Transition.addMode(name): a new firing mode, returning its 1-based index. | |
| void | set_mode_distribution (std::size_t node, std::size_t mode, const Distrib< T > &d) |
| Transition.setDistribution(mode, dist): the mode's firing law. | |
| void | set_mode_timing (std::size_t node, std::size_t mode, lang::TimingStrategy ts) |
| Transition.setTimingStrategy(mode, strategy): TIMED or IMMEDIATE. | |
| void | set_mode_servers (std::size_t node, std::size_t mode, double n) |
| Transition.setNumberOfServers(mode, n); GlobalConstants::MaxInt is infinite. | |
| void | set_firing_priority (std::size_t node, std::size_t mode, double prio) |
| Transition.setFiringPriorities(mode, priority). | |
| void | set_firing_weight (std::size_t node, std::size_t mode, const T &w) |
| Transition.setFiringWeights(mode, weight): the share among tied modes. | |
| void | set_mode_firing_dependence (std::size_t node, std::size_t mode, const std::function< T(const std::vector< T > &)> &g) |
| Transition.setFiringRateDependence(mode, g): g(marking) scales the rate. | |
| void | set_mode_fluid_rate (std::size_t node, std::size_t mode, std::size_t place, double rate) |
| Transition.setFluidRate(mode, place, rate): the FSPN flow of a TIMED mode into (rate > 0) or out of (rate < 0) a fluid place, per running server. | |
| void | set_mode_fluid_guard (std::size_t node, std::size_t mode, std::size_t place, const std::string &op, double threshold) |
| Transition.setFluidGuard(mode, place, op, threshold): the mode is enabled only while the level of the fluid place satisfies level op threshold, op ">=" or "<=". | |
| void | set_mode_fluid_impulse (std::size_t node, std::size_t mode, std::size_t place, double delta) |
| Transition.setFluidImpulse(mode, place, delta): every firing of the mode moves the level of the fluid place by delta at once, truncated at the place's bounds. | |
| void | set_mode_fluid_dependence (std::size_t node, std::size_t mode, std::size_t place, const std::function< double(double)> &h) |
| Transition.setFluidRateDependence(mode, place, h): the firing rate of a TIMED, exponential mode is multiplied by h(level) of the fluid place; several places multiply. | |
| void | set_mode_fluid_flow_dependence (std::size_t node, std::size_t mode, std::size_t place, const std::function< double(const std::vector< double > &)> &phi, const std::vector< std::size_t > &read=std::vector< std::size_t >()) |
| Transition.setFluidFlowDependence(mode, place, phi, readPlaces): the flow of the mode into or out of the fluid place becomes k * rate * phi(M), k the running servers. | |
| void | set_enabling_conditions (std::size_t node, std::size_t mode, std::size_t cls, std::size_t place, const T &tokens) |
| Transition.setEnablingConditions(mode, class, place, tokens): how many class-r tokens the mode needs at place before it may fire. | |
| void | set_inhibiting_conditions (std::size_t node, std::size_t mode, std::size_t cls, std::size_t place, const T &tokens) |
| Transition.setInhibitingConditions(mode, class, place, tokens): the class-r count at place that BLOCKS the mode. | |
| void | set_firing_outcome (std::size_t node, std::size_t mode, std::size_t cls, std::size_t dest, const T &tokens) |
| Transition.setFiringOutcome(mode, class, node, tokens): the class-r tokens the firing deposits. | |
| 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_orbit_policy (std::size_t node, std::size_t cls, int policy, int max_orbit, bool size_buffer=true) |
| The policy and bound of Queue.setOrbit(class, dist, policy, maxOrbit) on a class already declared by set_retrial: policy 1 = LINEAR (every orbiting job retries at its own rate), 2 = CONSTANT (the orbit retries as a whole); max_orbit = -1 leaves the orbit unbounded. | |
| 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_orbit_persistence (std::size_t node, std::size_t cls, const T &join_prob, const T &persist_prob=num_traits< T >::from_int(1)) |
| Queue.setOrbitPersistence(class, joinProb, persistProb): non-persistent retrial customers (Phung-Duc 2019, Sec. | |
| void | set_orbital_search (std::size_t node, std::size_t cls, const T &prob) |
| Queue.setOrbitalSearch(class, prob): orbital search (Artalejo, Joshua and Krishnamoorthy 2002). | |
| 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_place_fluid (std::size_t node, bool fluid) |
| Place.setFluid(flag): the place holds one real level in [0, fluid capacity] instead of tokens, the fluid place of an FSPN. | |
| void | set_fluid_capacity (std::size_t node, double cap) |
| Place.setFluidCapacity(B): the level ceiling of a fluid place, Inf when unbounded. | |
| void | set_fluid_level (std::size_t node, double level) |
| Place.setFluidLevel(x0): the initial level of a fluid place. | |
| bool | is_place_fluid (std::size_t node) |
| Place.isFluid(), getFluidCapacity() and getFluidLevel(). | |
| double | get_fluid_capacity (std::size_t node) |
| double | get_fluid_level (std::size_t node) |
| bool | has_fluid_arcs (std::size_t node) const |
| Transition.hasFluidArcs(): any mode declares a flow, guard, impulse or fluid rate dependence. | |
| 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. | |
| void | set_cache_read (std::size_t cache_node, std::size_t r, const std::vector< T > &pmf) |
| Cache.setRead(jobclass, popularity): class r (1-based) reads the cache, drawing items from the pmf pmf over the ranks 1..nitems. | |
| void | set_cache_read (std::size_t cache_node, std::size_t r, const lang::Distrib< T > &d) |
| Cache.setRead(jobclass, Zipf(s, n)) or DiscreteSampler(p): the law is expanded to its pmf, which every solver reads, and kept in preadkind because JMT's Cache section takes it as is. | |
| void | set_cache_hit_class (std::size_t cache_node, std::size_t r, std::size_t h) |
| Cache.setHitClass(jobclass, hitclass): a class-r read that hits leaves as class h. | |
| void | set_cache_miss_class (std::size_t cache_node, std::size_t r, std::size_t m) |
| Cache.setMissClass(jobclass, missclass): a class-r read that misses leaves as class m. | |
| 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. | |
| void | set_retrieval_system (std::size_t cache_node, std::size_t read_class, std::size_t miss_class, std::size_t queue_node) |
| Cache.setRetrievalSystem(readClass, missClass, queue) with a single Queue, as the reference accepts. | |
| void | set_item_service_rate (std::size_t queue_node, std::size_t cache_node, std::size_t read_class, std::size_t item, const T &rate) |
| queue.setItemServiceRate(cache, readClass, item, rate) (Queue.m): override, at queue_node, the retrieval service of one item of read_class with Exp(rate). | |
| void | set_item_routing_probability (std::size_t cache_node, std::size_t read_class, std::size_t item, std::size_t source_node, std::size_t dest_node, const T &p) |
| Cache.setItemRoutingProbability(readClass, item, source, dest, p): the probability of routing the retrieval class of item from source_node to dest_node (a retrieval queue or the cache itself). | |
| void | set_item_routing_prob (std::size_t cache_node, std::size_t read_class, std::size_t item, std::size_t source_node, std::size_t dest_node, const T &p) |
| Short alias of set_item_routing_probability (Cache.setItemRoutingProb). | |
| 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_polling_table (std::size_t node, const std::vector< std::size_t > &table, const std::vector< Distrib< T > > &swlegs=std::vector< Distrib< T > >()) |
| Queue.setPollingTable(table, swlegs): the visit sequence of a POLLING station (1-based classes, repeats allowed) and, optionally, the walk out of each table position (a disabled entry falls back to the class switchover of that entry). | |
| void | set_polling_order (std::size_t node, lang::PollingOrder order, std::size_t prioclass=0, long threshold=-1) |
| Queue.setPollingOrder(order, prioclass, L): the visit-order rule. | |
| void | set_polling_timer (std::size_t node, const std::vector< Distrib< T > > &dists, lang::PollingTimer scope=lang::PollingTimer::LOCAL, bool preemptive=false) |
| Queue.setPollingTimer(dist, scope, preemptive): a visit timer per class (one law for all classes, or one per class). | |
| 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_switchover (std::size_t node, std::size_t from_cls, std::size_t to_cls, const Distrib< T > &so) |
| Queue.setSwitchover(fromClass, toClass, distrib): the walk between two CLASSES at an ordinary station, the reference's (K x K) form. | |
| void | set_quantum (std::size_t node, std::size_t cls, const Distrib< T > &q) |
| Queue.setQuantum(jobclass, distrib): the time slice of a class at a round-robin station. | |
| void | set_quantum (std::size_t node, const Distrib< T > &q) |
| Queue.setQuantum(distrib): the same time slice for every 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_limited_load_dependence (std::size_t node, const std::vector< T > &alpha) |
| Station.setLimitedLoadDependence(alpha): the same setter with no discipline gate. | |
| 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_class_completes (std::size_t cls, bool flag) |
| jobclass.completes = flag: whether a passage through the reference station counts as a completion. | |
| 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. | |
| RoutingMatrix< T > | serial_routing (const std::vector< std::size_t > &nodes) const |
| model.serialRouting(nodes): a unit-probability path through nodes. | |
| void | link (const RoutingMatrix< T > &Pm) |
| model.link(P): install the routing. | |
| const NetworkStruct< T > & | get_struct () |
| The refreshed struct, MATLAB's model.getStruct(). | |
| std::vector< std::vector< bool > > | get_class_switching_mask () |
| model.getClassSwitchingMask(): entry (r-1, s-1) is true if some node can switch class r into s. | |
| 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 |
Static Public Member Functions | |
| static void | refuse_defective_patience (const Distrib< T > &d) |
| MATLAB setPatience: a Defective patience (never abandons w.p. | |
| static void | refuse_defective (const Distrib< T > &d, const char *what) |
| MATLAB Queue.setService / Source.setArrival: a Defective law has an infinite mean, so it is refused at the station with LINE:input:Argument. | |
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 111 of file network_builder.h.
|
inlineexplicit |
Definition at line 113 of file network_builder.h.
|
inline |
A Cache node with its item population, list capacities and popularity.
Definition at line 1083 of file network_builder.h.
Referenced by line::io::build_network_from_json(), and line::lal::decl_detail::build_network_impl().
|
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 251 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 225 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 1385 of file network_builder.h.
Referenced by line::io::build_network_from_json(), line::lal::decl_detail::build_network_impl(), line::qn::cyclic(), line::fes::fes_aggregate(), line::api::infer_mlps(), line::infer::infer_quick_model(), line::io::jmva2line(), 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 147 of file network_builder.h.
Referenced by line::io::build_network_from_json(), line::lal::decl_detail::build_network_impl(), line::qn::cyclic(), line::fes::fes_aggregate(), line::api::infer_mlps(), line::io::jmva2line(), line::io::read_jsim(), line::api::sn_aggregate_chains(), and line::qn::tandem().
|
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 274 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 348 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 362 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 204 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
Transition.addMode(name): a new firing mode, returning its 1-based index.
The defaults are the reference's own – one server, TIMED, priority one, weight one, and no firing law until set_mode_distribution gives it one.
Definition at line 476 of file network_builder.h.
Referenced by line::Transition::add_mode(), and line::lal::decl_detail::build_network_impl().
|
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 1404 of file network_builder.h.
Referenced by line::io::build_network_from_json(), line::lal::decl_detail::build_network_impl(), line::infer::infer_quick_model(), line::io::jmva2line(), line::io::read_jsim(), line::api::sn_aggregate_chains(), and line::qn::tandem().
|
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 391 of file network_builder.h.
Referenced by line::qn::Network< double >::add_place(), line::io::build_network_from_json(), line::lal::decl_detail::build_network_impl(), line::io::pnml_load(), and line::io::read_jsim().
|
inline |
A Place whose EMBEDDED QUEUE is served under sched: the QUEUEING PLACE of a queueing Petri net, Place(model, name, schedStrategy) in MATLAB.
A token arriving here is NOT immediately available to the output transitions. It joins the place's own queue, is served by the place's own servers, and only on completion does it reach the DEPOSITORY that the output arcs draw from. That is the whole of the construct, and it is why the discipline has to be declared at construction: MATLAB's installQueueServer picks the server SECTION from it, and the section is what decides the server count.
DECLARING THE DISCIPLINE DOES NOT YET MAKE IT A QUEUEING PLACE. is_queueing_place keys on a service process being present, which is Place.queueing being raised by setService and not by the constructor; a place built with a discipline and left without a service law is an ordinary pass-through place, exactly as in the reference.
The server count follows the section: one server for the queueing disciplines and infinitely many for INF, which is also the ordinary place's own shape, so add_place(nm) is this call at INF.
Definition at line 415 of file network_builder.h.
|
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 132 of file network_builder.h.
Referenced by line::io::build_network_from_json(), line::lal::decl_detail::build_network_impl(), line::qn::cyclic(), line::fes::fes_aggregate(), line::api::infer_mlps(), line::infer::infer_quick_model(), line::io::jmva2line(), line::io::read_jsim(), line::api::sn_aggregate_chains(), and line::qn::tandem().
|
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 2527 of file network_builder.h.
Referenced by line::io::build_network_from_json(), and line::lal::decl_detail::build_network_impl().
|
inline |
A stateless routing node.
Definition at line 189 of file network_builder.h.
Referenced by line::io::build_network_from_json(), line::lal::decl_detail::build_network_impl(), 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 1427 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 837 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 180 of file network_builder.h.
Referenced by line::io::build_network_from_json(), line::lal::decl_detail::build_network_impl(), line::infer::infer_quick_model(), line::io::jmva2line(), line::io::read_jsim(), line::api::sn_aggregate_chains(), and line::qn::tandem().
|
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 164 of file network_builder.h.
Referenced by line::io::build_network_from_json(), line::lal::decl_detail::build_network_impl(), line::infer::infer_quick_model(), line::io::jmva2line(), line::io::read_jsim(), line::api::sn_aggregate_chains(), and line::qn::tandem().
|
inline |
A Transition with NO modes yet: Transition(model, name) as MATLAB, the JAR and Python spell it, with the modes declared afterwards.
THE NODE IS REGISTERED FIRST, which is the whole point of this overload. A transition is itself a node, so the arc matrices of the form above are (nnodes x nclasses) over a node count that does not exist until the LAST transition has been added – a caller building a net through that overload has to hand-count the total and re-count it whenever the net gains a node. Here the arcs are held SPARSELY as (mode, node, class) triples and materialised against the finished model by get_struct(), so nothing has to be counted and nothing can be counted wrong.
Definition at line 462 of file network_builder.h.
|
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 437 of file network_builder.h.
Referenced by line::io::build_network_from_json(), line::lal::decl_detail::build_network_impl(), line::io::pnml_load(), and line::io::read_jsim().
|
inline |
Record which Fork a Join created by add_join_unbound closes.
Definition at line 375 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
model.getClassSwitchingMask(): entry (r-1, s-1) is true if some node can switch class r into s.
Definition at line 2405 of file network_builder.h.
|
inline |
Definition at line 955 of file network_builder.h.
Referenced by line::Place::get_fluid_capacity().
|
inline |
Definition at line 958 of file network_builder.h.
Referenced by line::Place::get_fluid_level().
|
inline |
The refreshed struct, MATLAB's model.getStruct().
Definition at line 2379 of file network_builder.h.
Referenced by line::SolverCTMC::acc_reward(), line::uq::SolverUq< T >::analyze(), line::SolverLDES::avg_busy_period(), line::NetworkSolver::avg_chain(), line::NetworkSolver::avg_chain_table(), line::NetworkSolver::avg_fj_table(), line::SolverNC::avg_link_table(), line::NetworkSolver::avg_sys_table(), line::NetworkSolver::avg_table(), line::NetworkSolver::avg_tard(), line::SolverBA::bounds_table(), line::lal::build_environment(), line::io::build_network_from_json(), line::SolverAUTO::candidate_solver_names(), line::SolverCTMC::cdf_first_passt(), line::SolverCTMC::cdf_first_passt(), line::SolverCTMC::cdf_respt(), line::SolverFLD::cdf_respt(), line::SolverJMT::cdf_respt(), line::SolverLDES::cdf_respt(), line::SolverAUTO::choose_solver(), line::opt::closed_sensitivities(), line::SolverAUTO::find_solver(), find_solver_report(), line::SolverCTMC::first_passt_moments(), line::SolverCTMC::first_passt_moments(), line::wfn::WorkflowNet::from_network(), line::gen::NetworkGenerator< T >::generate(), line::SolverCTMC::generator(), line::SolverLDES::get_struct(), line::api::infer_mlps(), line::SolverLDES::init_from_solver(), line::io::line2java(), line::io::line2matlab(), line::io::linemodel_save(), line::NetworkSolver::list_valid_methods(), main(), line::SolverCTMC::marg_aggr(), line::opt::open_sensitivities(), line::SolverLDES::perct_respt(), line::SolverLDES::perct_respt(), line::SolverCTMC::prob_aggr(), line::SolverJMT::prob_aggr(), line::SolverAUTO::proposed_solver_names(), line::io::qn2java(), line::io::qn2java(), line::io::qn2java(), line::io::qn2java_string(), line::io::qn2jsimg(), line::io::qn2lqn(), line::io::qn2matlab(), line::io::qn2matlab(), line::io::qn2matlab(), line::io::qn2matlab_string(), run_generate(), run_invocation(), line::SolverJMT::sample(), line::SolverLDES::sample(), line::SolverLDES::sample_aggr(), line::SolverLDES::sample_sys(), line::SolverLDES::sample_sys_aggr(), line::SolverAUTO::SolverAUTO(), line::SolverCTMC::state_space(), line::SolverCTMC::state_space_aggr(), line::SolverAUTO::supports(), line::SolverLDES::supports(), line::SolverCTMC::symbolic_solution(), line::io::to_tikz(), line::SolverFLD::tran_avg(), line::SolverJMT::tran_avg(), and line::uq::uq_interval_run().
|
inline |
Transition.hasFluidArcs(): any mode declares a flow, guard, impulse or fluid rate dependence.
Definition at line 961 of file network_builder.h.
Referenced by line::Transition::has_fluid_arcs().
|
inline |
An empty routing matrix, MATLAB's model.initRoutingMatrix.
Definition at line 2126 of file network_builder.h.
Referenced by line::lal::decl_detail::build_network_impl(), line::infer::infer_quick_model(), and line::io::jmva2line().
|
inline |
Place.isFluid(), getFluidCapacity() and getFluidLevel().
Definition at line 954 of file network_builder.h.
Referenced by line::Place::is_fluid().
|
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 2155 of file network_builder.h.
Referenced by line::opt::ClassServiceMapping::apply(), line::io::build_network_from_json(), line::lal::decl_detail::build_network_impl(), line::qn::cyclic(), line::fes::fes_aggregate(), line::api::infer_mlps(), line::infer::infer_quick_model(), line::io::jmva2line(), line::io::pnml_load(), line::io::read_jsim(), line::api::sn_aggregate_chains(), and line::qn::tandem().
|
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 2443 of file network_builder.h.
|
inline |
The struct WITHOUT refreshing it, for a caller that is still building.
Definition at line 2408 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(), line::lal::decl_detail::build_network_impl(), line::io::jsim2line(), line::io::tikz_detail::model_name(), and line::api::sn_aggregate_chains().
|
inlinestatic |
MATLAB Queue.setService / Source.setArrival: a Defective law has an infinite mean, so it is refused at the station with LINE:input:Argument.
Definition at line 1525 of file network_builder.h.
|
inlinestatic |
MATLAB setPatience: a Defective patience (never abandons w.p.
pInf) is refused by name with LINE:unsupported:Reneging.
Definition at line 1513 of file network_builder.h.
|
inline |
model.serialRouting(nodes): a unit-probability path through nodes.
A path ending at a Sink stays open. Every other path is closed back onto its first node, matching MATLAB's Network.serialRouting convention for closed models. The returned matrix is a one-class topology block and can be passed directly to link, or assigned to a class with P.set(cls, block).
Definition at line 2136 of file network_builder.h.
Referenced by line::io::jmva2line().
|
inline |
source.setArrival(class, dist): the same table, at the Source.
Definition at line 1552 of file network_builder.h.
Referenced by line::io::build_network_from_json(), line::lal::decl_detail::build_network_impl(), line::uq::SolverUq< T >::expand(), line::io::jmva2line(), line::io::read_jsim(), line::Source::set_arrival(), line::Source::set_marked_arrival(), line::api::sn_aggregate_chains(), and line::qn::tandem().
|
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 875 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 828 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
Queue.setBatchRejectProbability(class, p).
Definition at line 768 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 1051 of file network_builder.h.
Referenced by line::io::build_network_from_json(), and line::Station::set_breakdown().
|
inline |
Cache.setHitClass(jobclass, hitclass): a class-r read that hits leaves as class h.
Definition at line 1172 of file network_builder.h.
Referenced by line::lal::decl_detail::build_network_impl(), and line::Cache::set_hit_class().
|
inline |
Cache.setMissClass(jobclass, missclass): a class-r read that misses leaves as class m.
Definition at line 1179 of file network_builder.h.
Referenced by line::lal::decl_detail::build_network_impl(), and line::Cache::set_miss_class().
|
inline |
Cache.setRead(jobclass, Zipf(s, n)) or DiscreteSampler(p): the law is expanded to its pmf, which every solver reads, and kept in preadkind because JMT's Cache section takes it as is.
Definition at line 1147 of file network_builder.h.
|
inline |
Cache.setRead(jobclass, popularity): class r (1-based) reads the cache, drawing items from the pmf pmf over the ranks 1..nitems.
May be called after the classes exist, which is what a CacheParam given at construction cannot do once the node precedes its classes.
Definition at line 1133 of file network_builder.h.
Referenced by line::lal::decl_detail::build_network_impl(), line::Cache::set_read(), and line::Cache::set_read().
|
inline |
station.setCapacity(k), the K of Kendall's notation.
Definition at line 1589 of file network_builder.h.
Referenced by line::io::build_network_from_json(), line::fes::fes_aggregate(), line::infer::infer_quick_model(), line::io::read_jsim(), line::Station::set_capacity(), and line::api::sn_aggregate_chains().
|
inline |
station.setChainCapacity(class, k).
Definition at line 1594 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.completes = flag: whether a passage through the reference station counts as a completion.
Definition at line 2023 of file network_builder.h.
Referenced by line::lal::decl_detail::build_network_impl(), and line::JobClass::set_completes().
|
inline |
JobClass.deadline: the soft deadline EDD, EDF and JMT's tardiness use.
Definition at line 1440 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 1899 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 1615 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 1464 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 1448 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 259 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 913 of file network_builder.h.
Referenced by line::io::build_network_from_json(), and line::Place::set_departure_discipline().
|
inline |
station.setDropRule(class, rule).
Definition at line 1620 of file network_builder.h.
Referenced by line::io::build_network_from_json(), line::io::read_jsim(), and line::Station::set_drop_rule().
|
inline |
Transition.setEnablingConditions(mode, class, place, tokens): how many class-r tokens the mode needs at place before it may fire.
The CLASS IS NOT DECORATION: a mode needing two Class1 tokens must not be enabled by Class2 tokens sitting at the same place, so the arc is keyed by the (place, class) pair and not by the place alone.
Definition at line 645 of file network_builder.h.
Referenced by line::lal::decl_detail::build_network_impl(), and line::Transition::set_enabling_conditions().
|
inline |
Transition.setFiringOutcome(mode, class, node, tokens): the class-r tokens the firing deposits.
The destination is any node the firing may reach, a Sink included, which is why it is not narrowed to a Place.
Definition at line 667 of file network_builder.h.
Referenced by line::lal::decl_detail::build_network_impl(), and line::Transition::set_firing_outcome().
|
inline |
Transition.setFiringPriorities(mode, priority).
Definition at line 516 of file network_builder.h.
Referenced by line::Transition::set_firing_priorities().
|
inline |
Transition.setFiringWeights(mode, weight): the share among tied modes.
Definition at line 521 of file network_builder.h.
Referenced by line::lal::decl_detail::build_network_impl(), and line::Transition::set_firing_weights().
|
inline |
Place.setFluidCapacity(B): the level ceiling of a fluid place, Inf when unbounded.
Definition at line 939 of file network_builder.h.
Referenced by line::io::build_network_from_json(), and line::Place::set_fluid_capacity().
|
inline |
Place.setFluidLevel(x0): the initial level of a fluid place.
Definition at line 947 of file network_builder.h.
Referenced by line::io::build_network_from_json(), and line::Place::set_fluid_level().
|
inline |
A branch that fires only with probability prob.
Definition at line 330 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 302 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 314 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, at EVERY station once a handle is present, the delays among them. Only SolverCTMC, SolverSSA and SolverLDES honour the handle.
Definition at line 1960 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 1971 of file network_builder.h.
|
inline |
Queue.setHeteroSchedPolicy(...): how the server pools are picked among.
Definition at line 867 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 1608 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
Transition.setInhibitingConditions(mode, class, place, tokens): the class-r count at place that BLOCKS the mode.
Absent means never, which the materialised matrix spells as infinity.
Definition at line 656 of file network_builder.h.
Referenced by line::lal::decl_detail::build_network_impl(), and line::Transition::set_inhibiting_conditions().
|
inline |
Place.setState(marking): the initial token count of the place, per class.
Definition at line 921 of file network_builder.h.
Referenced by line::io::build_network_from_json(), line::lal::decl_detail::build_network_impl(), 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 1254 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 1100 of file network_builder.h.
Referenced by line::Cache::set_item_read_classes().
|
inline |
Short alias of set_item_routing_probability (Cache.setItemRoutingProb).
Definition at line 1375 of file network_builder.h.
|
inline |
Cache.setItemRoutingProbability(readClass, item, source, dest, p): the probability of routing the retrieval class of item from source_node to dest_node (a retrieval queue or the cache itself).
Applied by link() after the read-class template, so it overrides that single edge; p = 0 deletes it.
Definition at line 1367 of file network_builder.h.
|
inline |
queue.setItemServiceRate(cache, readClass, item, rate) (Queue.m): override, at queue_node, the retrieval service of one item of read_class with Exp(rate).
item is 1-based. The default is the read class's own service at that queue, copied by set_retrieval_system.
Definition at line 1357 of file network_builder.h.
|
inline |
Join.setStrategy(...): STD waits for every sibling, PARTIAL for a quorum.
Definition at line 982 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 1925 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
Station.setLimitedLoadDependence(alpha): the same setter with no discipline gate.
It is what a model TRANSFORMATION calls (the FES aggregation builds stations the user-facing gate would refuse), exactly as aggregateFES.m and the LN layer builder do in the reference.
Definition at line 1877 of file network_builder.h.
|
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 1856 of file network_builder.h.
Referenced by line::io::build_network_from_json(), line::io::jmva2line(), and line::Station::set_load_dependence().
|
inline |
Network.setLogPath: the directory every Logger of this model writes into.
Definition at line 217 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 908 of file network_builder.h.
Referenced by line::io::build_network_from_json(), and line::Source::set_marked_arrival().
|
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 1192 of file network_builder.h.
|
inline |
Transition.setDistribution(mode, dist): the mode's firing law.
Definition at line 501 of file network_builder.h.
Referenced by line::lal::decl_detail::build_network_impl(), and line::Transition::set_distribution().
|
inline |
Transition.setFiringRateDependence(mode, g): g(marking) scales the rate.
Definition at line 526 of file network_builder.h.
Referenced by line::Transition::set_firing_rate_dependence().
|
inline |
Transition.setFluidRateDependence(mode, place, h): the firing rate of a TIMED, exponential mode is multiplied by h(level) of the fluid place; several places multiply.
An empty h removes the dependence. The memoryless restriction is the one set_mode_firing_dependence carries, so set the Exp law first.
Definition at line 586 of file network_builder.h.
Referenced by line::Transition::set_fluid_rate_dependence().
|
inline |
Transition.setFluidFlowDependence(mode, place, phi, readPlaces): the flow of the mode into or out of the fluid place becomes k * rate * phi(M), k the running servers.
M is the flattened marking described at TransitionParam::FluidFlowDep, filled on the token places read (1-based node indices); an empty read means the mode's input places, resolved at get_struct(). An empty phi removes the dependence.
Definition at line 613 of file network_builder.h.
Referenced by line::Transition::set_fluid_flow_dependence().
|
inline |
Transition.setFluidGuard(mode, place, op, threshold): the mode is enabled only while the level of the fluid place satisfies level op threshold, op ">=" or "<=".
One guard per place; an empty op removes it.
Definition at line 547 of file network_builder.h.
Referenced by line::Transition::set_fluid_guard().
|
inline |
Transition.setFluidImpulse(mode, place, delta): every firing of the mode moves the level of the fluid place by delta at once, truncated at the place's bounds.
A zero delta removes the impulse.
Definition at line 573 of file network_builder.h.
Referenced by line::Transition::set_fluid_impulse().
|
inline |
Transition.setFluidRate(mode, place, rate): the FSPN flow of a TIMED mode into (rate > 0) or out of (rate < 0) a fluid place, per running server.
A zero rate removes the arc.
Definition at line 535 of file network_builder.h.
Referenced by line::Transition::set_fluid_rate().
|
inline |
Transition.setNumberOfServers(mode, n); GlobalConstants::MaxInt is infinite.
Definition at line 511 of file network_builder.h.
Referenced by line::Transition::set_number_of_servers().
|
inline |
Transition.setTimingStrategy(mode, strategy): TIMED or IMMEDIATE.
Definition at line 506 of file network_builder.h.
Referenced by line::lal::decl_detail::build_network_impl(), and line::Transition::set_timing_strategy().
|
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 1575 of file network_builder.h.
Referenced by line::opt::ServerAllocation::apply(), line::opt::StationReplicas::apply(), line::io::build_network_from_json(), line::lal::decl_detail::build_network_impl(), line::qn::cyclic(), line::fes::fes_aggregate(), line::api::infer_mlps(), line::infer::infer_quick_model(), line::io::jmva2line(), 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 761 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
Queue.setOrbitPersistence(class, joinProb, persistProb): non-persistent retrial customers (Phung-Duc 2019, Sec.
2). A fresh arrival that finds every server busy joins the orbit with probability join_prob and is lost otherwise; a retrial that finds every server busy returns to the orbit with probability persist_prob and leaves the system otherwise. Both default to 1. A closed class cannot leave the network, so p < 1 or q < 1 on one is refused (LINE:unsupported:Retrial).
Definition at line 783 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
The policy and bound of Queue.setOrbit(class, dist, policy, maxOrbit) on a class already declared by set_retrial: policy 1 = LINEAR (every orbiting job retries at its own rate), 2 = CONSTANT (the orbit retries as a whole); max_orbit = -1 leaves the orbit unbounded.
As the reference does, the orbit lives in the station buffer: the capacity becomes nservers + max_orbit, or Inf for an unbounded orbit, and a station with no finite server count gets one server. The JSON reader passes size_buffer = false, since the document carries its own buffer and that value is authoritative.
Definition at line 721 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
Queue.setOrbitalSearch(class, prob): orbital search (Artalejo, Joshua and Krishnamoorthy 2002).
On each service completion at this retrial station the freed server takes a class-cls orbiting job with probability prob instead of staying idle. Default 0; the probabilities over the classes must sum to at most 1.
Definition at line 809 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 2416 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 748 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
Place.setFluid(flag): the place holds one real level in [0, fluid capacity] instead of tokens, the fluid place of an FSPN.
Fluid moves only through the fluid arcs of the transitions; token arcs on it are refused by the solvers rather than here, because the arcs may be declared before the flag.
Definition at line 934 of file network_builder.h.
Referenced by line::io::build_network_from_json(), and line::Place::set_fluid().
|
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 2463 of file network_builder.h.
|
inline |
Queue.setPollingOrder(order, prioclass, L): the visit-order rule.
Under THRESHOLD the server goes to prioclass (1-based) whenever its buffer holds more than threshold jobs at a visit end, else SKIPEMPTY.
Definition at line 1725 of file network_builder.h.
Referenced by line::io::build_network_from_json(), and line::Station::set_polling_order().
|
inline |
Queue.setPollingTable(table, swlegs): the visit sequence of a POLLING station (1-based classes, repeats allowed) and, optionally, the walk out of each table position (a disabled entry falls back to the class switchover of that entry).
Refused with a load-dependent order.
Definition at line 1693 of file network_builder.h.
Referenced by line::io::build_network_from_json(), and line::Station::set_polling_table().
|
inline |
Queue.setPollingTimer(dist, scope, preemptive): a visit timer per class (one law for all classes, or one per class).
NONE clears it.
Definition at line 1752 of file network_builder.h.
Referenced by line::io::build_network_from_json(), line::Station::set_polling_timer(), and line::Station::set_polling_timer().
|
inline |
Queue.setPollingType(rule, par): the polling discipline of a POLLING station, identical across all class buffers as the reference assumes.
Only K-limited and G-limited carry a parameter; every other rule ignores it.
Definition at line 1674 of file network_builder.h.
Referenced by line::io::build_network_from_json(), and line::Station::set_polling_type().
|
inline |
Queue.setQuantum(distrib): the same time slice for every class.
Definition at line 1840 of file network_builder.h.
|
inline |
Queue.setQuantum(jobclass, distrib): the time slice of a class at a round-robin station.
Refused at any other station and for a Disabled or Immediate law, as MATLAB refuses them (LINE:input:Argument). A Det quantum is accepted here and refused by the state-space solvers, which need a phase-type slice.
Definition at line 1823 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
JobClass.setReferenceClass(true): sn.refclass(c) picks this class.
Definition at line 1435 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 2594 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 2585 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 1495 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 679 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 1281 of file network_builder.h.
Referenced by line::lal::decl_detail::build_network_impl().
|
inline |
Cache.setRetrievalSystem(readClass, missClass, queue) with a single Queue, as the reference accepts.
Definition at line 1347 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 2611 of file network_builder.h.
Referenced by line::io::build_network_from_json().
|
inline |
node.setRouting(class, strategy).
Definition at line 2016 of file network_builder.h.
Referenced by line::io::build_network_from_json(), line::lal::decl_detail::build_network_impl(), 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 1006 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 994 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 1845 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 851 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 1541 of file network_builder.h.
Referenced by line::opt::ServiceRate::apply(), line::lal::build_environment(), line::io::build_network_from_json(), line::lal::decl_detail::build_network_impl(), line::qn::cyclic(), line::uq::SolverUq< T >::expand(), line::fes::fes_aggregate(), line::api::infer_mlps(), line::infer::infer_quick_model(), line::io::jmva2line(), line::io::read_jsim(), line::Station::set_service(), line::api::sn_aggregate_chains(), and line::qn::tandem().
|
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 1641 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 1022 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 2640 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 2048 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 971 of file network_builder.h.
Referenced by line::io::build_network_from_json(), and line::SolverLDES::init_from_solver().
|
inline |
Queue.setSwitchover(jobclass, distrib): the switchover time of a class.
Definition at line 1777 of file network_builder.h.
Referenced by line::io::build_network_from_json(), line::Station::set_switchover(), and line::Station::set_switchover().
|
inline |
Queue.setSwitchover(fromClass, toClass, distrib): the walk between two CLASSES at an ordinary station, the reference's (K x K) form.
An UNDECLARED pair stays Disabled and is therefore not serialized, which is what the JAR and python write. MATLAB fills its cell with Immediate instead and writes all K^2 entries; the two mean the same thing, since no solver reads a pairwise switchover, and the sparse form is the one that round-trips a document unchanged.
Refused at a POLLING station, where a switchover is the walk out of one BUFFER and is declared per class by the overload above. MATLAB, the JAR and python refuse it there too: each used to accept it and read back a different leg.
Definition at line 1800 of file network_builder.h.
|
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 2489 of file network_builder.h.
|
inline |
Definition at line 2662 of file network_builder.h.
Referenced by line::Station::get_station_index().