Class LalSsa

java.lang.Object
jline.lang.lal.LalSsa

public final class LalSsa extends Object
On-demand Gillespie simulation of finite LAL compositions (Python lal.ssa). The joint state space is never constructed: each step asks the event kernel for the moves of the current state.

Two engines are offered. "ssa" is the serial direct method: one exponential holding time at the total enabled rate, then a cumulative choice among the enabled moves. "nrm" is the next-reaction method: one clock per event label, kept in a heap, with clocks rescaled when an agent the label reads changes and redrawn when the label fires or becomes enabled.

The random stream is a Random seeded by seed, consumed in the same order as the Python reference (initial-state draws per agent with an initial distribution, then per step an exponential followed by a uniform for ssa, or the per-label exponentials and one uniform per firing for nrm). The draws are not numpy's PCG64 stream, so paths are not bit-identical to Python; the statistics and seeding semantics are.

  • Method Details

    • simulate

      public static LalSsa.Result simulate(Composition model, int events, long seed)
    • simulate

      public static LalSsa.Result simulate(LalModel snapshot, int events, long seed)
    • simulate

      public static LalSsa.Result simulate(LalModel snapshot, int events, long seed, double warmupfrac, String method)
      Simulate event races without constructing the joint state space.
      Parameters:
      events - positive event budget
      seed - random seed
      warmupfrac - fraction of the budget discarded before measuring, in [0, 1)
      method - "ssa" or "nrm"