Package jline.lang

Class Network

All Implemented Interfaces:
Serializable, Copyable

public class Network extends Model implements Copyable
A queueing network model TABLE OF CONTENTS: 1. FIELDS AND INITIALIZATION 2. CONSTRUCTORS 3. FACTORY METHODS 4. NODE AND COMPONENT MANAGEMENT 5. STATE AND CACHE MANAGEMENT 6. GETTER METHODS - HANDLES 7. GETTER METHODS - CLASSES AND CHAINS 8. GETTER METHODS - CONFIGURATION 9. GETTER METHODS - INDEXES 10. GETTER METHODS - ROUTING 11. GETTER METHODS - NODES 12. GETTER METHODS - COUNTS 13. GETTER METHODS - PROCESS AND PRODUCT FORM 14. ROUTING MATRIX MANAGEMENT 15. GETTER METHODS - SOURCES AND SINKS 16. QUERY METHODS (HAS/IS) 17. INITIALIZATION METHODS 18. REFRESH METHODS 19. RESET METHODS 20. VALIDATION AND CONFIGURATION 21. UTILITY METHODS 22. INNER CLASSES
See Also:
  • Field Details

    • nodes

      public List<Node> nodes
    • isFJAugmented

      public boolean isFJAugmented
  • Constructor Details

    • Network

      public Network(String modelName)
      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

      public static Network cyclic(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.
      Parameters:
      N - matrix of job populations for each class [1 x R] where R is the number of job classes
      D - matrix of service demands [M x R] where M is the number of stations and R is the number of classes
      strategy - 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

      public static Network cyclicFcfs(Matrix N, Matrix D)
      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 classes
      D - 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

      public static Network cyclicFcfs(Matrix N, Matrix D, Matrix S)
      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 classes
      D - matrix of service demands [M x R] where M is the number of stations and R is the number of classes
      S - matrix specifying number of servers for each station [M x 1]
      Returns:
      a configured closed queueing network model with FCFS scheduling
    • cyclicFcfsInf

      public static Network cyclicFcfsInf(Matrix N, Matrix D, Matrix Z)
      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 classes
      D - 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

      public static Network cyclicFcfsInf(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.
      Parameters:
      N - matrix of job populations for each class [1 x R] where R is the number of job classes
      D - 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
      S - 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

      public static Network cyclicPs(Matrix N, Matrix D)
      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 classes
      D - 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

      public static Network cyclicPs(Matrix N, Matrix D, Matrix S)
      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 classes
      D - matrix of service demands [M x R] where M is the number of stations and R is the number of classes
      S - matrix specifying number of servers for each station [M x 1]
      Returns:
      a configured closed queueing network model with PS scheduling
    • cyclicPsInf

      public static Network cyclicPsInf(Matrix N, Matrix D, Matrix Z)
      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 classes
      D - 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

      public static Network cyclicPsInf(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.
      Parameters:
      N - matrix of job populations for each class [1 x R] where R is the number of job classes
      D - 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
      S - 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

      public static RoutingMatrix serialRouting(List<JobClass> jobClasses, Node... nodes)
      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 route
      nodes - nodes to connect in serial order
      Returns:
      routing matrix with serial connections
    • serialRouting

      public static RoutingMatrix serialRouting(List<JobClass> jobClasses, List<Node> nodes)
      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 route
      nodes - list of nodes to connect in serial order
      Returns:
      routing matrix with serial connections
    • serialRouting

      public static RoutingMatrix serialRouting(JobClass jobClass, Node... nodes)
      Creates a serial routing matrix for a single job class.
      Parameters:
      jobClass - the job class to route
      nodes - nodes to connect in serial order
      Returns:
      routing matrix with serial connections
    • serialRouting

      public static RoutingMatrix serialRouting(JobClass jobClass, List<Node> nodes)
      Creates a serial routing matrix for a single job class.
      Parameters:
      jobClass - the job class to route
      nodes - list of nodes to connect in serial order
      Returns:
      routing matrix with serial connections
    • serialRouting

      public static RoutingMatrix serialRouting(Node... nodes)
      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

      public static RoutingMatrix serialRouting(List<Node> nodes)
      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

      public static Network tandem(Matrix lambda, Matrix D, SchedStrategy[] strategy, Matrix S)
      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 station
      S - matrix of server counts [stations x classes]
      Returns:
      configured tandem network model
    • tandemFcfs

      public static Network tandemFcfs(Matrix lambda, Matrix D, Matrix S)
    • tandemFcfsInf

      public static Network tandemFcfsInf(Matrix lambda, Matrix D)
      Creates a tandem network with FCFS infinite servers.
      Parameters:
      lambda - arrival rate matrix
      D - service demand matrix
      Returns:
      configured tandem FCFS infinite server network
    • tandemFcfsInf

      public static Network tandemFcfsInf(Matrix lambda, Matrix D, Matrix Z)
      Creates a tandem network with FCFS infinite servers and delay centers.
      Parameters:
      lambda - arrival rate matrix
      D - service demand matrix
      Z - delay time matrix
      Returns:
      configured tandem FCFS infinite server network with delays
    • tandemFcfsInf

      public static Network tandemFcfsInf(Matrix lambda, Matrix D, Matrix Z, Matrix S)
      Creates a tandem network with FCFS infinite servers, delays, and specified server counts.
      Parameters:
      lambda - arrival rate matrix
      D - service demand matrix
      Z - delay time matrix
      S - server count matrix
      Returns:
      configured tandem FCFS infinite server network
    • tandemPs

      public static Network tandemPs(Matrix lambda, Matrix D, Matrix S)
    • tandemPsInf

      public static Network tandemPsInf(Matrix lambda, Matrix D)
      Creates a tandem network with processor sharing infinite servers.
      Parameters:
      lambda - arrival rate matrix
      D - service demand matrix
      Returns:
      configured tandem PS infinite server network
    • tandemPsInf

      public static Network tandemPsInf(Matrix lambda, Matrix D, Matrix Z)
      Creates a tandem network with processor sharing infinite servers and delays.
      Parameters:
      lambda - arrival rate matrix
      D - service demand matrix
      Z - delay time matrix
      Returns:
      configured tandem PS infinite server network with delays
    • tandemPsInf

      public static Network tandemPsInf(Matrix lambda, Matrix D, Matrix Z, Matrix S)
    • 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 Router that distributes incoming jobs to the M parallel server queues according to the supplied RoutingStrategy (RAND, RROBIN, JSQ, ...).

      Parameters:
      lambda - arrival rate matrix [1 x R]; entry r is the per-class arrival rate
      D - service time matrix [M x R]; entry (i, r) is the mean service time of class r at server i
      strategy - 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

      public static Network clusterFcfs(Matrix lambda, Matrix D, Matrix S, RoutingStrategy dispatching)
      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

      public static Network clusterPs(Matrix lambda, Matrix D, Matrix S, RoutingStrategy dispatching)
      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

      public static Network clusterPs(Matrix lambda, Matrix D, RoutingStrategy dispatching)
      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 D refer 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 classes
      N - per-class population matrix [1 x Rc] of the closed classes
      Z - per-class think time matrix [1 x Rc] of the closed classes
      D - service time matrix [M x (Ro+Rc)]; entry (i, r) is the mean service time of class r at server i
      strategy - per-server scheduling strategies (length M)
      S - server count matrix [M x 1]; entry i is the multiplicity of server i
      dispatching - dispatching policy applied at the router for every class
      Returns:
      configured mixed cluster model
    • addItemSet

      public void addItemSet(ItemSet itemSet)
      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

      public void addJobClass(JobClass jobClass)
      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

      public void addLink(Node sourceNode, Node destNode)
    • addLink

      public void addLink(int sourceNodeIdx, int destNodeIdx)
    • addLinks

      public void addLinks(Node[][] links)
    • addNode

      public boolean addNode(Node node)
      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

      public Region addRegion(List<Node> nodes)
      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

      public NetworkAttribute getAttribute()
      Description copied from class: Model
      Gets the metadata container of this model, twin of the MATLAB Model.attribute property.
      Overrides:
      getAttribute in class Model
      Returns:
      the model attribute container
    • getAvgArvRHandles

      public AvgHandle getAvgArvRHandles()
    • getAvgHandles

      public SolverAvgHandles getAvgHandles()
    • getAvgQLenHandles

      public AvgHandle getAvgQLenHandles()
    • getAvgTardHandles

      public AvgHandle 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 MATLAB MNetwork.getAvgTardHandles.

    • getAvgSysTardHandles

      public AvgHandle getAvgSysTardHandles()
      Mean system tardiness handles, SysTard(1,r) for class r.
    • getReducibilityInfo

      public RoutingErgodicity.ReducibilityInfo getReducibilityInfo()
      The reducibility structure plus one suggested repair per absorbing station.
    • getAbsorbingStations

      public List<Station> getAbsorbingStations()
      The stations that are absorbing: once a job enters, it never leaves.
    • makeErgodic

      public RoutingMatrix makeErgodic()
      A routing matrix that makes the network ergodic. Does NOT relink; apply it with model.link(P).
    • makeErgodic

      public RoutingMatrix makeErgodic(String targetName)
      As makeErgodic(), routing absorbing stations to TARGETNAME.
    • getAvgResidTHandles

      public AvgHandle getAvgResidTHandles()
    • getAvgRespTHandles

      public AvgHandle getAvgRespTHandles()
    • getAvgTputHandles

      public AvgHandle getAvgTputHandles()
    • getAvgUtilHandles

      public AvgHandle getAvgUtilHandles()
    • getChains

      public List<Chain> 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). Testing get(0,r) == 1 instead 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

      public JobClass getClassByIndex(int index)
    • getClassByName

      public JobClass getClassByName(String name)
    • getClassChain

      public Chain getClassChain(JobClass jobClass)
      The chain containing the given class.

      The old form ignored jobClass entirely 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, as getChains() does.

    • getClassChainIndex

      public int getClassChainIndex(JobClass jobClass)
    • getClassIndex

      public int getClassIndex(JobClass jobclass)
    • getClassIndex

      public int getClassIndex(String name)
    • getClassLinks

      public int getClassLinks(Node node, JobClass jobClass)
    • getClassNames

      public List<String> getClassNames()
    • getClassSwitchingMask

      public Matrix getClassSwitchingMask()
    • getClasses

      public List<JobClass> getClasses()
      Returns the list of job classes in this network.
      Returns:
      list of job classes
    • getConnectionMatrix

      public Matrix getConnectionMatrix()
    • setConnectionMatrix

      public void setConnectionMatrix(Matrix connection)
    • getCsMatrix

      public Matrix getCsMatrix()
    • setCsMatrix

      public void setCsMatrix(Matrix csMatrix)
    • getDemands

      public Ret.snGetDemands getDemands()
    • getDemandsChain

      public Matrix getDemandsChain()
    • getForkJoins

      public Matrix getForkJoins()
    • getHasStruct

      public boolean getHasStruct()
    • setHasStruct

      public void setHasStruct(boolean hasStruct)
    • getAllowReplace

      public boolean getAllowReplace()
    • setAllowReplace

      public void setAllowReplace(boolean allowReplace)
    • getIndexClosedClasses

      public List<Integer> getIndexClosedClasses()
      Returns the indices of all closed job classes in this network.
      Returns:
      list of indices for closed job classes
    • getIndexOpenClasses

      public List<Integer> 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

      public List<Integer> getIndexStatefulNodes()
    • getJobClassFromIndex

      public JobClass getJobClassFromIndex(int inIdx)
      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

      public int getJobClassIndex(JobClass jobClass)
      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

      public List<JobClass> getJobClasses()
    • getLimitedClassDependence

      public Map<Station,SerializableFunction<Matrix,Matrix>> 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

      public Map<Station,Matrix> 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

      public Map<Station,SerializableFunction<Matrix,Matrix>> getLimitedJointDependence()
      Map from station to its joint-dependence (non-product-form) function eta_i(n); empty if none. Twin of getLimitedClassDependence().
      Returns:
      map from station to its joint-dependence function; empty if none
    • getLimitedJointDependencePeak

      public Map<Station,Matrix> getLimitedJointDependencePeak()
      Peak joint-dependent rate scaling per class for each joint-dependent station, as a 1xR row vector. Twin of getLimitedClassDependencePeak().
      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

      public void setGlobalDependence(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. 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 matrix
      peak - 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)
      As setGlobalDependence(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 matrix
      peak - REQUIRED peak scaling, 1x1, (M x 1) or (M x K)
      wireCutoff - positive open-class truncation for JSON serialization
    • getGlobalDependence

      public SerializableFunction<Matrix,Matrix> 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

      public Matrix getGlobalDependencePeak()
      (nstations x nclasses) peak of the global dependence, or null if none is declared.
    • getLimitedLoadDependence

      public Matrix getLimitedLoadDependence()
    • getLinkedRoutingMatrix

      public Map<JobClass,Map<JobClass,Matrix>> getLinkedRoutingMatrix()
    • getLogPath

      public String getLogPath()
    • setLogPath

      public void setLogPath(String logPath)
    • getNodeByIndex

      public Node getNodeByIndex(int idx)
    • getNodeByName

      public Node getNodeByName(String name)
    • getNodeByStatefulIndex

      public Node getNodeByStatefulIndex(int idx)
    • getNodeIndex

      public int getNodeIndex(Node node)
    • getNodeIndex

      public int getNodeIndex(String name)
    • getNodeNames

      public List<String> getNodeNames()
    • getNodeTypes

      public List<NodeType> getNodeTypes()
    • getNodes

      public List<Node> 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

      public Matrix 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

      public ProcessType getProcessType(Distribution distr)
    • getProductFormChainParameters

      public Ret.snGetProductFormParams getProductFormChainParameters()
    • getProductFormParameters

      public Ret.snGetProductFormParams getProductFormParameters()
    • getReferenceClasses

      public Matrix getReferenceClasses()
    • getReferenceStations

      public Matrix getReferenceStations()
    • getRegions

      public List<Region> getRegions()
    • getRoutingMatrix

      public Network.routingMatrixReturn getRoutingMatrix(Matrix arvRates, int returnVal)
    • getRoutingStrategyFromNodeAndClassPair

      public RoutingStrategy getRoutingStrategyFromNodeAndClassPair(Node node, JobClass c)
    • getSink

      public Sink 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

      public Source getSource()
    • getState

      public State getState()
    • getStatefulNodeFromIndex

      public Node getStatefulNodeFromIndex(int inIdx)
    • getStatefulNodeIndex

      public int getStatefulNodeIndex(Node node)
    • getStatefulNodeIndex

      public int getStatefulNodeIndex(String name)
    • getStatefulNodeNames

      public List<String> getStatefulNodeNames()
    • getStatefulNodes

      public List<StatefulNode> getStatefulNodes()
    • getStatefulServers

      public Matrix getStatefulServers()
    • getStationByIndex

      public Station getStationByIndex(int index)
    • getStationByName

      public Station getStationByName(String name)
    • getStationFromIndex

      public Node getStationFromIndex(int inIdx)
    • getStationIndex

      public int getStationIndex(Node node)
    • getStationIndex

      public int getStationIndex(String name)
    • getStationIndexes

      public List<Integer> getStationIndexes(int index)
    • getStationNames

      public List<String> getStationNames()
    • getStationScheduling

      public Map<Station,SchedStrategy> getStationScheduling()
    • getStationServers

      public Matrix getStationServers()
    • getStations

      public List<Station> getStations()
      Returns the list of stations in this network. Stations are nodes that can provide service to jobs.
      Returns:
      list of service stations
    • getStruct

      public NetworkStruct getStruct()
    • setStruct

      public void setStruct(NetworkStruct sn)
    • getStruct

      public NetworkStruct getStruct(boolean wantInitialState)
    • getTranHandles

      public SolverTranHandles getTranHandles()
    • getTranQLenHandles

      public AvgHandle getTranQLenHandles()
    • getTranTputHandles

      public AvgHandle getTranTputHandles()
    • getTranUtilHandles

      public AvgHandle getTranUtilHandles()
    • findSolver

      public List<SolverCandidate> 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 why
       

      One row per pair; see SolverCandidate for the columns and SolverCandidate.toTable to print them. The method column is the method name to pass as a solver method, so a row can be acted on directly.

      findMethod() and help() are aliases.

      Returns:
      one row per runnable (family, method) pair
    • findSolver

      public List<SolverCandidate> findSolver(String metric, boolean showAll)
      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 pair
      showAll - keep the refused pairs too, with the reason each was refused
      Returns:
      the matching rows
    • findMethod

      public List<SolverCandidate> findMethod()
      Alias of findSolver(): 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

      public List<SolverCandidate> findMethod(String metric, boolean showAll)
      Parameters:
      metric - a measure group or the accessor that returns it
      showAll - keep the refused pairs too
      Returns:
      the matching rows
    • help

      public List<SolverCandidate> help()
      Alias of findSolver(): what can this model be solved with?
      Returns:
      one row per runnable (family, method) pair
    • help

      public List<SolverCandidate> help(String metric, boolean showAll)
      Parameters:
      metric - a measure group or the accessor that returns it
      showAll - keep the refused pairs too
      Returns:
      the matching rows
    • findBindingCapacity

      public Network.BindingCapacity findBindingCapacity()
      The first station whose finite capacity can actually BIND, or a result whose binds is false when no buffer in the model can refuse a job.

      ONE PREDICATE, TWO CALLERS, the port of MATLAB MNetwork.findBindingCapacity. NetworkSolver.bindingCapacityReason turns the answer into the refusal the product-form solvers raise, and getUsedLangFeatures() marks the registry name FiniteCapacity on 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 binds is false
    • getUsedLangFeatures

      public FeatureSet 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

      public boolean hasHomogeneousScheduling(SchedStrategy strategy)
    • 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

      public Graph 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 Graph describing the routing topology
    • removeClass

      public void removeClass(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.
      Parameters:
      jobclass - the job class to remove
    • aggregateChains

      public ModelAdapter.AggregateChainResult 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

      public ModelAdapter.AggregateChainResult aggregateChains(String suffix)
      Chain-aggregated copy of this model, with a suffix appended to the names of the aggregate classes. See aggregateChains().
      Parameters:
      suffix - suffix for the aggregate class names, may be null
      Returns:
      the aggregated model, alpha, and the deaggregation record
    • withoutClass

      public Network withoutClass(JobClass jobclass)
      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

      public Network.RoutingErgodicityResult 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

      public Network.RoutingErgodicityResult isRoutingErgodic(RoutingMatrix P)
      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

      public void initFromAvgQLen(Matrix AvgQLen)
    • initFromAvgTable

      public void initFromAvgTable(NetworkAvgTable nt)
    • initFromMarginal

      public void initFromMarginal(Matrix n)
    • initFromMarginalAndRunning

      public void initFromMarginalAndRunning(Matrix n, Matrix s)
    • initFromMarginalAndStarted

      public void initFromMarginalAndStarted(Matrix n, Matrix s)
    • initRoutingMatrix

      public RoutingMatrix 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

      public String toTikZ()
      Generates TikZ code for visualizing this network.
      Returns:
      Complete LaTeX document with TikZ diagram
    • toTikZ

      public String toTikZ(TikZOptions options)
      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

      public void tikzView(TikZOptions options)
      Displays this network as a TikZ diagram with custom options.
      Parameters:
      options - Configuration options for the visualization
    • tikzExportPNG

      public void tikzExportPNG(String filePath) throws IOException
      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

      public void tikzExportPNG(String filePath, int dpi) throws IOException
      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

      public File exportTikZ(String filePath) throws IOException
      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

      public void exportTikZToFile(String filePath) throws IOException
      Exports this network's TikZ code to a .tex file.
      Parameters:
      filePath - The output file path
      Throws:
      IOException - If file operations fail
    • link

      public void link(RoutingMatrix P)
    • linkAndLog

      public List<Logger>[] linkAndLog(RoutingMatrix P, boolean[] isNodeLogged, String logPath)
      Links the network with logging capability Creates Logger nodes before and after specified stations and updates routing matrix
      Parameters:
      P - the routing matrix
      isNodeLogged - boolean array indicating which nodes should be logged
      logPath - 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

      public NetworkStruct 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

      public void refreshLST(List<Integer> statSet, List<Integer> classSet)
    • 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

      public void refreshProcessPhases(List<Integer> statSet, List<Integer> classSet)
    • 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

      public void refreshProcessTypes(List<Integer> statSet, List<Integer> classSet)
    • refreshProcesses

      public void refreshProcesses(List<Integer> statSet, List<Integer> classSet)
    • refreshProcesses

      public void refreshProcesses()
    • refreshRates

      public boolean[] refreshRates(List<Integer> statSet, List<Integer> classSet)
    • refreshRoutingMatrix

      public void refreshRoutingMatrix(Matrix rates)
    • refreshScheduling

      public void refreshScheduling()
    • refreshStruct

      public void refreshStruct()
    • refreshStruct

      public void refreshStruct(boolean hardRefresh)
    • refreshSync

      public void refreshSync()
    • refreshGlobalSync

      public void refreshGlobalSync()
    • relink

      public void relink(RoutingMatrix P)
    • relinkFromRtorig

      public void relinkFromRtorig(Map<JobClass,Map<JobClass,Matrix>> rtorig)
      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

      public void updateRtorig(Map<JobClass,Map<JobClass,Matrix>> rtorig)
      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

      public List<Node> resetNetwork(boolean deleteCSNodes)
      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

      public void setJoinNodeRequired(int nodeIdx, JobClass jobClass, int njobs)
    • setJoinNodeStrategy

      public void setJoinNodeStrategy(int nodeIdx, JobClass jobClass, JoinStrategy joinStrategy)
    • setNodeRouting

      public void setNodeRouting(int nodeIdx, JobClass jobClass, RoutingStrategy routingStrategy)
    • setSn

      public void setSn(NetworkStruct sn)
    • setUsedLangFeature

      public void setUsedLangFeature(String feature)
    • 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 index
      jnd - destination node index
      r - active class
      s - passive class
      linksmat - connection matrix
      state_before - state before the transition
      state_after - state after the transition
      Returns:
      the routing probability from ind to jnd
    • sub_jsq

      public double sub_jsq(int ind, int jnd, int r, int s, Matrix linksmat, Map<Node,Matrix> state_before, Map<Node,Matrix> state_after)
    • 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

      public double sub_rr_wrr(int ind, int jnd, int r, int s, Matrix linksmat, Map<Node,Matrix> state_before, Map<Node,Matrix> state_after)
    • summary

      public void summary()
    • unLink

      public void unLink()
    • view

      public void view()
    • modelView

      public void modelView()
    • setReward

      public void setReward(String name, RewardFunction rewardFn)
      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 reward
      rewardFn - 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

      public Map<String,RewardFunction> getRewards()
      Get all defined reward functions.
      Returns:
      Map from reward name to reward function, or null if no rewards defined
    • getReward

      public RewardFunction getReward(String name)
      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

      public void plot(String title)
      Displays an interactive visualization of this queueing network.
      Parameters:
      title - the window title
    • plot

      public void plot(String title, int width, int height)
      Displays an interactive visualization of this queueing network.
      Parameters:
      title - the window title
      width - the window width
      height - the window height