Class SolverAG

Direct Known Subclasses:
AG

public class SolverAG extends NetworkSolver
Agent-based (RCAT) solver.

Solves a network by the Reversed Compound Agent Theorem: every (station, class) pair becomes an isolated agent, and the agents are coupled ONLY through the reversed rates of the synchronizing actions. Agent k carries

Q_k(x) = L_k + sum_{c passive at k} x_c Pb_c
and publishes, for every action it is active on, a scalar read off its own stationary vector. The fixed point over that scalar vector is the whole analysis.

Because the coupling is that thin, the sweep parallelises exactly rather than approximately: see AgExec for the threads and cluster execution backends and why they walk the same iterates as the serial loop.

Methods: inap, inaprc, inapinf, and the vestigial exact alias which warns and falls back to inap. Per Marin, Rota Bulo and Balsamo, "A Numerical Algorithm for the Decomposition of Cooperating Structured Markov Processes", MASCOTS 2012.

These are the only algorithms in LINE that read sn.issignal, so the G-network feature names belong here and to no other solver.

  • Constructor Details

    • SolverAG

      public SolverAG(Network model)
    • SolverAG

      public SolverAG(Network model, String method)
    • SolverAG

      public SolverAG(Network model, Object... varargin)
    • SolverAG

      public SolverAG(Network model, SolverOptions options)
    • SolverAG

      public SolverAG(Composition model, Object... args)
      Solve a finite LAL composition. args are key-value pairs with the Python option names: method, tol, max_iter, groups, group_max_states, lal_ctmc_max_states, verbose, timeout and lang. An unknown key is refused. Results are read with getLALAvgTable() and getActTable().
  • Method Details

    • setGroups

      public SolverAG setGroups(Object groups)
      Python option groups for method 'grouped'.
    • getGroups

      public Object getGroups()
    • setGroupMaxStates

      public SolverAG setGroupMaxStates(int maxStates)
      Python option group_max_states.
    • setLALCtmcMaxStates

      public SolverAG setLALCtmcMaxStates(Integer maxStates)
      Python option lal_ctmc_max_states; null means unlimited.
    • listLALMethods

      public static List<String> listLALMethods()
      Methods available for a finite LAL Composition (Python listLALMethods).
    • isLALComposition

      public boolean isLALComposition()
      True when this solver analyses a LAL composition rather than a Network.
      Overrides:
      isLALComposition in class NetworkSolver
      Returns:
      true when the solver was built from a LAL composition
    • reset

      public void reset()
      Drop the cached results, including the cached LAL result, so the next getter re-solves (Python SolverAG.reset).
      Overrides:
      reset in class Solver
    • getLALAvgTable

      public LalTable getLALAvgTable()
      Agent state probabilities of a finite LAL composition, columns Agent/State/Probability (Python getAvgTable on a Composition). The table attributes carry the provenance: method, exact, converged, truncated, fallback_reason and the method's residuals.
    • getActTable

      public LalTable getActTable()
      Steady-state labelled event rates, columns Action/Throughput (Python getActTable).
    • getAvgAct

      public double getAvgAct(Object... action)
      Throughput of one LAL action, named as in SolverCTMC.getAvgAct.
    • getAvgActMode

      public double getAvgActMode(Object node, EventType event, String mode)
      Throughput of a Petri-net mode action (transition, ENABLE|FIRE, mode).
    • getActAvg

      public List<Double> getActAvg(List<?> actions)
      Throughputs of several actions, each a name or an Object[] of getAvgAct(java.lang.Object...) arguments.
    • getActT

      public LalTable getActT()
      Alias of getActTable() (MATLAB and Python getActT).
    • actT

      public LalTable actT()
      Alias of getActTable() (MATLAB and Python actT).
    • getActionTable

      public LalTable getActionTable()
      Alias of getActTable() (MATLAB and Python getActionTable).
    • getLALResult

      public LalAGResult getLALResult()
      The LAL result container, solving first if needed (Python getAGResult on a Composition).
    • getAGDiagnostics

      public Map<String,Object> getAGDiagnostics()
      Python getAGDiagnostics().
    • getAGDiagnostics

      public Map<String,Object> getAGDiagnostics(boolean compareCtmc, Integer maxStates)
      Diagnostics of the LAL solution, optionally compared against the finite CTMC (Python getAGDiagnostics(compare_ctmc=, max_states=)). maxStates == null bounds the comparison CTMC only by the dense storage limit of the LAL CTMC path.
    • getAvgTable

      public NetworkAvgTable getAvgTable()
      Refused on a LAL composition, whose results are agent state probabilities rather than station averages: use getLALAvgTable().
      Overrides:
      getAvgTable in class NetworkSolver
      Returns:
      table containing station-level metrics for each class
    • getAvg

      public SolverResult getAvg()
      Description copied from class: NetworkSolver
      Computes and returns average station metrics at steady-state. This is the main method for obtaining steady-state performance metrics.
      Overrides:
      getAvg in class NetworkSolver
      Returns:
      solver result containing station-level average metrics
    • defaultOptions

      public static AGOptions defaultOptions()
    • getStruct

      public NetworkStruct getStruct()
    • listValidMethods

      public List<String> listValidMethods()
      The registry row minus the LAL-only methods for a Network (Python _NETWORK_METHODS); a finite LAL composition is offered listLALMethods() instead.
    • listValidMethods

      public List<String> listValidMethods(Network model)
    • getFeatureSet

      public static FeatureSet getFeatureSet()
      The RCAT feature envelope. The G-network names live here because Solver_ag_build is the only code in LINE that reads sn.issignal.
    • methodFeatureSet

      public static FeatureSet methodFeatureSet(String method)
      Every AG method is the same decomposition differing only in how the reversed rate is read off an agent, so they share one envelope; the genuine restrictions are structural and applied in supportsModelMethod(String).
    • getMethodFeatureSet

      public FeatureSet getMethodFeatureSet(String method)
      Description copied from class: Solver
      Per-method feature set, or null to signal "this solver does not diverge per method" (the coarse supports(model) is then used, preserving any structural checks it carries). Divergent solvers (e.g. MVA, MAM, NC) override this to return the base envelope with per-method deltas applied.
      Overrides:
      getMethodFeatureSet in class Solver
      Parameters:
      method - the concrete method name
      Returns:
      the per-method FeatureSet, or null
    • supports

      public boolean supports(Network model)
      Description copied from class: Solver
      Checks if this solver supports the given network model. Default implementation returns true; subclasses should override to provide specific feature validation.
      Overrides:
      supports in class Solver
      Parameters:
      model - the network model to check
      Returns:
      true if the model is supported, false otherwise
    • rcatSupportsProcess

      public static boolean rcatSupportsProcess(ProcessType pt)
      True when the RCAT analyzers can give a process of this type a phase dimension: after snNonmarkovToPh (which AG runs with phfit='ph' and preserveDet=false) it must hold a genuine (D0,D1) pair with non-negative off-diagonal rates and a single arrival per epoch.

      The list is an ALLOW-list on purpose: a process type nobody has checked against this construction must be refused, not answered. Refused are the laws whose matrices are not a generator (ME, RAP), those that are not time-homogeneous (NHPP, MAPt, PHt), those that are not continuous-time (DMAP), and those that arrive in batches (BMAP, MMAP), since a batch moves the level by more than one. Compare BY NAME across codebases, never by the raw ordinal.

    • supportsModelMethod

      public String supportsModelMethod(String method)
      Description copied from class: Solver
      Fine, method-aware gate. Returns an empty string when the model fits the concrete METHOD, else a human-readable reason. Base behavior derives the answer from getMethodFeatureSet(method); when that is null the solver's own supports(model) is used. Solvers with non-feature-set structural per-method rules override this.
      Overrides:
      supportsModelMethod in class Solver
      Parameters:
      method - the concrete method name
      Returns:
      empty string if supported, else the offending reason
    • runAnalyzer

      public void runAnalyzer()
      Description copied from class: Solver
      Executes the solver algorithm to analyze the model. This abstract method must be implemented by concrete solver classes.
      Specified by:
      runAnalyzer in class Solver
    • getAGResult

      public AGResult getAGResult()
      The converged reversed rates and the agents they induce, in addition to the mean measures returned by getAvg.

      Mean values alone hide the objects the decomposition is built on. The reversed rates ARE the coupling between agents -- one scalar per synchronizing action -- so a run cannot be checked against a published derivation, or against a product-form condition, without them.

    • solverType

      public static SolverType solverType()