Class Network
- All Implemented Interfaces:
Serializable,Copyable
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe answer offindBindingCapacity(): whether a buffer binds and, when it does, which one.static classResult class for isRoutingErgodic methodstatic class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddItemSet(ItemSet itemSet) Adds an item set to the network model.voidaddJobClass(JobClass jobClass) Adds a job class to the network model.voidaddLink(int sourceNodeIdx, int destNodeIdx) voidvoidbooleanAdds a node to this network.Adds a finite capacity region to this network.Returns a copy of this model in which all classes belonging to the same chain are merged into a single aggregate class, so that the aggregated model has one class per chain of this model.aggregateChains(String suffix) Chain-aggregated copy of this model, with a suffix appended to the names of the aggregate classes.voidvoidRemove all defined reward functions.static Networkcluster(Matrix lambda, Matrix D, SchedStrategy[] strategy, Matrix S, RoutingStrategy dispatching) Creates an open cluster network: Source -> Dispatcher (Router) -> Servers -> Sink.static NetworkclusterClosed(Matrix N, Matrix Z, Matrix D, SchedStrategy[] strategy, Matrix S, RoutingStrategy dispatching) Creates a closed cluster network: Think (Delay) -> Dispatcher (Router) -> Servers -> Think.static NetworkclusterFcfs(Matrix lambda, Matrix D, Matrix S, RoutingStrategy dispatching) Creates an open FCFS cluster with one server per queue.static NetworkclusterMixed(Matrix lambda, Matrix N, Matrix Z, Matrix D, SchedStrategy[] strategy, Matrix S, RoutingStrategy dispatching) Creates a mixed cluster network in which open and closed classes share the dispatcher and the servers: open classes flow Source -> Dispatcher -> Servers -> Sink while closed classes cycle Think (Delay) -> Dispatcher -> Servers -> Think.static NetworkclusterPs(Matrix lambda, Matrix D, RoutingStrategy dispatching) Creates an open PS cluster with one server per queue.static NetworkclusterPs(Matrix lambda, Matrix D, Matrix S, RoutingStrategy dispatching) Creates an open PS cluster.static Networkcyclic(Matrix N, Matrix D, SchedStrategy[] strategy, Matrix S) Creates a cyclic queueing network model with specified job populations, service demands, scheduling strategies, and server counts.static NetworkcyclicFcfs(Matrix N, Matrix D) Creates a cyclic queueing network with First Come First Served (FCFS) scheduling at all stations.static NetworkcyclicFcfs(Matrix N, Matrix D, Matrix S) Creates a cyclic queueing network with FCFS scheduling and specified server counts.static NetworkcyclicFcfsInf(Matrix N, Matrix D, Matrix Z) Creates a cyclic network with infinite server (delay) stations followed by FCFS queue stations.static NetworkcyclicFcfsInf(Matrix N, Matrix D, Matrix Z, Matrix S) Creates a cyclic network with infinite server stations followed by FCFS queue stations with specified server counts.static NetworkCreates a cyclic queueing network with Processor Sharing (PS) scheduling at all stations.static NetworkCreates a cyclic queueing network with PS scheduling and specified server counts.static NetworkcyclicPsInf(Matrix N, Matrix D, Matrix Z) Creates a cyclic network with infinite server (delay) stations followed by PS queue stations.static NetworkcyclicPsInf(Matrix N, Matrix D, Matrix Z, Matrix S) Creates a cyclic network with infinite server stations followed by PS queue stations with specified server counts.exportTikZ(String filePath) Exports this network to a PDF file using TikZ.voidexportTikZToFile(String filePath) Exports this network's TikZ code to a .tex file.The first station whose finite capacity can actually BIND, or a result whosebindsis false when no buffer in the model can refuse a job.Alias offindSolver(): which solvers and solver methods can analyze this model.findMethod(String metric, boolean showAll) Alias offindSolver(String, boolean).Which solvers and solver methods can analyze THIS model.findSolver(String metric, boolean showAll) Which solvers and solver methods can analyze this model, narrowed to one measure and optionally including the refused pairs.protected voidThe stations that are absorbing: once a job enters, it never leaves.booleanGets the metadata container of this model, twin of the MATLABModel.attributeproperty.Mean system tardiness handles, SysTard(1,r) for class r.Mean tardiness handles, Tard(i,r) for class r at station i.The chains of this network, each carrying the job classes it contains.booleanReturns whether validation checks are enabled for this network.getClassByIndex(int index) getClassByName(String name) getClassChain(JobClass jobClass) The chain containing the given class.intgetClassChainIndex(JobClass jobClass) Returns the list of job classes in this network.intgetClassIndex(String name) intgetClassIndex(JobClass jobclass) intgetClassLinks(Node node, JobClass jobClass) Network-level global dependence handle, or null if the model declares none.intPer-slot open-class wire truncation of the global dependence (default 10).(nstations x nclasses) peak of the global dependence, or null if none is declared.getGraph()Returns a directed-graph view of the network topology.booleanReturns the indices of all closed job classes in this network.Returns the indices of all open job classes in this network.intintintGets the station index of the sourcegetJobClassFromIndex(int inIdx) Returns the job class at the specified index.intgetJobClassIndex(JobClass jobClass) Returns the index of the specified job class in this network.Gets the class-dependence functions beta_i(n) of the stations that declare one.Peak (max) class-dependent rate scaling per class for each class-dependent station, as a 1xR row vector (scalar declarations broadcast to R classes).Map from station to its joint-dependence (non-product-form) function eta_i(n); empty if none.Peak joint-dependent rate scaling per class for each joint-dependent station, as a 1xR row vector.getNodeByIndex(int idx) getNodeByName(String name) getNodeByStatefulIndex(int idx) intgetNodeIndex(String name) intgetNodeIndex(Node node) getNodes()Returns the list of all nodes in this network.intintintintReturns the total number of nodes in this network.intintintReturns the total number of stations in this network.getProcessType(Distribution distr) The reducibility structure plus one suggested repair per absorbing station.Get a specific reward function by name.Get all defined reward functions.getRoutingMatrix(Matrix arvRates, int returnVal) getSink()int[]getSize()Returns the dimensions of this network as [nodes, classes].getState()getStatefulNodeFromIndex(int inIdx) intgetStatefulNodeIndex(String name) intgetStatefulNodeIndex(Node node) getStationByIndex(int index) getStationByName(String name) getStationFromIndex(int inIdx) intgetStationIndex(String name) intgetStationIndex(Node node) getStationIndexes(int index) Returns the list of stations in this network.getStruct(boolean wantInitialState) Returns the language features used by the given networkbooleanChecks if this network has any job classes defined.booleanbooleanChecks if this network contains any closed job classes.booleanhasDPS()booleanbooleanCheck if the network contains any Logger nodesbooleanhasFCFS()booleanhasFork()booleanhasGPS()booleanbooleanhasHOL()booleanhasHomogeneousScheduling(SchedStrategy strategy) booleanhasINF()booleanbooleanhasJoin()booleanhasLCFS()booleanbooleanhasLEPT()booleanhasLJF()booleanbooleanbooleanbooleanbooleanbooleanChecks if this network contains any open job classes.booleanChecks if this network has a product-form solution.booleanhasPS()booleanbooleanCheck if any rewards are defined.booleanhasSEPT()booleanbooleanbooleanhasSIRO()booleanhasSJF()help()Alias offindSolver(): what can this model be solved with?Alias offindSolver(String, boolean).voidvoidinitFromAvgQLen(Matrix AvgQLen) voidvoidvoidvoidbooleanChecks if this network is a Java native (JNetwork) implementation.booleanbooleanChecks if this network is a MATLAB native (MNetwork) implementation.Check if the queueing network routing matrix is ergodic (irreducible).Check if the queueing network routing matrix is ergodic (irreducible).booleanvoidvoidvoidlinkAndLog(RoutingMatrix P, boolean[] isNodeLogged, String logPath) Links the network with logging capability Creates Logger nodes before and after specified stations and updates routing matrixA routing matrix that makes the network ergodic.makeErgodic(String targetName) AsmakeErgodic(), routing absorbing stations to TARGETNAME.voidvoidplot()Displays an interactive visualization of this queueing network.voidDisplays an interactive visualization of this queueing network.voidDisplays an interactive visualization of this queueing network.voidvoidRefreshes balking configuration in the network structure.voidRefreshes the batch rejection probabilities in the network structure.voidRefreshes the server breakdown / repair configuration in the network structure.voidvoidrefreshChains(boolean propagate) voidRefreshes the deadline configuration for all job classes in the network structure.voidvoidPopulates heterogeneous server configuration in NetworkStruct.voidvoidvoidvoidrefreshLST(List<Integer> statSet, List<Integer> classSet) voidRefreshes orbit impatience configuration in the network structure.voidvoidvoidvoidrefreshProcesses(List<Integer> statSet, List<Integer> classSet) voidrefreshProcessPhases(List<Integer> statSet, List<Integer> classSet) voidvoidrefreshProcessTypes(List<Integer> statSet, List<Integer> classSet) boolean[]refreshRates(List<Integer> statSet, List<Integer> classSet) Populate finite capacity region information in sn struct.voidRefreshes retrial configuration in the network structure.voidrefreshRoutingMatrix(Matrix rates) voidvoidBuilds sn.sdr, the station-indexed twin of the Krzesinski state-dependent routing structure declared on the entry center.voidvoidrefreshStruct(boolean hardRefresh) voidvoidvoidRelink the network from a modified rtorig map.voidremoveClass(JobClass jobclass) Removes the specified job class from this model, updating all node configurations (service, capacity, routing, arrival and class-switching) accordingly, and re-initialising the model.voidreset()voidreset(boolean resetState) voidvoidresetModel(boolean resetState) voidresetNetwork(boolean deleteCSNodes) Resets the topology of the current networkvoidResets the struct of a given networkvoidResolves Signal placeholders to OpenSignal or ClosedSignal based on network structure.voidsanitize()static RoutingMatrixserialRouting(List<JobClass> jobClasses, List<Node> nodes) Creates a serial routing matrix connecting nodes in sequence.static RoutingMatrixserialRouting(List<JobClass> jobClasses, Node... nodes) Creates a serial routing matrix connecting nodes in sequence.static RoutingMatrixserialRouting(List<Node> nodes) Creates a serial routing matrix for all job classes in the network.static RoutingMatrixserialRouting(JobClass jobClass, List<Node> nodes) Creates a serial routing matrix for a single job class.static RoutingMatrixserialRouting(JobClass jobClass, Node... nodes) Creates a serial routing matrix for a single job class.static RoutingMatrixserialRouting(Node... nodes) Creates a serial routing matrix for all job classes in the network.voidsetAllowReplace(boolean allowReplace) voidsetChecks(boolean doChecks) Enables or disables validation checks for this network.voidsetConnectionMatrix(Matrix connection) voidsetCsMatrix(Matrix csMatrix) voidsetGlobalDependence(SerializableFunction<Matrix, Matrix> phi, Matrix peak) Declares a globally state-dependent service-rate scaling phi(n), where n is the FULL (nstations x nclasses) population matrix rather than the population local to one station.voidsetGlobalDependence(SerializableFunction<Matrix, Matrix> phi, Matrix peak, int wireCutoff) AssetGlobalDependence(SerializableFunction, Matrix), 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).voidsetHasStruct(boolean hasStruct) voidsetInitialized(boolean initStatus) Sets the initialization status of this network.voidsetJoinNodeRequired(int nodeIdx, JobClass jobClass, int njobs) voidsetJoinNodeStrategy(int nodeIdx, JobClass jobClass, JoinStrategy joinStrategy) voidsetLogPath(String logPath) voidsetNodeRouting(int nodeIdx, JobClass jobClass, RoutingStrategy routingStrategy) voidsetReward(String name, RewardFunction rewardFn) Define a reward function for CTMC reward computation.voidsetSn(NetworkStruct sn) voidvoidsetUsedLangFeature(String feature) doublesub_jsq(int ind, int jnd, int r, int s, Matrix linksmat, Map<Node, Matrix> state_before, Map<Node, Matrix> state_after) doublesub_rr_wrr(int ind, int jnd, int r, int s, Matrix linksmat, Map<Node, Matrix> state_before, Map<Node, Matrix> state_after) doublesub_sdr(int ind, int jnd, int r, int s, Matrix linksmat, Map<Node, Matrix> state_before, Map<Node, Matrix> state_after) Krzesinski (1987) product-form state-dependent routing, eq.doublesub_sq(int ind, int jnd, int r, int s, Matrix linksmat, Map<Node, Matrix> state_before, Map<Node, Matrix> state_after) Power-of-K choices marginal routing probability.voidsummary()static Networktandem(Matrix lambda, Matrix D, SchedStrategy[] strategy, Matrix S) Creates a tandem queueing network with specified arrival rates and service demands.static NetworktandemFcfs(Matrix lambda, Matrix D, Matrix S) static NetworktandemFcfsInf(Matrix lambda, Matrix D) Creates a tandem network with FCFS infinite servers.static NetworktandemFcfsInf(Matrix lambda, Matrix D, Matrix Z) Creates a tandem network with FCFS infinite servers and delay centers.static NetworktandemFcfsInf(Matrix lambda, Matrix D, Matrix Z, Matrix S) Creates a tandem network with FCFS infinite servers, delays, and specified server counts.static Networkstatic NetworktandemPsInf(Matrix lambda, Matrix D) Creates a tandem network with processor sharing infinite servers.static NetworktandemPsInf(Matrix lambda, Matrix D, Matrix Z) Creates a tandem network with processor sharing infinite servers and delays.static NetworktandemPsInf(Matrix lambda, Matrix D, Matrix Z, Matrix S) voidtikzExportPNG(String filePath) Exports this network to a PNG file using TikZ.voidtikzExportPNG(String filePath, int dpi) Exports this network to a PNG file using TikZ with custom DPI.voidtikzView()Displays this network as a TikZ diagram in a PDF viewer.voidtikzView(TikZOptions options) Displays this network as a TikZ diagram with custom options.toTikZ()Generates TikZ code for visualizing this network.toTikZ(TikZOptions options) Generates TikZ code with custom options.voidunLink()voidUpdates sn.rtorig without replacing the entire NetworkStruct.voidview()withoutClass(JobClass jobclass) Returns a copy of this model with the given job class removed, leaving this model untouched.Methods inherited from class jline.lang.Model
getName, getVersion, setAttribute, setName, setVersion
-
Field Details
-
nodes
-
isFJAugmented
public boolean isFJAugmented
-
-
Constructor Details
-
Network
Creates a new queueing network model with the specified name. Initializes all internal data structures and sets default configuration.- Parameters:
modelName- the name for this network model
-
-
Method Details
-
cyclic
Creates a cyclic queueing network model with specified job populations, service demands, scheduling strategies, and server counts.- Parameters:
N- matrix of job populations for each class [1 x R] where R is the number of job classesD- matrix of service demands [M x R] where M is the number of stations and R is the number of classesstrategy- array of scheduling strategies for each station [M x 1]S- matrix or vector specifying number of servers for each station [M x 1]- Returns:
- a configured closed queueing network model
- Throws:
RuntimeException- if server count matrix dimensions are invalid
-
cyclicFcfs
Creates a cyclic queueing network with First Come First Served (FCFS) scheduling at all stations.- Parameters:
N- matrix of job populations for each class [1 x R] where R is the number of job classesD- matrix of service demands [M x R] where M is the number of stations and R is the number of classes- Returns:
- a configured closed queueing network model with FCFS scheduling
-
cyclicFcfs
Creates a cyclic queueing network with FCFS scheduling and specified server counts.- Parameters:
N- matrix of job populations for each class [1 x R] where R is the number of job classesD- matrix of service demands [M x R] where M is the number of stations and R is the number of classesS- matrix specifying number of servers for each station [M x 1]- Returns:
- a configured closed queueing network model with FCFS scheduling
-
cyclicFcfsInf
Creates a cyclic network with infinite server (delay) stations followed by FCFS queue stations.- Parameters:
N- matrix of job populations for each class [1 x R] where R is the number of job classesD- matrix of service demands at queue stations [M x R]Z- matrix of think times at delay stations [MZ x R] where MZ is the number of delay stations- Returns:
- a configured mixed queueing network model with delay and FCFS queue stations
-
cyclicFcfsInf
Creates a cyclic network with infinite server stations followed by FCFS queue stations with specified server counts.- Parameters:
N- matrix of job populations for each class [1 x R] where R is the number of job classesD- matrix of service demands at queue stations [M x R]Z- matrix of think times at delay stations [MZ x R] where MZ is the number of delay stationsS- matrix specifying number of servers for queue stations [M x 1]- Returns:
- a configured mixed queueing network model with delay and FCFS queue stations
-
cyclicPs
Creates a cyclic queueing network with Processor Sharing (PS) scheduling at all stations.- Parameters:
N- matrix of job populations for each class [1 x R] where R is the number of job classesD- matrix of service demands [M x R] where M is the number of stations and R is the number of classes- Returns:
- a configured closed queueing network model with PS scheduling
-
cyclicPs
Creates a cyclic queueing network with PS scheduling and specified server counts.- Parameters:
N- matrix of job populations for each class [1 x R] where R is the number of job classesD- matrix of service demands [M x R] where M is the number of stations and R is the number of classesS- matrix specifying number of servers for each station [M x 1]- Returns:
- a configured closed queueing network model with PS scheduling
-
cyclicPsInf
Creates a cyclic network with infinite server (delay) stations followed by PS queue stations.- Parameters:
N- matrix of job populations for each class [1 x R] where R is the number of job classesD- matrix of service demands at queue stations [M x R]Z- matrix of think times at delay stations [MZ x R] where MZ is the number of delay stations- Returns:
- a configured mixed queueing network model with delay and PS queue stations
-
cyclicPsInf
Creates a cyclic network with infinite server stations followed by PS queue stations with specified server counts.- Parameters:
N- matrix of job populations for each class [1 x R] where R is the number of job classesD- matrix of service demands at queue stations [M x R]Z- matrix of think times at delay stations [MZ x R] where MZ is the number of delay stationsS- matrix specifying number of servers for queue stations [M x 1]- Returns:
- a configured mixed queueing network model with delay and PS queue stations
-
serialRouting
Creates a serial routing matrix connecting nodes in sequence. Jobs flow from each node to the next in the provided order. The last node connects back to the first unless it's a Sink.- Parameters:
jobClasses- list of job classes to routenodes- nodes to connect in serial order- Returns:
- routing matrix with serial connections
-
serialRouting
Creates a serial routing matrix connecting nodes in sequence. Jobs flow from each node to the next in the provided order. The last node connects back to the first unless it's a Sink.- Parameters:
jobClasses- list of job classes to routenodes- list of nodes to connect in serial order- Returns:
- routing matrix with serial connections
-
serialRouting
Creates a serial routing matrix for a single job class.- Parameters:
jobClass- the job class to routenodes- nodes to connect in serial order- Returns:
- routing matrix with serial connections
-
serialRouting
Creates a serial routing matrix for a single job class.- Parameters:
jobClass- the job class to routenodes- list of nodes to connect in serial order- Returns:
- routing matrix with serial connections
-
serialRouting
Creates a serial routing matrix for all job classes in the network.- Parameters:
nodes- nodes to connect in serial order- Returns:
- routing matrix with serial connections
-
serialRouting
Creates a serial routing matrix for all job classes in the network.- Parameters:
nodes- list of nodes to connect in serial order- Returns:
- routing matrix with serial connections
-
tandem
Creates a tandem queueing network with specified arrival rates and service demands.- Parameters:
lambda- matrix of arrival rates [classes x sources]D- matrix of service demands [stations x classes]strategy- array of scheduling strategies for each stationS- matrix of server counts [stations x classes]- Returns:
- configured tandem network model
-
tandemFcfs
-
tandemFcfsInf
Creates a tandem network with FCFS infinite servers.- Parameters:
lambda- arrival rate matrixD- service demand matrix- Returns:
- configured tandem FCFS infinite server network
-
tandemFcfsInf
Creates a tandem network with FCFS infinite servers and delay centers.- Parameters:
lambda- arrival rate matrixD- service demand matrixZ- delay time matrix- Returns:
- configured tandem FCFS infinite server network with delays
-
tandemFcfsInf
Creates a tandem network with FCFS infinite servers, delays, and specified server counts.- Parameters:
lambda- arrival rate matrixD- service demand matrixZ- delay time matrixS- server count matrix- Returns:
- configured tandem FCFS infinite server network
-
tandemPs
-
tandemPsInf
Creates a tandem network with processor sharing infinite servers.- Parameters:
lambda- arrival rate matrixD- service demand matrix- Returns:
- configured tandem PS infinite server network
-
tandemPsInf
Creates a tandem network with processor sharing infinite servers and delays.- Parameters:
lambda- arrival rate matrixD- service demand matrixZ- delay time matrix- Returns:
- configured tandem PS infinite server network with delays
-
tandemPsInf
-
cluster
public static Network cluster(Matrix lambda, Matrix D, SchedStrategy[] strategy, Matrix S, RoutingStrategy dispatching) Creates an open cluster network: Source -> Dispatcher (Router) -> Servers -> Sink.The dispatcher is a
Routerthat distributes incoming jobs to the M parallel server queues according to the suppliedRoutingStrategy(RAND, RROBIN, JSQ, ...).- Parameters:
lambda- arrival rate matrix [1 x R]; entry r is the per-class arrival rateD- service time matrix [M x R]; entry (i, r) is the mean service time of class r at server istrategy- per-server scheduling strategies (length M)S- server count matrix [M x 1]; entry i is the multiplicity of server i (1 = single server)dispatching- dispatching policy applied at the router for every class- Returns:
- configured open cluster model
-
clusterFcfs
Creates an open FCFS cluster with one server per queue.- Parameters:
lambda- arrival rate matrix [1 x R]D- service time matrix [M x R]S- server count matrix [M x 1]dispatching- dispatching policy applied at the router- Returns:
- configured open cluster with FCFS servers
-
clusterPs
Creates an open PS cluster.- Parameters:
lambda- arrival rate matrix [1 x R]D- service time matrix [M x R]S- server count matrix [M x 1]dispatching- dispatching policy applied at the router- Returns:
- configured open cluster with PS servers
-
clusterPs
Creates an open PS cluster with one server per queue.- Parameters:
lambda- arrival rate matrix [1 x R]D- service time matrix [M x R]dispatching- dispatching policy applied at the router- Returns:
- configured open cluster with single-server PS queues
-
clusterClosed
public static Network clusterClosed(Matrix N, Matrix Z, Matrix D, SchedStrategy[] strategy, Matrix S, RoutingStrategy dispatching) Creates a closed cluster network: Think (Delay) -> Dispatcher (Router) -> Servers -> Think.The think station is the reference station for every closed class; jobs cycle from the delay to the dispatcher, are dispatched to one of the parallel servers, and return to the delay on completion.
- Parameters:
N- per-class population matrix [1 x R]Z- per-class think time matrix [1 x R]D- service time matrix [M x R]strategy- per-server scheduling strategies (length M)S- server count matrix [M x 1]dispatching- dispatching policy applied at the router for every class- Returns:
- configured closed cluster model
-
clusterMixed
public static Network clusterMixed(Matrix lambda, Matrix N, Matrix Z, Matrix D, SchedStrategy[] strategy, Matrix S, RoutingStrategy dispatching) Creates a mixed cluster network in which open and closed classes share the dispatcher and the servers: open classes flow Source -> Dispatcher -> Servers -> Sink while closed classes cycle Think (Delay) -> Dispatcher -> Servers -> Think.Classes are ordered open first: columns 1..Ro of
Drefer to the open classes and columns Ro+1..Ro+Rc to the closed ones.- Parameters:
lambda- per-class arrival rate matrix [1 x Ro] of the open classesN- per-class population matrix [1 x Rc] of the closed classesZ- per-class think time matrix [1 x Rc] of the closed classesD- service time matrix [M x (Ro+Rc)]; entry (i, r) is the mean service time of class r at server istrategy- per-server scheduling strategies (length M)S- server count matrix [M x 1]; entry i is the multiplicity of server idispatching- dispatching policy applied at the router for every class- Returns:
- configured mixed cluster model
-
addItemSet
Adds an item set to the network model. Item sets define the types of resources or items that can be processed by the network nodes.- Parameters:
itemSet- the item set to add to the network- Throws:
RuntimeException- if an item set with the same name already exists
-
addJobClass
Adds a job class to the network model. Job classes define different types of jobs that traverse the network with potentially different service requirements and routing.- Parameters:
jobClass- the job class to add to the network- Throws:
RuntimeException- if a class with the same name already exists (when validation is enabled)
-
addLink
-
addLink
public void addLink(int sourceNodeIdx, int destNodeIdx) -
addLinks
-
addNode
Adds a node to this network. If the node is a station, it's also added to the stations list. If allowReplace is true and a node with the same name already exists, it will be replaced.- Parameters:
node- the node to add to the network- Returns:
- true if the node replaced an existing node, false otherwise
-
addRegion
Adds a finite capacity region to this network.- Parameters:
nodes- list of nodes forming the capacity region- Returns:
- the created finite capacity region
-
clearCaches
public void clearCaches() -
generateClassLinks
protected void generateClassLinks() -
getAttribute
Description copied from class:ModelGets the metadata container of this model, twin of the MATLABModel.attributeproperty.- Overrides:
getAttributein classModel- Returns:
- the model attribute container
-
getAvgArvRHandles
-
getAvgHandles
-
getAvgQLenHandles
-
getAvgTardHandles
Mean tardiness handles, Tard(i,r) for class r at station i.The handles were already built by
getAvgHandles(); only the named accessor was missing, so a caller had to reach through SolverAvgHandles by field. Twin of the MATLABMNetwork.getAvgTardHandles. -
getAvgSysTardHandles
Mean system tardiness handles, SysTard(1,r) for class r. -
getReducibilityInfo
The reducibility structure plus one suggested repair per absorbing station. -
getAbsorbingStations
The stations that are absorbing: once a job enters, it never leaves. -
makeErgodic
A routing matrix that makes the network ergodic. Does NOT relink; apply it withmodel.link(P). -
makeErgodic
AsmakeErgodic(), routing absorbing stations to TARGETNAME. -
getAvgResidTHandles
-
getAvgRespTHandles
-
getAvgTputHandles
-
getAvgUtilHandles
-
getChains
The chains of this network, each carrying the job classes it contains.sn.inchain.get(c)IS A LIST OF CLASS INDICES, not an indicator vector over classes -- which is how the rest of this file reads it (see the chain-capacity loops around line 5100). Testingget(0,r) == 1instead returned a chain with NO classes on every single-class model, because inchain[0] is then the vector [0] and 0 != 1. Everything built on top silently degraded: SolverCTMC.getCdfRespT looped over zero classes and its catch returned a zero matrix.The chain list is also rebuilt rather than appended to; the old code accumulated a fresh set of chains on every call.
-
getClassByIndex
-
getClassByName
-
getClassChain
The chain containing the given class.The old form ignored
jobClassentirely and returned the first chain whose indicator test passed, so on a multi-chain model it answered with the wrong chain. It reads inchain as a list of class indices, asgetChains()does. -
getClassChainIndex
-
getClassIndex
-
getClassIndex
-
getClassLinks
-
getClassNames
-
getClassSwitchingMask
-
getClasses
Returns the list of job classes in this network.- Returns:
- list of job classes
-
getConnectionMatrix
-
setConnectionMatrix
-
getCsMatrix
-
setCsMatrix
-
getDemands
-
getDemandsChain
-
getForkJoins
-
getHasStruct
public boolean getHasStruct() -
setHasStruct
public void setHasStruct(boolean hasStruct) -
getAllowReplace
public boolean getAllowReplace() -
setAllowReplace
public void setAllowReplace(boolean allowReplace) -
getIndexClosedClasses
Returns the indices of all closed job classes in this network.- Returns:
- list of indices for closed job classes
-
getIndexOpenClasses
Returns the indices of all open job classes in this network.- Returns:
- list of indices for open job classes
-
getIndexSinkNode
public int getIndexSinkNode() -
getIndexSourceNode
public int getIndexSourceNode() -
getIndexSourceStation
public int getIndexSourceStation()Gets the station index of the source- Returns:
- -
-
getIndexStatefulNodes
-
getJobClassFromIndex
Returns the job class at the specified index.- Parameters:
inIdx- index of the job class- Returns:
- job class at the given index
- Throws:
IndexOutOfBoundsException- if index is invalid
-
getJobClassIndex
Returns the index of the specified job class in this network.- Parameters:
jobClass- the job class to find- Returns:
- index of the job class, or -1 if not found
-
getJobClasses
-
getLimitedClassDependence
Gets the class-dependence functions beta_i(n) of the stations that declare one. Stations without class dependence are deliberately ABSENT from the map rather than mapped to a constant 1: the entry is a class-dependent service RATE (Sauer 1983, eq. (40)), for which a constant 1 would assert that every class completes at rate 1, which is not load independence (a load-independent station is beta_{i,r}(n) = mu_i * n_r/|n|, whose n_r/|n| factor is what regenerates the multinomial). Consumers treat a missing entry as "no class dependence": Pfqn_cdfun skips it and Pfqn_conv keeps the station on the load-independent recurrence. Consumers that index every station unconditionally fill the gaps with the neutral scaling themselves.- Returns:
- map from station to its class-dependence function; empty if none
-
getLimitedClassDependencePeak
Peak (max) class-dependent rate scaling per class for each class-dependent station, as a 1xR row vector (scalar declarations broadcast to R classes). Used to normalize utilization as U = T*S/peak. A station that declares a class dependence without a peak is a MODEL DEFECT and is refused here, as in MATLAB's getLimitedClassDependencePeak.m: the peak is not recoverable from the handle, and guessing it reports a number that is not a utilization.- Returns:
- map from station to its 1xR peak vector; empty if no class dependence
- Throws:
RuntimeException- if a class-dependent station declared no peak
-
getLimitedJointDependence
Map from station to its joint-dependence (non-product-form) function eta_i(n); empty if none. Twin ofgetLimitedClassDependence().- Returns:
- map from station to its joint-dependence function; empty if none
-
getLimitedJointDependencePeak
Peak joint-dependent rate scaling per class for each joint-dependent station, as a 1xR row vector. Twin ofgetLimitedClassDependencePeak().- Returns:
- map from station to its 1xR peak vector; empty if no joint dependence
- Throws:
RuntimeException- if a joint-dependent station declared no peak
-
setGlobalDependence
Declares a globally state-dependent service-rate scaling phi(n), where n is the FULL (nstations x nclasses) population matrix rather than the population local to one station. This is the Whittle-network primitive: when phi satisfies phi_s(n) phi_t(n-e_s) = phi_t(n) phi_s(n-e_t) the chain is reversible, has the product form pi(n) ~ Phi(n) prod rho_s^n_s and is insensitive. It also expresses bandwidth sharing, where one route holds several links at once and no per-station scaling can reproduce the coupling.phi returns a 1x1 scalar (broadcast), an (M x 1) column (per station) or an (M x K) matrix. The effective rate of class r at station i is its base rate times phi(i,r), composing multiplicatively with any load-, class- or joint-dependence. Only SolverCTMC declares support for it.
- Parameters:
phi- the scaling handle over the full population matrixpeak- REQUIRED peak scaling, 1x1, (M x 1) or (M x K), normalizing Util=T*S/peak
-
setGlobalDependence
public void setGlobalDependence(SerializableFunction<Matrix, Matrix> phi, Matrix peak, int wireCutoff) AssetGlobalDependence(SerializableFunction, Matrix), 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.- Parameters:
phi- the scaling handle over the full population matrixpeak- REQUIRED peak scaling, 1x1, (M x 1) or (M x K)wireCutoff- positive open-class truncation for JSON serialization
-
getGlobalDependence
Network-level global dependence handle, or null if the model declares none. -
getGlobalDependenceCutoff
public int getGlobalDependenceCutoff()Per-slot open-class wire truncation of the global dependence (default 10). -
getGlobalDependencePeak
(nstations x nclasses) peak of the global dependence, or null if none is declared. -
getLimitedLoadDependence
-
getLinkedRoutingMatrix
-
getLogPath
-
setLogPath
-
getNodeByIndex
-
getNodeByName
-
getNodeByStatefulIndex
-
getNodeIndex
-
getNodeIndex
-
getNodeNames
-
getNodeTypes
-
getNodes
Returns the list of all nodes in this network.- Returns:
- list of nodes including stations and non-station nodes
-
getNumberOfChains
public int getNumberOfChains() -
getNumberOfClasses
public int getNumberOfClasses() -
getNumberOfOpenClasses
public int getNumberOfOpenClasses() -
getNumberOfClosedClasses
public int getNumberOfClosedClasses() -
getNumberOfJobs
-
getNumberOfNodes
public int getNumberOfNodes()Returns the total number of nodes in this network.- Returns:
- number of nodes
-
getNumberOfStatefulNodes
public int getNumberOfStatefulNodes() -
getNumberOfStations
public int getNumberOfStations()Returns the total number of stations in this network.- Returns:
- number of service stations
-
getProcessType
-
getProductFormChainParameters
-
getProductFormParameters
-
getReferenceClasses
-
getReferenceStations
-
getRegions
-
getRoutingMatrix
-
getRoutingStrategyFromNodeAndClassPair
-
getSink
-
getSize
public int[] getSize()Returns the dimensions of this network as [nodes, classes].- Returns:
- array containing [number of nodes, number of job classes]
-
getSource
-
getState
-
getStatefulNodeFromIndex
-
getStatefulNodeIndex
-
getStatefulNodeIndex
-
getStatefulNodeNames
-
getStatefulNodes
-
getStatefulServers
-
getStationByIndex
-
getStationByName
-
getStationFromIndex
-
getStationIndex
-
getStationIndex
-
getStationIndexes
-
getStationNames
-
getStationScheduling
-
getStationServers
-
getStations
Returns the list of stations in this network. Stations are nodes that can provide service to jobs.- Returns:
- list of service stations
-
getStruct
-
setStruct
-
getStruct
-
getTranHandles
-
getTranQLenHandles
-
getTranTputHandles
-
getTranUtilHandles
-
findSolver
Which solvers and solver methods can analyze THIS model.model.findSolver() every (solver, method) pair that runs model.findSolver("cdf", false) ... that returns a passage-time law model.findSolver("getCdfRespT", false) the same question, by accessor model.findSolver("", true) also the pairs that are refused, and whyOne row per pair; see
SolverCandidatefor the columns andSolverCandidate.toTableto print them. The method column is the method name to pass as a solver method, so a row can be acted on directly.findMethod()andhelp()are aliases.- Returns:
- one row per runnable (family, method) pair
-
findSolver
Which solvers and solver methods can analyze this model, narrowed to one measure and optionally including the refused pairs.- Parameters:
metric- a measure group ("cdf") or the accessor that returns it ("getCdfRespT"); "" or "any" keeps every pairshowAll- keep the refused pairs too, with the reason each was refused- Returns:
- the matching rows
-
findMethod
Alias offindSolver(): which solvers and solver methods can analyze this model.The two names exist because the question is asked both ways round -- "which solver do I use" and "which method do I pass" -- and the answer is the same table, whose method column carries the method name either caller needs.
- Returns:
- one row per runnable (family, method) pair
-
findMethod
Alias offindSolver(String, boolean).- Parameters:
metric- a measure group or the accessor that returns itshowAll- keep the refused pairs too- Returns:
- the matching rows
-
help
Alias offindSolver(): what can this model be solved with?- Returns:
- one row per runnable (family, method) pair
-
help
Alias offindSolver(String, boolean).- Parameters:
metric- a measure group or the accessor that returns itshowAll- keep the refused pairs too- Returns:
- the matching rows
-
findBindingCapacity
The first station whose finite capacity can actually BIND, or a result whosebindsis false when no buffer in the model can refuse a job.ONE PREDICATE, TWO CALLERS, the port of MATLAB
MNetwork.findBindingCapacity.NetworkSolver.bindingCapacityReasonturns the answer into the refusal the product-form solvers raise, andgetUsedLangFeatures()marks the registry nameFiniteCapacityon the same answer, so a solver that does not declare the name refuses exactly the models the structural gate refuses.The test reads the node-level cap / classCap the user set and the class populations from the CLASS OBJECTS (
getNumberOfJobs()), never sn.cap / sn.classcap: refreshCapacity derives a FINITE classcap (the chain population) for every closed model, so an sn-level test would call every closed model capped, and reading the struct from the recorder would trigger a refresh on every feature query.Only a capacity that can bind counts. A closed model whose station capacity is at least the total population can never block a job, so the declaration is a no-op (setCapacity(N) on a station of an N-job closed model is a common idiom). The population of an open class is Inf, so any finite capacity an open class can reach binds. A Cache model is exempt: Cache builds retrieval queues that legitimately carry a per-class capacity of 1, and the cache analyzers solve those rather than treating them as a buffer constraint.
- Returns:
- - the binding buffer, or a result whose
bindsis false
-
getUsedLangFeatures
Returns the language features used by the given network- Returns:
- - the language features used by the given network
-
hasClassSwitching
public boolean hasClassSwitching() -
hasClasses
public boolean hasClasses()Checks if this network has any job classes defined.- Returns:
- true if job classes exist, false otherwise
-
hasClosedClasses
public boolean hasClosedClasses()Checks if this network contains any closed job classes. Closed classes have fixed populations with no external arrivals.- Returns:
- true if closed classes exist, false otherwise
-
hasDPS
public boolean hasDPS() -
hasDPSPrio
public boolean hasDPSPrio() -
hasFCFS
public boolean hasFCFS() -
hasFork
public boolean hasFork() -
hasGPS
public boolean hasGPS() -
hasGPSPrio
public boolean hasGPSPrio() -
hasHOL
public boolean hasHOL() -
hasHomogeneousScheduling
-
hasINF
public boolean hasINF() -
hasInitState
public boolean hasInitState() -
hasJoin
public boolean hasJoin() -
hasLCFS
public boolean hasLCFS() -
hasLCFSPR
public boolean hasLCFSPR() -
hasLEPT
public boolean hasLEPT() -
hasLJF
public boolean hasLJF() -
hasMultiChain
public boolean hasMultiChain() -
hasMultiClass
public boolean hasMultiClass() -
hasMultiClassFCFS
public boolean hasMultiClassFCFS() -
hasMultiClassHeterFCFS
public boolean hasMultiClassHeterFCFS() -
hasMultiServer
public boolean hasMultiServer() -
hasOpenClasses
public boolean hasOpenClasses()Checks if this network contains any open job classes. Open classes have external arrivals and departures.- Returns:
- true if open classes exist, false otherwise
-
hasPS
public boolean hasPS() -
hasPSPrio
public boolean hasPSPrio() -
hasProductFormSolution
public boolean hasProductFormSolution()Checks if this network has a product-form solution. Product-form networks can be solved efficiently using MVA methods.- Returns:
- true if the network has product-form, false otherwise
-
hasSEPT
public boolean hasSEPT() -
hasSIRO
public boolean hasSIRO() -
hasSJF
public boolean hasSJF() -
hasSingleChain
public boolean hasSingleChain() -
hasSingleClass
public boolean hasSingleClass() -
getGraph
Returns a directed-graph view of the network topology. Nodes are the network node names and edges carry the per-class routing probability (weight) between nodes.- Returns:
- a
Graphdescribing the routing topology
-
removeClass
Removes the specified job class from this model, updating all node configurations (service, capacity, routing, arrival and class-switching) accordingly, and re-initialising the model.- Parameters:
jobclass- the job class to remove
-
aggregateChains
Returns a copy of this model in which all classes belonging to the same chain are merged into a single aggregate class, so that the aggregated model has one class per chain of this model. Class switching is eliminated in the process.The result also carries the (nstations x nclasses) matrix of aggregation factors alpha and the deaggregation record needed to map chain-level metrics back to class-level metrics with
SnDeaggregateChainResults.snDeaggregateChainResults. The aggregation is exact for product-form models and approximate otherwise, since one aggregate service process replaces the per-class ones weighted by alpha.- Returns:
- the aggregated model, alpha, and the deaggregation record
-
aggregateChains
Chain-aggregated copy of this model, with a suffix appended to the names of the aggregate classes. SeeaggregateChains().- Parameters:
suffix- suffix for the aggregate class names, may be null- Returns:
- the aggregated model, alpha, and the deaggregation record
-
withoutClass
Returns a copy of this model with the given job class removed, leaving this model untouched. Use it when the original model must stay solvable, for instance in ablation studies or a per-class decomposition.- Parameters:
jobclass- the job class to remove from the copy- Returns:
- a new model without the specified class
-
isRoutingErgodic
Check if the queueing network routing matrix is ergodic (irreducible). This checks only the routing structure, not the full CTMC state space. A routing is ergodic if all stations communicate, meaning the routing matrix does not create absorbing states or disconnected components.- Returns:
- RoutingErgodicityResult containing isErgodic flag and details
-
isRoutingErgodic
Check if the queueing network routing matrix is ergodic (irreducible).- Parameters:
P- Optional RoutingMatrix. If null, will be computed from network structure.- Returns:
- RoutingErgodicityResult containing isErgodic flag and details
-
initDefault
public void initDefault() -
initFromAvgQLen
-
initFromAvgTable
-
initFromMarginal
-
initFromMarginalAndRunning
-
initFromMarginalAndStarted
-
initRoutingMatrix
-
isJavaNative
public boolean isJavaNative()Checks if this network is a Java native (JNetwork) implementation. Always returns true for JNetwork implementations.- Returns:
- true, as this is a Java implementation
-
isLimitedLoadDependent
public boolean isLimitedLoadDependent() -
isMatlabNative
public boolean isMatlabNative()Checks if this network is a MATLAB native (MNetwork) implementation. Always returns false for JNetwork implementations.- Returns:
- false, as this is a Java implementation
-
isStateValid
public boolean isStateValid() -
jsimgView
public void jsimgView() -
jsimwView
public void jsimwView() -
toTikZ
Generates TikZ code for visualizing this network.- Returns:
- Complete LaTeX document with TikZ diagram
-
toTikZ
Generates TikZ code with custom options.- Parameters:
options- Configuration options for the visualization- Returns:
- Complete LaTeX document with TikZ diagram
-
tikzView
public void tikzView()Displays this network as a TikZ diagram in a PDF viewer. Requires pdflatex to be installed on the system. -
tikzView
Displays this network as a TikZ diagram with custom options.- Parameters:
options- Configuration options for the visualization
-
tikzExportPNG
Exports this network to a PNG file using TikZ.- Parameters:
filePath- The output file path (.png extension added if missing)- Throws:
IOException- If file operations fail
-
tikzExportPNG
Exports this network to a PNG file using TikZ with custom DPI.- Parameters:
filePath- The output file path (.png extension added if missing)dpi- Resolution in dots per inch- Throws:
IOException- If file operations fail
-
exportTikZ
Exports this network to a PDF file using TikZ.- Parameters:
filePath- The output file path (without extension)- Returns:
- The generated PDF file
- Throws:
IOException- If file operations fail
-
exportTikZToFile
Exports this network's TikZ code to a .tex file.- Parameters:
filePath- The output file path- Throws:
IOException- If file operations fail
-
link
-
linkAndLog
Links the network with logging capability Creates Logger nodes before and after specified stations and updates routing matrix- Parameters:
P- the routing matrixisNodeLogged- boolean array indicating which nodes should be loggedlogPath- path where log files will be stored (optional, uses existing logPath if null)- Returns:
- array containing [loggersBefore, loggersAfter] as List arrays
-
printRoutingMatrix
public void printRoutingMatrix() -
refreshCapacity
public void refreshCapacity() -
refreshRegions
Populate finite capacity region information in sn struct.region is a CellMatrix of size F (number of regions). region.get(f) is Matrix(M, K+1) where: entry (i,r) = max jobs of class r at station i in region f entry (i,K) = global max jobs at station i in region f -1 = infinite capacity
- Returns:
- the updated NetworkStruct
-
refreshChains
public void refreshChains(boolean propagate) -
refreshJobs
public void refreshJobs() -
refreshLST
-
refreshLocalVars
public void refreshLocalVars() -
refreshPetriNetNodes
public void refreshPetriNetNodes() -
refreshPriorities
public void refreshPriorities() -
refreshDeadlines
public void refreshDeadlines()Refreshes the deadline configuration for all job classes in the network structure. Extracts deadline values from JobClass objects and populates the classdeadline matrix. -
refreshProcessPhases
-
refreshProcessRepresentations
public void refreshProcessRepresentations() -
refreshImpatience
public void refreshImpatience() -
refreshBalking
public void refreshBalking()Refreshes balking configuration in the network structure. Extracts balking strategy and thresholds from all station-class pairs. -
refreshRetrial
public void refreshRetrial()Refreshes retrial configuration in the network structure. Extracts retrial delay distributions and max attempts from all station-class pairs. -
refreshBreakdown
public void refreshBreakdown()Refreshes the server breakdown / repair configuration in the network structure.Failure and repair are properties of the SERVER, so they are stored per station; the optional degraded service used while the server is down is a service distribution and is therefore per class. Mirrors the sn.hasbreakdown / breakdownMu / repairMu / breakdownProc / repairProc / downServiceRates block built by MATLAB refreshStruct.m.
-
refreshOrbitImpatience
public void refreshOrbitImpatience()Refreshes orbit impatience configuration in the network structure. Extracts the (D0,D1) process representation of the orbit abandonment distribution from all station-class pairs into sn.orbitImpatience. -
refreshBatchRejectProb
public void refreshBatchRejectProb()Refreshes the batch rejection probabilities in the network structure. Exports the per station-class batch reject probability configured on the stations into sn.batchRejectProb. Mirrors the (nstations x nclasses) sn.batchRejectProb matrix built by MATLAB refreshStruct.m and by the native Python _refresh_balking_retrial(); entries default to 0, meaning that partial admission of an arriving batch is allowed. -
refreshHeterogeneousServers
public void refreshHeterogeneousServers()Populates heterogeneous server configuration in NetworkStruct.This method extracts heterogeneous server type information from Queue nodes and populates the corresponding fields in NetworkStruct:
- nservertypes - number of server types per station
- servertypenames - names of server types per station
- serverspertype - number of servers per type per station
- servercompat - compatibility matrix (server type x job class)
- heterorates - service rates per server type per class
- heteroproc - PH process representation per server type per class
- heteroprocid - process type per server type per class
- heteroschedpolicy - heterogeneous scheduling policy per station
-
refreshProcessTypes
-
refreshProcesses
-
refreshProcesses
public void refreshProcesses() -
refreshRates
-
refreshRoutingMatrix
-
refreshScheduling
public void refreshScheduling() -
refreshStruct
public void refreshStruct() -
refreshStruct
public void refreshStruct(boolean hardRefresh) -
refreshSync
public void refreshSync() -
refreshGlobalSync
public void refreshGlobalSync() -
relink
-
relinkFromRtorig
Relink the network from a modified rtorig map. Converts the map to a RoutingMatrix and calls link(). This matches MATLAB's relink(P) behavior when P comes from getLinkedRoutingMatrix. -
updateRtorig
Updates sn.rtorig without replacing the entire NetworkStruct. Used by RoutingMatrix.setRouting() to preserve computed fields (rates, isstatedep, etc.) when re-linking during solver iteration. -
reset
public void reset() -
reset
public void reset(boolean resetState) -
resetHandles
public void resetHandles() -
hasExistingLoggers
public boolean hasExistingLoggers()Check if the network contains any Logger nodes- Returns:
- true if Logger nodes exist in the network
-
resetModel
public void resetModel(boolean resetState) -
resetNetwork
public void resetNetwork() -
resetNetwork
Resets the topology of the current network- Parameters:
deleteCSNodes- - flag to indicate whether to delete the class switch nodes
-
resetStruct
public void resetStruct()Resets the struct of a given network -
sanitize
public void sanitize() -
resolveSignals
public void resolveSignals()Resolves Signal placeholders to OpenSignal or ClosedSignal based on network structure.This method is called during model finalization (refreshStruct) to convert Signal placeholder objects to their concrete types. For open networks (with Source), Signal becomes OpenSignal. For closed networks (no Source), Signal becomes ClosedSignal.
-
setChecks
public void setChecks(boolean doChecks) Enables or disables validation checks for this network.- Parameters:
doChecks- true to enable validation checks, false to disable
-
getChecks
public boolean getChecks()Returns whether validation checks are enabled for this network.- Returns:
- true if validation checks are enabled
-
setInitialized
public void setInitialized(boolean initStatus) Sets the initialization status of this network.- Parameters:
initStatus- true if the network is initialized, false otherwise
-
setJoinNodeRequired
-
setJoinNodeStrategy
-
setNodeRouting
-
setSn
-
setUsedLangFeature
-
refreshStateDepRouting
public void refreshStateDepRouting()Builds sn.sdr, the station-indexed twin of the Krzesinski state-dependent routing structure declared on the entry center. The node-indexed copy stays in sn.nodeparam.get(entry).sdr, where the routing function sub_sdr reads it.A network admits one subnetwork Q(V,V) and every class routed by it must declare the same one: the routing probabilities of Krzesinski (1987) are chain independent, so a per-class topology has no product form.
-
sub_sdr
public double sub_sdr(int ind, int jnd, int r, int s, Matrix linksmat, Map<Node, Matrix> state_before, Map<Node, Matrix> state_after) Krzesinski (1987) product-form state-dependent routing, eq. (10).ind is the entry center e of Q(V,V). The probability of proceeding to a branch entry is a function of the total branch and subnetwork populations, and the residual mass returns the customer to the departure center d, which is the busy form of waiting of Section 2.5.
- Parameters:
ind- entry node indexjnd- destination node indexr- active classs- passive classlinksmat- connection matrixstate_before- state before the transitionstate_after- state after the transition- Returns:
- the routing probability from ind to jnd
-
sub_jsq
-
sub_sq
public double sub_sq(int ind, int jnd, int r, int s, Matrix linksmat, Map<Node, Matrix> state_before, Map<Node, Matrix> state_after) Power-of-K choices marginal routing probability. Matches LDES semantics in Solver_ssj.kt:selectSQDestination: enumerate all m^k ordered tuples of eligible destinations sampled WITH replacement, break ties by first occurrence in the tuple, and return the fraction of tuples for which jnd is the JSQ winner. With memory, the prior pick is forced as the last candidate and only m^(k-1) tuples are enumerated. -
sub_rr_wrr
-
summary
public void summary() -
unLink
public void unLink() -
view
public void view() -
modelView
public void modelView() -
setReward
Define a reward function for CTMC reward computation. The reward function maps a state vector and network structure to a scalar reward value. Multiple rewards can be defined with different names.- Parameters:
name- The unique name for this rewardrewardFn- The reward function: (state, sn) -> double Example:// Queue length reward model.setReward("qlen", (state, sn) -> state.get(0, 1)); // Throughput reward model.setReward("throughput", (state, sn) -> { double n = state.get(0, 1); return n > 0 ? n * sn.rates.get(1, 0) / n : 0; });
-
getRewards
Get all defined reward functions.- Returns:
- Map from reward name to reward function, or null if no rewards defined
-
getReward
Get a specific reward function by name.- Parameters:
name- The reward name- Returns:
- The reward function, or null if not found
-
clearRewards
public void clearRewards()Remove all defined reward functions. -
hasRewards
public boolean hasRewards()Check if any rewards are defined.- Returns:
- true if at least one reward is defined
-
plot
public void plot()Displays an interactive visualization of this queueing network. Uses default window title and dimensions. -
plot
Displays an interactive visualization of this queueing network.- Parameters:
title- the window title
-
plot
Displays an interactive visualization of this queueing network.- Parameters:
title- the window titlewidth- the window widthheight- the window height
-