Class Solver_ssa_analyzer

java.lang.Object
jline.solvers.ssa.analyzers.Solver_ssa_analyzer

public final class Solver_ssa_analyzer extends Object
  • Method Details

    • firingDependenceReason

      public static String firingDependenceReason(NetworkStruct sn)
      Why the NRM engine cannot run a net with marking-dependent firing rates.

      The NRM builds one constant-propensity reaction per timed mode, so the g(marking) multiplier set by Transition.setFiringRateDependence has no place in it, and answering with the nominal rate would be a wrong number under the caller's own method name. The SERIAL engine does apply it: State.handleFireEvent scales the mode's firing rate by firingdep.get(m).apply(epSpace) on the state it is leaving, the same code and the same marking matrix SolverCTMC enumerates. The refusal is therefore confined to an explicit method="nrm", and every other method runs such a net on the serial engine. Mirrors matlab/src/solvers/SSA/ssa_firingdep_refusal.m and C++ ssa_check_firingdep (solver_ssa_nrm_spn.h).

      A FLUID NET IS EXEMPT. Its runner (spnFluidRun) recomputes every propensity at each segment, and the marking is constant within a segment, so it applies g(marking) exactly, on the same input-place marking the serial engine reads.

      Parameters:
      sn - network structure of the analyzed model
      Returns:
      the refusal sentence, or the empty string when no mode carries a dependence
    • fluidRefusal

      public static String fluidRefusal(NetworkStruct sn, String method)
      Why SolverSSA cannot run a fluid stochastic Petri net under the given method, or "" when it can.

      A fluid net has ONE engine, the NRM Petri runner (its piecewise-deterministic loop), so 'serial' and 'ssa' are withdrawn and every other method is bound by that runner's reach: Place, Transition, Source and Sink nodes only, exponential single-phase firing and arrivals, every Source feeding a Place, and no infinite marking. A marking-dependent firing or flow rate is read by the runner, segment by segment. Returns "" for a model without fluid places. Mirrors matlab/src/solvers/SSA/ssa_fluid_refusal.m.

      Parameters:
      sn - network structure of the analyzed model
      method - the SSA method, with any "ssa." prefix removed
      Returns:
      the refusal sentence, or the empty string
    • assertNrmFiringDependence

      public static void assertNrmFiringDependence(NetworkStruct sn)
      Throws when firingDependenceReason(jline.lang.NetworkStruct) is non-empty: the explicit-NRM refusal.
      Parameters:
      sn - network structure of the analyzed model
    • ssaWarmupFrac

      public static double ssaWarmupFrac(NetworkStruct sn, SolverOptions options)
      Effective warmup (initial-transient) discard fraction of an SSA run, mirroring matlab/src/solvers/SSA/ssa_warmupfrac.m.

      An explicit options.config.warmupfrac is honoured as given, 0 included, clamped to [0, 0.99]. When it is unset (null) the rule is the same in all four codebases: a STEADY-STATE run (infinite options.timespan end) of a model with at least one OPEN class drops the first 20% of its samples, the LDES default, and any other run drops none. An open model starts empty, far from its stationary load; a closed model starts at a feasible state of its fixed population. Transient runs and sample paths keep every sample.

      Parameters:
      sn - the network structure
      options - the solver options
      Returns:
      the fraction of the requested samples whose tallies are discarded
    • solver_ssa_analyzer

      public static SSAResult solver_ssa_analyzer(NetworkStruct snInput, SolverOptions options, SolverSSA solverSSA)
    • nrmMethodRefusal

      public static String nrmMethodRefusal(NetworkStruct sn)
      Whether the NRM engine can run this model, as a SENTENCE.

      ONE PREDICATE, TWO CALLERS. The dispatch above asks it to decide whether to PREFER the NRM on the default path; SolverSSA .supportsModelMethod asks it to decide whether nrm may be OFFERED at all. Inlined in the dispatch it could answer only the first, so findSolver reported ssa.nrm runnable on every model and an explicit SolverSSA(model,"nrm") then raised from Solver_ssa_analyzer_nrm on the very models this test excludes.

      Parameters:
      sn - the network structure
      Returns:
      empty string when the NRM can run it, else the reason it cannot
    • nrmEligibleReason

      public static String nrmEligibleReason(NetworkStruct sn)
    • immTputBalance

      public static void immTputBalance(NetworkStruct sn, SSAResult res)
      Throughput of the station-class pairs whose service is Immediate, taken from flow balance rather than from the sample path (MATLAB ssa_imm_tput_balance.m).

      Such a station holds a job for zero time, so its departure rate IS its arrival rate. Both SSA engines estimate TN as the time integral of the departure rate, which at an Immediate station is noise: each visit lasts ~Exp(Immediate) and adds rate*dt ~ Exp(1) rather than one departure. TN there is replaced by the arrival rate that SnGetArvRFromTput derives from the other TNs (timed stations, measured cache hit/miss split, stateless routing), swept until a chain of Immediate stations settles; XN, RN of the replaced pairs and CN follow. Sources are excluded, and the step is skipped under JSQ/SQ routing, whose split is not in sn.rt.

      Parameters:
      sn - the network structure
      res - the SSA result, updated in place (TN, RN, CN, XN)