LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
line::qn::Network< T > Class Template Reference

A queueing network under construction. More...

#include <line/lang/qn/network_builder.h>

Inheritance diagram for line::qn::Network< T >:

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)
 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_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_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_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_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

Detailed Description

template<class T>
class line::qn::Network< T >

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.

Constructor & Destructor Documentation

◆ Network()

template<class T>
line::qn::Network< T >::Network ( const std::string & nm)
inlineexplicit

Definition at line 113 of file network_builder.h.

Member Function Documentation

◆ add_cache()

template<class T>
std::size_t line::qn::Network< T >::add_cache ( const std::string & nm,
const CacheParam< T > & par )
inline

A Cache node with its item population, list capacities and popularity.

Definition at line 1022 of file network_builder.h.

Referenced by line::io::build_network_from_json().

◆ add_class_switch() [1/2]

template<class T>
std::size_t line::qn::Network< T >::add_class_switch ( const std::string & nm)
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.

◆ add_class_switch() [2/2]

template<class T>
std::size_t line::qn::Network< T >::add_class_switch ( const std::string & nm,
const Matrix< T > & C )
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().

◆ add_closed_class()

template<class T>
std::size_t line::qn::Network< T >::add_closed_class ( const std::string & nm,
double njobs,
std::size_t refstat_node,
int prio = 0 )
inline

◆ add_delay()

template<class T>
std::size_t line::qn::Network< T >::add_delay ( const std::string & nm)
inline

◆ add_fork()

template<class T>
std::size_t line::qn::Network< T >::add_fork ( const std::string & nm,
double tasks_per_link = 1.0 )
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().

◆ add_join()

template<class T>
std::size_t line::qn::Network< T >::add_join ( const std::string & nm,
std::size_t fork_node )
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().

◆ add_join_unbound()

template<class T>
std::size_t line::qn::Network< T >::add_join_unbound ( const std::string & nm)
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().

◆ add_logger()

template<class T>
std::size_t line::qn::Network< T >::add_logger ( const std::string & nm,
const std::string & log_file = std::string() )
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().

◆ add_mode()

template<class T>
std::size_t line::qn::Network< T >::add_mode ( std::size_t node,
const std::string & nm )
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().

◆ add_open_class()

template<class T>
std::size_t line::qn::Network< T >::add_open_class ( const std::string & nm,
int prio = 0 )
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 1343 of file network_builder.h.

Referenced by line::io::build_network_from_json(), line::infer::infer_quick_model(), line::io::jmva2line(), line::io::read_jsim(), line::api::sn_aggregate_chains(), and line::qn::tandem().

◆ add_place() [1/2]

template<class T>
std::size_t line::qn::Network< T >::add_place ( const std::string & nm)
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::io::pnml_load(), and line::io::read_jsim().

◆ add_place() [2/2]

template<class T>
std::size_t line::qn::Network< T >::add_place ( const std::string & nm,
SchedStrategy sched )
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.

◆ add_queue()

template<class T>
std::size_t line::qn::Network< T >::add_queue ( const std::string & nm,
SchedStrategy sched = SchedStrategy::FCFS )
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::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().

◆ add_region()

template<class T>
std::size_t line::qn::Network< 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() )
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.

Parameters
nodes1-based node indices; each must be a station
class_max_jobs(K) per-class job cap inside the region, -1 for unbounded
global_max_jobscap 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_memorycap on the total memory inside the region, -1 for unbounded

Definition at line 2298 of file network_builder.h.

Referenced by line::io::build_network_from_json().

◆ add_router()

template<class T>
std::size_t line::qn::Network< T >::add_router ( const std::string & nm)
inline

A stateless routing node.

Definition at line 189 of file network_builder.h.

Referenced by line::io::build_network_from_json(), line::io::read_jsim(), and line::api::sn_aggregate_chains().

◆ add_self_looping_class()

template<class T>
std::size_t line::qn::Network< T >::add_self_looping_class ( const std::string & nm,
double njobs,
std::size_t refstat_node,
int prio = 0 )
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 1366 of file network_builder.h.

Referenced by line::io::build_network_from_json().

◆ add_server_type()

template<class T>
void line::qn::Network< T >::add_server_type ( std::size_t node,
const typename Station< T >::ServerType & stype )
inline

Queue.addServerType(...): one heterogeneous server pool of the station.

Definition at line 776 of file network_builder.h.

Referenced by line::Station::add_server_type(), and line::io::build_network_from_json().

◆ add_sink()

template<class T>
std::size_t line::qn::Network< T >::add_sink ( const std::string & nm)
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::infer::infer_quick_model(), line::io::jmva2line(), line::io::read_jsim(), line::api::sn_aggregate_chains(), and line::qn::tandem().

◆ add_source()

template<class T>
std::size_t line::qn::Network< T >::add_source ( const std::string & nm)
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::infer::infer_quick_model(), line::io::jmva2line(), line::io::read_jsim(), line::api::sn_aggregate_chains(), and line::qn::tandem().

◆ add_transition() [1/2]

template<class T>
std::size_t line::qn::Network< T >::add_transition ( const std::string & nm)
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.

◆ add_transition() [2/2]

template<class T>
std::size_t line::qn::Network< T >::add_transition ( const std::string & nm,
const TransitionParam< T > & par )
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::io::pnml_load(), and line::io::read_jsim().

◆ bind_join()

template<class T>
void line::qn::Network< T >::bind_join ( std::size_t join_node,
std::size_t fork_node )
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().

◆ get_class_switching_mask()

template<class T>
std::vector< std::vector< bool > > line::qn::Network< T >::get_class_switching_mask ( )
inline

model.getClassSwitchingMask(): entry (r-1, s-1) is true if some node can switch class r into s.

Definition at line 2176 of file network_builder.h.

◆ get_fluid_capacity()

template<class T>
double line::qn::Network< T >::get_fluid_capacity ( std::size_t node)
inline

Definition at line 894 of file network_builder.h.

Referenced by line::Place::get_fluid_capacity().

◆ get_fluid_level()

template<class T>
double line::qn::Network< T >::get_fluid_level ( std::size_t node)
inline

Definition at line 897 of file network_builder.h.

Referenced by line::Place::get_fluid_level().

◆ get_struct()

template<class T>
const NetworkStruct< T > & line::qn::Network< T >::get_struct ( )
inline

The refreshed struct, MATLAB's model.getStruct().

Definition at line 2150 of file network_builder.h.

Referenced by line::uq::SolverUq< T >::analyze(), line::NetworkSolver::avg_chain(), line::NetworkSolver::avg_chain_table(), line::NetworkSolver::avg_fj_table(), line::NetworkSolver::avg_sys_table(), line::NetworkSolver::avg_table(), line::SolverBA::bounds_table(), 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::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::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::SolverAUTO::SolverAUTO(), line::SolverCTMC::state_space(), line::SolverCTMC::state_space_aggr(), line::SolverAUTO::supports(), line::SolverCTMC::symbolic_solution(), line::io::to_tikz(), line::SolverFLD::tran_avg(), line::SolverJMT::tran_avg(), and line::uq::uq_interval_run().

◆ has_fluid_arcs()

template<class T>
bool line::qn::Network< T >::has_fluid_arcs ( std::size_t node) const
inline

Transition.hasFluidArcs(): any mode declares a flow, guard, impulse or fluid rate dependence.

Definition at line 900 of file network_builder.h.

Referenced by line::Transition::has_fluid_arcs().

◆ init_routing_matrix()

template<class T>
RoutingMatrix< T > line::qn::Network< T >::init_routing_matrix ( ) const
inline

An empty routing matrix, MATLAB's model.initRoutingMatrix.

Definition at line 1897 of file network_builder.h.

Referenced by line::infer::infer_quick_model(), and line::io::jmva2line().

◆ is_place_fluid()

template<class T>
bool line::qn::Network< T >::is_place_fluid ( std::size_t node)
inline

Place.isFluid(), getFluidCapacity() and getFluidLevel().

Definition at line 893 of file network_builder.h.

Referenced by line::Place::is_fluid().

◆ link()

template<class T>
void line::qn::Network< T >::link ( const RoutingMatrix< T > & Pm)
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 1926 of file network_builder.h.

Referenced by line::opt::ClassServiceMapping::apply(), line::io::build_network_from_json(), 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().

◆ pas_mirror()

template<class T>
void line::qn::Network< T >::pas_mirror ( std::size_t ist,
const std::function< T(const std::vector< std::size_t > &)> & mu,
const Matrix< T > & swap_graph )
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 2214 of file network_builder.h.

◆ raw_struct()

◆ serial_routing()

template<class T>
RoutingMatrix< T > line::qn::Network< T >::serial_routing ( const std::vector< std::size_t > & nodes) const
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 1907 of file network_builder.h.

Referenced by line::io::jmva2line().

◆ set_arrival()

template<class T>
void line::qn::Network< T >::set_arrival ( std::size_t node,
std::size_t cls,
const Distrib< T > & d )
inline

◆ set_arrival_batch()

template<class T>
void line::qn::Network< T >::set_arrival_batch ( std::size_t node,
std::size_t cls,
const Distrib< T > & dist )
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 814 of file network_builder.h.

Referenced by line::io::build_network_from_json(), and line::Source::set_arrival_batch().

◆ set_balking()

template<class T>
void line::qn::Network< T >::set_balking ( std::size_t node,
std::size_t cls,
lang::BalkingStrategy strategy,
const std::vector< typename Station< T >::BalkingThreshold > & thresholds )
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 767 of file network_builder.h.

Referenced by line::io::build_network_from_json().

◆ set_batch_reject()

template<class T>
void line::qn::Network< T >::set_batch_reject ( std::size_t node,
std::size_t cls,
const T & p )
inline

Queue.setBatchRejectProbability(class, p).

Definition at line 756 of file network_builder.h.

Referenced by line::io::build_network_from_json().

◆ set_breakdown()

template<class T>
void line::qn::Network< T >::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>>() )
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 990 of file network_builder.h.

Referenced by line::io::build_network_from_json(), and line::Station::set_breakdown().

◆ set_cache_hit_class()

template<class T>
void line::qn::Network< T >::set_cache_hit_class ( std::size_t cache_node,
std::size_t r,
std::size_t h )
inline

Cache.setHitClass(jobclass, hitclass): a class-r read that hits leaves as class h.

Definition at line 1111 of file network_builder.h.

Referenced by line::Cache::set_hit_class().

◆ set_cache_miss_class()

template<class T>
void line::qn::Network< T >::set_cache_miss_class ( std::size_t cache_node,
std::size_t r,
std::size_t m )
inline

Cache.setMissClass(jobclass, missclass): a class-r read that misses leaves as class m.

Definition at line 1118 of file network_builder.h.

Referenced by line::Cache::set_miss_class().

◆ set_cache_read() [1/2]

template<class T>
void line::qn::Network< T >::set_cache_read ( std::size_t cache_node,
std::size_t r,
const lang::Distrib< T > & d )
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 1086 of file network_builder.h.

◆ set_cache_read() [2/2]

template<class T>
void line::qn::Network< T >::set_cache_read ( std::size_t cache_node,
std::size_t r,
const std::vector< T > & pmf )
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 1072 of file network_builder.h.

Referenced by line::Cache::set_read(), and line::Cache::set_read().

◆ set_capacity()

template<class T>
void line::qn::Network< T >::set_capacity ( std::size_t node,
double k )
inline

◆ set_class_capacity()

template<class T>
void line::qn::Network< T >::set_class_capacity ( std::size_t node,
std::size_t cls,
double k )
inline

station.setChainCapacity(class, k).

Definition at line 1506 of file network_builder.h.

Referenced by line::io::build_network_from_json(), line::io::read_jsim(), and line::Station::set_class_capacity().

◆ set_class_completes()

template<class T>
void line::qn::Network< T >::set_class_completes ( std::size_t cls,
bool flag )
inline

jobclass.completes = flag: whether a passage through the reference station counts as a completion.

Definition at line 1794 of file network_builder.h.

Referenced by line::JobClass::set_completes().

◆ set_class_deadline()

template<class T>
void line::qn::Network< T >::set_class_deadline ( std::size_t cls,
double due )
inline

JobClass.deadline: the soft deadline EDD, EDF and JMT's tardiness use.

Definition at line 1379 of file network_builder.h.

Referenced by line::io::build_network_from_json().

◆ set_class_dependence()

template<class T>
void line::qn::Network< T >::set_class_dependence ( std::size_t node,
const CdScaling< T > & fun,
const std::vector< T > & peak = std::vector<T>() )
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 1670 of file network_builder.h.

Referenced by line::io::build_network_from_json(), and line::fes::fes_aggregate().

◆ set_class_immediate_feedback()

template<class T>
void line::qn::Network< T >::set_class_immediate_feedback ( std::size_t cls)
inline

jobclass.setImmediateFeedback(): the same property, class-wide.

Definition at line 1527 of file network_builder.h.

Referenced by line::io::build_network_from_json().

◆ set_class_patience()

template<class T>
void line::qn::Network< T >::set_class_patience ( std::size_t cls,
const Distrib< T > & dist,
lang::ImpatienceType kind = lang::ImpatienceType::RENEGING )
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 1403 of file network_builder.h.

Referenced by line::io::build_network_from_json().

◆ set_class_spawn()

template<class T>
void line::qn::Network< T >::set_class_spawn ( std::size_t cls,
std::size_t spawn_cls )
inline

JobClass.spawnClass (sn.classspawn): the class injected at the same station on every completion of cls.

Definition at line 1387 of file network_builder.h.

Referenced by line::io::build_network_from_json().

◆ set_class_switch_matrix()

template<class T>
void line::qn::Network< T >::set_class_switch_matrix ( std::size_t node,
const Matrix< T > & C )
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().

◆ set_departure_discipline()

template<class T>
void line::qn::Network< T >::set_departure_discipline ( std::size_t node,
std::size_t cls,
lang::DepartureDiscipline rule )
inline

Place.setDepartureDiscipline(class, rule).

Definition at line 852 of file network_builder.h.

Referenced by line::io::build_network_from_json(), and line::Place::set_departure_discipline().

◆ set_drop_rule()

template<class T>
void line::qn::Network< T >::set_drop_rule ( std::size_t node,
std::size_t cls,
DropStrategy rule )
inline

station.setDropRule(class, rule).

Definition at line 1532 of file network_builder.h.

Referenced by line::io::build_network_from_json(), line::io::read_jsim(), and line::Station::set_drop_rule().

◆ set_enabling_conditions()

template<class T>
void line::qn::Network< T >::set_enabling_conditions ( std::size_t node,
std::size_t mode,
std::size_t cls,
std::size_t place,
const T & tokens )
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::Transition::set_enabling_conditions().

◆ set_firing_outcome()

template<class T>
void line::qn::Network< T >::set_firing_outcome ( std::size_t node,
std::size_t mode,
std::size_t cls,
std::size_t dest,
const T & tokens )
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::Transition::set_firing_outcome().

◆ set_firing_priority()

template<class T>
void line::qn::Network< T >::set_firing_priority ( std::size_t node,
std::size_t mode,
double prio )
inline

Transition.setFiringPriorities(mode, priority).

Definition at line 516 of file network_builder.h.

Referenced by line::Transition::set_firing_priorities().

◆ set_firing_weight()

template<class T>
void line::qn::Network< T >::set_firing_weight ( std::size_t node,
std::size_t mode,
const T & w )
inline

Transition.setFiringWeights(mode, weight): the share among tied modes.

Definition at line 521 of file network_builder.h.

Referenced by line::Transition::set_firing_weights().

◆ set_fluid_capacity()

template<class T>
void line::qn::Network< T >::set_fluid_capacity ( std::size_t node,
double cap )
inline

Place.setFluidCapacity(B): the level ceiling of a fluid place, Inf when unbounded.

Definition at line 878 of file network_builder.h.

Referenced by line::io::build_network_from_json(), and line::Place::set_fluid_capacity().

◆ set_fluid_level()

template<class T>
void line::qn::Network< T >::set_fluid_level ( std::size_t node,
double level )
inline

Place.setFluidLevel(x0): the initial level of a fluid place.

Definition at line 886 of file network_builder.h.

Referenced by line::io::build_network_from_json(), and line::Place::set_fluid_level().

◆ set_fork_branch_probability()

template<class T>
void line::qn::Network< T >::set_fork_branch_probability ( std::size_t fork_node,
std::size_t jobclass,
std::size_t dest_node,
double prob )
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().

◆ set_fork_tasks_per_link()

template<class T>
void line::qn::Network< T >::set_fork_tasks_per_link ( std::size_t fork_node,
std::size_t jobclass,
double tasks,
std::size_t dest_node = 0 )
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().

◆ set_fork_tasks_per_link_dist()

template<class T>
void line::qn::Network< T >::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 )
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().

◆ set_global_dependence() [1/2]

template<class T>
void line::qn::Network< T >::set_global_dependence ( const GdScaling< T > & fun,
const std::vector< T > & peak )
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 1731 of file network_builder.h.

Referenced by line::io::build_network_from_json().

◆ set_global_dependence() [2/2]

template<class T>
void line::qn::Network< T >::set_global_dependence ( const GdScaling< T > & fun,
const std::vector< T > & peak,
int wire_cutoff )
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 1742 of file network_builder.h.

◆ set_hetero_sched_policy()

template<class T>
void line::qn::Network< T >::set_hetero_sched_policy ( std::size_t node,
lang::HeteroSchedPolicy policy )
inline

Queue.setHeteroSchedPolicy(...): how the server pools are picked among.

Definition at line 806 of file network_builder.h.

Referenced by line::io::build_network_from_json().

◆ set_immediate_feedback()

template<class T>
void line::qn::Network< T >::set_immediate_feedback ( std::size_t node,
std::size_t cls )
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 1520 of file network_builder.h.

Referenced by line::io::build_network_from_json().

◆ set_inhibiting_conditions()

template<class T>
void line::qn::Network< T >::set_inhibiting_conditions ( std::size_t node,
std::size_t mode,
std::size_t cls,
std::size_t place,
const T & tokens )
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::Transition::set_inhibiting_conditions().

◆ set_initial_marking()

template<class T>
void line::qn::Network< T >::set_initial_marking ( std::size_t node,
const std::vector< T > & tokens )
inline

Place.setState(marking): the initial token count of the place, per class.

Definition at line 860 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().

◆ set_item_miss_class()

template<class T>
void line::qn::Network< T >::set_item_miss_class ( std::size_t cache_node,
const std::vector< std::size_t > & miss_classes )
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 1193 of file network_builder.h.

◆ set_item_read_classes()

template<class T>
void line::qn::Network< T >::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 )
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 1039 of file network_builder.h.

Referenced by line::Cache::set_item_read_classes().

◆ set_item_routing_prob()

template<class T>
void line::qn::Network< T >::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 )
inline

Short alias of set_item_routing_probability (Cache.setItemRoutingProb).

Definition at line 1314 of file network_builder.h.

◆ set_item_routing_probability()

template<class T>
void line::qn::Network< T >::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 )
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 1306 of file network_builder.h.

◆ set_item_service_rate()

template<class T>
void line::qn::Network< T >::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 )
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 1296 of file network_builder.h.

◆ set_join_strategy()

template<class T>
void line::qn::Network< T >::set_join_strategy ( std::size_t node,
lang::JoinStrategy strategy,
double quorum = 0.0 )
inline

Join.setStrategy(...): STD waits for every sibling, PARTIAL for a quorum.

Definition at line 921 of file network_builder.h.

Referenced by line::io::build_network_from_json(), and line::Join::set_strategy().

◆ set_joint_dependence()

template<class T>
void line::qn::Network< T >::set_joint_dependence ( std::size_t node,
const CdScaling< T > & fun,
const std::vector< T > & peak )
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 1696 of file network_builder.h.

Referenced by line::io::build_network_from_json().

◆ set_load_dependence()

template<class T>
void line::qn::Network< T >::set_load_dependence ( std::size_t node,
const std::vector< T > & alpha )
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 1648 of file network_builder.h.

Referenced by line::io::build_network_from_json(), line::io::jmva2line(), and line::Station::set_load_dependence().

◆ set_log_path()

template<class T>
void line::qn::Network< T >::set_log_path ( const std::string & path)
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().

◆ set_marked_classes()

template<class T>
void line::qn::Network< T >::set_marked_classes ( std::size_t node,
const std::vector< std::size_t > & classes )
inline

Source.markedClasses: the 1-based class carried by each mark of an MMAP.

Definition at line 847 of file network_builder.h.

Referenced by line::io::build_network_from_json(), and line::Source::set_marked_arrival().

◆ set_miss_cache()

template<class T>
std::vector< std::size_t > line::qn::Network< T >::set_miss_cache ( std::size_t cache_node,
std::size_t next_cache,
const std::vector< std::size_t > & hit_classes_at_next )
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 1131 of file network_builder.h.

◆ set_mode_distribution()

template<class T>
void line::qn::Network< T >::set_mode_distribution ( std::size_t node,
std::size_t mode,
const Distrib< T > & d )
inline

Transition.setDistribution(mode, dist): the mode's firing law.

Definition at line 501 of file network_builder.h.

Referenced by line::Transition::set_distribution().

◆ set_mode_firing_dependence()

template<class T>
void line::qn::Network< T >::set_mode_firing_dependence ( std::size_t node,
std::size_t mode,
const std::function< T(const std::vector< T > &)> & g )
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().

◆ set_mode_fluid_dependence()

template<class T>
void line::qn::Network< T >::set_mode_fluid_dependence ( std::size_t node,
std::size_t mode,
std::size_t place,
const std::function< double(double)> & h )
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().

◆ set_mode_fluid_flow_dependence()

template<class T>
void line::qn::Network< T >::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>() )
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().

◆ set_mode_fluid_guard()

template<class T>
void line::qn::Network< T >::set_mode_fluid_guard ( std::size_t node,
std::size_t mode,
std::size_t place,
const std::string & op,
double threshold )
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().

◆ set_mode_fluid_impulse()

template<class T>
void line::qn::Network< T >::set_mode_fluid_impulse ( std::size_t node,
std::size_t mode,
std::size_t place,
double delta )
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().

◆ set_mode_fluid_rate()

template<class T>
void line::qn::Network< T >::set_mode_fluid_rate ( std::size_t node,
std::size_t mode,
std::size_t place,
double rate )
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().

◆ set_mode_servers()

template<class T>
void line::qn::Network< T >::set_mode_servers ( std::size_t node,
std::size_t mode,
double n )
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().

◆ set_mode_timing()

template<class T>
void line::qn::Network< T >::set_mode_timing ( std::size_t node,
std::size_t mode,
lang::TimingStrategy ts )
inline

Transition.setTimingStrategy(mode, strategy): TIMED or IMMEDIATE.

Definition at line 506 of file network_builder.h.

Referenced by line::Transition::set_timing_strategy().

◆ set_number_of_servers()

template<class T>
void line::qn::Network< T >::set_number_of_servers ( std::size_t node,
double n )
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 1487 of file network_builder.h.

Referenced by line::opt::ServerAllocation::apply(), line::opt::StationReplicas::apply(), line::io::build_network_from_json(), 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().

◆ set_orbit_impatience()

template<class T>
void line::qn::Network< T >::set_orbit_impatience ( std::size_t node,
std::size_t cls,
const Distrib< T > & dist )
inline

Queue.setOrbitImpatience(class, dist): abandonment from the retrial orbit.

Definition at line 749 of file network_builder.h.

Referenced by line::io::build_network_from_json().

◆ set_orbit_policy()

template<class T>
void line::qn::Network< T >::set_orbit_policy ( std::size_t node,
std::size_t cls,
int policy,
int max_orbit )
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.

The capacity is NOT set here: the reference sets it to nservers + maxOrbit, and the document carries it on its own.

Definition at line 717 of file network_builder.h.

Referenced by line::io::build_network_from_json().

◆ set_pas()

template<class T>
void line::qn::Network< T >::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>>() )
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 2187 of file network_builder.h.

Referenced by line::io::build_network_from_json().

◆ set_patience()

template<class T>
void line::qn::Network< T >::set_patience ( std::size_t node,
std::size_t cls,
const Distrib< T > & dist,
lang::ImpatienceType kind = lang::ImpatienceType::RENEGING )
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 737 of file network_builder.h.

Referenced by line::io::build_network_from_json().

◆ set_place_fluid()

template<class T>
void line::qn::Network< T >::set_place_fluid ( std::size_t node,
bool fluid )
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 873 of file network_builder.h.

Referenced by line::io::build_network_from_json(), and line::Place::set_fluid().

◆ set_polling()

template<class T>
void line::qn::Network< T >::set_polling ( std::size_t node,
lang::PollingType ptype,
const std::vector< Distrib< T > > & switchover = std::vector<Distrib<T>>(),
std::size_t pk = 1 )
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 2234 of file network_builder.h.

◆ set_polling_type()

template<class T>
void line::qn::Network< T >::set_polling_type ( std::size_t node,
lang::PollingType rule,
int par = 0 )
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 1586 of file network_builder.h.

Referenced by line::io::build_network_from_json(), and line::Station::set_polling_type().

◆ set_reference_class()

template<class T>
void line::qn::Network< T >::set_reference_class ( std::size_t cls)
inline

JobClass.setReferenceClass(true): sn.refclass(c) picks this class.

Definition at line 1374 of file network_builder.h.

Referenced by line::io::build_network_from_json().

◆ set_region_constraint()

template<class T>
void line::qn::Network< T >::set_region_constraint ( std::size_t region,
const Matrix< T > & A,
const std::vector< T > & b )
inline

The optional linear constraint A n <= b a region may carry beyond its caps.

Definition at line 2365 of file network_builder.h.

Referenced by line::io::build_network_from_json().

◆ set_region_weights()

template<class T>
void line::qn::Network< T >::set_region_weights ( std::size_t region,
const std::vector< T > & weight )
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 2356 of file network_builder.h.

Referenced by line::io::build_network_from_json().

◆ set_reply_signal_class()

template<class T>
void line::qn::Network< T >::set_reply_signal_class ( std::size_t call_cls,
std::size_t reply_cls )
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 1433 of file network_builder.h.

Referenced by line::io::build_network_from_json().

◆ set_retrial()

template<class T>
void line::qn::Network< T >::set_retrial ( std::size_t node,
std::size_t cls,
const Distrib< T > & proc,
const T & rate,
int max_attempts = 0 )
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().

◆ set_retrieval_system() [1/2]

template<class T>
void line::qn::Network< T >::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 )
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 1220 of file network_builder.h.

◆ set_retrieval_system() [2/2]

template<class T>
void line::qn::Network< T >::set_retrieval_system ( std::size_t cache_node,
std::size_t read_class,
std::size_t miss_class,
std::size_t queue_node )
inline

Cache.setRetrievalSystem(readClass, missClass, queue) with a single Queue, as the reference accepts.

Definition at line 1286 of file network_builder.h.

◆ set_reward()

template<class T>
void line::qn::Network< T >::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 )
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 2382 of file network_builder.h.

Referenced by line::io::build_network_from_json().

◆ set_routing()

template<class T>
void line::qn::Network< T >::set_routing ( std::size_t node,
std::size_t cls,
RoutingStrategy rs )
inline

node.setRouting(class, strategy).

Definition at line 1787 of file network_builder.h.

Referenced by line::io::build_network_from_json(), line::io::read_jsim(), and line::Node::set_routing().

◆ set_routing_param()

template<class T>
void line::qn::Network< T >::set_routing_param ( std::size_t node,
std::size_t cls,
int d )
inline

The d of a power-of-d (SQ) dispatcher, per (node, class).

Definition at line 945 of file network_builder.h.

Referenced by line::io::build_network_from_json(), and line::io::read_jsim().

◆ set_routing_weights()

template<class T>
void line::qn::Network< T >::set_routing_weights ( std::size_t node,
std::size_t cls,
const std::map< std::size_t, double > & weights )
inline

The per-destination weights of a WRROBIN dispatcher, per (node, class).

Definition at line 933 of file network_builder.h.

Referenced by line::io::build_network_from_json(), line::io::read_jsim(), and line::Node::set_routing_weights().

◆ set_sched_param()

template<class T>
void line::qn::Network< T >::set_sched_param ( std::size_t node,
std::size_t cls,
const T & weight )
inline

The DPS / GPS weight of a class at a station.

Definition at line 1637 of file network_builder.h.

Referenced by line::io::build_network_from_json(), line::io::read_jsim(), and line::Station::set_sched_param().

◆ set_server_parallelism()

template<class T>
void line::qn::Network< T >::set_server_parallelism ( std::size_t node,
std::size_t cls,
std::size_t n )
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 790 of file network_builder.h.

Referenced by line::io::build_network_from_json().

◆ set_service()

template<class T>
void line::qn::Network< T >::set_service ( std::size_t node,
std::size_t cls,
const Distrib< T > & d )
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 1455 of file network_builder.h.

Referenced by line::opt::ServiceRate::apply(), line::io::build_network_from_json(), 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().

◆ set_service_rate_function()

template<class T>
void line::qn::Network< T >::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>() )
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 1553 of file network_builder.h.

◆ set_setup_delayoff()

template<class T>
void line::qn::Network< T >::set_setup_delayoff ( std::size_t node,
std::size_t cls,
const Distrib< T > & setup,
const Distrib< T > & delayoff )
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 961 of file network_builder.h.

Referenced by line::io::build_network_from_json().

◆ set_signal()

template<class T>
void line::qn::Network< T >::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>() )
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 2411 of file network_builder.h.

Referenced by line::io::build_network_from_json().

◆ set_state_dep_routing()

template<class T>
void line::qn::Network< T >::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 )
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 1819 of file network_builder.h.

Referenced by line::io::build_network_from_json().

◆ set_state_prior()

template<class T>
void line::qn::Network< T >::set_state_prior ( std::size_t node,
const Matrix< T > & space,
const std::vector< T > & prior )
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 910 of file network_builder.h.

Referenced by line::io::build_network_from_json(), and line::SolverLDES::init_from_solver().

◆ set_switchover() [1/2]

template<class T>
void line::qn::Network< T >::set_switchover ( std::size_t node,
std::size_t cls,
const Distrib< T > & so )
inline

Queue.setSwitchover(jobclass, distrib): the switchover time of a class.

Definition at line 1597 of file network_builder.h.

Referenced by line::io::build_network_from_json(), line::Station::set_switchover(), and line::Station::set_switchover().

◆ set_switchover() [2/2]

template<class T>
void line::qn::Network< T >::set_switchover ( std::size_t node,
std::size_t from_cls,
std::size_t to_cls,
const Distrib< T > & so )
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. The reference accepts the call there and then drops the extra rows when it serializes, which is a silently different model.

Definition at line 1620 of file network_builder.h.

◆ set_sync_reply()

template<class T>
void line::qn::Network< T >::set_sync_reply ( std::size_t node,
std::size_t call_cls,
std::size_t reply_cls )
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 2260 of file network_builder.h.

◆ station_index()

template<class T>
std::size_t line::qn::Network< T >::station_index ( std::size_t node) const
inline

Definition at line 2433 of file network_builder.h.

Referenced by line::Station::get_station_index().


The documentation for this class was generated from the following files: