lang.nodes
- class Station
Bases:
StatefulNodeAn abstract class for nodes where jobs station
Copyright (c) 2012-2026, Imperial College London All rights reserved.
- Property Summary
- cap
- classCap
- dropRule
- lcdScaling
limited class-dependence scaling factors (product-form beta_{i,r})
- lcdScalingPeak
peak (max) class-dependent rate scaling per class, used to normalize Util (T*S/peak)
- ljdScaling
limited joint-dependence scaling factors (non-product-form eta_i)
- ljdScalingPeak
peak (max) joint-dependent rate scaling per class, used to normalize Util (T*S/peak)
- lldScaling
limited load-dependence scaling factors
- numberOfServers
- patienceDistributions
per-class patience distributions (cell array indexed by class)
- stationIndex
- Method Summary
- getNumServers()
VALUE = GETNUMSERVERS()
- getNumberOfServers()
VALUE = GETNUMBEROFSERVERS()
- getNumberOfServiceClasses()
R = GETNUMBEROFSERVICECLASSES()
- getSelfLoopProbabilities()
[P] = GETSELFLOOPPROBABILITIES()
- getServiceRates()
[PH,MU,PHI] = GETSERVICERATES()
- getSourceRates()
[PH,MU,PHI] = GETSOURCERATES()
- isServiceDefined(class)
- isServiceDisabled(class)
ISD = ISSERVICEDISABLED(CLASS)
- isServiceImmediate(class)
ISI = ISSERVICEIMMEDIATE(CLASS)
- removeJobClass(jobclass)
SELF = REMOVEJOBCLASS(JOBCLASS)
Drop the per-class capacity, drop rule and patience of JOBCLASS on top of the routing configuration handled by Node.
- setCap(value)
SETCAP(VALUE) Alias for setCapacity() for backwards compatibility
- setCapacity(value)
SETCAPACITY(VALUE)
INVALIDATESTRUCT IS PART OF THE SETTER, not an optimization the caller may skip: sn.cap and sn.classcap are DERIVED (refreshCapacity folds this value together with classCap and the chain population), so a cached struct does not see the new buffer. Without it, a setCapacity called after the first getStruct() – the ordinary order when a model is built, inspected, then capped – was silently dropped and every sn-reading solver answered the UNBOUNDED model: SolverCTMC returned the product-form 1.1475 jobs for a buffer of 1 while SolverFLD, whose gate reads the node objects instead, refused the very same model as capacity-bound. see _kb/11-conventions-and-gotchas.md
- setChainCapacity(values)
SETCHAINCAPACITY(VALUES)
- setClassCapacity(class, capacity)
SETCLASSCAPACITY(CLASS, CAPACITY) Per-class buffer at this station, the station-level twin of SETCHAINCAPACITY. Native Python (Station.set_class_capacity), C++ (network_builder set_class_capacity) and the JAR (setClassCap) all carry it; MATLAB had it on Place only, so JSIM2LINE’s import of a per-class JSIMgraph capacity and every model that declares one on a Queue died on an unrecognized method.
SELF.CAP IS LEFT ALONE, unlike setChainCapacity, which sets EVERY class in one call and can therefore total them. Setting one class says nothing about the others, and REFRESHCAPACITY already reads classCap(r) beside cap and takes the tighter of the two.
- setDropRule(class, drop)
SELF = SETDROPRULE(CLASS, DROPRULE)
- setNumServers(value)
SETNUMSERVERS(VALUE)
- setNumberOfServers(value)
SETNUMBEROFSERVERS(VALUE)
- summary()
SUMMARY()
- class Cache
Bases:
StatefulNodeMulti-level cache node with hit/miss class switching
Models cache memory systems with multiple levels and replacement strategies.
Copyright (c) 2012-2026, Imperial College London All rights reserved.
- Constructor Summary
- Cache(model, name, nitems, itemLevelCap, replStrat, graph)
CACHE Create a Cache node instance
@brief Creates a Cache node with configurable levels and replacement strategy @param model Network model to add the cache to @param name String identifier for the cache node @param nitems Total number of cacheable items @param itemLevelCap Vector specifying capacity of each cache level @param replStrat Replacement strategy (LRU, FIFO, Random, etc.) @param graph Optional graph structure for cache hierarchy @return self Cache instance configured for the given model
The constructor creates a multi-level cache with the specified total items and per-level capacities. The replacement strategy determines how items are evicted when cache levels become full.
- Property Summary
- accessProb
- admissionProb
q-LRU admission probability on a miss (1.0 = always admit)
- cap
- costCap
per-list storage cost cap; [] when unset
- costCapGlobal
true when costCap came from a single cache-wide cap
- graph
- itemClasses
cell indexed by the chain’s first read class -> [per-item class
- itemLevelCap
- itemOfClass
(1,K) item each per-item class reads, 0 where the class is not
- itemSize
per-item storage cost (size); [] when unset
- items
- nLevels
- popularity
- replacestrategy
- retrievalClassIndices
set of indices of retrieval classes (used in afterEventCache READ)
- retrievalRoutingEntries
cell array of [fromCls,toCls,srcNode,dstNode,prob] routing tuples;
- retrievalSystemCapacity
0 until setRetrievalSystem is called; nitems-totalCacheCapacity otherwise
- retrievalSystemQueueIndices
dictionary jobinClassIdx -> [queue node indices]
- schedPolicy
- schedStrategy
- totalCacheCapacity
sum(itemLevelCap)
- Method Summary
- addRetrievalRoutingEntry(fromCls, toCls, srcNode, dstNode, prob, allowZero)
ADDRETRIEVALROUTINGENTRY(fromCls, toCls, srcNode, dstNode, prob, allowZero) Register a routing edge for an auto-generated retrieval class. link() injects all such entries into the routing matrix P. Entries are 1-based class indices and 1-based node indices; prob is the routing probability. Later entries override earlier ones for the same (fromCls,toCls,src,dst). With allowZero=true an explicit prob==0 entry is recorded so it can override (delete) a default edge inherited from the read class; the internal broadcast path keeps allowZero=false and drops zero edges.
- getDelayedHitQLen()
GETDELAYEDHITQLEN Per-item delayed-hit queue length; empty when the solver does not compute it.
- getDelayedHitRatio()
GETDELAYEDHITRATIO Actual delayed-hit fraction per class (empty/zero when the cache has no retrieval system).
- getHitClass()
HITCLASS = GETHITCLASS
For an incoming job of class r, HITCLASS(r) is the new class of that job after a hit
- getHitRatio()
GETHITRATIO Actual (true) hit fraction per class: the item is resident in the cache. Delayed hits are reported separately by getDelayedHitRatio.
- getHitRatioByList()
GETHITRATIOBYLIST Per-class, per-list hit fraction matrix [classes x lists]; empty when not computed by the solver.
- getItemProb()
GETITEMPROB Per-item occupancy matrix [items x (lists+1)]: column 1 is the miss probability, columns 2..end the per-list probabilities; empty when not computed by the solver.
- getListCost()
GETLISTCOST Mean storage cost held by each list [1 x lists]; empty when the model carries no item sizes.
- getMissClass()
MISSCLASS = GETMISSCLASS
For an incoming job of class r, MISSCLASS(r) is the new class of that job after a miss
- getMissRatio()
- getResidT()
- getRetrievalClassIndices()
- getRetrievalClasses()
- getRetrievalSystemCapacity()
- getRetrievalSystemQueueIndicesFor(jobinClassIdx)
q = getRetrievalSystemQueueIndicesFor(jobinClassIdx) Return node indices of the queues comprising the retrieval system for the given (0-indexed) arrival class, or [] if no retrieval system is set.
- getTotalCacheCapacity()
- static perItemClasses(spec, nItems, what)
OUT = PERITEMCLASSES(SPEC, NITEMS, WHAT) Normalise a hit/miss class argument for the cache network helpers: a single class is shared by every item, a cell of NITEMS classes is taken one per item. A closed model typically needs the per-item form, because the job must leave the cache as the class that identifies its own item; an open model whose hits all go to the same place can share one class.
- removeJobClass(jobclass)
SELF = REMOVEJOBCLASS(JOBCLASS)
Reject class removal: the cache item state is indexed by class and lives in the model state, not only in this node, so it cannot be re-indexed here. Matches Cache.removeJobClass in the JAR and Cache.remove_job_class in python.
- reset()
SELF = RESET()
Reset internal data structures when the network model is reset
- setAccessProb(R)
SETACCESSCOSTS(R)
- setAdmissionProb(q)
SETADMISSIONPROB(Q) Probability q in [0,1] of admitting a missed item into the cache (q-LRU). Only used when the replacement strategy is QLRU.
- setCostCaps(caps)
SETCOSTCAPS(CAPS) Per-list cap on the total storage cost of the resident items. A scalar declares a single cap for the whole cache, which is modelled as the same cap on every list.
- setHitClass(jobinclass, joboutclass)
SETHITCLASS(JOBINCLASS, JOBOUTCLASS)
- setItemClasses(jobinClass, hitClass)
ITEMCLASSIDX = SETITEMCLASSES(JOBINCLASS, HITCLASS)
Mint one job class per item at a cache that is FED BY ANOTHER CACHE, so item identity survives the miss hop. Each minted class reads exactly its own item (one-hot popularity) and reports a hit as HITCLASS. The classes arrive by ordinary routing from the upstream cache, so no arc-level class switch is involved. At the cache the exogenous requests enter, the per-item classes are the user’s own: use setItemReadClasses there instead.
Idempotent: calling it twice for the same JOBINCLASS returns the existing classes and does not mint again.
- setItemMissClass(jobinClass, missClass)
SETITEMMISSCLASS(JOBINCLASS, MISSCLASS)
Terminate a cache network: every per-item class of this cache reports a miss as MISSCLASS, which the user routes onward (typically to the origin server). Required on the root cache, whose misses leave the network.
- setItemReadClasses(readClasses, hitClass)
SETITEMREADCLASSES(READCLASSES, HITCLASS)
Declare that READCLASSES{i} is the request stream for item i at this cache: each reads exactly its own item and reports a hit as HITCLASS. Use this at the cache the exogenous requests enter, where the per-item classes are the user’s own; item popularity is then carried by the per-class arrival rates (or populations), not by a popularity distribution the cache draws from.
This is what keeps a cache network free of arc-level class switching: no ClassSwitch node is inserted, so no class acquires a default route into the cache that the model never intended.
- setItemRoutingProb(jobinClass, item, source, dest, probability)
Short alias for setItemRoutingProbability.
- setItemRoutingProbability(jobinClass, item, source, dest, probability)
SETITEMROUTINGPROBABILITY(jobinClass, item, source, dest, probability) Probability of routing the retrieval class for item between two nodes of the retrieval system. source/dest are either a retrieval queue or the cache itself: pass the cache as source for a cache->queue entry, or as dest for a queue->cache exit.
- setItemSizes(sizes)
SETITEMSIZES(SIZES) Storage cost (size) of each item, a positive integer vector with one entry per item. Used together with setCostCaps to bound the storage held by each cache list.
- setMissCache(jobinClass, nextCache, hitClassAtNext)
NEXTCLASSES = SETMISSCACHE(JOBINCLASS, NEXTCACHE, HITCLASSATNEXT)
Send this cache’s misses to NEXTCACHE preserving item identity: the miss class of this cache for item i IS the read class of NEXTCACHE for item i. Mints the per-item classes on NEXTCACHE, registers the cache-to-cache routing arc that link() injects into P, and returns the minted classes so the caller can route them onward from NEXTCACHE.
- setMissClass(jobinclass, joboutclass)
SETMISSCLASS(JOBINCLASS, JOBOUTCLASS)
- setProbRouting(class, destination, probability)
SETPROBROUTING(CLASS, DESTINATION, PROBABILITY)
- setRead(jobclass, distribution)
SETREAD(JOBCLASS, DISTRIBUTION)
- setReadItemEntry(jobclass, popularity, cardinality)
SETREAD(JOBCLASS, DISTRIBUTION)
- setResultDelayedHitProb(actualDelayedHitProb)
SETRESULTDELAYEDHITPROB Per-class delayed-hit fraction (requests arriving for an item whose fetch is already in progress in the retrieval system). Zero for caches without a retrieval system.
- setResultDelayedHitQLen(d1, dfull)
SETRESULTDELAYEDHITQLEN Per-item delayed-hit queue length: the mean number of secondary requests waiting on the in-flight fetch of each item (d1), and the same count including the request that triggered the fetch (dfull).
- setResultHitProb(actualHitProb)
- setResultHitProbList(actualHitProbList)
SETRESULTHITPROBLIST Per-class, per-list (per-level) hit fraction matrix [classes x lists]; rows sum to getHitRatio.
- setResultItemProb(actualItemProb)
SETRESULTITEMPROB Per-item occupancy matrix [items x (lists+1)]; column 1 = miss (item not cached), columns 2..end = per-list.
- setResultListCost(actualListCost)
SETRESULTLISTCOST Mean storage cost held by each list [1 x lists].
- setResultMissProb(actualMissProb)
- setResultResidT(actualResidT)
- setRetrievalClass(jobinClass, joboutClass, item)
SETRETRIEVALCLASS(jobinClass, joboutClass, item) item is 1-based (MATLAB convention).
- setRetrievalSystem(jobinClass, missClass, queues)
SETRETRIEVALSYSTEM(jobinClass, missClass, queues)
Initialise the retrieval system through which a request that misses the cache is fetched. The request switches to a per-item retrieval class that circulates the queues and returns to the cache, where the returning READ logs it as a miss (switching into missClass). getResidT reports the per-class queueing time in the retrieval sub-network.
- Parameters:
jobinClass arrival JobClass that can route through the retrieval system
missClass JobClass into which a completed retrieval transitions
queues single Queue or array/cell of Queue nodes comprising the system
- Routing and service are NOT passed here; they are taken from the read class:
service: the read class’s service distribution at each queue. Call queue.setService(jobinClass, …) beforehand; override per item with queue.setItemServiceRate(cache, jobinClass, item, rate).
routing: the read class’s routing among the retrieval queues drawn in the top-level routing matrix P; override per item with setItemQueueEntryProbability / setItemRoutingProbability / setItemQueueExitProbability.
- class Queue
Bases:
ServiceStationA service station with queueing
Copyright (c) 2012-2026, Imperial College London All rights reserved.
- Constructor Summary
- Queue(model, name, schedStrategy)
SELF = QUEUE(MODEL, NAME, SCHEDSTRATEGY)
- Property Summary
- balkingStrategies
per-class BalkingStrategy constant
- Type:
Cell array
- balkingThresholds
per-class balking thresholds (list of {minJobs, maxJobs, probability})
- Type:
Cell array
- batchRejectProb
per-class batch rejection probability [0,1]
- Type:
Array
- breakdownDownService
per-class service distribution used while the server is down ([] = no service)
- Type:
Cell array
- breakdownFailure
time to failure of the server (runs while up, busy or idle)
- Type:
- breakdownRepair
repair time of the server
- Type:
- delayoffTime
- heteroSchedPolicy
HeteroSchedPolicy for server assignment
- heteroServiceDistributions
ServerType -> (dictionary: JobClass -> Distribution)
- Type:
dictionary
- immediateFeedback
Cell array of class indices, or ‘all’ for all classes
- impatienceTypes
- orbitImpatienceDistributions
per-class orbit abandonment distributions
- Type:
Cell array
- orbitMaxJobs
per-class orbit capacity (-1 = unbounded)
- Type:
Array
- pollingPar
- pollingType
- retrialDelays
per-class retrial delay distributions
- Type:
Cell array
- retrialMaxAttempts
per-class max retrial attempts (-1 = unlimited)
- Type:
Array
- retrialPolicies
per-class RetrialPolicy (LINEAR = per-customer rate, CONSTANT = orbit-wide rate)
- Type:
Array
- serverParallelism
per-class number of servers a job seizes at once (default 1)
- Type:
Array
- serverTypes
Cell array of ServerType objects
- setupTime
- svcRateFun
total service rate as a function of the ordered state vector c (PAS scheduling)
- Type:
function handle mu(c)
- swapGraph
(nclasses x nclasses) class-compatibility/swap graph for PAS scheduling
- switchoverTime
- Method Summary
- addServerType(serverType)
ADDSERVERTYPE Add a server type to this queue
self = ADDSERVERTYPE(serverType) adds a ServerType to this queue for heterogeneous multiserver configuration.
When server types are added, the queue becomes a heterogeneous multiserver queue where different server types can have different service rates and serve different subsets of job classes.
@param serverType The ServerType object to add
- checkPermInvariance(Nvec, cap)
[OK, BADC, PARTIAL] = CHECKPERMINVARIANCE(NVEC, CAP)
Checks the order-independence (OI) condition on the service rate mu(c): the rate of the job in position j must depend only on the jobs at or ahead of it (positions 1..j) and not on the jobs behind it. Since the position-j rate is the prefix increment Delta_mu(c1..cj) = mu(c1..cj) - mu(c1..c_{j-1}), tail-independence is structural; the substantive requirement is that this increment be independent of the ORDER of the jobs ahead, which (by induction on prefix length) is equivalent to mu(c) being permutation- invariant, i.e. a function of the multiset of present jobs only. This is what is verified, over the reachable microstates (per-class counts bounded by the population NVEC and total by the station capacity CAP). Returns OK=false and the offending sorted microstate BADC if a violation is found. When the reachable population is too large to enumerate exhaustively, only a subset of microstates is verified and PARTIAL is returned true.
- checkRateMonotonicity(Nvec, cap)
[OK, BADC, BADR, PARTIAL] = CHECKRATEMONOTONICITY(NVEC, CAP)
Checks the order-independence (OI) condition (1) on the service rate mu(c): the per-job rates must be non-negative, that is mu(c1..cj) >= mu(c1..c_{j-1}) for every microstate and position j.
A rate can be permutation-invariant and still fail to parameterize an OI queue. Single-server processor sharing with class-dependent rates, mu(c) = (sum_j mu_{cj}) / n, is the standard trap: it is flatly invariant under permutations, yet as soon as two classes have different rates its prefix increments go negative – with mu_hit = 3.0 and mu_miss = 0.7, mu(Hit) = 3.0 while mu(Hit,Miss) = 1.85, so the second job would be served at -1.15.
Run this AFTER checkPermInvariance: permutation invariance is what makes mu a function of the count vector, and the increments to test are then just mu(n + e_r) - mu(n) over count vectors n and classes r, with no permutation enumeration. Prefixes are non-empty, so mu is never evaluated on an empty microstate, and an increment of exactly zero is accepted – that is how a class which does not visit this station is expressed. Returns OK=false with the microstate BADC whose rate is lowered and the class BADR whose arrival lowers it. When the reachable population is too large to enumerate exhaustively, only a subset is verified and PARTIAL is returned true.
- getBalking(class)
[STRATEGY, THRESHOLDS] = GETBALKING(CLASS)
Returns the balking configuration for a specific job class.
- Parameters:
class - JobClass object
- Returns:
strategy - BalkingStrategy constant, or [] if not configured thresholds - Cell array of {minJobs, maxJobs, probability} tuples
- getBatchRejectProbability(class)
P = GETBATCHREJECTPROBABILITY(CLASS)
Returns the batch reject probability for a specific job class.
- Parameters:
class - JobClass object
- Returns:
p - Batch reject probability [0,1], or 0 if not set
- getBreakdown()
[FAILUREDISTRIBUTION, REPAIRDISTRIBUTION, DOWNSERVICEDISTRIBUTION] = GETBREAKDOWN()
Returns the breakdown configuration of this station, or empty values when the station is not subject to breakdowns.
- getDelayOffTime(jobclass)
- getHeteroSchedPolicy()
GETHETEROSCHEDPOLICY Get the heterogeneous server scheduling policy
policy = GETHETEROSCHEDPOLICY() returns the HeteroSchedPolicy.
- getHeteroService(jobClass, serverType)
GETHETEROSERVICE Get service distribution for a job class and server type
distribution = GETHETEROSERVICE(jobClass, serverType) returns the service time distribution for a specific job class and server type.
@param jobClass The JobClass object @param serverType The ServerType object @return distribution The service time Distribution, or [] if not set
- getImmediateFeedbackClasses()
GETIMMEDIATEFEEDBACKCLASSES Get list of class indices with immediate feedback
CLASSES = GETIMMEDIATEFEEDBACKCLASSES() returns cell array of class indices
- getImpatienceType(class)
IMPATIENCETYPE = GETIMPATIENCETYPE(CLASS)
Returns the impatience type for a specific job class. Returns the queue-specific setting if available, otherwise falls back to the global class impatience type.
- Parameters:
class - JobClass object
- Returns:
impatienceType - The impatience type (ImpatienceType constant), or [] if not set
- getLimit()
LIMIT = GETLIMIT() Returns the maximum number of jobs for LPS scheduling
- Returns:
limit - Maximum number of jobs in PS mode for LPS
- getNumServerTypes()
GETNUMSERVERTYPES Get the number of server types
n = GETNUMSERVERTYPES() returns the number of server types, or 0 if this is a homogeneous queue.
- getOrbit(class)
[RETRIALDISTRIBUTION, POLICY, MAXORBIT] = GETORBIT(CLASS)
Returns the orbit configuration of CLASS at this station.
- getOrbitImpatience(class)
DISTRIBUTION = GETORBITIMPATIENCE(CLASS)
Returns the orbit impatience distribution for a specific job class.
- Parameters:
class - JobClass object
- Returns:
distribution - The orbit impatience distribution, or [] if not set
- getPatience(class)
DISTRIBUTION = GETPATIENCE(CLASS)
Returns the patience distribution for a specific job class. Returns the queue-specific setting if available, otherwise falls back to the global class patience.
- Parameters:
class - JobClass object
- Returns:
distribution - The patience distribution, or [] if not set
- getRetrial(class)
[DELAYDISTRIBUTION, MAXATTEMPTS] = GETRETRIAL(CLASS)
Returns the retrial configuration for a specific job class.
- Parameters:
class - JobClass object
- Returns:
delayDistribution - Retrial delay distribution, or [] if not configured maxAttempts - Maximum retrial attempts (-1 = unlimited)
- getServerParallelism(class)
N = GETSERVERPARALLELISM(CLASS)
Returns the number of servers seized by a class-CLASS job, 1 if unset.
- getServerTypeById(id)
GETSERVERTYPEBYID Get a server type by its ID
st = GETSERVERTYPEBYID(id) returns the ServerType with the given ID, or [] if not found.
- getServerTypeByName(name)
GETSERVERTYPEBYNAME Get a server type by its name
st = GETSERVERTYPEBYNAME(name) returns the ServerType with the given name, or [] if not found.
- getServerTypes()
GETSERVERTYPES Get the list of server types
types = GETSERVERTYPES() returns a cell array of ServerType objects.
- getService(class)
DISTRIBUTION = GETSERVICE(CLASS)
- getServiceRateFunction()
MUFUNCTION = GETSERVICERATEFUNCTION()
Returns the total service rate function mu(c) of a pass-and-swap (PAS) queue, or [] if not configured.
- getSetupTime(jobclass)
- getSwapGraph()
GRAPH = GETSWAPGRAPH()
Returns the (nclasses x nclasses) class compatibility/swap graph for a pass-and-swap (PAS) queue, or [] if not configured.
- hasBalking(class)
TF = HASBALKING(CLASS)
Returns true if this class has balking configured at this queue.
- hasImmediateFeedback(varargin)
HASIMMEDIATEFEEDBACK Check if immediate feedback is enabled
TF = HASIMMEDIATEFEEDBACK() returns true if enabled for any class TF = HASIMMEDIATEFEEDBACK(jobClass) returns true if enabled for specific class
- hasOrbitImpatience(class)
TF = HASORBITORBITIMPATIENCE(CLASS)
Returns true if this class has orbit impatience configured at this queue.
- hasPatience(class)
TF = HASPATIENCE(CLASS)
Returns true if this class has patience configured at this queue (either locally or globally).
- hasRetrial(class)
TF = HASRETRIAL(CLASS)
Returns true if this class has retrial configured at this queue.
- hasServerParallelism()
TF = HASSERVERPARALLELISM()
True when some class seizes more than one server.
- isHeterogeneous()
ISHETEROGENEOUS Check if this is a heterogeneous multiserver queue
result = ISHETEROGENEOUS() returns true if server types are defined.
- setBalking(class, strategy, thresholds)
SETBALKING(CLASS, STRATEGY, THRESHOLDS)
Configures balking behavior for a specific job class at this queue. When a customer arrives, they may refuse to join based on queue length.
- Parameters:
class - JobClass object
strategy - BalkingStrategy constant – QUEUE_LENGTH - Balk based on current queue length EXPECTED_WAIT - Balk based on expected waiting time COMBINED - Both conditions (OR logic)
thresholds - Cell array of balking thresholds, each element is – {minJobs, maxJobs, probability} where probability is the chance to balk when queue length is in [minJobs, maxJobs] range.
Example
% Balk with 30% probability when 5-10 jobs in queue, % 80% when 11-20 jobs, 100% when >20 jobs queue.setBalking(jobclass, BalkingStrategy.QUEUE_LENGTH, …
{{5, 10, 0.3}, {11, 20, 0.8}, {21, Inf, 1.0}});
- setBatchRejectProbability(class, p)
SETBATCHREJECTPROBABILITY(CLASS, P)
Sets the probability that an entire batch is rejected when it cannot be fully admitted. Used in BMAP/PH/N/N retrial queues with batch arrivals.
- When a batch of size k arrives and only m < k servers are free:
With probability p: entire batch is rejected to orbit
With probability (1-p): m customers are admitted, k-m go to orbit
- Parameters:
class - JobClass object
p - Probability [0,1] that batch is rejected vs partially admitted – Default is 0 (partial admission allowed)
Example
queue.setBatchRejectProbability(jobclass, 0.4);
- setBreakdown(failureDistribution, repairDistribution, downServiceDistribution)
SETBREAKDOWN(FAILUREDISTRIBUTION, REPAIRDISTRIBUTION) SETBREAKDOWN(FAILUREDISTRIBUTION, REPAIRDISTRIBUTION, DOWNSERVICEDISTRIBUTION)
Makes the server of this station subject to breakdowns. The server alternates between an UP and a DOWN status: while up it fails after FAILUREDISTRIBUTION, while down it is restored after REPAIRDISTRIBUTION.
The failure clock runs whenever the server is up, whether or not a job is in service, so a station can fail while idle. Arrivals are unaffected by the server status and keep queueing (subject to the station capacity) while the server is down. A job that is in service when the server fails is not lost: it stays at the station and, service being memoryless in the supported case, resumes when the server is repaired.
- Parameters:
failureDistribution - time to failure of an up server
repairDistribution - repair time of a down server
downServiceDistribution - optional service distribution used – while the server is down, either a single Distribution applied to every class or a cell array indexed by class. Omitted or empty means the server does not serve at all while down, which is the usual breakdown model.
Only exponential failure and repair distributions are currently expanded into the joint (queue, server status) chain; anything else is rejected here rather than silently approximated.
Example
% M/M/1/K whose server fails at rate 1e-4 and is repaired at rate 0.1 queue.setBreakdown(Exp(0.0001), Exp(0.1));
- setClassDependence(beta, peakRatePerClass)
SETCLASSDEPENDENCE(self, beta, peakRatePerClass) beta(ni) is the class-dependent service-rate scaling handle. peakRatePerClass (REQUIRED) is the peak rate scaling per class (scalar broadcast to all classes) used to normalize Util = T*S/peak.
- setDelayOff(jobclass, setupTime, delayoffTime)
- setHeteroSchedPolicy(policy)
SETHETEROSCHEDPOLICY Set the heterogeneous server scheduling policy
self = SETHETEROSCHEDPOLICY(policy) sets the policy that determines how jobs are assigned to server types when a job’s class is compatible with multiple server types.
@param policy HeteroSchedPolicy constant (ORDER, ALIS, ALFS, FAIRNESS, FSF, RAIS)
- setHeteroService(jobClass, serverType, distribution)
SETHETEROSERVICE Set service distribution for a job class and server type
SETHETEROSERVICE(jobClass, serverType, distribution) sets the service time distribution for a specific job class when served by a specific server type.
@param jobClass The JobClass object @param serverType The ServerType object @param distribution The service time Distribution
- setImmediateFeedback(varargin)
SETIMMEDIATEFEEDBACK Set immediate feedback for self-loops
SETIMMEDIATEFEEDBACK(true) enables immediate feedback for all classes SETIMMEDIATEFEEDBACK(false) disables immediate feedback for all classes SETIMMEDIATEFEEDBACK(jobClass) enables for a specific class SETIMMEDIATEFEEDBACK({class1, class2}) enables for multiple classes
When enabled, a job that self-loops at this station stays in service instead of going back to the queue.
- setItemServiceRate(cache, jobinClass, item, serviceRate)
SETITEMSERVICERATE(cache, jobinClass, item, serviceRate) Override, at this queue, the retrieval service rate for a single item of the read class jobinClass in the given cache’s retrieval system. The default (when not overridden) is the read class’s own service distribution at this queue. item is 1-based.
- setJointDependence(eta, peakRatePerClass)
SETJOINTDEPENDENCE(self, eta, peakRatePerClass) eta(ni) is the joint-dependent service-rate scaling handle, where ni=[ni1,…,niR] is the joint per-class population at the station. It returns a scalar (shared across all classes) or a length-R per-class vector. This is the NON-product-form case (e.g. min(ni(1),c)); use setClassDependence for the product-form beta_{i,r}(n_{i,r}). peakRatePerClass (REQUIRED) normalizes Util = T*S/peak.
- setLimit(limit)
SETLIMIT(LIMIT) Sets the maximum number of jobs for LPS scheduling
- Parameters:
limit - Maximum number of jobs in PS (processor sharing)
- setLoadDependence(alpha)
DPS is admitted alongside PS and FCFS: alpha(n) scales the total station capacity and the discipline then splits it, so the two compose. State.afterEventStation already applies lldscaling in its DPS branch, and SolverFLD closes it through psi(n).
- setNumServers(value)
SETNUMSERVERS(VALUE)
- setNumberOfServers(value)
SETNUMBEROFSERVERS(VALUE)
- setOrbit(class, retrialDistribution, policy, maxOrbit)
SETORBIT(CLASS, RETRIALDISTRIBUTION) SETORBIT(CLASS, RETRIALDISTRIBUTION, POLICY) SETORBIT(CLASS, RETRIALDISTRIBUTION, POLICY, MAXORBIT)
Declares this station to be a retrial queue for CLASS: a job that finds every server busy joins an orbit and re-attempts entry after a random delay, instead of waiting in a line.
This is the first-class form of the retrial idiom. It removes the waiting room itself (capacity = number of servers), which is what makes the station bufferless, so the caller no longer has to know that setCapacity(nservers) is the way to express “no waiting room, blocked jobs orbit”.
- Parameters:
class - JobClass object
retrialDistribution - retrial delay of an orbiting job
policy - RetrialPolicy.LINEAR (default) – each orbiting job retries at its own rate, so the aggregate rate is (orbit size)*nu. RetrialPolicy.CONSTANT: the orbit retries as a whole at rate nu whenever non-empty.
maxOrbit - orbit capacity; -1 (default) – orbit unbounded. A job that finds the orbit full is lost.
The mean orbit length is reported by getAvgOrbit / the Orbit column of the average table, so it need not be recovered as QLen - Util.
Example
% M/M/1 retrial queue with per-customer retrial rate 1.0 queue.setNumberOfServers(1); queue.setOrbit(jobclass, Exp(1.0));
- setOrbitImpatience(class, distribution)
SETORBITIMPATIENCE(CLASS, DISTRIBUTION)
Sets the impatience (abandonment) rate for customers in the orbit. This is separate from queue patience (reneging from waiting queue). Used in BMAP/PH/N/N retrial queues where customers in the orbit may abandon before successfully retrying.
- Parameters:
class - JobClass object
distribution - Distribution for orbit abandonment time (e.g., Exp(gamma))
Example
queue.setOrbitImpatience(jobclass, Exp(0.008)); % gamma = 0.008
- setPatience(class, varargin)
SETPATIENCE(CLASS, DISTRIBUTION) - Backwards compatible SETPATIENCE(CLASS, PATIENCETYPE, DISTRIBUTION) - Explicit type
Sets the patience type and distribution for a specific job class at this queue. Jobs that wait longer than their patience time will abandon the queue.
- Parameters:
class - JobClass object
impatienceType - (Optional) ImpatienceType constant (RENEGING or BALKING) – If omitted, defaults to ImpatienceType.RENEGING
distribution - Any LINE distribution (Exp, Erlang, HyperExp, etc.) – excluding modulated processes (BMAP, MAP, MMPP2)
Note: This setting takes precedence over the global class patience.
Examples
queue.setPatience(jobclass, Exp(0.2)) % Defaults to RENEGING queue.setPatience(jobclass, ImpatienceType.RENEGING, Exp(0.2)) queue.setPatience(jobclass, ImpatienceType.BALKING, Exp(0.5))
- setPollingType(rule, par)
- setRetrial(class, delayDistribution, maxAttempts)
SETRETRIAL(CLASS, DELAYDISTRIBUTION, MAXATTEMPTS)
Configures retrial behavior for a specific job class at this queue. When a customer is rejected (queue full), they move to an orbit and retry after a random delay.
- Parameters:
class - JobClass object
delayDistribution - Distribution for retrial delay (e.g., Exp(0.5))
maxAttempts - Maximum number of retrial attempts – -1 = unlimited retries (default) N = drop after N failed attempts
Example
% Retry with exponential delay, unlimited attempts queue.setRetrial(jobclass, Exp(0.5), -1);
% Retry up to 3 times with Erlang delay queue.setRetrial(jobclass, Erlang(2, 0.3), 3);
- setServerParallelism(class, n)
SETSERVERPARALLELISM(CLASS, N)
Sets the number of servers that a class-CLASS job seizes for the whole of its service, JMT’s job parallelism (Server.serverNumRequired). A job waits until N servers are simultaneously free and holds all of them until it completes, so the station serves at most floor(c/N) such jobs at a time. Default is 1.
- Parameters:
class - JobClass object
n - Number of servers required, an integer in [1, c]
- setService(class, distribution, weight)
SETSERVICE(CLASS, DISTRIBUTION, WEIGHT) distribution can be a Distribution object or a Workflow object
SETSERVICE(MUFUNCTION) on a pass-and-swap (PAS) queue An order-independent/PAS queue is parameterized by a single total service rate function mu(c) of the ordered state vector c (the row vector of class indices, c(1)=oldest job), not by per-class service distributions. The rate allocated to position i is the increment Delta_mu(c(1..i)) = mu(c(1..i)) - mu(c(1..i-1)).
- setServiceRateFunction(muFun)
SETSERVICERATEFUNCTION(MUFUNCTION)
Sets the total service rate function mu(c) of a pass-and-swap (PAS) queue. MUFUNCTION is a function handle taking the ordered state vector c (a row vector of class indices, c(1)=oldest job) and returning the scalar total service rate mu(c). The rate allocated to the job in position i is the increment Delta_mu(c(1..i)) = mu(c(1..i)) - mu(c(1..i-1)).
An order-independent/PAS queue is parameterized by mu(c) as a whole and does not support per-class service distributions.
- setStrategyParam(class, weight)
SELF = SETSTRATEGYPARAM(CLASS, WEIGHT)
- setSwapGraph(graph)
SETSWAPGRAPH(GRAPH)
Sets the class compatibility/swap graph for a pass-and-swap (PAS) queue. GRAPH is an (nclasses x nclasses) matrix whose (r,s) entry is nonzero iff, upon completion of a class-r job, a waiting class-s job may swap into the freed position (order-independent service).
- Parameters:
graph - (nclasses x nclasses)
- setSwitchover(varargin)
- updateTotalServerCount()
UPDATETOTALSERVERCOUNT Update total server count from all types
Internal method to recalculate numberOfServers.
- validateCompatibility()
VALIDATECOMPATIBILITY Check all job classes have compatible server types
result = VALIDATECOMPATIBILITY() returns true if all job classes in the model have at least one compatible server type at this queue.
- class Node
Bases:
NetworkElementAn abstract for a node in a Network model
Copyright (c) 2012-2026, Imperial College London All rights reserved.
- Property Summary
- index
- input
- model
- output
- server
- Method Summary
- static findRoutingEntry(entries, destination)
POS = FINDROUTINGENTRY(ENTRIES, DESTINATION) Index of the {destination, value} pair naming DESTINATION, 0 if absent.
- getSections()
SECTIONS = GETSECTIONS()
- hasClassSwitching()
BOOL = HASCLASSSWITCHING()
- horzcat(varargin)
V = HORZCAT(VARARGIN)
- isStateful()
BOOL = ISSTATEFUL()
- isStation()
BOOL = ISSTATION()
- remainingClassIndexes(jobclass)
REMAINING = REMAININGCLASSINDEXES(JOBCLASS)
Indexes of the classes that survive the removal of JOBCLASS. The lookup is by name so that a class object belonging to another copy of the model still resolves, as in @MNetwork/removeClass.m.
- removeJobClass(jobclass)
SELF = REMOVEJOBCLASS(JOBCLASS)
Remove all per-class configuration referencing JOBCLASS from this node. The base implementation drops the class’s routing (output) strategy; subclasses extend it to drop service, capacity, arrival and class-switching configuration. Called by @MNetwork/removeClass.m, mirroring Node.removeJobClass in the JAR and Node.remove_job_class in python.
- setProbRouting(class, destination, probability)
SETPROBROUTING(CLASS, DESTINATION, PROBABILITY)
- setRouting(class, strategy, par1, par2)
SETROUTING(CLASS, STRATEGY, PARAM) SETROUTING(CLASS, STRATEGY, DESTINATION, PROBABILITY)
- setStateDepRouting(class, departure, branches, level, C, d)
SETSTATEDEPROUTING(CLASS, DEPARTURE, BRANCHES, LEVEL, C, D)
Declares this node to be the entry center e of a subnetwork Q(V,V) served by the product-form state-dependent routing of Krzesinski (1987), “Multiclass Queueing Networks with State-Dependent Routing”, Performance Evaluation 7:125-143.
DEPARTURE is the departure center d of Q(V,V), which may be this node itself in a central server model. BRANCHES is a cell array following the paper’s own indexing: BRANCHES{1} must be empty because branch index 1 denotes the complement M-V, and BRANCHES{b} for b >= 2 lists the nodes of branch b with its entry center first and its departure center last. A single-center branch is written {node}. LEVEL(b) is the index t of the subnetwork with B_b in V_t - V_{t+1}, and LEVEL(1) is ignored. C is the 1xT vector of coefficients C_t and D the TxB matrix of coefficients d_tb, of which entry (t,b) is read for 1 <= t <= LEVEL(b) and 2 <= b <= B.
Negative C_t and positive d_tb make the routing prefer the least congested branches and impose the population bounds m_b <= d_{t,b}/(-C_t) and v_t <= D_tt/(-C_t).
Example, the central server of Section 2.5 with two peripheral centers, C = (-1,-1), d_12 = 1, d_13 = 2, d_23 = 3:
d = zeros(2,3); d(1,2) = 1; d(1,3) = 2; d(2,3) = 3; node1.setStateDepRouting(class, node1, {[], {node2}, {node3}}, …
[0 1 2], [-1 -1], d);
- subsindex()
IND = SUBSINDEX()
- summary()
SUMMARY()
- vertcat(varargin)
V = VERTCAT(VARARGIN)
- class Fork
Bases:
NodeFork Job splitting node for parallel processing models
Fork is a specialized node that splits incoming jobs into multiple sibling tasks that can be processed in parallel by downstream nodes. Each job arriving at a Fork node is replicated into multiple parallel tasks that must later be synchronized using a corresponding Join node.
@brief Job splitting node that creates parallel sibling tasks from incoming jobs
Key characteristics: - Splits each job into multiple parallel tasks - Works in conjunction with Join nodes for synchronization - Supports different fork strategies and task distributions - Essential for modeling parallel processing systems - No service delay - instantaneous job splitting
Fork nodes are commonly used for: - Parallel processing models - Fork-join queueing networks - Multi-threaded system modeling - Task decomposition scenarios - Distributed computing models
Example: @code fork = Fork(model, ‘TaskSplitter’); % Jobs entering this fork will be split into parallel tasks % Must be paired with a Join node for proper synchronization @endcode
Copyright (c) 2012-2026, Imperial College London All rights reserved.
- Constructor Summary
- Fork(model, name)
FORK Create a Fork node instance
@brief Creates a Fork node for splitting jobs into parallel tasks @param model Network model to add the fork to @param name String identifier for the fork node @return self Fork instance configured for the given model
The constructor initializes the Fork node with appropriate buffers, service tunnels, and forker output components. Fork nodes have no service delay and immediately split incoming jobs into parallel tasks.
- Property Summary
- cap
- schedStrategy
- Method Summary
- setBranchProbability(jobclass, destNode, prob)
SETBRANCHPROBABILITY Activate an outgoing branch only with probability PROB
SETBRANCHPROBABILITY(JOBCLASS, DESTNODE, PROB) makes the branch towards DESTNODE fire with probability PROB for jobs of JOBCLASS, and emit nothing otherwise. The branches are activated independently, so the number of siblings a job produces is random even when the tasks per link are deterministic.
The matched Join must be told what to wait for: with a standard join a job that skipped a branch would block forever, so a fork with any branch probability below one requires JoinStrategy.PARTIAL (see Join.setRequired) or a quorum.
@param jobclass Job class the probability applies to @param destNode Destination node of the branch @param prob Activation probability in [0,1]
- setTasksPerLink(nTasks, varargin)
SETTASKSPERLINK Configure number of tasks per output link
Sets the number of tasks sent out on each outgoing link. By default, a Fork node sends exactly one task per outgoing link. This method allows configuring the Fork to send multiple identical tasks on each link. The total number of tasks created will be: (number of outgoing links) × tasksPerLink.
- Solver compatibility for tasksPerLink > 1:
SolverJMT: Fully supported - simulation handles multiple tasks correctly
SolverLDES: Fully supported - simulation handles multiple tasks correctly
SolverMVA (H-T method): Not supported - throws error
SolverMVA/SolverNC (MMT method): Supported - the auxiliary open class carries the load of all (links x nTasks) siblings and the join synchronises on the order statistic of that many branch times, each branch replicated nTasks times. That is the same approximation an ordinary fork-join gets, but the warning below still stands for the per-link and DISTRIBUTION forms, where the analytical solvers see only the mean fanout.
SETTASKSPERLINK(JOBCLASS, NTASKS) sets it for one class only, leaving every other class on the node-wide value.
SETTASKSPERLINK(JOBCLASS, NTASKS, DESTNODE) sets it for the link towards DESTNODE only, leaving the other links alone.
@param nTasks Number of tasks per link (default: 1)
- setTasksPerLinkDistribution(jobclass, dist, destNode)
SETTASKSPERLINKDISTRIBUTION Configure a RANDOM number of tasks per link
SETTASKSPERLINKDISTRIBUTION(JOBCLASS, DIST) makes the number of tasks emitted on each outgoing link a draw from DIST, a DiscreteSampler over a non-negative integer support, redrawn independently for every link and every forked job. This is the variable forking level of JMT’s JobsPerLinkDis.
SETTASKSPERLINKDISTRIBUTION(JOBCLASS, DIST, DESTNODE) restricts it to the link towards DESTNODE, leaving the other links alone.
Exact under SolverJMT and SolverLDES, which draw the degree at the fork epoch. The analytical solvers see E[DIST]: SolverMVA’s MMT method uses it as the mean fanout, and SolverNC/SolverCTMC obtain the visit ratios from sn_fj_visits_spn.
@param jobclass Job class the distribution applies to @param dist DiscreteSampler over the tasks-per-link support @param destNode Optional destination node restricting the link
- summary()
SUMMARY Display fork node configuration summary
@brief Prints a summary of the fork node’s routing configuration
- class Router
Bases:
StatefulNodeRouter Probabilistic job routing node for queueing networks
Router is a stateful node that routes jobs towards other nodes based on probabilistic routing strategies. Unlike service stations, jobs do not queue inside a Router node but are immediately routed to downstream nodes according to configured routing probabilities or strategies.
@brief Probabilistic routing node that directs jobs to downstream destinations
Key characteristics: - Jobs flow through without queueing or service delays - Supports probabilistic routing matrices - Maintains state for routing decisions - Can implement complex routing strategies (random, round-robin, etc.) - Essential for modeling load balancing and traffic distribution
Router nodes are commonly used in: - Load balancing scenarios - Multi-path routing - Traffic distribution models - Complex network topologies with branching
Example: @code router = Router(model, ‘LoadBalancer’); model.addNode(router); % Set routing probabilities in routing matrix @endcode
Copyright (c) 2012-2026, Imperial College London All rights reserved.
- Constructor Summary
- Router(model, name)
ROUTER Create a Router node instance
@brief Creates a Router node for probabilistic job routing @param model Network model to add the router to @param name String identifier for the router node @return self Router instance configured for the given model
Note: This is a node and not a Station because jobs cannot queue inside it - they flow through immediately to downstream nodes.
- Property Summary
- cap
- numberOfServers
- schedPolicy
- schedStrategy
- Method Summary
- setProbRouting(class, destination, probability)
SETPROBROUTING(CLASS, DESTINATION, PROBABILITY)
- setService(class, distribution)
SETSERVICE(CLASS, DISTRIBUTION)
- class Transition
Bases:
StatefulNodeA class for a stochastic Petri net transition
Copyright (c) 2012-2026, Imperial College London All rights reserved.
- Constructor Summary
- Transition(model, name)
TRANSITION(MODEL, NAME)
- Property Summary
- cap
- distributions
- enablingConditions
- firingOutcomes
- firingPriorities
- firingRateDependence
- firingWeights
- inhibitingConditions
- modeNames
- modes
- numberOfServers
- timingStrategies
- Method Summary
- addMode(modeName)
- getModes()
- getNumberOfModes()
- getServiceRates()
[PH,MU,PHI] = GETPHSERVICERATES()
- init()
SELF = INIT()
- setDistribution(mode, distribution)
- setEnablingConditions(mode, class, inputNode, enablingCondition)
SELF = SETENABLINGCONDITIONS(MODE, CLASS, NODE, ENABLINGCONDITIONS)
- setFiringOutcome(mode, class, node, firingOutcome)
SELF = SETFIRINGOUTCOMES(MODE, NODE, CLASS,FIRINGOUTCOME)
- setFiringPriorities(mode, firingPriority)
SELF = SETFIRINGPRIORITIES(MODE, FIRINGPRIORITIES)
- setFiringRateDependence(mode, g)
SELF = SETFIRINGRATEDEPENDENCE(MODE, G) Marking-dependent firing-rate multiplier for a timed mode. G is a function handle g(m) of the input-place marking matrix m (shaped like enablingConditions{mode}, nnodes x nclasses), returning a positive scalar. The effective firing rate of an enabled binding becomes rate_base(mode)*g(m). Empty G restores the unit (marking-independent) multiplier.
Exact only for memoryless firing: the mode must be TIMED (not IMMEDIATE, which uses firingWeights) and exponentially distributed. This mirrors the PS/FCFS-only restriction on station load/class dependence.
- setFiringWeights(mode, firingWeight)
SELF = SETFIRINGWEIGHTS(MODE, FIRINGWEIGHTS)
- setInhibitingConditions(mode, class, inputNode, inhibitingCondition)
SELF = SETINHIBITINGCONDITIONS(MODE, CLASS, NODE, INHIBITINGCONDITIONS)
- setModeNames(mode, modeName)
SELF = SETMODENAMES(MODE, MODENAMES)
- setNumberOfServers(mode, numberOfServers)
SELF = SETNUMBEROFSERVERS(MODE, NUMOFSERVERS)
- setTimingStrategy(mode, timingStrategy)
SELF = SETTIMINGSTRATEGY(MODE, TIMINGSTRATEGY)
- class Source
Bases:
StationSource External job arrival node for open queueing networks
Source represents an external arrival node that generates jobs for open classes according to specified arrival processes. It serves as the entry point for jobs entering the network from the external environment, with configurable arrival rates and distributions for each job class.
@brief External arrival node generating jobs for open queueing networks
Key characteristics: - External job generation for open classes - Class-dependent arrival processes - Infinite capacity job source - Configurable inter-arrival time distributions - Integration with network routing
Source node features: - Multiple job class support - Flexible arrival process specification - Poisson, MAP, and general arrival processes - Arrival rate configuration per class - Disabled arrival capability for specific classes
Source is used for: - Web server client arrivals - Manufacturing job arrivals - Call center customer generation - Network packet injection - Open system workload modeling
Example: @code model = Network(‘WebServer’); source = Source(model, ‘ClientArrivals’); webClass = OpenClass(model, ‘WebRequests’, 1); source.setArrival(webClass, Exp(2.0)); % Poisson arrivals, rate 2 @endcode
Copyright (c) 2012-2026, Imperial College London All rights reserved.
- Constructor Summary
- Source(model, name)
SOURCE Create an external arrival source node
@brief Creates a Source node for external job generation @param model Network model to add the source node to @param name String identifier for the source node @return self Source instance ready for arrival process configuration
- Property Summary
- arrivalBatch
(1,K) cell of batch-size DiscreteDistribution per class (empty = single arrivals)
- arrivalProcess
- markedClasses
(1,K) class indexes bound to marks 1..K of markedProcess
- markedProcess
shared MarkedMAP driving the marked classes (empty if none)
- schedStrategy
- Method Summary
- getArrivalBatch(class)
BATCHSIZE = GETARRIVALBATCH(CLASS) Returns the batch-size law bound to CLASS, or [] for single arrivals.
- getArrivalProcess(oclass)
- removeJobClass(jobclass)
SELF = REMOVEJOBCLASS(JOBCLASS)
Drop the arrival process of JOBCLASS, at the source and inside its input section, on top of what Station and Node remove.
- setArrival(class, distribution)
SETARRIVAL(CLASS, DISTRIBUTION) distribution can be a Distribution object or a Workflow object
- setArrivalBatch(class, batchSize)
SETARRIVALBATCH(CLASS, BATCHSIZE)
Turns each arrival epoch of CLASS into the simultaneous release of a batch of jobs. The interarrival distribution set by SETARRIVAL keeps spacing the epochs; this decides how many jobs each epoch releases. Geometric interarrivals with a Geometric batch size is the Geo^X arrival stream, whose analytical counterpart is QSYS_GEOXGEO1.
The batch size must be supported on {1,2,…}: an epoch that releases no job is not an arrival epoch, so a law that can return zero is rejected rather than clamped. Pass [] to restore single arrivals.
- setMarkedArrival(mmap, classes)
SETMARKEDARRIVAL(MMAP, CLASSES)
Bind a MarkedMAP with K marks to K open classes: mark k emits jobs of class CLASSES{k}, with all marks driven by one shared modulating chain. CLASSES is a cell array or vector of K distinct OpenClass handles, ordered by mark index.
- class ServiceStation
Bases:
StationAn abstract class for stations with service
Copyright (c) 2012-2026, Imperial College London All rights reserved.
- Property Summary
- schedPolicy
- schedStrategy
- schedStrategyPar
- serviceProcess
- Method Summary
- getServiceProcess(oclass)
- removeJobClass(jobclass)
SELF = REMOVEJOBCLASS(JOBCLASS)
Drop the service process and the scheduling parameter of JOBCLASS, at the station and inside its server section, on top of what Station and Node remove.
- class Place
Bases:
StationCopyright (c) 2012-2026, Imperial College London All rights reserved.
- Constructor Summary
- Place(model, name, schedStrategy)
PLACE(MODEL, NAME) PLACE(MODEL, NAME, SCHEDSTRATEGY) SCHEDSTRATEGY (optional) turns the place into a queueing place with an embedded queue served under the given scheduling strategy once a service process is assigned via setService.
- Property Summary
- departureDiscipline
per-class depository departure discipline
- queueing
true if this is a queueing place (has an embedded queue)
- schedStrategies
- schedStrategy
- schedStrategyPar
- serviceProcess
per-class service (queue) processes; empty for ordinary places
- Method Summary
- getService(class)
DISTRIBUTION = GETSERVICE(CLASS)
- init()
- installQueueServer()
INSTALLQUEUESERVER() Installs the concrete server section matching the place’s scheduling strategy, replacing the default ServiceTunnel used by ordinary places.
- isQueueing()
BOOL = ISQUEUEING()
- setClassCapacity(class, capacity)
SELF = SETCLASSCAPACITY(CLASS, CAPACITY)
- setDepartureDiscipline(class, discipline)
SETDEPARTUREDISCIPLINE(CLASS, DISCIPLINE)
- setMarking(state)
SELF = SETMARKING(STATE) Alias for setState using Petri-net terminology: sets the initial token marking (number of tokens per class) of this place.
- setSchedStrategies(class, strategy)
SELF = SETSCHEDSTRATEGIES(CLASS, STRATEGY)
- setService(class, distribution)
SETSERVICE(CLASS, DISTRIBUTION) Assigns a service process to a token color, turning this ordinary place into a queueing place. The embedded queue serves tokens under the place’s scheduling strategy; the first such call installs the concrete server section for that strategy.
- class ClassSwitch
Bases:
NodeA node to change the class of visiting jobs
Copyright (c) 2012-2026, Imperial College London All rights reserved.
- Constructor Summary
- ClassSwitch(model, name, csMatrix)
SELF = CLASSSWITCH(MODEL, NAME, CSMATRIX)
- Property Summary
- cap
- schedPolicy
- schedStrategy
- Method Summary
- initClassSwitchMatrix()
C = INITCLASSSWITCHMATRIX()
- removeJobClass(jobclass)
SELF = REMOVEJOBCLASS(JOBCLASS)
Slice the class-switching matrix, which is indexed by class position, on top of the routing configuration handled by Node.
- setClassSwitchingMatrix(csMatrix)
- setProbRouting(class, destination, probability)
SETPROBROUTING(CLASS, DESTINATION, PROBABILITY)
- summary()
SUMMARY()
- class StatefulNode
Bases:
NodeAn abstract class for nodes that under some parametrizations can be stateful
Copyright (c) 2012-2026, Imperial College London All rights reserved.
- class Sink
Bases:
NodeExternal job departure node for open queueing networks
Represents network exit point where jobs are removed from open classes.
Copyright (c) 2012-2026, Imperial College London All rights reserved.
- Constructor Summary
- Sink(model, name)
SINK Create an external departure sink node
@brief Creates a Sink node for external job removal @param model Network model to add the sink node to @param name String identifier for the sink node @return self Sink instance ready for job absorption
- Property Summary
- schedStrategy
- Method Summary
- getSections()
SECTIONS = GETSECTIONS()
- class QueueingStation
Bases:
QueueAlias for the Queue class
Copyright (c) 2012-2026, Imperial College London All rights reserved.
- Constructor Summary
- QueueingStation(model, name, schedStrategy)
SELF = QUEUEINGSTATION(MODEL, NAME, SCHEDSTRATEGY)
- class Logger
Bases:
NodeA node where jobs are logged upon passage.
Copyright (c) 2012-2026, Imperial College London All rights reserved.
- Constructor Summary
- Logger(model, name, logFileName)
SELF = LOGGER(MODEL, NAME, LOGFILENAME)
- Property Summary
- cap
- fileName
- filePath
- schedPolicy
- schedStrategy
- Method Summary
- getJobClass()
RET = GETJOBCLASS()
- getJobID()
RET = GETJOBID()
- getLoggerName()
RET = GETLOGGERNAME()
- getStartTime()
RET = GETSTARTTIME()
- getTimeAnyClass()
RET = GETTIMEANYCLASS()
- getTimeSameClass()
RET = GETTIMESAMECLASS()
- getTimestamp()
RET = GETTIMESTAMP()
- setJobClass(bool)
SETJOBCLASS(BOOL)
- setJobID(bool)
SETJOBID(BOOL)
- setLoggerName(bool)
SETLOGGERNAME(BOOL)
- setProbRouting(class, destination, probability)
SETPROBROUTING(CLASS, DESTINATION, PROBABILITY)
- setStartTime(bool)
SETSTARTTIME(BOOL)
- setTimeAnyClass(bool)
SETTIMEANYCLASS(BOOL)
- setTimeSameClass(bool)
SETTIMESAMECLASS(BOOL)
- setTimestamp(bool)
SETTIMESTAMP(BOOL)
- class Join
Bases:
StationTask synchronization node for fork-join models
Combines parallel sibling tasks created by Fork nodes, waiting until all arrive.
Copyright (c) 2012-2026, Imperial College London All rights reserved.
- Constructor Summary
- Join(model, name, fork)
JOIN Create a Join node instance
@brief Creates a Join node for synchronizing parallel tasks @param model Network model to add the join node to @param name String identifier for the join node @param fork Optional Fork node this join synchronizes with @return self Join instance configured for task synchronization
The constructor creates a Join node with appropriate joiners, dispatchers, and service tunnels. If a fork parameter is provided, the join is associated with that specific fork node.
- Property Summary
- joinOf
- joinStrategy
- Method Summary
- setProbRouting(class, destination, probability)
SELF = SETPROBROUTING(CLASS, DESTINATION, PROBABILITY)
- setRequired(class, njobs)
SELF = SETREQUIRED(CLASS, NJOBS)
- setStrategy(class, strategy)
SELF = SETSTRATEGY(CLASS, STRATEGY)
- summary()
SUMMARY()
- class DelayStation
Bases:
DelayAlias for the Delay class
Copyright (c) 2012-2026, Imperial College London All rights reserved.
- Constructor Summary
- DelayStation(model, name)
SELF = DELAYSTATION(MODEL, NAME)
- class Delay
Bases:
QueueDelay Infinite server station with no queueing delays
Delay is a specialized Queue with infinite servers, meaning jobs experience service time but never wait in queue. Each arriving job is immediately served, making this ideal for modeling think times, processing delays, and other non-competing service processes.
@brief Infinite server station for modeling non-queueing delays
Key characteristics: - Infinite number of servers (no queueing) - Jobs experience service time but no waiting - Suitable for modeling think times and processing delays - Inherits all Queue functionality with modified scheduling - Equivalent to M/M/∞ queueing system
Delay stations are commonly used for: - User think time modeling - Network propagation delays - Processing time without resource contention - Timeout and waiting periods - Background processing tasks
Example: @code delay = Delay(model, ‘ThinkTime’); delay.setService(jobClass, Exp(1.0)); % Exponential service time @endcode
Copyright (c) 2012-2026, Imperial College London All rights reserved.
- Constructor Summary
- Delay(model, name)
DELAY Create a Delay station instance
@brief Creates a Delay station with infinite servers (no queueing) @param model Network model to add the delay station to @param name String identifier for the delay station @return self Delay instance configured with infinite servers
The constructor creates a delay station by calling the parent Queue constructor with infinite scheduling and sets numberOfServers to Inf.