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

  • 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
    • 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()
    • getAvgArvRHandles

      public AvgHandle getAvgArvRHandles()
    • getAvgHandles

      public SolverAvgHandles getAvgHandles()
    • getAvgQLenHandles

      public AvgHandle getAvgQLenHandles()
    • getAvgResidTHandles

      public AvgHandle getAvgResidTHandles()
    • getAvgRespTHandles

      public AvgHandle getAvgRespTHandles()
    • getAvgTputHandles

      public AvgHandle getAvgTputHandles()
    • getAvgUtilHandles

      public AvgHandle getAvgUtilHandles()
    • getChains

      public List<Chain> getChains()
      Returns the list of job chains in this network. Job chains group classes that follow similar routing patterns.
      Returns:
      list of job chains
    • getClassByIndex

      public JobClass getClassByIndex(int index)
    • getClassByName

      public JobClass getClassByName(String name)
    • getClassChain

      public Chain getClassChain(JobClass jobClass)
    • 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,Double>> getLimitedClassDependence()
    • getLimitedLoadDependence

      public Matrix getLimitedLoadDependence()
    • getLimitedJointDependence

      public Pair<Map<Station,Matrix>,Map<Station,Matrix>> getLimitedJointDependence()
      Gets the limited joint-dependent scaling tables and cutoffs for all stations.
      Returns:
      a Pair containing: (1) Map of station -> linearized scaling table, (2) Map of station -> per-class cutoffs
    • getLimitedJointClassDependence

      public Pair<Map<Station,Map<JobClass,Matrix>>,Map<Station,Matrix>> getLimitedJointClassDependence()
      Gets the limited joint-class-dependent scaling tables and cutoffs for all stations. Each class has its own scaling table indexed by the population vector.
      Returns:
      a Pair containing: (1) Map of station -> (Map of class -> scaling table), (2) Map of station -> per-class cutoffs
    • 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()
    • 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()
    • 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.
    • 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
    • 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)
    • 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_kchoices

      public double sub_kchoices(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:selectKChoicesDestinationWithClass: 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_rl

      public double sub_rl(int ind, int jnd, int r, int s, Matrix linksmat, Map<Node,Matrix> state_before, Map<Node,Matrix> state_after)
      Reinforcement-learning routing marginal probability. Mirrors MATLAB sub_rl in refreshRoutingMatrix.m. Three branches:
      • rlStateSize == 0: tabular value function lookup over per-queue occupancies.
      • rlStateSize > 0: linear approximation (1 + x_i + x_i*x_j features).
      • otherwise: JSQ fallback.
      If the dispatching node is not in rlNodesNeedAction, falls back to JSQ. If queue lengths fall outside the table/feature support, falls back to JSQ. Single-class only (matches MATLAB).
    • 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