Package jline.lang

Class NetworkStruct

java.lang.Object
jline.lang.NetworkStruct
All Implemented Interfaces:
Serializable, Cloneable, Copyable

public class NetworkStruct extends Object implements Copyable, Cloneable
Class summarizing the characteristics of a Network object
See Also:
  • Field Details

  • Constructor Details

    • NetworkStruct

      public NetworkStruct()
  • Method Details

    • getServiceParam

      public ServiceNodeParam getServiceParam(Station st)
      Returns the ServiceNodeParam attached to the given station, or null if the station has no nodeparam entry or its entry is not a ServiceNodeParam.

      This is the single access point for the per-station heterogeneous-server fields (nservertypes, servertypenames, serverspertype, servercompat, heterorates, heteroproc, heteroprocid, heteroschedpolicy).

      Parameters:
      st - the station
      Returns:
      the station's ServiceNodeParam, or null
    • getStations

      public List<Station> getStations()
      Returns the list of stations in the network.
      Returns:
      List of Station objects
    • validateStructuralConsistency

      public void validateStructuralConsistency()
      Validates the structural consistency of stations, stateful nodes, and nodes according to MATLAB implementation requirements. This method ensures: 1. All stations are stateful nodes (stations ⊆ stateful) 2. All stateful nodes are nodes (stateful ⊆ nodes) 3. Hash mapping consistency between node types 4. Count consistency for nstations, nstateful, nnodes
      Throws:
      IllegalStateException - if structural consistency is violated
    • isConsistentWithMatlab

      public boolean isConsistentWithMatlab()
      Checks if this NetworkStruct is consistent with MATLAB implementation. This is a convenience method that calls validateStructuralConsistency and returns true if no exceptions are thrown.
      Returns:
      true if structure is consistent, false otherwise
    • print

      public void print()
      Print comprehensive information about this NetworkStruct. This method displays all fields, matrices, lists, and maps in a formatted manner useful for debugging and inspection.
    • shallowCopy

      public NetworkStruct shallowCopy()
      Field-by-field shallow copy of this struct. Every reference (matrices, maps, lists) is shared with the original, so callers that mutate a field must replace it with their own copy first. Used by the synchronous-call (REPLY) enumeration in FromMarginal, which needs a struct with a reduced server count and the reply block cleared without paying for a deep copy per enumerated held-server configuration.
      Returns:
      a shallow copy of this struct